Skip to content

Commit

Permalink
Use L1 blk num from the block
Browse files Browse the repository at this point in the history
  • Loading branch information
tuommaki committed Nov 28, 2023
1 parent 4455303 commit 32ca091
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/processor/snapshot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,17 @@ impl SnapshotBuilder {
#[async_trait]
impl Processor for SnapshotBuilder {
async fn run(mut self, mut rx: mpsc::Receiver<CommitBlockInfoV1>) {
// TODO: Send these from fetcher.
let miniblock_number = U64::from(0);
let l1_block_number = U64::from(0);

while let Some(block) = rx.recv().await {
// Initial calldata.
for (key, value) in &block.initial_storage_changes {
self.database
.insert_storage_log(&SnapshotStorageLog {
key: U256::from_little_endian(key),
value: H256::from(value),
miniblock_number_of_initial_write: miniblock_number,
l1_batch_number_of_initial_write: l1_block_number,
miniblock_number_of_initial_write: U64::from(0),
l1_batch_number_of_initial_write: U64::from(
block.l1_block_number.unwrap_or(0),
),
enumeration_index: 0,
})
.expect("failed to insert storage_log_entry");
Expand All @@ -81,8 +79,6 @@ impl Processor for SnapshotBuilder {
max_idx
);
};

//.expect("failed to update storage_log_value");
}

// Factory dependencies.
Expand Down

0 comments on commit 32ca091

Please sign in to comment.