Skip to content

fix(local-test): pass Hoodi network flag to morphnode#139

Merged
panos-xyz merged 2 commits into
mainfrom
fix/local-test-l1-beacon-rpc
Jul 8, 2026
Merged

fix(local-test): pass Hoodi network flag to morphnode#139
panos-xyz merged 2 commits into
mainfrom
fix/local-test-l1-beacon-rpc

Conversation

@panos-xyz

@panos-xyz panos-xyz commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pass --hoodi to morphnode when using local-test Hoodi scripts

Root 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
  • confirmed the running PM2 morph-node args include --hoodi with restarts=0

Summary by CodeRabbit

  • New Features

    • Added support for configuring an L1 beacon RPC endpoint in local test environments.
    • Local startup now includes the beacon RPC setting when launching the node.
  • Documentation

    • Updated the local test README to describe the new required environment variable and clarify the L1 RPC setting.
  • Bug Fixes

    • Improved network-specific defaults for supported test networks, including hoodi, to better match required configuration.

panos-xyz and others added 2 commits July 8, 2026 15:29
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.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces a new MORPH_NODE_L1_BEACON_RPC environment variable with per-network defaults for mainnet and hoodi, wires it into the morphnode startup command via a new --l1.beaconrpc CLI flag, updates hoodi's extra flags and contract defaults, and documents the change in the README.

Changes

L1 Beacon RPC Configuration

Layer / File(s) Summary
Beacon RPC defaults and startup wiring
local-test/common.sh, local-test/node-start.sh
Adds MORPH_NODE_L1_BEACON_RPC defaults for mainnet and hoodi, updates hoodi MORPH_NODE_EXTRA_FLAGS to --hoodi with retained contract defaults, and passes --l1.beaconrpc to the morphnode process.
Documentation update
local-test/README.md
Adds MORPH_NODE_L1_BEACON_RPC to the configuration table as required for L1 derivation and clarifies MORPH_NODE_L1_RPC as the L1 execution RPC endpoint.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • morph-l2/morph-reth#54: Builds on the same local-test/common.sh/node-start.sh network-argument structure that this PR extends with the beacon RPC configuration.

Suggested reviewers: chengwenxi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main Hoodi morphnode startup fix, even though it omits the new beacon RPC wiring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/local-test-l1-beacon-rpc

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@panos-xyz panos-xyz changed the title Fix local Hoodi morphnode network flag fix(local-test): pass Hoodi network flag to morphnode Jul 8, 2026
@panos-xyz panos-xyz marked this pull request as ready for review July 8, 2026 07:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 773887b and 94316cb.

📒 Files selected for processing (3)
  • local-test/README.md
  • local-test/common.sh
  • local-test/node-start.sh

Comment thread local-test/common.sh
Comment on lines +39 to +43
# 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}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
# 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.

@panos-xyz panos-xyz merged commit 43c3e59 into main Jul 8, 2026
14 of 15 checks passed
@panos-xyz panos-xyz deleted the fix/local-test-l1-beacon-rpc branch July 8, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants