-
Notifications
You must be signed in to change notification settings - Fork 245
feat: make reaper poll duration configurable #2951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e4acf92
2dc7879
3327e43
d02a105
bb341eb
8b5ef76
c57b2af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| coverage.txt | ||
| *.out | ||
| proto/pb | ||
| proto/tendermint | ||
| types/pb/tendermint | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,8 @@ const ( | |
| FlagReadinessWindowSeconds = FlagPrefixEvnode + "node.readiness_window_seconds" | ||
| // FlagReadinessMaxBlocksBehind configures how many blocks behind best-known head is still considered ready | ||
| FlagReadinessMaxBlocksBehind = FlagPrefixEvnode + "node.readiness_max_blocks_behind" | ||
| // FlagScrapeInterval is a flag for specifying the reaper scrape interval | ||
| FlagScrapeInterval = FlagPrefixEvnode + "node.scrape_interval" | ||
| // FlagClearCache is a flag for clearing the cache | ||
| FlagClearCache = FlagPrefixEvnode + "clear_cache" | ||
|
|
||
|
|
@@ -203,6 +205,7 @@ type NodeConfig struct { | |
| MaxPendingHeadersAndData uint64 `mapstructure:"max_pending_headers_and_data" yaml:"max_pending_headers_and_data" comment:"Maximum number of headers or data pending DA submission. When this limit is reached, the aggregator pauses block production until some headers or data are confirmed. Use 0 for no limit."` | ||
| LazyMode bool `mapstructure:"lazy_mode" yaml:"lazy_mode" comment:"Enables lazy aggregation mode, where blocks are only produced when transactions are available or after LazyBlockTime. Optimizes resources by avoiding empty block creation during periods of inactivity."` | ||
| LazyBlockInterval DurationWrapper `mapstructure:"lazy_block_interval" yaml:"lazy_block_interval" comment:"Maximum interval between blocks in lazy aggregation mode (LazyAggregator). Ensures blocks are produced periodically even without transactions to keep the chain active. Generally larger than BlockTime."` | ||
| ScrapeInterval DurationWrapper `mapstructure:"scrape_interval" yaml:"scrape_interval" comment:"Interval at which the reaper polls the execution layer for new transactions. Lower values reduce transaction detection latency but increase RPC load. Examples: \"250ms\", \"500ms\", \"1s\"."` | ||
|
|
||
| // Readiness / health configuration | ||
| ReadinessWindowSeconds uint64 `mapstructure:"readiness_window_seconds" yaml:"readiness_window_seconds" comment:"Time window in seconds used to calculate ReadinessMaxBlocksBehind based on block time. Default: 15 seconds."` | ||
|
|
@@ -337,6 +340,7 @@ func AddFlags(cmd *cobra.Command) { | |
| cmd.Flags().Duration(FlagLazyBlockTime, def.Node.LazyBlockInterval.Duration, "maximum interval between blocks in lazy aggregation mode") | ||
| cmd.Flags().Uint64(FlagReadinessWindowSeconds, def.Node.ReadinessWindowSeconds, "time window in seconds for calculating readiness threshold based on block time (default: 15s)") | ||
| cmd.Flags().Uint64(FlagReadinessMaxBlocksBehind, def.Node.ReadinessMaxBlocksBehind, "how many blocks behind best-known head the node can be and still be considered ready (0 = must be at head)") | ||
| cmd.Flags().Duration(FlagScrapeInterval, def.Node.ScrapeInterval.Duration, "interval at which the reaper polls the execution layer for new transactions") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's great that you've added this new configuration flag. To ensure it's working as expected and to maintain test coverage, please consider adding a test case for |
||
|
|
||
| // Data Availability configuration flags | ||
| cmd.Flags().String(FlagDAAddress, def.DA.Address, "DA address (host:port)") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that the reaper interval is configurable and passed in here, the
reaping.DefaultIntervalconstant appears to be unused. It would be good to remove it fromblock/internal/reaping/reaper.goto avoid dead code.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on this, cc @chatton