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
9 changes: 9 additions & 0 deletions benchmark/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const (
MachineProviderFlagName = "machine-provider"
MachineRegionFlagName = "machine-region"
FileSystemFlagName = "file-system"
ParallelTxBatchesFlagName = "parallel-tx-batches"
)

// TxFuzz defaults
Expand Down Expand Up @@ -98,6 +99,13 @@ var (
Value: "ext4",
EnvVars: prefixEnvVars("FILE_SYSTEM"),
}

ParallelTxBatchesFlag = &cli.IntFlag{
Name: ParallelTxBatchesFlagName,
Usage: "Number of parallel batches for sending transactions",
Value: 4,
EnvVars: prefixEnvVars("PARALLEL_TX_BATCHES"),
}
)

// Flags contains the list of configuration options available to the binary.
Expand All @@ -114,6 +122,7 @@ var RunFlags = []cli.Flag{
MachineProviderFlag,
MachineRegionFlag,
FileSystemFlag,
ParallelTxBatchesFlag,
}

func init() {
Expand Down
7 changes: 7 additions & 0 deletions runner/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Config interface {
MachineProvider() string
MachineRegion() string
FileSystem() string
ParallelTxBatches() int
}

type config struct {
Expand All @@ -41,6 +42,7 @@ type config struct {
machineProvider string
machineRegion string
fileSystem string
parallelTxBatches int
}

func NewConfig(ctx *cli.Context) Config {
Expand All @@ -56,6 +58,7 @@ func NewConfig(ctx *cli.Context) Config {
machineProvider: ctx.String(appFlags.MachineProviderFlagName),
machineRegion: ctx.String(appFlags.MachineRegionFlagName),
fileSystem: ctx.String(appFlags.FileSystemFlagName),
parallelTxBatches: ctx.Int(appFlags.ParallelTxBatchesFlagName),
clientOptions: ReadClientOptions(ctx),
}
}
Expand Down Expand Up @@ -128,3 +131,7 @@ func (c *config) MachineRegion() string {
func (c *config) FileSystem() string {
return c.fileSystem
}

func (c *config) ParallelTxBatches() int {
return c.parallelTxBatches
}
2 changes: 2 additions & 0 deletions runner/network/consensus/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type ConsensusClientOptions struct {
GasLimit uint64
// GasLimitSetup is the gas limit for the setup payload
GasLimitSetup uint64
// ParallelTxBatches is the number of parallel batches for sending transactions
ParallelTxBatches int
}

// BaseConsensusClient contains common functionality shared between different consensus client implementations.
Expand Down
7 changes: 5 additions & 2 deletions runner/network/consensus/sequencer_consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ func (f *SequencerConsensusClient) Propose(ctx context.Context, blockMetrics *me
sendCallsPerBatch := 100
batches := (len(sendTxs) + sendCallsPerBatch - 1) / sendCallsPerBatch

// Process batches in parallel, 4 at a time
parallelBatches := 4
// Process batches in parallel
parallelBatches := f.options.ParallelTxBatches
if parallelBatches <= 0 {
parallelBatches = 4 // default
}
for i := 0; i < batches; i += parallelBatches {
g, gCtx := errgroup.WithContext(ctx)

Expand Down
1 change: 1 addition & 0 deletions runner/network/sequencer_benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func (nb *sequencerBenchmark) Run(ctx context.Context, metricsCollector metrics.
BlockTime: params.BlockTime,
GasLimit: params.GasLimit,
GasLimitSetup: 1e9, // 1G gas
ParallelTxBatches: nb.config.Config.ParallelTxBatches(),
}, headBlockHash, headBlockNumber, l1Chain, nb.config.BatcherAddr())

payloads := make([]engine.ExecutableData, 0)
Expand Down
Loading