Skip to content

chore(local-test): unify mainnet/hoodi scripts with MORPH_NETWORK selector#54

Merged
panos-xyz merged 2 commits intomainfrom
panos/test-scripts
Mar 18, 2026
Merged

chore(local-test): unify mainnet/hoodi scripts with MORPH_NETWORK selector#54
panos-xyz merged 2 commits intomainfrom
panos/test-scripts

Conversation

@panos-xyz
Copy link
Contributor

@panos-xyz panos-xyz commented Mar 18, 2026

Summary

  • Merge local-test-hoodi/ into local-test/ — single set of scripts for all networks
  • Select network via positional arg or env var: ./start-all.sh hoodi or MORPH_NETWORK=hoodi ./start-all.sh
  • Per-network data isolation: local-test/{mainnet,hoodi}/reth-data, local-test/{mainnet,hoodi}/node-data
  • Remove geth and benchmark scripts (geth-start.sh, geth-stop.sh, sync-test.sh)
  • Fix node-start.sh: add --l1.rpc, --sync.depositContractAddr, conditional --derivation.rollupAddress (hoodi only)
  • Fix reth-stop.sh, node-stop.sh: migrate from stale pid-file approach to pm2
  • Add --engine.persistence-threshold 256 and --engine.memory-block-buffer-target 16 to reth args

Usage

# Mainnet (default)
./local-test/start-all.sh
./local-test/reset.sh --yes

# Hoodi testnet
./local-test/start-all.sh hoodi
./local-test/reset.sh hoodi --yes

Summary by CodeRabbit

  • New Features

    • Added network selection (mainnet / hoodi) and per-network configuration behavior.
  • Improvements

    • Per-network data and log directories; startup/status messages show active network.
    • Switch to PM2-managed process control for node components.
    • More flexible startup argument handling and runtime options.
  • Removals

    • Removed legacy Geth start/stop scripts and the sync-test benchmarking script.
  • Documentation

    • Added local-test README with usage and per-network guidance.

…ector

Merge the separate local-test-hoodi/ scripts into a single local-test/
directory. Select the network via first positional arg or env var:

  ./local-test/start-all.sh           # mainnet (default)
  ./local-test/start-all.sh hoodi     # Hoodi testnet

Key changes:
- common.sh: add MORPH_NETWORK=mainnet|hoodi with per-network defaults
  (L1 RPC, deposit contract, rollup contract, chain name, config URL)
- Data dirs are now network-isolated: local-test/{mainnet,hoodi}/
- node-start.sh: add --l1.rpc, --sync.depositContractAddr, conditional
  --derivation.rollupAddress for hoodi
- reth-start.sh: use ${MORPH_CHAIN} for --chain, add persistence tuning
- reth-stop.sh, node-stop.sh: migrate from pid files to pm2
- prepare.sh: unified config bundle download logic
- reset.sh: remove geth references, clean per-network data dirs
- Remove geth-start.sh, geth-stop.sh, sync-test.sh
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

📝 Walkthrough

Walkthrough

Adds MORPH_NETWORK-driven configuration and per-network data paths (mainnet/hoodi), consolidates process control to PM2, refactors startup/prepare/reset scripts for network awareness, removes Geth-specific scripts and a large sync-test harness, and adds a README for local-test usage.

Changes

Cohort / File(s) Summary
Network config & ignores
local-test/.gitignore, local-test/common.sh
Introduce MORPH_NETWORK (default mainnet) and per-network defaults (RPC endpoints, contract addresses, chain, data/log paths). Update gitignore to per-network data dirs and add *.pid, *.log, jwt-secret.txt ignores.
Removed Geth scripts
local-test/geth-start.sh, local-test/geth-stop.sh
Deleted legacy Geth start/stop scripts and associated PM2 orchestration for morph-geth.
PM2 stop migration
local-test/node-stop.sh, local-test/reth-stop.sh
Switched from PID-file stops to pm2_stop for morph-node and morph-reth.
Node startup refactor
local-test/node-start.sh
Refactored argument assembly into an args array, added conditional --derivation.rollupAddress and support for MORPH_NODE_EXTRA_FLAGS, and include MORPH_NETWORK in startup messaging.
Reth startup tweaks
local-test/reth-start.sh
Make chain selection dynamic (--chain "${MORPH_CHAIN}") and add engine flags (--engine.persistence-threshold, --engine.memory-block-buffer-target); include MORPH_NETWORK in messages.
Prepare & reset updates
local-test/prepare.sh, local-test/reset.sh
Prepare: changed build path, unified config ZIP handling (CONFIG_ZIP_URL), detect bundle in data/MORPH_NETWORK-data/temp, and copy config files. Reset: remove only RETH and NODE_HOME data (no Geth deletion); include MORPH_NETWORK in messages.
Removed sync test harness
local-test/sync-test.sh
Deleted a 335-line Morph Sync Speed Test script that compared Geth vs Reth, including sampling, reset flows, and reporting.
Docs and UX messages
local-test/README.md, local-test/start-all.sh, local-test/status.sh
Added README.md for local-test usage and updated user-facing messages to include MORPH_NETWORK.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Suggested reviewers

  • chengwenxi

Poem

🐰 I hopped through scripts, nose twitching bright,
I cued each network—mainnet, hoodi—just right,
PM2 drums a steady, humming beat,
Old Geth footprints vanish from my feet,
Configs tucked per-burrow, snug and neat.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective: unifying multiple network-specific scripts (mainnet/hoodi) into a single set with a MORPH_NETWORK selector variable, which is the primary change throughout the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch panos/test-scripts
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

Copy link

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@local-test/reth-start.sh`:
- Around line 43-44: Remove the unsupported engine flags
--engine.persistence-threshold and --engine.memory-block-buffer-target from the
reth startup command (they cause "unknown argument" failures); either delete
those options or replace them with valid, supported engine options from the
morph-reth fork you’re using, then validate the startup command runs without
"unknown argument" errors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: af02f386-bd1f-4d6f-a4ba-57e95a938173

📥 Commits

Reviewing files that changed from the base of the PR and between 192925e and 9fcb174.

📒 Files selected for processing (13)
  • local-test/.gitignore
  • local-test/common.sh
  • local-test/geth-start.sh
  • local-test/geth-stop.sh
  • local-test/node-start.sh
  • local-test/node-stop.sh
  • local-test/prepare.sh
  • local-test/reset.sh
  • local-test/reth-start.sh
  • local-test/reth-stop.sh
  • local-test/start-all.sh
  • local-test/status.sh
  • local-test/sync-test.sh
💤 Files with no reviewable changes (3)
  • local-test/geth-stop.sh
  • local-test/geth-start.sh
  • local-test/sync-test.sh

Copy link

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@local-test/README.md`:
- Around line 42-55: The fenced code block showing the directory layout is
missing a language identifier which triggers markdownlint MD040; update the
opening fence for that block (the triple-backticks before the directory tree) to
include a language identifier such as "text" (i.e., change ``` to ```text) so
the block becomes a proper fenced code block—look for the directory layout block
content beginning with "local-test/" in README.md and modify its opening fence
accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50576b83-8d5f-43a9-97b3-ea418d23afba

📥 Commits

Reviewing files that changed from the base of the PR and between 9fcb174 and 416b510.

📒 Files selected for processing (1)
  • local-test/README.md

Comment on lines +42 to +55
```
local-test/
jwt-secret.txt # Shared JWT secret (auto-generated)
mainnet/
reth-data/ # morph-reth chain database
node-data/config/ # genesis.json, config.toml, keys
node-data/data/ # Tendermint state
reth.log, node.log
hoodi/
reth-data/
node-data/config/
node-data/data/
reth.log, node.log
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add a language identifier to the fenced block.

The directory layout block is missing a fence language, which triggers markdownlint MD040.

💡 Proposed fix
-```
+```text
 local-test/
   jwt-secret.txt              # Shared JWT secret (auto-generated)
   mainnet/
     reth-data/                 # morph-reth chain database
@@
     node-data/data/
     reth.log, node.log
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 42-42: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@local-test/README.md` around lines 42 - 55, The fenced code block showing the
directory layout is missing a language identifier which triggers markdownlint
MD040; update the opening fence for that block (the triple-backticks before the
directory tree) to include a language identifier such as "text" (i.e., change
``` to ```text) so the block becomes a proper fenced code block—look for the
directory layout block content beginning with "local-test/" in README.md and
modify its opening fence accordingly.

@panos-xyz panos-xyz merged commit 0f3f0a7 into main Mar 18, 2026
9 checks passed
@panos-xyz panos-xyz deleted the panos/test-scripts branch March 18, 2026 03:39
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.

2 participants