From 12fa91407309e8cdb4c462cb018addd27ac1be5b Mon Sep 17 00:00:00 2001 From: panos Date: Wed, 8 Apr 2026 13:21:51 +0800 Subject: [PATCH] fix(rpc): handle eth_config when no timestamp fork is active yet When the chain is at block 0 (block-based fork era like Bernoulli/Curie), no timestamp-based forks are active yet. The eth_config handler previously returned an error "no active timestamp fork found", which caused morphnode to fail its startup readiness check and loop forever. Fall back to the current block's timestamp when no timestamp fork is active. This produces a correct response (useZktrie=true, jadeForkTime set, next fork pointing to Morph203) so morphnode can proceed. --- crates/rpc/src/eth_config.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/rpc/src/eth_config.rs b/crates/rpc/src/eth_config.rs index cf94059..9e2e190 100644 --- a/crates/rpc/src/eth_config.rs +++ b/crates/rpc/src/eth_config.rs @@ -201,11 +201,14 @@ where fork_timestamps.dedup(); let latest_ts = latest.timestamp(); + // If no timestamp fork is active yet (e.g. we're still in the block-based fork era, + // like early Bernoulli/Curie blocks), use the current block's timestamp so that + // the fork config reflects the current chain state (pre-Morph203, useZktrie=true). let current_fork_timestamp = fork_timestamps .iter() .copied() .rfind(|&ts| ts <= latest_ts) - .ok_or_else(|| RethError::msg("no active timestamp fork found"))?; + .unwrap_or(latest_ts); let next_fork_timestamp = fork_timestamps.iter().copied().find(|&ts| ts > latest_ts); let current = self.build_fork_config_at(current_fork_timestamp, current_precompiles);