From 31dc43e884723a55f4a504f1c63e90a8e675fa71 Mon Sep 17 00:00:00 2001 From: zeapoz Date: Wed, 21 Aug 2024 08:43:23 +0200 Subject: [PATCH 1/2] chore(snapshots): use correct l1 batch number of initial write --- src/processor/snapshot/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/processor/snapshot/mod.rs b/src/processor/snapshot/mod.rs index 154e2f3..142883e 100644 --- a/src/processor/snapshot/mod.rs +++ b/src/processor/snapshot/mod.rs @@ -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"); @@ -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, })?; } From 4c838405e9051fa339d8191c780b435354121238 Mon Sep 17 00:00:00 2001 From: zeapoz Date: Thu, 22 Aug 2024 14:14:01 +0200 Subject: [PATCH 2/2] chore: clippy --- src/processor/snapshot/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/snapshot/mod.rs b/src/processor/snapshot/mod.rs index 142883e..b2c7ecb 100644 --- a/src/processor/snapshot/mod.rs +++ b/src/processor/snapshot/mod.rs @@ -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::{