fix(local-test): pass Hoodi network flag to morphnode#139
Conversation
A fullnode (no sequencer signer) derives L2 blocks from batches posted to L1 as EIP-4844 blobs, so morphnode requires --l1.beaconrpc. The scripts never set it, so SetCliContext failed with 'invalid L1BeaconAddr' and the node crash-looped. Add MORPH_NODE_L1_BEACON_RPC defaults for mainnet/hoodi and pass --l1.beaconrpc from node-start.sh.
📝 WalkthroughWalkthroughThis PR introduces a new ChangesL1 Beacon RPC Configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@local-test/common.sh`:
- Around line 39-43: Keep the Hoodi mode flag out of the overridable extra flags
path in common.sh. The issue is that MORPH_NODE_EXTRA_FLAGS currently owns the
--hoodi default, so any caller-provided value can replace it and drop the
required mode flag. Update the shell setup so the Hoodi flag is applied
independently from MORPH_NODE_EXTRA_FLAGS, and keep MORPH_NODE_EXTRA_FLAGS
reserved only for optional user extras; use the existing MORPH_NODE_EXTRA_FLAGS
assignment area and the related MORPH_NODE_* variable initialization block to
locate the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 18381a8b-7b88-4cb4-bf11-488c18e91c97
📒 Files selected for processing (3)
local-test/README.mdlocal-test/common.shlocal-test/node-start.sh
| # L1 Beacon (CL) endpoint — see mainnet branch above for why this is required. | ||
| : "${MORPH_NODE_L1_BEACON_RPC:=${MORPH_NODE_L1_ETH_BEACON_RPC:-https://ethereum-hoodi-beacon-api.publicnode.com}}" | ||
| : "${MORPH_NODE_DEPOSIT_CONTRACT:=${MORPH_NODE_SYNC_DEPOSIT_CONTRACT_ADDRESS:-0xd7f39d837f4790b215ba67e0ab63665912648dbe}}" | ||
| : "${MORPH_NODE_ROLLUP_CONTRACT:=0x57e0e6dde89dc52c01fe785774271504b1e04664}" | ||
| : "${MORPH_NODE_EXTRA_FLAGS:=}" | ||
| : "${MORPH_NODE_EXTRA_FLAGS:=--hoodi}" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep --hoodi out of the overridable extras path.
Any non-empty MORPH_NODE_EXTRA_FLAGS value replaces this default, so Hoodi runs can silently lose --hoodi again. Append the mode flag independently and leave this variable for optional extras only.
Proposed fix
- : "${MORPH_NODE_EXTRA_FLAGS:=--hoodi}"
+ : "${MORPH_NODE_EXTRA_FLAGS:=}" args=(
--home "${NODE_HOME}"
--l2.jwt-secret "${JWT_SECRET}"
--l2.eth "http://${RETH_HTTP_ADDR}:${RETH_HTTP_PORT}"
--l2.engine "http://${RETH_AUTHRPC_ADDR}:${RETH_AUTHRPC_PORT}"
--l1.rpc "${MORPH_NODE_L1_RPC}"
--l1.beaconrpc "${MORPH_NODE_L1_BEACON_RPC}"
--sync.depositContractAddr "${MORPH_NODE_DEPOSIT_CONTRACT}"
--log.filename "${NODE_LOG_FILE}"
)
+if [[ "${MORPH_NETWORK}" == "hoodi" ]]; then
+ args+=(--hoodi)
+fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # L1 Beacon (CL) endpoint — see mainnet branch above for why this is required. | |
| : "${MORPH_NODE_L1_BEACON_RPC:=${MORPH_NODE_L1_ETH_BEACON_RPC:-https://ethereum-hoodi-beacon-api.publicnode.com}}" | |
| : "${MORPH_NODE_DEPOSIT_CONTRACT:=${MORPH_NODE_SYNC_DEPOSIT_CONTRACT_ADDRESS:-0xd7f39d837f4790b215ba67e0ab63665912648dbe}}" | |
| : "${MORPH_NODE_ROLLUP_CONTRACT:=0x57e0e6dde89dc52c01fe785774271504b1e04664}" | |
| : "${MORPH_NODE_EXTRA_FLAGS:=}" | |
| : "${MORPH_NODE_EXTRA_FLAGS:=--hoodi}" | |
| # L1 Beacon (CL) endpoint — see mainnet branch above for why this is required. | |
| : "${MORPH_NODE_L1_BEACON_RPC:=${MORPH_NODE_L1_ETH_BEACON_RPC:-https://ethereum-hoodi-beacon-api.publicnode.com}}" | |
| : "${MORPH_NODE_DEPOSIT_CONTRACT:=${MORPH_NODE_SYNC_DEPOSIT_CONTRACT_ADDRESS:-0xd7f39d837f4790b215ba67e0ab63665912648dbe}}" | |
| : "${MORPH_NODE_ROLLUP_CONTRACT:=0x57e0e6dde89dc52c01fe785774271504b1e04664}" | |
| : "${MORPH_NODE_EXTRA_FLAGS:=}" |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@local-test/common.sh` around lines 39 - 43, Keep the Hoodi mode flag out of
the overridable extra flags path in common.sh. The issue is that
MORPH_NODE_EXTRA_FLAGS currently owns the --hoodi default, so any
caller-provided value can replace it and drop the required mode flag. Update the
shell setup so the Hoodi flag is applied independently from
MORPH_NODE_EXTRA_FLAGS, and keep MORPH_NODE_EXTRA_FLAGS reserved only for
optional user extras; use the existing MORPH_NODE_EXTRA_FLAGS assignment area
and the related MORPH_NODE_* variable initialization block to locate the change.
Summary
--hoodito morphnode when usinglocal-testHoodi scriptsRoot cause
The Hoodi branch configured the Hoodi RPCs and contract addresses, but did not pass the Hoodi network flag to morphnode. morphnode then started with dev network defaults and failed because no L1 sequencer contract was configured.
Validation
bash -n local-test/common.sh local-test/node-start.sh local-test/start-all.sh--hoodiwithrestarts=0Summary by CodeRabbit
New Features
Documentation
Bug Fixes