You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: increase default ReadinessMaxBlocksBehind from 3 to 30 (#2779)
This PR increases the default `ReadinessMaxBlocksBehind` value from 3 to
30 blocks to avoid false-negatives during normal p2p sync operations.
### Problem
The current default of 3 blocks marks most healthy nodes as "not ready"
because they are routinely >3 blocks behind best-head while the p2p sync
executes blocks in batches. Observability tools that scrape
`/health/ready` every 5s therefore report the node as permanently
offline.
### Solution
Raised the default to 30 blocks (≈ 15s worth of blocks with 0.5s block
time). This keeps the safety property ("stuck node is detected") while
removing the false-positive during normal batch-sync.
### Changes
- Updated `pkg/config/defaults.go` to change `ReadinessMaxBlocksBehind`
from 3 to 30
Fixes#2778
Generated with [Claude Code](https://claude.ai/code)
---------
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Marko <tac0turtle@users.noreply.github.com>
Co-authored-by: auricom <auricom@users.noreply.github.com>
// FlagClearCache is a flag for clearing the cache
@@ -198,6 +200,7 @@ type NodeConfig struct {
198
200
TrustedHashstring`mapstructure:"trusted_hash" yaml:"trusted_hash" comment:"Initial trusted hash used to bootstrap the header exchange service. Allows nodes to start synchronizing from a specific trusted point in the chain instead of genesis. When provided, the node will fetch the corresponding header/block from peers using this hash and use it as a starting point for synchronization. If not provided, the node will attempt to fetch the genesis block instead."`
199
201
200
202
// Readiness / health configuration
203
+
ReadinessWindowSecondsuint64`mapstructure:"readiness_window_seconds" yaml:"readiness_window_seconds" comment:"Time window in seconds used to calculate ReadinessMaxBlocksBehind based on block time. Default: 15 seconds."`
201
204
ReadinessMaxBlocksBehinduint64`mapstructure:"readiness_max_blocks_behind" yaml:"readiness_max_blocks_behind" comment:"How many blocks behind best-known head the node can be and still be considered ready. 0 means must be exactly at head."`
cmd.Flags().Bool(FlagLazyAggregator, def.Node.LazyMode, "produce blocks only when transactions are available or after lazy block time")
315
318
cmd.Flags().Uint64(FlagMaxPendingHeadersAndData, def.Node.MaxPendingHeadersAndData, "maximum headers or data pending DA confirmation before pausing block production (0 for no limit)")
316
319
cmd.Flags().Duration(FlagLazyBlockTime, def.Node.LazyBlockInterval.Duration, "maximum interval between blocks in lazy aggregation mode")
320
+
cmd.Flags().Uint64(FlagReadinessWindowSeconds, def.Node.ReadinessWindowSeconds, "time window in seconds for calculating readiness threshold based on block time (default: 15s)")
317
321
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)")
0 commit comments