Skip to content

Commit

Permalink
add-sequener-timeout-on-empty-tx-pool (#1032)
Browse files Browse the repository at this point in the history
* add-sequener-timeout-on-empty-tx-pool

* Update cmd/utils/flags.go

Co-authored-by: Igor Mandrigin <[email protected]>

---------

Co-authored-by: Igor Mandrigin <[email protected]>
# Conflicts:
#	zk/stages/stage_sequence_execute.go
  • Loading branch information
kstoykov authored and hexoscott committed Aug 29, 2024
1 parent d4e4449 commit 4c449bb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,11 @@ var (
Usage: "This is a maximum time that a batch verification could take. Including retries. This could be interpreted as maximum that that the sequencer can run without executor. Setting it to 0s will mean infinite timeout. Defaults to 30min",
Value: "30m",
}
SequencerTimeoutOnEmptyTxPool = cli.StringFlag{
Name: "zkevm.sequencer-timeout-on-empty-tx-pool",
Usage: "Timeout before requesting txs from the txpool if none were found before. Defaults to 250ms",
Value: "250ms",
}
SequencerHaltOnBatchNumber = cli.Uint64Flag{
Name: "zkevm.sequencer-halt-on-batch-number",
Usage: "Halt the sequencer on this batch number",
Expand Down
1 change: 1 addition & 0 deletions eth/ethconfig/config_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Zk struct {
SequencerBlockSealTime time.Duration
SequencerBatchSealTime time.Duration
SequencerBatchVerificationTimeout time.Duration
SequencerTimeoutOnEmptyTxPool time.Duration
SequencerHaltOnBatchNumber uint64
ExecutorUrls []string
ExecutorStrictMode bool
Expand Down
1 change: 1 addition & 0 deletions turbo/cli/default_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ var DefaultFlags = []cli.Flag{
&utils.SequencerBlockSealTime,
&utils.SequencerBatchSealTime,
&utils.SequencerBatchVerificationTimeout,
&utils.SequencerTimeoutOnEmptyTxPool,
&utils.SequencerHaltOnBatchNumber,
&utils.ExecutorUrls,
&utils.ExecutorStrictMode,
Expand Down
7 changes: 7 additions & 0 deletions turbo/cli/flags_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config) {
panic(fmt.Sprintf("could not parse sequencer batch seal time timeout value %s", sequencerBatchSealTimeVal))
}

sequencerTimeoutOnEmptyTxPoolVal := ctx.String(utils.SequencerTimeoutOnEmptyTxPool.Name)
sequencerTimeoutOnEmptyTxPool, err := time.ParseDuration(sequencerTimeoutOnEmptyTxPoolVal)
if err != nil {
panic(fmt.Sprintf("could not parse sequencer batch seal time timeout value %s", sequencerBatchSealTimeVal))
}

effectiveGasPriceForEthTransferVal := ctx.Float64(utils.EffectiveGasPriceForEthTransfer.Name)
effectiveGasPriceForErc20TransferVal := ctx.Float64(utils.EffectiveGasPriceForErc20Transfer.Name)
effectiveGasPriceForContractInvocationVal := ctx.Float64(utils.EffectiveGasPriceForContractInvocation.Name)
Expand Down Expand Up @@ -133,6 +139,7 @@ func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config) {
SequencerBlockSealTime: sequencerBlockSealTime,
SequencerBatchSealTime: sequencerBatchSealTime,
SequencerBatchVerificationTimeout: sequencerBatchVerificationTimeout,
SequencerTimeoutOnEmptyTxPool: sequencerTimeoutOnEmptyTxPool,
SequencerHaltOnBatchNumber: ctx.Uint64(utils.SequencerHaltOnBatchNumber.Name),
ExecutorUrls: strings.Split(strings.ReplaceAll(ctx.String(utils.ExecutorUrls.Name), " ", ""), ","),
ExecutorStrictMode: ctx.Bool(utils.ExecutorStrictMode.Name),
Expand Down

0 comments on commit 4c449bb

Please sign in to comment.