Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
fix: remove safe checker for block_number convert
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Jan 16, 2025
1 parent a895d9d commit e6cce5d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ pub use reth_engine_primitives::InvalidBlockHook;

mod root;

const MAX_SAFE_F64_INT: u64 = 9_007_199_254_740_992; // 2^53

/// Keeps track of the state of the tree.
///
/// ## Invariants
Expand Down Expand Up @@ -2350,13 +2348,8 @@ where
// if the parent is the canonical head, we can insert the block as the pending block
self.canonical_in_memory_state.set_pending_block(executed.clone());
// update metrics
if block_number > MAX_SAFE_F64_INT {
debug!(target: "engine::tree", block_number, "Warning: block number exceeds safe f64 conversion");
};
let float_value = block_number as f64;

debug!(target: "engine::tree", block_number, "updating canonical chain height metric");
self.metrics.tree.canonical_chain_height.set(float_value);
self.metrics.tree.canonical_chain_height.set(block_number as f64);
}

self.state.tree_state.insert_executed(executed);
Expand Down

0 comments on commit e6cce5d

Please sign in to comment.