diff --git a/cmd/rollkit/docs/rollkit_start.md b/cmd/rollkit/docs/rollkit_start.md index e6473aa899..07fcf017e6 100644 --- a/cmd/rollkit/docs/rollkit_start.md +++ b/cmd/rollkit/docs/rollkit_start.md @@ -41,6 +41,7 @@ rollkit start [flags] --rollkit.da_start_height uint starting DA block height (for syncing) --rollkit.lazy_aggregator wait for transactions, don't build empty blocks --rollkit.lazy_block_time duration block time (for lazy mode) (default 1m0s) + --rollkit.lazy_buffer_time duration additional time to wait to accumulate transactions in lazy mode (default 1s) --rollkit.light run light client --rollkit.max_pending_blocks uint limit of blocks pending DA submission (0 for no limit) --rollkit.trusted_hash string initial trusted hash to start the header exchange service diff --git a/config/config.go b/config/config.go index c8e2d28a51..aa5b4c9cb2 100644 --- a/config/config.go +++ b/config/config.go @@ -40,6 +40,8 @@ const ( FlagDAMempoolTTL = "rollkit.da_mempool_ttl" // FlagLazyBlockTime is a flag for specifying the block time in lazy mode FlagLazyBlockTime = "rollkit.lazy_block_time" + // FlagLazyBufferTime is a flag for specifying the additional time to wait to accumulate transactions in lazy mode + FlagLazyBufferTime = "rollkit.lazy_buffer_time" ) // NodeConfig stores Rollkit node configuration. @@ -138,6 +140,7 @@ func (nc *NodeConfig) GetViperConfig(v *viper.Viper) error { nc.MaxPendingBlocks = v.GetUint64(FlagMaxPendingBlocks) nc.DAMempoolTTL = v.GetUint64(FlagDAMempoolTTL) nc.LazyBlockTime = v.GetDuration(FlagLazyBlockTime) + nc.LazyBufferTime = v.GetDuration(FlagLazyBufferTime) return nil } @@ -161,4 +164,5 @@ func AddFlags(cmd *cobra.Command) { cmd.Flags().Uint64(FlagMaxPendingBlocks, def.MaxPendingBlocks, "limit of blocks pending DA submission (0 for no limit)") cmd.Flags().Uint64(FlagDAMempoolTTL, def.DAMempoolTTL, "number of DA blocks until transaction is dropped from the mempool") cmd.Flags().Duration(FlagLazyBlockTime, def.LazyBlockTime, "block time (for lazy mode)") + cmd.Flags().Duration(FlagLazyBufferTime, def.LazyBufferTime, "additional time to wait to accumulate transactions in lazy mode") } diff --git a/config/defaults.go b/config/defaults.go index e01f8278af..5092de87a5 100644 --- a/config/defaults.go +++ b/config/defaults.go @@ -26,6 +26,7 @@ var DefaultNodeConfig = NodeConfig{ DABlockTime: 15 * time.Second, LazyAggregator: false, LazyBlockTime: 60 * time.Second, + LazyBufferTime: 1 * time.Second, }, DAAddress: "http://localhost:26658", DAGasPrice: -1,