Skip to content

Commit

Permalink
chore(snapshots): use correct l1 batch number of initial write (#115)
Browse files Browse the repository at this point in the history
* chore(snapshots): use correct l1 batch number of initial write

* chore: clippy
  • Loading branch information
zeapoz authored Aug 22, 2024
1 parent b8b945b commit b787de9
Showing 1 changed file with 3 additions and 5 deletions.
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

0 comments on commit b787de9

Please sign in to comment.