Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion local-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ All defaults can be overridden via environment variables. Common ones:
| `MORPHNODE_BIN` | `../morph/node/build/bin/morphnode` | Path to morphnode binary |
| `RETH_HTTP_PORT` | `8545` | HTTP RPC port |
| `RETH_AUTHRPC_PORT` | `8551` | Engine API auth RPC port |
| `MORPH_NODE_L1_RPC` | *(per-network default)* | L1 Ethereum RPC endpoint |
| `MORPH_NODE_L1_RPC` | *(per-network default)* | L1 Ethereum execution RPC endpoint |
| `MORPH_NODE_L1_BEACON_RPC` | *(per-network default)* | L1 Ethereum beacon (blob) RPC endpoint — required for L1 derivation |

Example with overrides:

Expand Down
7 changes: 6 additions & 1 deletion local-test/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export MORPH_NETWORK

if [[ "${MORPH_NETWORK}" == "mainnet" ]]; then
: "${MORPH_NODE_L1_RPC:=${MORPH_NODE_L1_ETH_RPC:-https://ethereum.publicnode.com}}"
# L1 Beacon (CL) endpoint — a fullnode (no sequencer signer) derives L2 blocks
# from batches posted to L1 as EIP-4844 blobs, so the beacon blob API is required.
: "${MORPH_NODE_L1_BEACON_RPC:=${MORPH_NODE_L1_ETH_BEACON_RPC:-https://ethereum-beacon-api.publicnode.com}}"
: "${MORPH_NODE_DEPOSIT_CONTRACT:=${MORPH_NODE_SYNC_DEPOSIT_CONTRACT_ADDRESS:-0x3931ade842f5bb8763164bdd81e5361dce6cc1ef}}"
: "${MORPH_NODE_ROLLUP_CONTRACT:=}"
: "${MORPH_NODE_EXTRA_FLAGS:=--mainnet}"
Expand All @@ -33,9 +36,11 @@ if [[ "${MORPH_NETWORK}" == "mainnet" ]]; then
: "${MORPH_CHAIN:=mainnet}"
else
: "${MORPH_NODE_L1_RPC:=${MORPH_NODE_L1_ETH_RPC:-https://ethereum-hoodi-rpc.publicnode.com}}"
# 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}"
Comment on lines +39 to +43

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.

: "${CONFIG_ZIP_URL:=https://raw.githubusercontent.com/morph-l2/run-morph-node/main/hoodi/data.zip}"
: "${CONFIG_ZIP_PATH:=./local-test/hoodi-data.zip}"
: "${MORPH_CHAIN:=hoodi}"
Expand Down
1 change: 1 addition & 0 deletions local-test/node-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ args=(
--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}"
)
Expand Down
Loading