From 3b1d3b75162556c5ffd6efbc80cec37d7c3be629 Mon Sep 17 00:00:00 2001 From: Igor Braga <5835477+bragaigor@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:56:06 +0000 Subject: [PATCH] Extend nitro-testnode to run consensus and exection separately Signed-off-by: Igor Braga <5835477+bragaigor@users.noreply.github.com> --- README.md | 5 +++ docker-compose.yaml | 93 +++++++++++++++++++++++++++++++++++++++++++++ test-node.bash | 25 +++++++++++- 3 files changed, 122 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c61ae520..0347d405 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,11 @@ To fund the address 0x1111222233334444555566667777888899990000 on l2, use: ./test-node.bash script send-l2 --to address_0x1111222233334444555566667777888899990000 ``` +To get private key of an account you can: +```bash +./test-node.bash script print-private-key --account funnel +``` + For help and further scripts, see: ```bash diff --git a/docker-compose.yaml b/docker-compose.yaml index 896d7e38..c9a134cc 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -154,6 +154,99 @@ services: - "consensus:/consensus" - "config:/config" + execution-follower-node: + pid: host # allow debugging + image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro + ports: + - "127.0.0.1:7247:8547" + - "127.0.0.1:7248:8548" + - "127.0.0.1:9682:9682" + volumes: + - "seqdata:/home/user/.arbitrum/local/nitro" + - "l1keystore:/home/user/l1keystore" + - "config:/config" + - "tokenbridge-data:/tokenbridge-data" + command: + - --conf.file=/config/consensus_config.json + - --node.feed.output.enable + - --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer + - --node.seq-coordinator.my-url=http://sequencer:8547 + - --graphql.enable + - --graphql.vhosts=* + - --graphql.corsdomain=* + - --ws.addr=0.0.0.0 + - --ws.port=9682 + - --ws.api=net,web3,eth,txpool,debug,nitroexecution + - --execution.rpc-server.enable + - --execution.rpc-server.public + - --execution.rpc-server.authenticated=false + - --execution.consensus-rpc-client.url=ws://consensus-follower-node:8552 + - --execution.consensus-rpc-client.jwtsecret=/config/jwt.hex + - --execution.consensus-rpc-client.retries=3 + - --execution.consensus-rpc-client.connection-wait=15s + - --execution.consensus-rpc-client.retry-delay=1s + depends_on: + - geth + + consensus-follower-node: + pid: host # allow debugging + image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro + ports: + - "127.0.0.1:7147:8547" + - "127.0.0.1:7148:8548" + - "127.0.0.1:8552:8552" + volumes: + - "seqdata:/home/user/.arbitrum/local/nitro" + - "l1keystore:/home/user/l1keystore" + - "config:/config" + - "tokenbridge-data:/tokenbridge-data" + command: + - --conf.file=/config/consensus_config.json + - --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer + - --node.seq-coordinator.my-url=http://sequencer:8547 + - --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer + - --graphql.enable + - --graphql.vhosts=* + - --graphql.corsdomain=* + - --ws.addr=0.0.0.0 + - --ws.port=8552 + - --ws.api=net,web3,eth,txpool,debug,nitroconsensus + - --node.rpc-server.enable + - --node.rpc-server.public + - --node.rpc-server.authenticated=false + - --node.execution-rpc-client.url=ws://execution-follower-node:9682 + - --node.execution-rpc-client.jwtsecret=/config/jwt.hex + - --node.execution-rpc-client.retries=3 + - --node.execution-rpc-client.connection-wait=15s + - --node.execution-rpc-client.retry-delay=1s + depends_on: + - geth + + regular-follower-node: + pid: host # allow debugging + image: nitro-node-dev-testnode + entrypoint: /usr/local/bin/nitro + ports: + - "127.0.0.1:7447:8547" + - "127.0.0.1:7548:8548" + volumes: + - "seqdata:/home/user/.arbitrum/local/nitro" + - "l1keystore:/home/user/l1keystore" + - "config:/config" + - "tokenbridge-data:/tokenbridge-data" + command: + - --conf.file=/config/consensus_config.json + - --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer + - --node.seq-coordinator.my-url=http://sequencer:8547 + - --http.api=net,web3,eth,txpool,debug,timeboost,auctioneer + - --graphql.enable + - --graphql.vhosts=* + - --graphql.corsdomain=* + depends_on: + - geth + sequencer: pid: host # allow debugging image: nitro-node-dev-testnode diff --git a/test-node.bash b/test-node.bash index 5c8145f8..dd6a5f15 100755 --- a/test-node.bash +++ b/test-node.bash @@ -50,6 +50,8 @@ blockscout=false tokenbridge=false l3node=false consensusclient=false +run_consensus_and_execution_in_different_processes=false +follower_node=false redundantsequencers=0 l3_custom_fee_token=false l3_custom_fee_token_pricer=false @@ -175,6 +177,14 @@ while [[ $# -gt 0 ]]; do build_utils=true shift ;; + --run-consensus-and-execution-in-different-processes) + run_consensus_and_execution_in_different_processes=true + shift + ;; + --follower-node) + follower_node=true + shift + ;; --validate) simple=false validate=true @@ -327,6 +337,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 --batchposters batch posters [0-3] + echo --follower-node run a follower node echo --redundantsequencers redundant sequencers [0-3] echo --detach detach from nodes after running them echo --blockscout build or launch blockscout @@ -343,6 +354,7 @@ while [[ $# -gt 0 ]]; do echo --no-build-dev-blockscout don\'t rebuild dev blockscout docker image echo --build-utils rebuild scripts, rollupcreator, token bridge docker images echo --no-build-utils don\'t rebuild scripts, rollupcreator, token bridge docker images + echo --run-consensus-and-execution-in-different-processes run consensus and execution node in different processed communicating over rpc echo --force-build-utils force rebuilding utils, useful if NITRO_CONTRACTS_BRANCH or TOKEN_BRIDGE_BRANCH changes echo echo script runs inside a separate docker. For SCRIPT-ARGS, run $0 script --help @@ -353,6 +365,14 @@ done NODES="sequencer" INITIAL_SEQ_NODES="sequencer" +if $run_consensus_and_execution_in_different_processes && $simple; then + NODES="$NODES consensus-follower-node execution-follower-node" +fi + +if $follower_node && $simple; then + NODES="$NODES regular-follower-node" +fi + if ! $simple; then NODES="$NODES redis" fi @@ -623,10 +643,13 @@ if $force_init; then run_script redis-init --redundancy $redundantsequencers fi - echo == Funding l2 funnel and dev key + echo == Spinning up sequencer nodes docker compose up --wait $INITIAL_SEQ_NODES + echo == Sleeping for 45s allow for parent chain to recieve the contract creation tx and process it 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 + echo == Funding l2 funnel and dev key run_script bridge-funds --ethamount 100000 --wait + echo == Funding l2owner run_script send-l2 --ethamount 100 --to l2owner --wait rollupAddress=`docker compose run --rm --entrypoint sh poster -c "jq -r '.[0].rollup.rollup' /config/deployed_chain_info.json | tail -n 1 | tr -d '\r\n'"`