Skip to content

Commit

Permalink
fix: TestBatcherConcurrentAltDARequests
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Aug 30, 2024
1 parent 625f294 commit d78ffa9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
37 changes: 21 additions & 16 deletions op-e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ func DefaultSystemConfig(t testing.TB) SystemConfig {
"proposer": testlog.Logger(t, log.LevelInfo).New("role", "proposer"),
"da-server": testlog.Logger(t, log.LevelInfo).New("role", "da-server"),
},
GethOptions: map[string][]geth.GethOption{},
P2PTopology: nil, // no P2P connectivity by default
NonFinalizedProposals: false,
ExternalL2Shim: config.ExternalL2Shim,
DataAvailabilityType: batcherFlags.CalldataType,
MaxPendingTransactions: 1,
BatcherTargetNumFrames: 1,
GethOptions: map[string][]geth.GethOption{},
P2PTopology: nil, // no P2P connectivity by default
NonFinalizedProposals: false,
ExternalL2Shim: config.ExternalL2Shim,
DataAvailabilityType: batcherFlags.CalldataType,
BatcherMaxPendingTransactions: 1,
BatcherTargetNumFrames: 1,
}
}

Expand Down Expand Up @@ -300,12 +300,16 @@ type SystemConfig struct {
// If >0, limits the number of blocks per span batch
BatcherMaxBlocksPerSpanBatch int

// BatcherMaxPendingTransactions determines how many transactions the batcher will try to send
// concurrently. 0 means unlimited.
BatcherMaxPendingTransactions uint64

// BatcherMaxConcurrentDARequest determines how many DAserver requests the batcher is allowed to
// make concurrently. 0 means unlimited.
BatcherMaxConcurrentDARequest uint64

// SupportL1TimeTravel determines if the L1 node supports quickly skipping forward in time
SupportL1TimeTravel bool

// MaxPendingTransactions determines how many transactions the batcher will try to send
// concurrently. 0 means unlimited.
MaxPendingTransactions uint64
}

type System struct {
Expand Down Expand Up @@ -842,17 +846,18 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
sys.FakeAltDAServer = fakeAltDAServer

batcherAltDACLIConfig = altda.CLIConfig{
Enabled: cfg.DeployConfig.UseAltDA,
DAServerURL: fakeAltDAServer.HttpEndpoint(),
VerifyOnRead: true,
GenericDA: true,
Enabled: cfg.DeployConfig.UseAltDA,
DAServerURL: fakeAltDAServer.HttpEndpoint(),
VerifyOnRead: true,
GenericDA: true,
MaxConcurrentRequests: cfg.BatcherMaxConcurrentDARequest,
}
}
batcherCLIConfig := &bss.CLIConfig{
L1EthRpc: sys.EthInstances[RoleL1].UserRPC().RPC(),
L2EthRpc: sys.EthInstances[RoleSeq].UserRPC().RPC(),
RollupRpc: sys.RollupNodes[RoleSeq].UserRPC().RPC(),
MaxPendingTransactions: cfg.MaxPendingTransactions,
MaxPendingTransactions: cfg.BatcherMaxPendingTransactions,
MaxChannelDuration: 1,
MaxL1TxSize: batcherMaxL1TxSizeBytes,
TestUseMaxTxSizeForBlobs: cfg.BatcherUseMaxTxSizeForBlobs,
Expand Down
5 changes: 3 additions & 2 deletions op-e2e/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ func TestBatcherMultiTx(t *testing.T) {
InitParallel(t)

cfg := DefaultSystemConfig(t)
cfg.MaxPendingTransactions = 0 // no limit on parallel txs
cfg.BatcherMaxPendingTransactions = 0 // no limit on parallel txs
// ensures that batcher txs are as small as possible
cfg.BatcherMaxL1TxSizeBytes = derive.FrameV0OverHeadSize + 1 /*version bytes*/ + 1
cfg.DisableBatcher = true
Expand Down Expand Up @@ -1408,11 +1408,12 @@ func TestBatcherConcurrentAltDARequests(t *testing.T) {

cfg := DefaultSystemConfig(t)
cfg.DeployConfig.UseAltDA = true
cfg.MaxPendingTransactions = 0 // no limit on parallel txs
cfg.BatcherMaxPendingTransactions = 0 // no limit on parallel txs
// ensures that batcher txs are as small as possible
cfg.BatcherMaxL1TxSizeBytes = derive.FrameV0OverHeadSize + 1 /*version bytes*/ + 1
cfg.BatcherBatchType = 0
cfg.DataAvailabilityType = flags.CalldataType
cfg.BatcherMaxConcurrentDARequest = 0 // no limit

// disable batcher because we start it manually below
cfg.DisableBatcher = true
Expand Down

0 comments on commit d78ffa9

Please sign in to comment.