Skip to content

Commit 5f1c0ad

Browse files
feat: Flag for LazyBufferTime (#1797)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new command-line flag `--rollkit.lazy_buffer_time` to enhance transaction accumulation timing in lazy mode. - Added default configuration for `LazyBufferTime`, allowing users to specify additional wait time for transactions. These updates provide users with improved configurability and potential performance benefits when managing transaction processing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 92a7df1 commit 5f1c0ad

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

cmd/rollkit/docs/rollkit_start.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ rollkit start [flags]
4141
--rollkit.da_start_height uint starting DA block height (for syncing)
4242
--rollkit.lazy_aggregator wait for transactions, don't build empty blocks
4343
--rollkit.lazy_block_time duration block time (for lazy mode) (default 1m0s)
44+
--rollkit.lazy_buffer_time duration additional time to wait to accumulate transactions in lazy mode (default 1s)
4445
--rollkit.light run light client
4546
--rollkit.max_pending_blocks uint limit of blocks pending DA submission (0 for no limit)
4647
--rollkit.trusted_hash string initial trusted hash to start the header exchange service

config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ const (
4040
FlagDAMempoolTTL = "rollkit.da_mempool_ttl"
4141
// FlagLazyBlockTime is a flag for specifying the block time in lazy mode
4242
FlagLazyBlockTime = "rollkit.lazy_block_time"
43+
// FlagLazyBufferTime is a flag for specifying the additional time to wait to accumulate transactions in lazy mode
44+
FlagLazyBufferTime = "rollkit.lazy_buffer_time"
4345
)
4446

4547
// NodeConfig stores Rollkit node configuration.
@@ -138,6 +140,7 @@ func (nc *NodeConfig) GetViperConfig(v *viper.Viper) error {
138140
nc.MaxPendingBlocks = v.GetUint64(FlagMaxPendingBlocks)
139141
nc.DAMempoolTTL = v.GetUint64(FlagDAMempoolTTL)
140142
nc.LazyBlockTime = v.GetDuration(FlagLazyBlockTime)
143+
nc.LazyBufferTime = v.GetDuration(FlagLazyBufferTime)
141144
return nil
142145
}
143146

@@ -161,4 +164,5 @@ func AddFlags(cmd *cobra.Command) {
161164
cmd.Flags().Uint64(FlagMaxPendingBlocks, def.MaxPendingBlocks, "limit of blocks pending DA submission (0 for no limit)")
162165
cmd.Flags().Uint64(FlagDAMempoolTTL, def.DAMempoolTTL, "number of DA blocks until transaction is dropped from the mempool")
163166
cmd.Flags().Duration(FlagLazyBlockTime, def.LazyBlockTime, "block time (for lazy mode)")
167+
cmd.Flags().Duration(FlagLazyBufferTime, def.LazyBufferTime, "additional time to wait to accumulate transactions in lazy mode")
164168
}

config/defaults.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ var DefaultNodeConfig = NodeConfig{
2626
DABlockTime: 15 * time.Second,
2727
LazyAggregator: false,
2828
LazyBlockTime: 60 * time.Second,
29+
LazyBufferTime: 1 * time.Second,
2930
},
3031
DAAddress: "http://localhost:26658",
3132
DAGasPrice: -1,

0 commit comments

Comments
 (0)