You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, im deploying a zk chain on sepolia using the zksync-era commit core-v24.7.0.
The following reasoning was used to run the program with the custom hyperchain deploy:
In order to customize the program, the variables inside state-reconstruct-fetcher/src/constants.rs has to be changed:
pubmod ethereum {/// Number of Ethereum blocks to advance in one filter step.pubconstBLOCK_STEP:u64 = 1_000;/// Block number in Ethereum for zkSync genesis block.//pub const GENESIS_BLOCK: u64 = 16_627_460;pubconstGENESIS_BLOCK:u64 = <BlockHeightwhere the DiamondProxy contract was deployed>;/// Block number in Ethereum of the first Boojum-formatted block.//pub const BOOJUM_BLOCK: u64 = 18_715_403;pubconstBOOJUM_BLOCK:u64 = <GenesisBlock>;/// Block number in Ethereum of the first block storing pubdata within blobs.//pub const BLOB_BLOCK: u64 = 19_412_473;// Sepolia Dencun UpgradepubconstBLOB_BLOCK:u64 = 5_187_023;/// zkSync smart contract address.//pub const ZK_SYNC_ADDR: &str = "0x32400084C286CF3E17e7B677ea9583e60a000324";pubconstZK_SYNC_ADDR:&str = <DiamondProxyContractAddr>;/// Default Ethereum blob storage URL base.//pub const BLOBS_URL: &str = "https://api.blobscan.com/blobs/";pubconstBLOBS_URL:&str = "https://api.sepolia.blobscan.com/blobs/";}pubmod storage {/// The path to the initial state file.pubconstINITAL_STATE_PATH:&str = "InitialState.csv";/// The default name of the database.pubconstDEFAULT_DB_NAME:&str = "db";/// The name of the index-to-key database folder.pubconstINNER_DB_NAME:&str = "inner_db";}pubmod zksync {/// Bytes in raw L2 to L1 log.pubconstL2_TO_L1_LOG_SERIALIZE_SIZE:usize = 88;// The bitmask by applying which to the compressed state diff metadata we retrieve its operation.pubconstOPERATION_BITMASK:u8 = 7;// The number of bits shifting the compressed state diff metadata by which we retrieve its length.pubconstLENGTH_BITS_OFFSET:u8 = 3;// Size of `CommitBatchInfo.pubdataCommitments` item.pubconstPUBDATA_COMMITMENT_SIZE:usize = 144;// The number of trailing bytes to ignore when using calldata post-blobs. Contains unused blob commitments.pubconstCALLDATA_SOURCE_TAIL_SIZE:usize = 32;}
Reasoning about how to set the variables:
GENESIS_BLOCK: Is this the block where the DiamondProxy contract was deployed? Based on assumption: Yes.
BOOJUM_BLOCK: Since version 24.7.0 deployment does not include the BOOJUM update, should BOOJUM_BLOCK match GENESIS_BLOCK? Based on assumption: Yes.
BLOB_BLOCK: Set to 5_187_023 for the Sepolia Dencun Upgrade.
ZK_SYNC_ADDR: Is this the DiamondProxyAddr? How does it interact with Hyperchains? Based on assumption: DiamondProxyAddr.
A snapshot was generated using snapshots-creator from the zksync-era repository, downloaded, and placed in ./storage_logs_snapshots. The following command was then executed:
cargo run --release -- reconstruct --snapshot ./storage_logs_snapshots l1 --http-url https://ethereum-sepolia-rpc.publicnode.com
Snapshots were succesfully imported, but there is a mismatch.
Output:
2024-07-08T13:10:16.024141Z INFO Succesfully imported snapshot containing 574 storage logs!
2024-07-08T13:10:16.069307Z INFO PROGRESS: [ - ] CUR BLOCK L1: 6135177 L2: 0 TOTAL BLOCKS PROCESSED L1: 0 L2: 0
2024-07-08T13:10:21.084794Z ERROR Root hash mismatch!
Local: 586db64a95fdda64b42c5d4bd80a785b6fba06d796add5258238a985e56895f5
Published: 43ff9d17f184cd0cc84bcc951359d9c2016c93e7f20b123839bdb8c6ffd4942a
The InitialState.csv file contains genesis information. Since no relevant information was found directly in the L1 blockchain of the zksync-era mainnet tracing the GENESIS_BLOCK transactions, the information in the InitialState.csv is assumed to be present in the PostgreSQL database."
The initial_writes table in the zksync_local database is a good candidate:
List of relations
Schema | Name | Type | Owner
--------+----------------------------------+-------+----------
public | initial_writes | table | postgres
initial_writes was copied into a .csv with the following psql command:
\COPY initial_writes TO '/home/admin/InitialState.csv' CSV HEADER
Purpose
Reconstruct zk hyperchain using this tool.
Context
Hi, im deploying a zk chain on
sepolia
using thezksync-era
commitcore-v24.7.0
.The following reasoning was used to run the program with the custom hyperchain deploy:
state-reconstruct-fetcher/src/constants.rs
has to be changed:A snapshot was generated using snapshots-creator from the zksync-era repository, downloaded, and placed in
./storage_logs_snapshots
. The following command was then executed:Snapshots were succesfully imported, but there is a mismatch.
Output:
zksync-era mainnet
tracing theGENESIS_BLOCK
transactions, the information in theInitialState.csv
is assumed to be present in the PostgreSQL database."InitialState.csv
format:The
initial_writes
table in thezksync_local
database is a good candidate:initial_writes
was copied into a.csv
with the following psql command:\COPY initial_writes TO '/home/admin/InitialState.csv' CSV HEADER
DB output format:
This file was used instead of the original, but since it does not match the expected format, it caused the program to panic.
Questions:
DiamondProxyAddr
?InitialState.csv
file originally created? It seems to involve a complex query.The text was updated successfully, but these errors were encountered: