fix(rpc): handle eth_config when no timestamp fork is active yet#86
fix(rpc): handle eth_config when no timestamp fork is active yet#86
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change modifies fork timestamp selection logic in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
eth_configreturned error"no active timestamp fork found"when the chain is at block 0 (Bernoulli/Curie block-based fork era)latest_tswhen no timestamp fork is active, so the response correctly reflects the current chain state (useZktrie: true,jadeForkTimeset,nextpointing to Morph203)Root Cause
eth_configcollects all timestamp-based fork activation timestamps and finds the latest one<= latest block timestamp. At genesis (block 0, timestamp ~0 or early), all timestamp forks (Morph203 @ 1747029600, Viridian, Emerald, Jade) are in the future, sorfindreturnsNone→ error.Test Plan
cargo check -p morph-rpcpassescargo build --releasepasseseth_configresponse at block 0 correctly returnsuseZktrie: trueandjadeForkTimeSummary by CodeRabbit