From 7681a6ccea32b9fc2cf4e2a1a27eba7df0a13a24 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 13 Nov 2026 13:17:37 +0000 Subject: [PATCH 1/3] Add support for MEL --- README.md | 10 ++++++++++ docker-compose.yaml | 18 +++++++++++++++++- scripts/config.ts | 22 +++++++++++++++++++++- test-node.bash | 39 +++++++++++++++++++++++++++++++++++---- 4 files changed, 83 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 66656653..b6a2c52f 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,16 @@ Initialize the node in dev-mode (this will build the docker images from source) ``` To see more options, use `--help`. +## Running under MEL + +Pass `--mel` to create the L2 (and L3) chains with MEL enabled. Each node that validates (the `--validate` L2 validator and the `--l3node` node) gets a proof data provider (`mel_provider_l2`, `mel_provider_l3`), and validation runs on the arbitrator instead of the JIT. + +```bash +./test-node.bash --init --dev --mel --l3node --validate +``` + +> Notice: `--mel` needs a nitro image that ships `target/machines/mel0` and `mel-provider` (a MEL-aware nitro built with `--dev`, or a matching `NITRO_NODE_VERSION`) and a `NITRO_CONTRACTS_BRANCH` that supports MEL. + ## Further information ### Branch Selection Guide (for devs working *on* nitro-testnode) diff --git a/docker-compose.yaml b/docker-compose.yaml index 939d1279..8472a62c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -322,7 +322,7 @@ services: - "127.0.0.1:3347:3347" - "127.0.0.1:3348:3348" volumes: - - "validator-data:/home/user/.arbitrum/local/nitro" + - "l3-validator-data:/home/user/.arbitrum/local/nitro" - "l1keystore:/home/user/l1keystore" - "config:/config" command: --conf.file /config/l3node_config.json --http.port 3347 --http.api net,web3,arb,debug,eth --ws.port 3348 @@ -330,6 +330,21 @@ services: - sequencer - validation_node + # MEL proof data providers (nitro-reth mel-provider) + mel_provider_l2: + image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/mel-provider + command: --parent-chain-rpc-url http://geth:8545 --rpc-addr 0.0.0.0:8549 + depends_on: + - geth + + mel_provider_l3: + image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/mel-provider + command: --parent-chain-rpc-url http://sequencer:8547 --rpc-addr 0.0.0.0:8549 + depends_on: + - sequencer + validation_node: pid: host # allow debugging image: nitro-node-dev-testnode @@ -565,6 +580,7 @@ volumes: poster-data: poster-data-b: poster-data-c: + l3-validator-data: config: postgres-data: tokenbridge-data: diff --git a/scripts/config.ts b/scripts/config.ts index 88407678..05d61154 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -388,6 +388,9 @@ function writeConfigs(argv: any) { if (argv.anytrust) { simpleConfig.node["da"]["anytrust"]["rpc-aggregator"].enable = true } + if (argv.mel) { + simpleConfig.execution["caching"] = { "archive": true } + } if (argv.txfiltering) { applyTxFilteringConfig(simpleConfig); } @@ -400,7 +403,10 @@ function writeConfigs(argv: any) { validatorConfig.node.staker.enable = true validatorConfig.node.staker["use-smart-contract-wallet"] = true let validconfJSON = JSON.stringify(validatorConfig) - fs.writeFileSync(path.join(consts.configpath, "validator_config.json"), validconfJSON) + if (argv.mel) { + validatorConfig.node["mel"] = { "client": { "url": "http://mel_provider_l2:8549" } } + } + fs.writeFileSync(path.join(consts.configpath, "validator_config.json"), JSON.stringify(validatorConfig)) let unsafeStakerConfig = JSON.parse(validconfJSON) unsafeStakerConfig.node.staker.dangerous["without-block-validator"] = true @@ -417,6 +423,9 @@ function writeConfigs(argv: any) { "redis-url": argv.redisUrl }; } + if (argv.mel) { + sequencerConfig.execution["caching"] = { "archive": true } + } if (argv.txfiltering) { applyTxFilteringConfig(sequencerConfig); } @@ -449,6 +458,9 @@ function writeConfigs(argv: any) { l3Config.chain["info-files"] = [l3ChainInfoFile] l3Config.node.staker.enable = true l3Config.node.staker["use-smart-contract-wallet"] = true + if (argv.mel) { + l3Config.node["mel"] = { "client": { "url": "http://mel_provider_l3:8549" } } + } l3Config.node.sequencer = true l3Config.execution["sequencer"].enable = true l3Config.node["dangerous"]["no-sequencer-coordinator"] = true @@ -478,6 +490,9 @@ function writeConfigs(argv: any) { "addr": "0.0.0.0", }, })) + if (argv.mel) { + validationNodeConfig.validation["use-jit"] = false + } fs.writeFileSync(path.join(consts.configpath, "validation_node_config.json"), JSON.stringify(validationNodeConfig)) } @@ -755,6 +770,11 @@ export const writeConfigCommand = { describe: "enable filtering report framework", default: false }, + mel: { + boolean: true, + describe: "chains run MEL: proof data providers for validators, arbitrator validation", + default: false + }, }, handler: (argv: any) => { if (argv.filteringreport) { diff --git a/test-node.bash b/test-node.bash index 463ffa24..43608872 100755 --- a/test-node.bash +++ b/test-node.bash @@ -64,6 +64,7 @@ l2referenceda=false l2timeboost=false l2txfiltering=false l2filteringreport=false +mel=false # Use the dev versions of nitro/blockscout dev_nitro=false @@ -286,6 +287,10 @@ while [[ $# -gt 0 ]]; do l2txfiltering=true shift ;; + --mel) + mel=true + shift + ;; --redundantsequencers) simple=false redundantsequencers=$2 @@ -333,6 +338,7 @@ while [[ $# -gt 0 ]]; do echo --l2-timeboost run the L2 with Timeboost enabled, including auctioneer and bid validator echo --l2-tx-filtering run the L2 with transaction filtering enabled echo --l2-filtering-report run the L2 with filtering report framework enabled \(implies --l2-tx-filtering\) + echo --mel run the L2 \(and L3\) rollups under MEL: mel0 wasm module root, proof data providers for validators, arbitrator validation echo --batchposters batch posters [0-3] echo --redundantsequencers redundant sequencers [0-3] echo --detach detach from nodes after running them @@ -391,11 +397,17 @@ fi if $validate; then NODES="$NODES validator" + if $mel; then + NODES="$NODES mel_provider_l2" + fi elif ! $simple; then NODES="$NODES staker-unsafe" fi if $l3node; then NODES="$NODES l3node" + if $mel; then + NODES="$NODES mel_provider_l3" + fi fi if $blockscout; then NODES="$NODES blockscout" @@ -457,6 +469,13 @@ else docker tag $NITRO_NODE_VERSION nitro-node-dev-testnode fi +if $mel; then + if ! docker run --rm --entrypoint sh nitro-node-dev-testnode -c 'cd /home/user/target/machines/mel0 && test -f latest/machine.v2.wavm.br && test -d "$(cat latest/module-root.txt)" && test -x /usr/local/bin/mel-provider'; then + echo "--mel needs a nitro image that ships target/machines/mel0 (latest and ) and mel-provider" + exit 1 + fi +fi + if $blockscout; then if $dev_blockscout; then docker tag blockscout:latest blockscout-testnode @@ -555,7 +574,11 @@ if $force_init; then sequenceraddress=`run_script print-address --account sequencer | tail -n 1 | tr -d '\r\n'` l2ownerKey=`run_script print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` - wasmroot=`docker compose run --rm --entrypoint sh sequencer -c "cat /home/user/target/machines/latest/module-root.txt"` + machinesDir=/home/user/target/machines + if $mel; then + machinesDir=$machinesDir/mel0 + fi + wasmroot=`docker compose run --rm --entrypoint sh sequencer -c "cat $machinesDir/latest/module-root.txt"` echo "== Deploying L2 chain" docker compose run --rm -e PARENT_CHAIN_RPC="http://geth:8545" -e DEPLOYER_PRIVKEY=$l2ownerKey -e PARENT_CHAIN_ID=$l1chainid -e CHILD_CHAIN_NAME="arb-dev-test" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=$wasmroot -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l2_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_chain_info.json" rollupcreator create-rollup-testnode @@ -588,6 +611,7 @@ referenceDaNodeConfigLine="" timeboostNodeConfigLine="" txFilteringNodeConfigLine="" filteringReportNodeConfigLine="" +melNodeConfigLine="" # Remaining init may require AnyTrust committee/mirrors to have been started if $l2anytrust; then @@ -634,12 +658,15 @@ if $force_init; then if $l2filteringreport; then filteringReportNodeConfigLine="--filteringreport" fi + if $mel; then + melNodeConfigLine="--mel" + fi echo "== Writing configs" if $simple; then - run_script write-config --simple $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine + run_script write-config --simple $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine $melNodeConfigLine else - run_script write-config $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine + run_script write-config $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine $melNodeConfigLine echo == Initializing redis docker compose up --wait redis @@ -761,7 +788,11 @@ if $force_init; then docker compose run --rm --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_l3_chain_info.json > /config/l3_chain_info.json" echo == Funding l3 funnel and dev key - docker compose up --wait l3node sequencer + l3Nodes="l3node sequencer" + if $mel; then + l3Nodes="$l3Nodes mel_provider_l3" + fi + docker compose up --wait $l3Nodes sleep 45 # in case we need to create a smart contract wallet, allow for parent chain to recieve the contract creation tx and process it if $l3_token_bridge; then From 88ff210f9efce34750ba981f1122436b09f6ea94 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 20 Nov 2026 11:00:24 +0000 Subject: [PATCH 2/3] Start with MEL by default, allow pre-MEL with contracts and wasmModuleRoot flags, add CI job for pre-MEL --- .github/workflows/ci.yml | 11 ++++++++- README.md | 8 +++--- docker-compose.yaml | 15 ++++++------ scripts/config.ts | 36 ++++++--------------------- test-node.bash | 53 +++++++++------------------------------- 5 files changed, 40 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb74a23a..e1dfb81f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,12 @@ jobs: l3node: [l3node, l3node-token-6, no-l3node] tokenbridge: [tokenbridge, no-tokenbridge] simple: [simple, no-simple] + include: + # One extra job that starts pre-MEL chains. Its l3node value is not in the list above, so it is added as a new job + - pos: no-pos + l3node: l3node-pre-mel + tokenbridge: no-tokenbridge + simple: simple steps: - name: Checkout @@ -46,4 +52,7 @@ jobs: restore-keys: ${{ runner.os }}-buildx- - name: Startup Nitro testnode - run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force ${{ (matrix.l3node == 'l3node' && '--l3node') || (matrix.l3node == 'l3node-token-6' && '--l3node --l3-fee-token --l3-token-bridge --l3-fee-token-decimals 6') || '' }} ${{ matrix.tokenbridge == 'tokenbridge' && '--tokenbridge' || '--no-tokenbridge' }} --detach ${{ matrix.pos == 'pos' && '--pos' || '' }} --simple ${{ (matrix.simple == 'simple' && '--simple') || (matrix.simple == 'no-simple' && '--no-simple') || '' }} + env: + # Empty keeps the testnode's default contracts + NITRO_CONTRACTS_BRANCH: ${{ matrix.l3node == 'l3node-pre-mel' && 'v3.2.0' || '' }} + run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force ${{ (matrix.l3node == 'l3node' && '--l3node') || (matrix.l3node == 'l3node-token-6' && '--l3node --l3-fee-token --l3-token-bridge --l3-fee-token-decimals 6') || (matrix.l3node == 'l3node-pre-mel' && '--l3node --wasm-module-root 0xc10cd7ec6acaf1c441a3f6bd0900ad20f15855ba775a96f1939118cbc629dc97') || '' }} ${{ matrix.tokenbridge == 'tokenbridge' && '--tokenbridge' || '--no-tokenbridge' }} --detach ${{ matrix.pos == 'pos' && '--pos' || '' }} --simple ${{ (matrix.simple == 'simple' && '--simple') || (matrix.simple == 'no-simple' && '--no-simple') || '' }} diff --git a/README.md b/README.md index b6a2c52f..6ddd1546 100644 --- a/README.md +++ b/README.md @@ -44,16 +44,14 @@ Initialize the node in dev-mode (this will build the docker images from source) ``` To see more options, use `--help`. -## Running under MEL +## Starting a pre-MEL chain -Pass `--mel` to create the L2 (and L3) chains with MEL enabled. Each node that validates (the `--validate` L2 validator and the `--l3node` node) gets a proof data provider (`mel_provider_l2`, `mel_provider_l3`), and validation runs on the arbitrator instead of the JIT. +The chains are created with MEL enabled. To create chains that start before MEL, pass pre-MEL contracts together with a pre-MEL root from the image's `target/machines`. The following example uses the wasm module root of ArbOS v61: ```bash -./test-node.bash --init --dev --mel --l3node --validate +NITRO_CONTRACTS_BRANCH=v3.2.0 ./test-node.bash --init --l3node --wasm-module-root 0xc10cd7ec6acaf1c441a3f6bd0900ad20f15855ba775a96f1939118cbc629dc97 ``` -> Notice: `--mel` needs a nitro image that ships `target/machines/mel0` and `mel-provider` (a MEL-aware nitro built with `--dev`, or a matching `NITRO_NODE_VERSION`) and a `NITRO_CONTRACTS_BRANCH` that supports MEL. - ## Further information ### Branch Selection Guide (for devs working *on* nitro-testnode) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0231f402..d54a014a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -309,10 +309,11 @@ services: - "validator-data:/home/user/.arbitrum/local/nitro" - "l1keystore:/home/user/l1keystore" - "config:/config" - command: --conf.file /config/validator_config.json --http.port 8547 --http.api net,web3,arb,debug --ws.port 8548 + command: --conf.file /config/validator_config.json --http.port 8547 --http.api net,web3,arb,debug --ws.port 8548 --node.mel.client.url http://mel_provider_l2:8549 depends_on: - sequencer - validation_node + - mel_provider_l2 l3node: pid: host # allow debugging @@ -325,16 +326,18 @@ services: - "l3-validator-data:/home/user/.arbitrum/local/nitro" - "l1keystore:/home/user/l1keystore" - "config:/config" - command: --conf.file /config/l3node_config.json --http.port 3347 --http.api net,web3,arb,debug,eth --ws.port 3348 + command: --conf.file /config/l3node_config.json --http.port 3347 --http.api net,web3,arb,debug,eth --ws.port 3348 --node.mel.client.url http://mel_provider_l3:8549 depends_on: - sequencer - validation_node + - mel_provider_l3 # MEL proof data providers (nitro-reth mel-provider) mel_provider_l2: image: nitro-node-dev-testnode entrypoint: /usr/local/bin/mel-provider command: --parent-chain-rpc-url http://geth:8545 --rpc-addr 0.0.0.0:8549 + stop_signal: SIGINT depends_on: - geth @@ -342,21 +345,19 @@ services: image: nitro-node-dev-testnode entrypoint: /usr/local/bin/mel-provider command: --parent-chain-rpc-url http://sequencer:8547 --rpc-addr 0.0.0.0:8549 + stop_signal: SIGINT depends_on: - sequencer validation_node: pid: host # allow debugging image: nitro-node-dev-testnode - # Serve the image's legacy and current machines from one directory, so the node can validate a rollup that starts - # on an older root and the latest root after an upgrade. Legacy machines lack machine.v2.wavm.br, so they only - # validate through JIT and can't run challenges. Built on every start, so it follows the image - entrypoint: ["sh", "-c", "mkdir -p /tmp/machines && ln -sfn /home/user/nitro-legacy/machines/0x* /home/user/target/machines/* /tmp/machines/ && exec /usr/local/bin/nitro-val \"$$@\"", "--"] + entrypoint: /usr/local/bin/nitro-val ports: - "127.0.0.1:8949:8549" volumes: - "config:/config" - command: --conf.file /config/validation_node_config.json --validation.wasm.root-path /tmp/machines + command: --conf.file /config/validation_node_config.json --validation.wasm.root-path /home/user/target/machines scripts: build: scripts/ diff --git a/scripts/config.ts b/scripts/config.ts index 95494e6d..489c0e75 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -265,11 +265,6 @@ function writeConfigs(argv: any) { "id": 412346, "info-files": [chainInfoFile], }, - "validation": { - "wasm": { - "allowed-wasm-module-roots": ["/home/user/nitro-legacy/machines", "/home/user/target/machines"] - } - }, "node": { "bold": { "rpc-block-number": "latest", @@ -390,12 +385,11 @@ function writeConfigs(argv: any) { simpleConfig.node["batch-poster"].enable = true simpleConfig.node["batch-poster"]["redis-url"] = "" simpleConfig.execution["sequencer"].enable = true + // mel_provider_l3 requests proofs at past blocks of this chain, so this node has to keep their state + simpleConfig.execution["caching"] = { "archive": true } if (argv.anytrust) { simpleConfig.node["da"]["anytrust"]["rpc-aggregator"].enable = true } - if (argv.mel) { - simpleConfig.execution["caching"] = { "archive": true } - } if (argv.txfiltering) { applyTxFilteringConfig(simpleConfig); } @@ -408,10 +402,7 @@ function writeConfigs(argv: any) { validatorConfig.node.staker.enable = true validatorConfig.node.staker["use-smart-contract-wallet"] = true let validconfJSON = JSON.stringify(validatorConfig) - if (argv.mel) { - validatorConfig.node["mel"] = { "client": { "url": "http://mel_provider_l2:8549" } } - } - fs.writeFileSync(path.join(consts.configpath, "validator_config.json"), JSON.stringify(validatorConfig)) + fs.writeFileSync(path.join(consts.configpath, "validator_config.json"), validconfJSON) let unsafeStakerConfig = JSON.parse(validconfJSON) unsafeStakerConfig.node.staker.dangerous["without-block-validator"] = true @@ -422,15 +413,14 @@ function writeConfigs(argv: any) { sequencerConfig.node["seq-coordinator"].enable = true sequencerConfig.execution["sequencer"].enable = true sequencerConfig.node["delayed-sequencer"].enable = true + // mel_provider_l3 requests proofs at past blocks of this chain, so this node has to keep their state + sequencerConfig.execution["caching"] = { "archive": true } if (argv.timeboost) { sequencerConfig.execution.sequencer.timeboost = { "enable": false, // Create it false initially, turn it on with sed in test-node.bash after contract setup. "redis-url": argv.redisUrl }; } - if (argv.mel) { - sequencerConfig.execution["caching"] = { "archive": true } - } if (argv.txfiltering) { applyTxFilteringConfig(sequencerConfig); } @@ -463,9 +453,6 @@ function writeConfigs(argv: any) { l3Config.chain["info-files"] = [l3ChainInfoFile] l3Config.node.staker.enable = true l3Config.node.staker["use-smart-contract-wallet"] = true - if (argv.mel) { - l3Config.node["mel"] = { "client": { "url": "http://mel_provider_l3:8549" } } - } l3Config.node.sequencer = true l3Config.execution["sequencer"].enable = true l3Config.node["dangerous"]["no-sequencer-coordinator"] = true @@ -489,15 +476,13 @@ function writeConfigs(argv: any) { "validation": { "api-auth": true, "api-public": false, + "use-jit": false // The image's mel0 machine lacks the wasm libraries the JIT needs }, "auth": { "jwtsecret": valJwtSecret, "addr": "0.0.0.0", }, })) - if (argv.mel) { - validationNodeConfig.validation["use-jit"] = false - } fs.writeFileSync(path.join(consts.configpath, "validation_node_config.json"), JSON.stringify(validationNodeConfig)) } @@ -525,7 +510,7 @@ function writeL2ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": argv.anytrust, - "InitialArbOSVersion": argv.txfiltering ? 60 : 40, + "InitialArbOSVersion": 61, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } @@ -558,7 +543,7 @@ function writeL3ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 40, + "InitialArbOSVersion": 61, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } @@ -775,11 +760,6 @@ export const writeConfigCommand = { describe: "enable filtering report framework", default: false }, - mel: { - boolean: true, - describe: "chains run MEL: proof data providers for validators, arbitrator validation", - default: false - }, }, handler: (argv: any) => { if (argv.filteringreport) { diff --git a/test-node.bash b/test-node.bash index be494cda..7bc17173 100755 --- a/test-node.bash +++ b/test-node.bash @@ -8,7 +8,7 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8 # nitro-contract workaround for testnode # 1. authorizing validator signer key since validator wallet is buggy # - gas estimation sent from 0x0000 lead to balance and permission error -DEFAULT_NITRO_CONTRACTS_VERSION="v3.2.0" +DEFAULT_NITRO_CONTRACTS_VERSION="feat/mel-0-melconfig-contract" DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.5" # Set default versions if not overriden by provided env vars @@ -70,7 +70,6 @@ l2timeboost=false l2txfiltering=false l2filteringreport=false wasmroot="" -mel=false # Use the dev versions of nitro/blockscout dev_nitro=false @@ -293,10 +292,6 @@ while [[ $# -gt 0 ]]; do l2txfiltering=true shift ;; - --mel) - mel=true - shift - ;; --redundantsequencers) simple=false redundantsequencers=$2 @@ -353,7 +348,6 @@ while [[ $# -gt 0 ]]; do echo --l2-timeboost run the L2 with Timeboost enabled, including auctioneer and bid validator echo --l2-tx-filtering run the L2 with transaction filtering enabled echo --l2-filtering-report run the L2 with filtering report framework enabled \(implies --l2-tx-filtering\) - echo --mel run the L2 \(and L3\) rollups under MEL: mel0 wasm module root, proof data providers for validators, arbitrator validation echo --batchposters batch posters [0-3] echo --redundantsequencers redundant sequencers [0-3] echo --detach detach from nodes after running them @@ -372,7 +366,7 @@ while [[ $# -gt 0 ]]; do echo --build-utils rebuild scripts, rollupcreator, token bridge docker images echo --no-build-utils don\'t rebuild scripts, rollupcreator, token bridge docker images echo --force-build-utils force rebuilding utils, useful if NITRO_CONTRACTS_BRANCH or TOKEN_BRIDGE_BRANCH changes - echo --wasm-module-root initial WASM module root of the L2 and L3 rollups, one of the nitro image\'s machines \(default: the latest\). Needs an init, and a machine that supports the ArbOS version the chains start on. The nitro-legacy machines can\'t run challenges + echo --wasm-module-root initial WASM module root of the L2 and L3 rollups, one of the machines in the nitro image\'s target/machines \(default: the latest mel0 machine\). Needs an init, a machine that supports the ArbOS version the chains start on, and contracts of the same kind: a classic root for pre-MEL contracts, a mel0 root for MEL contracts echo echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help exit 0 @@ -425,17 +419,11 @@ fi if $validate; then NODES="$NODES validator" - if $mel; then - NODES="$NODES mel_provider_l2" - fi elif ! $simple; then NODES="$NODES staker-unsafe" fi if $l3node; then NODES="$NODES l3node" - if $mel; then - NODES="$NODES mel_provider_l3" - fi fi if $blockscout; then NODES="$NODES blockscout" @@ -497,20 +485,16 @@ else docker tag $NITRO_NODE_VERSION nitro-node-dev-testnode fi -# Validate the specified Wasm module root against the available machines in the nitro image +# Validate the specified Wasm module root against the available machines in the nitro image, or default to its latest machine if [ -n "$wasmroot" ]; then - image_roots=`docker run --rm --entrypoint sh nitro-node-dev-testnode -c "cat /home/user/*/machines/*/module-root.txt"` + image_roots=`docker run --rm --entrypoint sh nitro-node-dev-testnode -c "find /home/user/target/machines -name module-root.txt -exec cat {} +"` if ! grep -qxiF "$wasmroot" <<< "$image_roots"; then - echo "Error: $wasmroot is not a machine of the nitro image." - exit 1 - fi -fi - -if $mel; then - if ! docker run --rm --entrypoint sh nitro-node-dev-testnode -c 'cd /home/user/target/machines/mel0 && test -f latest/machine.v2.wavm.br && test -d "$(cat latest/module-root.txt)" && test -x /usr/local/bin/mel-provider'; then - echo "--mel needs a nitro image that ships target/machines/mel0 (latest and ) and mel-provider" + echo "Error: $wasmroot is not a machine in target/machines of the nitro image." exit 1 fi +elif $force_init; then + # Read before the old data is removed, so an image without the mel0 machine fails first + wasmroot=`docker run --rm --entrypoint sh nitro-node-dev-testnode -c "cat /home/user/target/machines/mel0/latest/module-root.txt"` fi if $blockscout; then @@ -611,13 +595,6 @@ if $force_init; then sequenceraddress=`run_script print-address --account sequencer | tail -n 1 | tr -d '\r\n'` l2ownerKey=`run_script print-private-key --account l2owner | tail -n 1 | tr -d '\r\n'` - if [ -z "$wasmroot" ]; then - machinesDir=/home/user/target/machines - if $mel; then - machinesDir=$machinesDir/mel0 - fi - wasmroot=`docker compose run --rm --entrypoint sh sequencer -c "cat $machinesDir/latest/module-root.txt"` - fi echo "== Deploying L2 chain" docker compose run --rm -e PARENT_CHAIN_RPC="http://geth:8545" -e DEPLOYER_PRIVKEY=$l2ownerKey -e PARENT_CHAIN_ID=$l1chainid -e CHILD_CHAIN_NAME="arb-dev-test" -e MAX_DATA_SIZE=117964 -e OWNER_ADDRESS=$l2ownerAddress -e WASM_MODULE_ROOT=$wasmroot -e SEQUENCER_ADDRESS=$sequenceraddress -e AUTHORIZE_VALIDATORS=10 -e CHILD_CHAIN_CONFIG_PATH="/config/l2_chain_config.json" -e CHAIN_DEPLOYMENT_INFO="/config/deployment.json" -e CHILD_CHAIN_INFO="/config/deployed_chain_info.json" rollupcreator create-rollup-testnode @@ -650,7 +627,6 @@ referenceDaNodeConfigLine="" timeboostNodeConfigLine="" txFilteringNodeConfigLine="" filteringReportNodeConfigLine="" -melNodeConfigLine="" # Remaining init may require AnyTrust committee/mirrors to have been started if $l2anytrust; then @@ -697,15 +673,12 @@ if $force_init; then if $l2filteringreport; then filteringReportNodeConfigLine="--filteringreport" fi - if $mel; then - melNodeConfigLine="--mel" - fi echo "== Writing configs" if $simple; then - run_script write-config --simple $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine $melNodeConfigLine + run_script write-config --simple $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine else - run_script write-config $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine $melNodeConfigLine + run_script write-config $anytrustNodeConfigLine $referenceDaNodeConfigLine $timeboostNodeConfigLine $txFilteringNodeConfigLine $filteringReportNodeConfigLine echo == Initializing redis docker compose up --wait redis @@ -827,11 +800,7 @@ if $force_init; then docker compose run --rm --entrypoint sh rollupcreator -c "jq [.[]] /config/deployed_l3_chain_info.json > /config/l3_chain_info.json" echo == Funding l3 funnel and dev key - l3Nodes="l3node sequencer" - if $mel; then - l3Nodes="$l3Nodes mel_provider_l3" - fi - docker compose up --wait $l3Nodes + docker compose up --wait l3node sequencer sleep 45 # in case we need to create a smart contract wallet, allow for parent chain to recieve the contract creation tx and process it if $l3_token_bridge; then From ba3c14ffd7873a63b5586356706f2daa130168b4 Mon Sep 17 00:00:00 2001 From: TucksonDev Date: Fri, 20 Nov 2026 12:02:06 +0000 Subject: [PATCH 3/3] Restore some unnecessary changes --- docker-compose.yaml | 7 +++++-- scripts/config.ts | 9 +++++++-- test-node.bash | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index d54a014a..acb2e431 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -352,12 +352,15 @@ services: validation_node: pid: host # allow debugging image: nitro-node-dev-testnode - entrypoint: /usr/local/bin/nitro-val + # Serve the image's legacy and current machines from one directory, so the node can validate a rollup that starts + # on an older root and the latest root after an upgrade. Legacy machines lack machine.v2.wavm.br, so they only + # validate through JIT and can't run challenges. Built on every start, so it follows the image + entrypoint: ["sh", "-c", "mkdir -p /tmp/machines && ln -sfn /home/user/nitro-legacy/machines/0x* /home/user/target/machines/* /tmp/machines/ && exec /usr/local/bin/nitro-val \"$$@\"", "--"] ports: - "127.0.0.1:8949:8549" volumes: - "config:/config" - command: --conf.file /config/validation_node_config.json --validation.wasm.root-path /home/user/target/machines + command: --conf.file /config/validation_node_config.json --validation.wasm.root-path /tmp/machines scripts: build: scripts/ diff --git a/scripts/config.ts b/scripts/config.ts index 489c0e75..1cf85bbf 100644 --- a/scripts/config.ts +++ b/scripts/config.ts @@ -265,6 +265,11 @@ function writeConfigs(argv: any) { "id": 412346, "info-files": [chainInfoFile], }, + "validation": { + "wasm": { + "allowed-wasm-module-roots": ["/home/user/nitro-legacy/machines", "/home/user/target/machines"] + } + }, "node": { "bold": { "rpc-block-number": "latest", @@ -510,7 +515,7 @@ function writeL2ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": argv.anytrust, - "InitialArbOSVersion": 61, + "InitialArbOSVersion": argv.txfiltering ? 60 : 40, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } @@ -543,7 +548,7 @@ function writeL3ChainConfig(argv: any) { "EnableArbOS": true, "AllowDebugPrecompiles": true, "DataAvailabilityCommittee": false, - "InitialArbOSVersion": 61, + "InitialArbOSVersion": 40, "InitialChainOwner": argv.l2owner, "GenesisBlockNum": 0 } diff --git a/test-node.bash b/test-node.bash index 7bc17173..4f846cfc 100755 --- a/test-node.bash +++ b/test-node.bash @@ -485,7 +485,8 @@ else docker tag $NITRO_NODE_VERSION nitro-node-dev-testnode fi -# Validate the specified Wasm module root against the available machines in the nitro image, or default to its latest machine +# Validate the wasm module root against the image's target/machines (the arbitrator can't load the nitro-legacy ones), +# or default to its latest mel0 machine if [ -n "$wasmroot" ]; then image_roots=`docker run --rm --entrypoint sh nitro-node-dev-testnode -c "find /home/user/target/machines -name module-root.txt -exec cat {} +"` if ! grep -qxiF "$wasmroot" <<< "$image_roots"; then