chore(local-test): unify mainnet/hoodi scripts with MORPH_NETWORK selector#54
chore(local-test): unify mainnet/hoodi scripts with MORPH_NETWORK selector#54
Conversation
…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
📝 WalkthroughWalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes 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 unit tests (beta)
📝 Coding Plan
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 Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
There was a problem hiding this comment.
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
📒 Files selected for processing (13)
local-test/.gitignorelocal-test/common.shlocal-test/geth-start.shlocal-test/geth-stop.shlocal-test/node-start.shlocal-test/node-stop.shlocal-test/prepare.shlocal-test/reset.shlocal-test/reth-start.shlocal-test/reth-stop.shlocal-test/start-all.shlocal-test/status.shlocal-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
There was a problem hiding this comment.
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.
| ``` | ||
| 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 | ||
| ``` |
There was a problem hiding this comment.
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.
Summary
local-test-hoodi/intolocal-test/— single set of scripts for all networks./start-all.sh hoodiorMORPH_NETWORK=hoodi ./start-all.shlocal-test/{mainnet,hoodi}/reth-data,local-test/{mainnet,hoodi}/node-datageth-start.sh,geth-stop.sh,sync-test.sh)node-start.sh: add--l1.rpc,--sync.depositContractAddr, conditional--derivation.rollupAddress(hoodi only)reth-stop.sh,node-stop.sh: migrate from stale pid-file approach to pm2--engine.persistence-threshold 256and--engine.memory-block-buffer-target 16to reth argsUsage
Summary by CodeRabbit
New Features
Improvements
Removals
Documentation