diff --git a/.github/workflows/localnet-test.yml b/.github/workflows/localnet-test.yml index a4f155ad..0982ae9e 100644 --- a/.github/workflows/localnet-test.yml +++ b/.github/workflows/localnet-test.yml @@ -35,9 +35,15 @@ jobs: - name: "Download and verify dependencies" run: make deps + - name: "build localnet" + run: docker compose -f ./e2e/docker-compose.yml build + - name: "run localnet" run: docker compose -f ./e2e/docker-compose.yml up -d + - name: "kill an op-node after a minute" + run: sleep 60 && docker compose -f ./e2e/docker-compose.yml down op-node + - name: "get localnet stats" working-directory: ./e2e/monitor # XXX should this be a make command? diff --git a/e2e/deploy-config.json b/e2e/deploy-config.json index 9b5d20ed..8041e0cb 100644 --- a/e2e/deploy-config.json +++ b/e2e/deploy-config.json @@ -1,7 +1,7 @@ { "l1ChainID": 1337, "l2ChainID": 901, - "l2BlockTime": 1, + "l2BlockTime": 2, "maxSequencerDrift": 300, "sequencerWindowSize": 200, "channelTimeout": 120, diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index 8e442911..68472c38 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -20,7 +20,9 @@ services: - "18443:18443" - "18444:18444" volumes: - - bitcoindata:/bitcoin/.bitcoin + - { type: "tmpfs", target: "/bitcoin/.bitcoin" } + networks: + e2e: bitcoind-initialblocks: image: "kylemanna/bitcoind@sha256:5d97bbe3c74856818f0b3a1e718eb3968981ab03ce08aaf1c7d528f99aaf30b7" @@ -37,6 +39,8 @@ services: - "1000" # need to generate a lot for greater chance to not spend coinbase - "$BTC_ADDRESS" restart: on-failure + networks: + e2e: bitcoind-moreblocks: image: "kylemanna/bitcoind@sha256:5d97bbe3c74856818f0b3a1e718eb3968981ab03ce08aaf1c7d528f99aaf30b7" @@ -55,6 +59,8 @@ services: - "generatetoaddress" - "1" - "$BTC_ADDRESS" + networks: + e2e: electrs: image: blockstream/esplora@sha256:1fb16180f430f75da28eca37a265630c7192b3c103aafd9b9ba4bf5b6d9c8ea8 @@ -76,17 +82,17 @@ services: - "50000" - --electrum-txs-limit - "50000" - - --blocks-dir - - "/bitcoindata/regtest/blocks" + - --jsonrpc-import environment: RUST_LOG: debug RUST_BACKTRACE: "full" volumes: - ./cookie:/tmp/.cookie - - bitcoindata:/bitcoindata:ro deploy: restart_policy: condition: "on-failure" + networks: + e2e: bfgd-postgres: build: @@ -105,6 +111,8 @@ services: POSTGRES_HOST_AUTH_METHOD: "trust" volumes: - { type: "tmpfs", target: "/var" } + networks: + e2e: bfgd: build: @@ -126,6 +134,8 @@ services: BFG_LOG_LEVEL: "INFO" BFG_PUBLIC_ADDRESS: ":8383" BFG_PRIVATE_ADDRESS: ":8080" + networks: + e2e: bssd: build: @@ -139,6 +149,8 @@ services: BSS_BFG_URL: "ws://bfgd:8080/v1/ws/private" BSS_LOG_LEVEL: "INFO" BSS_ADDRESS: ":8081" + networks: + e2e: popmd: build: @@ -151,6 +163,8 @@ services: POPM_BFG_URL: "http://bfgd:8383/v1/ws/public" POPM_LOG_LEVEL: "INFO" POPM_REMINE_THRESHOLD: "1" + networks: + e2e: geth-l1: image: "ethereum/client-go@sha256:343cff592e1a9daf99a89261d3263941ff9c3350b62b3ebc0f7c30d35721d905" @@ -185,6 +199,8 @@ services: - "./e2e/passwords.txt:/tmp/passwords.txt:ro" - "./e2e/jwt.txt:/tmp/jwt.txt:ro" - { type: "tmpfs", target: "/tmp" } + networks: + e2e: op-geth-l2: build: @@ -194,6 +210,7 @@ services: - "geth-l1" healthcheck: test: ["CMD-SHELL", "ls /l2configs/rollup.json"] + timeout: 60s environment: ADMIN_PRIVATE_KEY: "${ADMIN_PRIVATE_KEY}" OP_GETH_L1_RPC: "http://geth-l1:8545" @@ -212,6 +229,74 @@ services: - "./deploy-config.json:/git/optimism/packages/contracts-bedrock/deploy-config/devnetL1.json" - "./prestate-proof.json:/git/optimism/op-program/bin/prestate-proof.json" - { type: "tmpfs", target: "/tmp" } + networks: + e2e: + + op-geth-l2-2: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + depends_on: + op-geth-l2: + condition: "service_healthy" + healthcheck: + test: ["CMD-SHELL", "ls /l2configs/rollup.json"] + timeout: 60s + environment: + ADMIN_PRIVATE_KEY: "${ADMIN_PRIVATE_KEY}" + OP_GETH_L1_RPC: "http://op-geth-l1:8545" + ENTRYPOINT_SKIP_GENESIS: "true" + working_dir: "/tmp" + command: + - "sh" + - "/tmp/entrypointl2.sh" + volumes: + - "./e2e/keystore:/tmp/keystore:ro" + - "./e2e/passwords.txt:/tmp/passwords.txt:ro" + - "./jwt.txt:/tmp/jwt.txt:ro" + - "./entrypointl2.sh:/tmp/entrypointl2.sh" + - "./genesisl2.sh:/tmp/genesisl2.sh" + - "./output:/tmp/output" + - "l2configs:/l2configs" + - "./deploy-config.json:/git/optimism/packages/contracts-bedrock/deploy-config/devnetL1.json" + - "./prestate-proof.json:/git/optimism/op-program/bin/prestate-proof.json" + - { type: "tmpfs", target: "/tmp" } + restart: on-failure + networks: + e2e: + + op-geth-l2-3: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + depends_on: + op-geth-l2: + condition: "service_healthy" + healthcheck: + test: ["CMD-SHELL", "ls /l2configs/rollup.json"] + timeout: 60s + environment: + ADMIN_PRIVATE_KEY: "${ADMIN_PRIVATE_KEY}" + OP_GETH_L1_RPC: "http://op-geth-l1:8545" + ENTRYPOINT_SKIP_GENESIS: "true" + working_dir: "/tmp" + command: + - "sh" + - "/tmp/entrypointl2.sh" + volumes: + - "./e2e/keystore:/tmp/keystore:ro" + - "./e2e/passwords.txt:/tmp/passwords.txt:ro" + - "./jwt.txt:/tmp/jwt.txt:ro" + - "./entrypointl2.sh:/tmp/entrypointl2.sh" + - "./genesisl2.sh:/tmp/genesisl2.sh" + - "./output:/tmp/output" + - "l2configs:/l2configs" + - "./deploy-config.json:/git/optimism/packages/contracts-bedrock/deploy-config/devnetL1.json" + - "./prestate-proof.json:/git/optimism/op-program/bin/prestate-proof.json" + - { type: "tmpfs", target: "/tmp" } + restart: on-failure + networks: + e2e: op-node: build: @@ -231,23 +316,143 @@ services: - "op-node/bin/op-node" - "--l2=ws://op-geth-l2:8551" - "--l2.jwt-secret=/tmp/jwt.txt" - - "--sequencer.enabled" + - "--sequencer.enabled=true" - "--sequencer.l1-confs=0" + - "--sequencer.stopped=true" - "--verifier.l1-confs=0" - "--rollup.config=/l2configs/rollup.json" - "--rpc.addr=0.0.0.0" - "--rpc.port=8547" - - "--p2p.disable" - "--rpc.enable-admin" - "--l1=http://geth-l1:8545" - "--l1.rpckind=standard" - "--l1.trustrpc" - "--log.level=info" - "--l1.trustrpc=true" + - "--l1.http-poll-interval=6s" + - "--p2p.no-discovery" + - "--p2p.priv.path=/tmp/op-node-priv-key.txt" + - "--p2p.sequencer.key=${ADMIN_PRIVATE_KEY}" + - "--p2p.static=/ip4/192.169.198.7/tcp/9222/p2p/16Uiu2HAkx8gegEci9Jk2GDJ92S7HuF7odZCgg9mbos18qiqNEpFz" + - "--p2p.static=/ip4/192.169.197.7/tcp/9222/p2p/16Uiu2HAmVqqZGwbuWDffuQo2jCLBSULod13CZuoACZQS8WTKEL2X" + - "--conductor.enabled=true" + - "--conductor.rpc=http://op-conductor:8547" + - "--log.level=debug" + - "--log.format=terminal" + - "--override.ecotone=1725868497" + - "--override.canyon=1725868497" + - "--override.delta=1725868497" + - "--l1.beacon.ignore=true" + volumes: + - "l2configs:/l2configs" + - "./jwt.txt:/tmp/jwt.txt" + - "./op-node-priv-key.txt:/tmp/op-node-priv-key.txt" + networks: + e2e: + ipv4_address: 192.169.199.7 + + + op-node-2: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + deploy: + restart_policy: + condition: "any" + depends_on: + op-geth-l1: + condition: "service_started" + op-geth-l2-2: + condition: "service_healthy" + environment: + OP_NODE_BSS_WS: "http://bssd:8081/v1/ws" + command: + - "op-node/bin/op-node" + - "--l2=ws://op-geth-l2-2:8551" + - "--l2.jwt-secret=/tmp/jwt.txt" + - "--sequencer.enabled=true" + - "--sequencer.l1-confs=0" + - "--sequencer.stopped=true" + - "--verifier.l1-confs=0" + - "--rollup.config=/l2configs/rollup.json" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8547" + - "--rpc.enable-admin" + - "--l1=http://op-geth-l1:8545" + - "--l1.rpckind=standard" + - "--l1.trustrpc" + - "--log.level=trace" + - "--l1.trustrpc=true" - "--l1.http-poll-interval=1s" + - "--p2p.static=/ip4/192.169.199.7/tcp/9222/p2p/16Uiu2HAmGCJv5C97ZcdMr6pCCQFqdNXvwE8k6RgTd7vWu4WtVUmr" + - "--p2p.static=/ip4/192.169.197.7/tcp/9222/p2p/16Uiu2HAmVqqZGwbuWDffuQo2jCLBSULod13CZuoACZQS8WTKEL2X" + - "--p2p.no-discovery" + - "--p2p.priv.path=/tmp/op-node-priv-key.txt" + - "--p2p.sequencer.key=${ADMIN_PRIVATE_KEY}" + - "--conductor.enabled=true" + - "--conductor.rpc=http://op-conductor-2:8547" + - "--override.ecotone=1725868497" + - "--override.canyon=1725868497" + - "--override.delta=1725868497" + - "--l1.beacon.ignore=true" volumes: - "l2configs:/l2configs" - "./jwt.txt:/tmp/jwt.txt" + - "./op-node-priv-key-2.txt:/tmp/op-node-priv-key.txt" + networks: + e2e: + ipv4_address: 192.169.198.7 + + op-node-3: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + deploy: + restart_policy: + condition: "any" + depends_on: + op-geth-l1: + condition: "service_started" + op-geth-l2-3: + condition: "service_healthy" + environment: + OP_NODE_BSS_WS: "http://bssd:8081/v1/ws" + command: + - "op-node/bin/op-node" + - "--l2=ws://op-geth-l2-3:8551" + - "--l2.jwt-secret=/tmp/jwt.txt" + - "--sequencer.enabled=true" + - "--sequencer.l1-confs=0" + - "--sequencer.stopped=true" + - "--verifier.l1-confs=0" + - "--rollup.config=/l2configs/rollup.json" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8547" + - "--rpc.enable-admin" + - "--l1=http://op-geth-l1:8545" + - "--l1.rpckind=standard" + - "--l1.trustrpc" + - "--log.level=trace" + - "--l1.trustrpc=true" + - "--l1.http-poll-interval=1s" + - "--p2p.static=/ip4/192.169.199.7/tcp/9222/p2p/16Uiu2HAmGCJv5C97ZcdMr6pCCQFqdNXvwE8k6RgTd7vWu4WtVUmr" + - "--p2p.static=/ip4/192.169.198.7/tcp/9222/p2p/16Uiu2HAkx8gegEci9Jk2GDJ92S7HuF7odZCgg9mbos18qiqNEpFz" + - "--p2p.no-discovery" + - "--p2p.priv.path=/tmp/op-node-priv-key.txt" + - "--p2p.sequencer.key=${ADMIN_PRIVATE_KEY}" + - "--conductor.enabled=true" + - "--conductor.rpc=http://op-conductor-3:8547" + - "--override.ecotone=1725868497" + - "--override.canyon=1725868497" + - "--override.delta=1725868497" + - "--l1.beacon.ignore=true" + volumes: + - "l2configs:/l2configs" + - "./jwt.txt:/tmp/jwt.txt" + - "./op-node-priv-key-3.txt:/tmp/op-node-priv-key.txt" + networks: + e2e: + ipv4_address: 192.169.197.7 op-batcher: build: @@ -279,6 +484,74 @@ services: condition: "service_healthy" op-node: condition: "service_started" + networks: + e2e: + + op-batcher-2: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + deploy: + restart_policy: + condition: "any" + command: + - "op-batcher/bin/op-batcher" + - "--l2-eth-rpc=http://op-geth-l2-2:8546" + - "--rollup-rpc=http://op-node-2:8547" + - "--poll-interval=1s" + - "--sub-safety-margin=1" + - "--num-confirmations=1" + - "--safe-abort-nonce-too-low-count=3" + - "--resubmission-timeout=30s" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8548" + - "--rpc.enable-admin" + - "--max-channel-duration=1" + - "--max-pending-tx=1" + - "--l1-eth-rpc=http://op-geth-l1:8545" + - "--private-key=${ADMIN_PRIVATE_KEY}" + depends_on: + op-geth-l1: + condition: "service_started" + op-geth-l2-2: + condition: "service_healthy" + op-node-2: + condition: "service_started" + networks: + e2e: + + op-batcher-3: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + deploy: + restart_policy: + condition: "any" + command: + - "op-batcher/bin/op-batcher" + - "--l2-eth-rpc=http://op-geth-l2-3:8546" + - "--rollup-rpc=http://op-node-3:8547" + - "--poll-interval=1s" + - "--sub-safety-margin=1" + - "--num-confirmations=1" + - "--safe-abort-nonce-too-low-count=3" + - "--resubmission-timeout=30s" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8548" + - "--rpc.enable-admin" + - "--max-channel-duration=1" + - "--max-pending-tx=1" + - "--l1-eth-rpc=http://op-geth-l1:8545" + - "--private-key=${ADMIN_PRIVATE_KEY}" + depends_on: + op-geth-l1: + condition: "service_started" + op-geth-l2-3: + condition: "service_healthy" + op-node-3: + condition: "service_started" + networks: + e2e: op-proposer: build: @@ -303,6 +576,181 @@ services: - "--private-key=${ADMIN_PRIVATE_KEY}" - "--l1-eth-rpc=http://geth-l1:8545" + op-proposer-2: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + deploy: + restart_policy: + condition: "any" + depends_on: + op-geth-l1: + condition: "service_started" + op-geth-l2-2: + condition: "service_healthy" + op-node-2: + condition: "service_started" + command: + - "op-proposer/bin/op-proposer" + - "--poll-interval=1s" + - "--rpc.port=8560" + - "--rollup-rpc=http://op-node-2:8547" + - "--l2oo-address=${L2OO_ADDRESS}" + - "--private-key=${ADMIN_PRIVATE_KEY}" + - "--l1-eth-rpc=http://op-geth-l1:8545" + networks: + e2e: + + op-proposer-3: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + deploy: + restart_policy: + condition: "any" + depends_on: + op-geth-l1: + condition: "service_started" + op-geth-l2-3: + condition: "service_healthy" + op-node-3: + condition: "service_started" + command: + - "op-proposer/bin/op-proposer" + - "--poll-interval=1s" + - "--rpc.port=8560" + - "--rollup-rpc=http://op-node-3:8547" + - "--l2oo-address=${L2OO_ADDRESS}" + - "--private-key=${ADMIN_PRIVATE_KEY}" + - "--l1-eth-rpc=http://op-geth-l1:8545" + networks: + e2e: + + op-conductor: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + command: + - "op-conductor/bin/op-conductor" + - "--consensus.addr=op-conductor" + - "--consensus.port=50050" + - "--raft.server.id=op-conductor-1" + - "--raft.storage.dir=/tmp/raft" + - "--raft.bootstrap" + - "--node.rpc=http://op-node:8547" + - "--execution.rpc=http://op-geth-l2:8546" + - "--healthcheck.unsafe-interval=10" + - "--healthcheck.safe-interval=200" + - "--healthcheck.min-peer-count=1" + - "--healthcheck.interval=60" + - "--rollup.config=/l2configs/rollup.json" + - "--log.format=terminal" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8547" + volumes: + - "l2configs:/l2configs" + - "./jwt.txt:/tmp/jwt.txt" + restart: always + networks: + e2e: + depends_on: + op-node: + condition: "service_started" + op-geth-l2: + condition: "service_healthy" + ports: + - "127.0.0.1:50050:50050" + + op-conductor-2: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + command: + - "op-conductor/bin/op-conductor" + - "--consensus.addr=op-conductor-2" + - "--consensus.port=50051" + - "--raft.server.id=op-conductor-2" + - "--raft.storage.dir=/tmp/raft" + - "--node.rpc=http://op-node-2:8547" + - "--execution.rpc=http://op-geth-l2-2:8546" + - "--healthcheck.unsafe-interval=10" + - "--healthcheck.safe-interval=200" + - "--healthcheck.min-peer-count=1" + - "--healthcheck.interval=60" + - "--rollup.config=/l2configs/rollup.json" + - "--log.format=terminal" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8547" + volumes: + - "l2configs:/l2configs" + - "./jwt.txt:/tmp/jwt.txt" + restart: always + networks: + e2e: + depends_on: + op-node-2: + condition: "service_started" + op-geth-l2-2: + condition: "service_healthy" + ports: + - "127.0.0.1:50051:50051" + + op-conductor-3: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + command: + - "op-conductor/bin/op-conductor" + - "--consensus.addr=op-conductor-3" + - "--consensus.port=50052" + - "--raft.server.id=op-conductor-3" + - "--raft.storage.dir=/tmp/raft" + - "--node.rpc=http://op-node-3:8547" + - "--execution.rpc=http://op-geth-l2-3:8546" + - "--healthcheck.unsafe-interval=10" + - "--healthcheck.safe-interval=200" + - "--healthcheck.min-peer-count=1" + - "--healthcheck.interval=60" + - "--rollup.config=/l2configs/rollup.json" + - "--log.format=terminal" + - "--rpc.addr=0.0.0.0" + - "--rpc.port=8547" + volumes: + - "l2configs:/l2configs" + - "./jwt.txt:/tmp/jwt.txt" + restart: always + networks: + e2e: + depends_on: + op-node-3: + condition: "service_started" + op-geth-l2-3: + condition: "service_healthy" + ports: + - "127.0.0.1:50052:50052" + + raft: + build: + dockerfile: "optimism-stack.Dockerfile" + context: "." + entrypoint: + - "bash" + command: + - "/tmp/setup-raft.bash" + depends_on: + - "op-conductor" + - "op-conductor-2" + - "op-conductor-3" + volumes: + - "./setup-raft.bash:/tmp/setup-raft.bash" + restart: on-failure + networks: + e2e: volumes: l2configs: - bitcoindata: + +networks: + e2e: + ipam: + config: + - subnet: 192.169.0.0/16 diff --git a/e2e/entrypointl2.sh b/e2e/entrypointl2.sh index 35ca99f1..96838425 100644 --- a/e2e/entrypointl2.sh +++ b/e2e/entrypointl2.sh @@ -5,7 +5,10 @@ set -xe -sh /tmp/genesisl2.sh +if [ -z "${ENTRYPOINT_SKIP_GENESIS}" ]; then + sh /tmp/genesisl2.sh +fi + /git/op-geth/build/bin/geth init --datadir /tmp/datadir /l2configs/genesis.json @@ -42,4 +45,7 @@ sh /tmp/genesisl2.sh --gpo.maxprice=1 \ --tbc.network=localnet \ --tbc.initheight=1 \ - --tbc.seeds='bitcoind:18444' + --tbc.seeds='bitcoind:18444' \ + --override.ecotone=1725868497 \ + --override.canyon=1725868497 \ + --override.cancun=1725868497 diff --git a/e2e/monitor/main.go b/e2e/monitor/main.go index 859cd263..cd715014 100644 --- a/e2e/monitor/main.go +++ b/e2e/monitor/main.go @@ -320,10 +320,10 @@ func monitorRolledUpTxs(ctx context.Context, s *state, mtx *sync.Mutex) { } for { - first := runJs(firstBatcherTxBlockJs, "l1", "geth.ipc") - last := runJs(lastBatcherTxBlockJs, "l1", "geth.ipc") - count := runJs(batcherPublicationCountJs, "l1", "geth.ipc") - popMinerBalance := runJs(popMinerBalanceJs, "l2", "datadir/geth.ipc") + first := runJs(firstBatcherTxBlockJs, "l1", "geth.ipc", "1") + last := runJs(lastBatcherTxBlockJs, "l1", "geth.ipc", "1") + count := runJs(batcherPublicationCountJs, "l1", "geth.ipc", "1") + popMinerBalance := runJs(popMinerBalanceJs, "l2", "datadir/geth.ipc", "2-1") mtx.Lock() s.firstBatcherPublicationHash = first diff --git a/e2e/op-node-priv-key-2.txt b/e2e/op-node-priv-key-2.txt new file mode 100644 index 00000000..b827eab1 --- /dev/null +++ b/e2e/op-node-priv-key-2.txt @@ -0,0 +1 @@ +41d77a5faede98c56af340a16646b21420a6d8512a11a04058a6609081f84e75 \ No newline at end of file diff --git a/e2e/op-node-priv-key-3.txt b/e2e/op-node-priv-key-3.txt new file mode 100644 index 00000000..dd534c54 --- /dev/null +++ b/e2e/op-node-priv-key-3.txt @@ -0,0 +1 @@ +41d77a5faede98c56af340a16646b21420a6d8512a11a04058a6609081f84e76 \ No newline at end of file diff --git a/e2e/op-node-priv-key.txt b/e2e/op-node-priv-key.txt new file mode 100644 index 00000000..2b92fb14 --- /dev/null +++ b/e2e/op-node-priv-key.txt @@ -0,0 +1 @@ +41d77a5faede98c56af340a16646b21420a6d8512a11a04058a6609081f84e74 \ No newline at end of file diff --git a/e2e/optimism-stack.Dockerfile b/e2e/optimism-stack.Dockerfile index f6e1c33a..f5bca118 100644 --- a/e2e/optimism-stack.Dockerfile +++ b/e2e/optimism-stack.Dockerfile @@ -20,10 +20,10 @@ ENV PATH="${PATH}:/root/.foundry/bin" RUN foundryup -ARG OP_GETH_CACHE_BREAK=1 +ARG OP_GETH_CACHE_BREAK=12F RUN git clone https://github.com/hemilabs/op-geth WORKDIR /git/op-geth -RUN git checkout 83dd8a6e0459dd0f96182bb16065411f9318ac00 +RUN git checkout 4c818bcfa33873c808cfb697ea1b713748338117 WORKDIR /git @@ -50,6 +50,8 @@ WORKDIR /git/optimism/op-bindings RUN go mod tidy WORKDIR /git/optimism RUN make op-bindings op-node op-batcher op-proposer +RUN make -C ./op-conductor op-conductor + RUN pnpm build WORKDIR /git/optimism/packages/contracts-bedrock diff --git a/e2e/setup-raft.bash b/e2e/setup-raft.bash new file mode 100644 index 00000000..42b8bed8 --- /dev/null +++ b/e2e/setup-raft.bash @@ -0,0 +1,20 @@ +#! /bin/bash + +set -ev + +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_pause","params":[],"id":4}' http://op-conductor:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_pause","params":[],"id":4}' http://op-conductor-2:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_pause","params":[],"id":4}' http://op-conductor-3:8547 +curl -X POST -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"admin_stopSequencer\",\"params\":[],\"id\":3}" http://op-node:8547 + + +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":1}' http://op-node:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_addServerAsVoter","params":["op-conductor-2", "op-conductor-2:50051"],"id":4}' http://op-conductor:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_addServerAsVoter","params":["op-conductor-3", "op-conductor-3:50052"],"id":4}' http://op-conductor:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_resume","params":[],"id":4}' http://op-conductor:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_resume","params":[],"id":4}' http://op-conductor-2:8547 +curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"conductor_resume","params":[],"id":4}' http://op-conductor-3:8547 + +unsafe_head=$(curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"optimism_syncStatus","params":[],"id":2}' http://op-node:8547 | jq '.result.unsafe_l2.hash' ) +echo "unsafe_head=$unsafe_head" +curl -X POST -H "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"admin_startSequencer\",\"params\":[$unsafe_head],\"id\":3}" http://op-node:8547