Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Jan 30, 2025
1 parent be48bcc commit 2662500
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions utils/host/src/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,9 +781,14 @@ impl OPSuccinctDataFetcher {

// To avoid re-orgs, we require that the L1 head selected is at least 10 blocks (2 minutes) behind the latest L1 header.
const REQUIRED_CONFIRMATIONS: u64 = 10;
let max_usable_number = latest_l1_header.number.saturating_sub(REQUIRED_CONFIRMATIONS);
let max_usable_number = latest_l1_header
.number
.saturating_sub(REQUIRED_CONFIRMATIONS);
let l1_head_hash = match l1_head_number > max_usable_number {
true => self.get_l1_header(max_usable_number.into()).await?.hash_slow(),
true => self
.get_l1_header(max_usable_number.into())
.await?
.hash_slow(),
false => self.get_l1_header(l1_head_number.into()).await?.hash_slow(),
};

Expand Down

0 comments on commit 2662500

Please sign in to comment.