diff --git a/testing/endtoend/backend/anvil_local.go b/testing/endtoend/backend/anvil_local.go index a1c8c3dda..dfdbecf98 100644 --- a/testing/endtoend/backend/anvil_local.go +++ b/testing/endtoend/backend/anvil_local.go @@ -221,8 +221,11 @@ func (a *AnvilLocal) DeployRollup(ctx context.Context, opts ...challenge_testing anyTrustFastConfirmer, opts..., ), - false, // Do not use a mock bridge. - true, // Use a mock one step prover entry. + setup.RollupStackConfig{ + UseMockBridge: false, + UseMockOneStepProver: true, + MinimumAssertionPeriod: 0, + }, ) if err != nil { return nil, errors.Wrap(err, "could not deploy rollup stack") diff --git a/testing/setup/rollup_stack.go b/testing/setup/rollup_stack.go index c225ed2e6..747719d1d 100644 --- a/testing/setup/rollup_stack.go +++ b/testing/setup/rollup_stack.go @@ -171,6 +171,7 @@ type ChainSetup struct { useMockBridge bool useMockOneStepProver bool numAccountsToGen uint64 + minimumAssertionPeriod int64 challengeTestingOpts []challenge_testing.Opt StateManagerOpts []statemanager.Opt EnableFastConfirmation bool @@ -203,6 +204,12 @@ func WithMockBridge() Opt { } } +func WithMinimumAssertionPeriod(period int64) Opt { + return func(setup *ChainSetup) { + setup.minimumAssertionPeriod = period + } +} + func WithChallengeTestingOpts(opts ...challenge_testing.Opt) Opt { return func(setup *ChainSetup) { setup.challengeTestingOpts = opts @@ -377,8 +384,11 @@ func ChainsWithEdgeChallengeManager(opts ...Opt) (*ChainSetup, error) { accs[0].TxOpts, accs[0].TxOpts.From, // Sequencer addr. cfg, - setp.useMockBridge, - setp.useMockOneStepProver, + RollupStackConfig{ + UseMockBridge: setp.useMockBridge, + UseMockOneStepProver: setp.useMockOneStepProver, + MinimumAssertionPeriod: setp.minimumAssertionPeriod, + }, ) if err != nil { return nil, err @@ -486,17 +496,22 @@ type RollupAddresses struct { DeployedAt uint64 `json:"deployed-at"` } +type RollupStackConfig struct { + UseMockBridge bool + UseMockOneStepProver bool + MinimumAssertionPeriod int64 +} + func DeployFullRollupStack( ctx context.Context, backend protocol.ChainBackend, deployAuth *bind.TransactOpts, sequencer common.Address, config rollupgen.Config, - useMockBridge bool, - useMockOneStepProver bool, + stackConf RollupStackConfig, ) (*RollupAddresses, error) { log.Info("Deploying rollup creator") - rollupCreator, rollupUserAddr, rollupCreatorAddress, validatorUtils, validatorWalletCreator, err := deployRollupCreator(ctx, backend, deployAuth, useMockBridge, useMockOneStepProver) + rollupCreator, rollupUserAddr, rollupCreatorAddress, validatorUtils, validatorWalletCreator, err := deployRollupCreator(ctx, backend, deployAuth, stackConf.UseMockBridge, stackConf.UseMockOneStepProver) if err != nil { return nil, err } @@ -552,7 +567,7 @@ func DeployFullRollupStack( if err != nil { return nil, err } - setMinimumAssertionPeriod, err := rollupABI.Pack("setMinimumAssertionPeriod", big.NewInt(0)) + setMinimumAssertionPeriod, err := rollupABI.Pack("setMinimumAssertionPeriod", big.NewInt(stackConf.MinimumAssertionPeriod)) if err != nil { return nil, err }