Skip to content

Commit 79bfdb0

Browse files
l1: extract magic number to MIN_EXPECTED_BLOCK_NUMBER (#9701)
1 parent 42e30b9 commit 79bfdb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/apollo_l1_endpoint_monitor/src/monitor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ pub mod l1_endpoint_monitor_tests;
1515
// a bug in infura where the connectivity was fine, but get_block_number() failed.
1616
pub const HEALTH_CHECK_RPC_METHOD: &str = "eth_blockNumber";
1717

18+
/// The minimum expected L1 block number for a valid endpoint response.
19+
pub const MIN_EXPECTED_BLOCK_NUMBER: u64 = 1000;
20+
1821
#[derive(Debug, Clone, PartialEq, Eq)]
1922
pub struct L1EndpointMonitor {
2023
pub current_l1_endpoint_index: usize,
@@ -91,7 +94,7 @@ impl L1EndpointMonitor {
9194
Ok(Ok(block_number)) => {
9295
// TODO(guyn): remove this once we understand where these low numbers are coming
9396
// from.
94-
if block_number < U64::from(1000) {
97+
if block_number < U64::from(MIN_EXPECTED_BLOCK_NUMBER) {
9598
warn!(
9699
"L1 endpoint {l1_endpoint_url} is operational, but block number is too \
97100
low: {block_number}"

0 commit comments

Comments
 (0)