Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 68 additions & 6 deletions .github/workflows/e2e-op-historical-proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -131,13 +131,75 @@ 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
if: always()
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
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion crates/optimism/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file modified crates/optimism/tests/artifacts/compressed/artifacts.tzst
Binary file not shown.
12 changes: 6 additions & 6 deletions crates/optimism/tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions crates/optimism/tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/tests/optimism
Submodule optimism updated 968 files
4 changes: 2 additions & 2 deletions crates/optimism/tests/proofs/core/execute_payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/tests/proofs/prune/prune_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

// -----------------------------
Expand Down
5 changes: 4 additions & 1 deletion crates/optimism/tests/proofs/reorg/reorg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
67 changes: 56 additions & 11 deletions crates/optimism/tests/proofs/utils/preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type L2ELClient string
const (
L2ELClientGeth L2ELClient = "geth"
L2ELClientReth L2ELClient = "reth"
L2ELClientRethWithProofs L2ELClient = "reth-with-proof"
)

type L2ELNodeID struct {
Expand Down Expand Up @@ -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{}))
}
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))

Expand Down
Loading
Loading