diff --git a/.github/workflows/e2e-op-historical-proof.yml b/.github/workflows/e2e-op-historical-proof.yml index f89e1b7872b..352c7fe6e0e 100644 --- a/.github/workflows/e2e-op-historical-proof.yml +++ b/.github/workflows/e2e-op-historical-proof.yml @@ -53,9 +53,9 @@ jobs: run: | source <(cargo llvm-cov show-env --export-prefix) make build - make test-e2e-sysgo GO_PKG_NAME=proofs/core OP_DEVSTACK_PROOF_SEQUENCER_EL=op-geth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth - make test-e2e-sysgo GO_PKG_NAME=proofs/reorg OP_DEVSTACK_PROOF_SEQUENCER_EL=op-geth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth - make test-e2e-sysgo GO_PKG_NAME=proofs/prune OP_DEVSTACK_PROOF_SEQUENCER_EL=op-geth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth + make test-e2e-sysgo GO_PKG_NAME=proofs/core OP_DEVSTACK_PROOF_SEQUENCER_EL=op-geth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth-with-proof + make test-e2e-sysgo GO_PKG_NAME=proofs/reorg OP_DEVSTACK_PROOF_SEQUENCER_EL=op-geth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth-with-proof + make test-e2e-sysgo GO_PKG_NAME=proofs/prune OP_DEVSTACK_PROOF_SEQUENCER_EL=op-geth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth-with-proof cargo llvm-cov report --lcov --output-path verifier_cov.lcov - name: Upload coverage to codecov.io @@ -115,9 +115,9 @@ jobs: run: | source <(cargo llvm-cov show-env --export-prefix) make build - make test-e2e-sysgo GO_PKG_NAME=proofs/core OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-geth - make test-e2e-sysgo GO_PKG_NAME=proofs/reorg OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-geth - make test-e2e-sysgo GO_PKG_NAME=proofs/prune OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-geth + make test-e2e-sysgo GO_PKG_NAME=proofs/core OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth-with-proof OP_DEVSTACK_PROOF_VALIDATOR_EL=op-geth + make test-e2e-sysgo GO_PKG_NAME=proofs/reorg OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth-with-proof OP_DEVSTACK_PROOF_VALIDATOR_EL=op-geth + make test-e2e-sysgo GO_PKG_NAME=proofs/prune OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth-with-proof OP_DEVSTACK_PROOF_VALIDATOR_EL=op-geth cargo llvm-cov report --lcov --output-path sequencer_cov.lcov - name: Upload coverage to codecov.io @@ -131,6 +131,67 @@ jobs: name: sequencer-sysgo-tests verbose: true + op-reth-as-sequencer-and-verifier: + name: op-reth-as-sequencer-and-verifier + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: '1.24.0' + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - uses: taiki-e/install-action@cargo-llvm-cov + + - name: Verify tools + run: | + echo "forge: $(command -v forge || true)" + go version + + - name: Build contract artifacts with forge + working-directory: crates/optimism/tests/proofs/contracts + run: | + forge build + + - uses: jdx/mise-action@v3 + + - name: Run e2e tests + working-directory: crates/optimism/tests + run: | + source <(cargo llvm-cov show-env --export-prefix) + make build + make test-e2e-sysgo GO_PKG_NAME=proofs/core OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth-with-proof + make test-e2e-sysgo GO_PKG_NAME=proofs/reorg OP_DEVSTACK_PROOF_SEQUENCER_EL=op-reth OP_DEVSTACK_PROOF_VALIDATOR_EL=op-reth-with-proof + cargo llvm-cov report --lcov --output-path sequencer_and_verifier_cov.lcov + + - name: Upload coverage to codecov.io + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} + files: sequencer_and_verifier_cov.lcov + flags: e2e + env_vars: OS,RUST + name: sequencer-and-verifier-sysgo-tests + verbose: true + e2e-op-historical-proof-success: name: e2e-op-historical-proof-success runs-on: ubuntu-latest @@ -138,6 +199,7 @@ jobs: needs: - op-reth-as-verifier - op-reth-as-sequencer + - op-reth-as-sequencer-and-verifier timeout-minutes: 60 steps: - name: E2E tests for Proof History ExEx succeeded diff --git a/.gitmodules b/.gitmodules index 93f63753598..a52703dbf5f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "crates/optimism/tests/optimism"] path = crates/optimism/tests/optimism url = https://github.com/ChainSafe/optimism.git - branch = jk/op-historical-proofs + branch = jk/historical-proofs diff --git a/crates/optimism/tests/Makefile b/crates/optimism/tests/Makefile index 459b8e09301..23bd092a1d0 100644 --- a/crates/optimism/tests/Makefile +++ b/crates/optimism/tests/Makefile @@ -7,7 +7,7 @@ DEVNET ?= opgeth-seq-opreth-val GO_PKG_NAME ?= proofs/core SOURCE_DIR := $(shell pwd) OP_DEVSTACK_PROOF_SEQUENCER_EL ?= op-geth -OP_DEVSTACK_PROOF_VALIDATOR_EL ?= op-reth +OP_DEVSTACK_PROOF_VALIDATOR_EL ?= op-reth-with-proof .PHONY: all build-docker build-contracts unzip-contract-artifacts update-packages run clean help diff --git a/crates/optimism/tests/artifacts/compressed/artifacts.tzst b/crates/optimism/tests/artifacts/compressed/artifacts.tzst index 3be176ef01f..a3ebbe3866d 100644 Binary files a/crates/optimism/tests/artifacts/compressed/artifacts.tzst and b/crates/optimism/tests/artifacts/compressed/artifacts.tzst differ diff --git a/crates/optimism/tests/go.mod b/crates/optimism/tests/go.mod index bc1a3751bcc..5df87c26b5a 100644 --- a/crates/optimism/tests/go.mod +++ b/crates/optimism/tests/go.mod @@ -66,7 +66,7 @@ require ( github.com/elastic/gosigar v0.14.3 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.4-0.20251001155152-4eb15ccedf7e // indirect - github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20251121143344-5ac16e0fbb00 // indirect + github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20260115192958-fb86a23cd30e // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect github.com/ethereum/go-verkle v0.2.2 // indirect @@ -262,15 +262,15 @@ require ( go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.36.0 // indirect + golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect - golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.38.0 // indirect + golang.org/x/mod v0.24.0 // indirect + golang.org/x/net v0.39.0 // indirect golang.org/x/sys v0.36.0 // indirect - golang.org/x/term v0.30.0 // indirect + golang.org/x/term v0.31.0 // indirect golang.org/x/text v0.25.0 // indirect golang.org/x/time v0.11.0 // indirect - golang.org/x/tools v0.29.0 // indirect + golang.org/x/tools v0.32.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect google.golang.org/grpc v1.69.4 // indirect diff --git a/crates/optimism/tests/go.sum b/crates/optimism/tests/go.sum index 7c7baeae102..d2f86a0cfd4 100644 --- a/crates/optimism/tests/go.sum +++ b/crates/optimism/tests/go.sum @@ -203,8 +203,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.4-0.20251001155152-4eb15c github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.4-0.20251001155152-4eb15ccedf7e/go.mod h1:DYj7+vYJ4cIB7zera9mv4LcAynCL5u4YVfoeUu6Wa+w= github.com/ethereum-optimism/op-geth v1.101605.0-rc.1 h1:rzmwuBKOMZnQc4QNBm5iEqBrnEo1M5cbklWHkC5Oszo= github.com/ethereum-optimism/op-geth v1.101605.0-rc.1/go.mod h1:9J7De8kDwXE/lrMgVEHc0F33TZqcN1Lb5nYaW6UZt38= -github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20251121143344-5ac16e0fbb00 h1:TR5Y7B+5m63V0Dno7MHcFqv/XZByQzx/4THV1T1A7+U= -github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20251121143344-5ac16e0fbb00/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20260115192958-fb86a23cd30e h1:TO1tUcwbhIrNuea/LCsQJSQ5HDWCHdrzT/5MLC1aIU4= +github.com/ethereum-optimism/superchain-registry/validation v0.0.0-20260115192958-fb86a23cd30e/go.mod h1:NZ816PzLU1TLv1RdAvYAb6KWOj4Zm5aInT0YpDVml2Y= github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= @@ -931,8 +931,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= @@ -948,8 +948,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -982,8 +982,8 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1072,8 +1072,8 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= -golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1113,8 +1113,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= -golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= +golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/crates/optimism/tests/optimism b/crates/optimism/tests/optimism index 48cfc7d1fb6..b862b241d3b 160000 --- a/crates/optimism/tests/optimism +++ b/crates/optimism/tests/optimism @@ -1 +1 @@ -Subproject commit 48cfc7d1fb6f58218eea58f6f3086d2c5da81431 +Subproject commit b862b241d3b2117f4b4494b212278ea84eff3df3 diff --git a/crates/optimism/tests/proofs/core/execute_payload_test.go b/crates/optimism/tests/proofs/core/execute_payload_test.go index 0216eae68f4..d49a82b9451 100644 --- a/crates/optimism/tests/proofs/core/execute_payload_test.go +++ b/crates/optimism/tests/proofs/core/execute_payload_test.go @@ -15,7 +15,7 @@ func TestExecutePayloadSuccess(gt *testing.T) { ctx := t.Ctx() sys := utils.NewMixedOpProofPreset(t) user := sys.FunderL2.NewFundedEOA(eth.OneHundredthEther) - opRethELNode := sys.RethL2ELNode() + opRethELNode := sys.RethWithProofL2ELNode() plannedTxOption := user.PlanTransfer(user.Address(), eth.OneWei) plannedTx := txplan.NewPlannedTx(plannedTxOption) @@ -70,7 +70,7 @@ func TestExecutePayloadWithInvalidParentHash(gt *testing.T) { ctx := t.Ctx() sys := utils.NewMixedOpProofPreset(t) user := sys.FunderL2.NewFundedEOA(eth.OneHundredthEther) - opRethELNode := sys.RethL2ELNode() + opRethELNode := sys.RethWithProofL2ELNode() plannedTxOption := user.PlanTransfer(user.Address(), eth.OneWei) plannedTx := txplan.NewPlannedTx(plannedTxOption) diff --git a/crates/optimism/tests/proofs/core/execution_witness_test.go b/crates/optimism/tests/proofs/core/execution_witness_test.go index 2cbbc2b73e8..eaf0742e104 100644 --- a/crates/optimism/tests/proofs/core/execution_witness_test.go +++ b/crates/optimism/tests/proofs/core/execution_witness_test.go @@ -27,7 +27,7 @@ type ExecutionWitness struct { func TestDebugExecutionWitness(gt *testing.T) { t := devtest.SerialT(gt) sys := utils.NewMixedOpProofPreset(t) - opRethELNode := sys.RethL2ELNode() + opRethELNode := sys.RethWithProofL2ELNode() // Create a funded account and recipient account := sys.FunderL2.NewFundedEOA(eth.Ether(10)) diff --git a/crates/optimism/tests/proofs/prune/prune_test.go b/crates/optimism/tests/proofs/prune/prune_test.go index 9ba50d1ac88..528851a82c3 100644 --- a/crates/optimism/tests/proofs/prune/prune_test.go +++ b/crates/optimism/tests/proofs/prune/prune_test.go @@ -33,7 +33,7 @@ func TestPruneProofStorageWithGetProofConsistency(gt *testing.T) { // An expected time within the prune should be detected. var pruneDetectTimeout = 5 * time.Minute - opRethELNode := sys.RethL2ELNode() + opRethELNode := sys.RethWithProofL2ELNode() ethClient := opRethELNode.Escape().EthClient() // ----------------------------- diff --git a/crates/optimism/tests/proofs/reorg/reorg_test.go b/crates/optimism/tests/proofs/reorg/reorg_test.go index fd8cd3174a8..7df16d63064 100644 --- a/crates/optimism/tests/proofs/reorg/reorg_test.go +++ b/crates/optimism/tests/proofs/reorg/reorg_test.go @@ -188,8 +188,11 @@ func TestReorgUsingAccountProof(gt *testing.T) { require.NotEqual(t, originalRef.Hash, reorgedRef_A.Hash, "Expected to get different heads on divergence block number, but got the same hash, so no reorg happened on chain A") require.Equal(t, originalRef.ParentID().Hash, reorgedRef_A.ParentHash, "Expected to get same parent hashes on divergence block number, but got different hashes") + time.Sleep(10 * time.Second) + // verify that the accounts involved in the conflicting blocks - for _, c := range cases { + for i, c := range cases { + l.Info("Verifying proof", "case", i, "addr", c.addr.Hex(), "block", c.Block) utils.FetchAndVerifyProofs(t, sys, c.addr, c.slots, c.Block) } } diff --git a/crates/optimism/tests/proofs/utils/preset.go b/crates/optimism/tests/proofs/utils/preset.go index 7e284d111d5..166adec2eda 100644 --- a/crates/optimism/tests/proofs/utils/preset.go +++ b/crates/optimism/tests/proofs/utils/preset.go @@ -24,6 +24,7 @@ type L2ELClient string const ( L2ELClientGeth L2ELClient = "geth" L2ELClientReth L2ELClient = "reth" + L2ELClientRethWithProofs L2ELClient = "reth-with-proof" ) type L2ELNodeID struct { @@ -100,6 +101,18 @@ func (m *MixedOpProofPreset) RethL2ELNode() *dsl.L2ELNode { return nil } +// RethWithProofL2ELNode returns first L2 EL nodes that are running op-reth with proof +func (m *MixedOpProofPreset) RethWithProofL2ELNode() *dsl.L2ELNode { + if m.L2ELSequencer.Client == L2ELClientRethWithProofs { + return m.L2ELSequencer.L2ELNode + } + + if m.L2ELValidator.Client == L2ELClientRethWithProofs { + return m.L2ELValidator.L2ELNode + } + return nil +} + func WithMixedOpProofPreset() stack.CommonOption { return stack.MakeCommon(DefaultMixedOpProofSystem(&DefaultMixedOpProofSystemIDs{})) } @@ -135,7 +148,12 @@ func NewMixedOpProofPreset(t devtest.T) *MixedOpProofPreset { sequencerCL := l2Net.L2CLNode(match.Assume(t, match.WithSequencerActive(t.Ctx()))) sequencerELInner := l2Net.L2ELNode(match.Assume(t, match.EngineFor(sequencerCL))) var sequencerEL *L2ELNode - if strings.Contains(sequencerELInner.ID().String(), "op-reth") { + if strings.Contains(sequencerELInner.ID().String(), "op-reth-with-proof") { + sequencerEL = &L2ELNode{ + L2ELNode: dsl.NewL2ELNode(sequencerELInner, orch.ControlPlane()), + Client: L2ELClientRethWithProofs, + } + } else if strings.Contains(sequencerELInner.ID().String(), "op-reth") { sequencerEL = &L2ELNode{ L2ELNode: dsl.NewL2ELNode(sequencerELInner, orch.ControlPlane()), Client: L2ELClientReth, @@ -161,7 +179,12 @@ func NewMixedOpProofPreset(t devtest.T) *MixedOpProofPreset { match.Not(sequencerEL.ID()), ))) var verifierEL *L2ELNode - if strings.Contains(verifierELInner.ID().String(), "op-reth") { + if strings.Contains(verifierELInner.ID().String(), "op-reth-with-proof") { + verifierEL = &L2ELNode{ + L2ELNode: dsl.NewL2ELNode(verifierELInner, orch.ControlPlane()), + Client: L2ELClientRethWithProofs, + } + } else if strings.Contains(verifierELInner.ID().String(), "op-reth") { verifierEL = &L2ELNode{ L2ELNode: dsl.NewL2ELNode(verifierELInner, orch.ControlPlane()), Client: L2ELClientReth, @@ -233,29 +256,41 @@ func NewDefaultMixedOpProofSystemIDs(l1ID, l2ID eth.ChainID) DefaultMixedOpProof TestSequencer: "test-sequencer", } - // default to op-geth for sequencer and op-reth for validator - if os.Getenv("OP_DEVSTACK_PROOF_SEQUENCER_EL") == "op-reth" { + // default to op-geth for sequencer and op-reth-with-proof for validator + switch os.Getenv("OP_DEVSTACK_PROOF_SEQUENCER_EL") { + case "op-reth-with-proof": + ids.L2ELSequencer = L2ELNodeID{ + L2ELNodeID: stack.NewL2ELNodeID("sequencer-op-reth-with-proof", l2ID), + Client: L2ELClientRethWithProofs, + } + case "op-reth": ids.L2ELSequencer = L2ELNodeID{ L2ELNodeID: stack.NewL2ELNodeID("sequencer-op-reth", l2ID), Client: L2ELClientReth, } - } else { + default: ids.L2ELSequencer = L2ELNodeID{ L2ELNodeID: stack.NewL2ELNodeID("sequencer-op-geth", l2ID), Client: L2ELClientGeth, } } - if os.Getenv("OP_DEVSTACK_PROOF_VALIDATOR_EL") == "op-geth" { + switch os.Getenv("OP_DEVSTACK_PROOF_VALIDATOR_EL") { + case "op-geth": ids.L2ELValidator = L2ELNodeID{ L2ELNodeID: stack.NewL2ELNodeID("validator-op-geth", l2ID), Client: L2ELClientGeth, } - } else { + case "op-reth": ids.L2ELValidator = L2ELNodeID{ L2ELNodeID: stack.NewL2ELNodeID("validator-op-reth", l2ID), Client: L2ELClientReth, } + default: + ids.L2ELValidator = L2ELNodeID{ + L2ELNodeID: stack.NewL2ELNodeID("validator-op-reth-with-proof", l2ID), + Client: L2ELClientRethWithProofs, + } } return ids @@ -297,18 +332,28 @@ func defaultMixedOpProofSystemOpts(src, dest *DefaultMixedOpProofSystemIDs) stac opt.Add(sysgo.WithL1Nodes(src.L1EL, src.L1CL)) // Spawn L2 sequencer nodes - if src.L2ELSequencer.Client == L2ELClientReth { + switch src.L2ELSequencer.Client { + case L2ELClientRethWithProofs: + opt.Add(sysgo.WithOpReth(src.L2ELSequencer.L2ELNodeID, sysgo.L2ELWithProofHistory(true))) + case L2ELClientReth: opt.Add(sysgo.WithOpReth(src.L2ELSequencer.L2ELNodeID)) - } else { + case L2ELClientGeth: opt.Add(sysgo.WithOpGeth(src.L2ELSequencer.L2ELNodeID)) + default: + panic("unknown L2 EL client for sequencer") } opt.Add(sysgo.WithL2CLNode(src.L2CLSequencer, src.L1CL, src.L1EL, src.L2ELSequencer.L2ELNodeID, sysgo.L2CLSequencer())) // Spawn L2 validator nodes - if src.L2ELValidator.Client == L2ELClientReth { + switch src.L2ELValidator.Client { + case L2ELClientRethWithProofs: + opt.Add(sysgo.WithOpReth(src.L2ELValidator.L2ELNodeID, sysgo.L2ELWithProofHistory(true))) + case L2ELClientReth: opt.Add(sysgo.WithOpReth(src.L2ELValidator.L2ELNodeID)) - } else { + case L2ELClientGeth: opt.Add(sysgo.WithOpGeth(src.L2ELValidator.L2ELNodeID)) + default: + panic("unknown L2 EL client for validator") } opt.Add(sysgo.WithL2CLNode(src.L2CLValidator, src.L1CL, src.L1EL, src.L2ELValidator.L2ELNodeID)) diff --git a/crates/optimism/tests/proofs/utils/proof.go b/crates/optimism/tests/proofs/utils/proof.go index 16a6287b9be..b0199d5b293 100644 --- a/crates/optimism/tests/proofs/utils/proof.go +++ b/crates/optimism/tests/proofs/utils/proof.go @@ -106,32 +106,23 @@ func VerifyProof(res *eth.AccountResult, stateRoot common.Hash) error { // FetchAndVerifyProofs fetches account proofs from both L2EL and L2ELB for the given address func FetchAndVerifyProofs(t devtest.T, sys *MixedOpProofPreset, address common.Address, slots []common.Hash, block uint64) { ctx := t.Ctx() - gethProofRes, err := sys.GethL2ELNode().Escape().L2EthClient().GetProof(ctx, address, slots, hexutil.Uint64(block).String()) - if err != nil { - require.NoError(t, err, "failed to get proof from L2EL at block %d", block) - } + blockInfo, err := sys.L2ELSequencerNode().Escape().L2EthClient().InfoByNumber(ctx, block) + require.NoError(t, err, "failed to get block info for block %d", block) - rethProofRes, err := sys.RethL2ELNode().Escape().L2EthClient().GetProof(ctx, address, slots, hexutil.Uint64(block).String()) - if err != nil { - require.NoError(t, err, "failed to get proof from L2ELB at block %d", block) - } - NormalizeProofResponse(rethProofRes) - NormalizeProofResponse(gethProofRes) + seqProofRes, err := sys.L2ELSequencerNode().Escape().L2EthClient().GetProof(ctx, address, slots, hexutil.Uint64(block).String()) + require.NoError(t, err, "failed to get proof from L2EL at block %d", block) - require.Equal(t, gethProofRes, rethProofRes, "geth and reth proofs should match") + valProofRes, err := sys.L2ELValidatorNode().Escape().L2EthClient().GetProof(ctx, address, slots, hexutil.Uint64(block).String()) + require.NoError(t, err, "failed to get proof from L2ELB at block %d", block) - blockInfo, err := sys.GethL2ELNode().Escape().L2EthClient().InfoByNumber(ctx, block) - if err != nil { - require.NoError(t, err, "failed to get block info for block %d", block) - } + NormalizeProofResponse(seqProofRes) + NormalizeProofResponse(valProofRes) - err = VerifyProof(gethProofRes, blockInfo.Root()) - if err != nil { - require.NoError(t, err, "geth proof verification failed at block %d", block) - } + require.Equal(t, seqProofRes, valProofRes, "sequencer and validator proofs should match") - err = VerifyProof(rethProofRes, blockInfo.Root()) - if err != nil { - require.NoError(t, err, "reth proof verification failed at block %d", block) - } + err = VerifyProof(seqProofRes, blockInfo.Root()) + require.NoError(t, err, "geth proof verification failed at block %d", block) + + err = VerifyProof(valProofRes, blockInfo.Root()) + require.NoError(t, err, "reth proof verification failed at block %d", block) }