Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(snapshots): use correct l1 batch number of initial write #115

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/processor/snapshot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use async_trait::async_trait;
use ethers::types::{Address, H256, U256, U64};
use eyre::Result;
use state_reconstruct_fetcher::{
constants::{ethereum, storage, zksync::L2_BLOCK_NUMBER_ADDRESSES},
constants::{storage, zksync::L2_BLOCK_NUMBER_ADDRESSES},
types::CommitBlock,
};
use state_reconstruct_storage::{
Expand Down Expand Up @@ -74,9 +74,7 @@ impl Processor for SnapshotBuilder {
.insert_storage_log(&mut SnapshotStorageLog {
key: *key,
value,
l1_batch_number_of_initial_write: U64::from(
block.l1_block_number.unwrap_or(0),
),
l1_batch_number_of_initial_write: U64::from(block.l1_batch_number),
enumeration_index: 0,
})
.expect("failed to insert storage_log_entry");
Expand Down Expand Up @@ -226,7 +224,7 @@ fn reconstruct_genesis_state(database: &mut SnapshotDatabase, path: &str) -> Res
database.insert_storage_log(&mut SnapshotStorageLog {
key,
value,
l1_batch_number_of_initial_write: U64::from(ethereum::GENESIS_BLOCK),
l1_batch_number_of_initial_write: U64::from(0),
enumeration_index: 0,
})?;
}
Expand Down