Skip to content

Commit

Permalink
using --block-count as relative to the actual start block
Browse files Browse the repository at this point in the history
  • Loading branch information
vbar committed Apr 4, 2024
1 parent 5f4a203 commit 4001bd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion state-reconstruct-fetcher/src/l1_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl L1Fetcher {
let end_block = self
.config
.block_count
.map(|count| U64::from(self.config.start_block + count));
.map(|count| (current_l1_block_number + count));

// Initialize metrics with last state, if it exists.
{
Expand Down Expand Up @@ -226,6 +226,10 @@ impl L1Fetcher {
max_end_block: Option<U64>,
disable_polling: bool,
) -> Result<tokio::task::JoinHandle<u64>> {
if let Some(end_block_limit) = max_end_block {
assert!(current_l1_block_number <= end_block_limit);
}

let metrics = self.metrics.clone();
let event = self.contracts.v1.events_by_name("BlockCommit")?[0].clone();
let provider_clone = self.provider.clone();
Expand Down

0 comments on commit 4001bd2

Please sign in to comment.