Skip to content

Commit

Permalink
Pass entire rollup cfg through the stack
Browse files Browse the repository at this point in the history
  • Loading branch information
natebeauregard committed Sep 9, 2024
1 parent f456866 commit 7c4ab4e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
23 changes: 12 additions & 11 deletions e2e/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/ethereum-optimism/optimism/indexer/bindings"
opgenesis "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/rawdb"
Expand All @@ -44,16 +45,16 @@ type EventListener interface {
}

type StackConfig struct {
Ctx context.Context
Operator L1User
Users []L1User
L1Client *L1Client
L1Portal *bindings.OptimismPortal
L2Client *bftclient.HTTP
MonomerClient *MonomerClient
WaitL1 func(numBlocks int) error
WaitL2 func(numBlocks int) error
SequencerWindowSize uint64
Ctx context.Context
Operator L1User
Users []L1User
L1Client *L1Client
L1Portal *bindings.OptimismPortal
L2Client *bftclient.HTTP
MonomerClient *MonomerClient
RollupConfig *rollup.Config
WaitL1 func(numBlocks int) error
WaitL2 func(numBlocks int) error
}

type stack struct {
Expand Down Expand Up @@ -297,13 +298,13 @@ func (s *stack) run(ctx context.Context, env *environment.Env) (*StackConfig, er
MonomerClient: monomerClient,
Operator: l1users[0],
Users: l1users[1:],
RollupConfig: rollupConfig,
WaitL1: func(numBlocks int) error {
return wait(numBlocks, 1)
},
WaitL2: func(numBlocks int) error {
return wait(numBlocks, 2)
},
SequencerWindowSize: deployConfig.SequencerWindowSize,
}, nil
}

Expand Down
4 changes: 3 additions & 1 deletion e2e/stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ func checkForRollbacks(t *testing.T, stack *e2e.StackConfig) {
require.NoError(t, err)

// End the test once a sequencing window has passed.
if l1BlockInfo.Number >= stack.SequencerWindowSize+1 {
if l1BlockInfo.Number >= stack.RollupConfig.SeqWindowSize+1 {
t.Log("No Monomer rollbacks detected")
return
}
}

require.Fail(t, "event chan closed prematurely")
}

func containsAttributesTx(t *testing.T, stack *e2e.StackConfig) {
Expand Down

0 comments on commit 7c4ab4e

Please sign in to comment.