Skip to content

Commit 8395e0a

Browse files
Copilotjulienrbrt
andcommitted
Rename recovery history setting
Co-authored-by: julienrbrt <29894366+julienrbrt@users.noreply.github.com>
1 parent e692661 commit 8395e0a

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

block/components.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func NewSyncComponents(
184184
execPruner = candidate
185185
}
186186
}
187-
recoveryPruner := pruner.New(store, execPruner, config.Node.StateHistoryRetention, pruner.DefaultPruneInterval, logger.With().Str("component", "Pruner").Logger())
187+
recoveryPruner := pruner.New(store, execPruner, config.Node.RecoveryHistoryDepth, pruner.DefaultPruneInterval, logger.With().Str("component", "Pruner").Logger())
188188

189189
// Create submitter for sync nodes (no signer, only DA inclusion processing)
190190
var daSubmitter submitting.DASubmitterAPI = submitting.NewDASubmitter(daClient, config, genesis, blockOpts, metrics, logger, headerDAHintAppender, dataDAHintAppender)
@@ -275,7 +275,7 @@ func NewAggregatorComponents(
275275
execPruner = candidate
276276
}
277277
}
278-
recoveryPruner := pruner.New(store, execPruner, config.Node.StateHistoryRetention, pruner.DefaultPruneInterval, logger.With().Str("component", "Pruner").Logger())
278+
recoveryPruner := pruner.New(store, execPruner, config.Node.RecoveryHistoryDepth, pruner.DefaultPruneInterval, logger.With().Str("component", "Pruner").Logger())
279279

280280
reaper, err := reaping.NewReaper(
281281
exec,

pkg/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ const (
5151
FlagReadinessMaxBlocksBehind = FlagPrefixEvnode + "node.readiness_max_blocks_behind"
5252
// FlagScrapeInterval is a flag for specifying the reaper scrape interval
5353
FlagScrapeInterval = FlagPrefixEvnode + "node.scrape_interval"
54-
// FlagStateHistoryRetention is a flag for specifying how much state/exec metadata history to keep
55-
FlagStateHistoryRetention = FlagPrefixEvnode + "node.state_history_retention"
54+
// FlagRecoveryHistoryDepth is a flag for specifying how much recovery history to keep
55+
FlagRecoveryHistoryDepth = FlagPrefixEvnode + "node.recovery_history_depth"
5656
// FlagClearCache is a flag for clearing the cache
5757
FlagClearCache = FlagPrefixEvnode + "clear_cache"
5858

@@ -259,7 +259,7 @@ type NodeConfig struct {
259259
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."`
260260
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."`
261261
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\"."`
262-
StateHistoryRetention uint64 `mapstructure:"state_history_retention" yaml:"state_history_retention" comment:"Number of recent heights to keep state and execution metadata for recovery (0 keeps all)."`
262+
RecoveryHistoryDepth uint64 `mapstructure:"recovery_history_depth" yaml:"recovery_history_depth" comment:"Number of recent heights to keep state and execution metadata indexed for recovery (0 keeps all)."`
263263

264264
// Readiness / health configuration
265265
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."`
@@ -439,7 +439,7 @@ func AddFlags(cmd *cobra.Command) {
439439
cmd.Flags().Uint64(FlagReadinessWindowSeconds, def.Node.ReadinessWindowSeconds, "time window in seconds for calculating readiness threshold based on block time (default: 15s)")
440440
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)")
441441
cmd.Flags().Duration(FlagScrapeInterval, def.Node.ScrapeInterval.Duration, "interval at which the reaper polls the execution layer for new transactions")
442-
cmd.Flags().Uint64(FlagStateHistoryRetention, def.Node.StateHistoryRetention, "number of recent heights to keep state and execution metadata for recovery (0 keeps all)")
442+
cmd.Flags().Uint64(FlagRecoveryHistoryDepth, def.Node.RecoveryHistoryDepth, "number of recent heights to keep state and execution metadata indexed for recovery (0 keeps all)")
443443

444444
// Data Availability configuration flags
445445
cmd.Flags().String(FlagDAAddress, def.DA.Address, "DA address (host:port)")

pkg/config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestDefaultConfig(t *testing.T) {
3333
assert.Equal(t, uint64(0), def.Node.MaxPendingHeadersAndData)
3434
assert.Equal(t, false, def.Node.LazyMode)
3535
assert.Equal(t, 60*time.Second, def.Node.LazyBlockInterval.Duration)
36-
assert.Equal(t, uint64(5000), def.Node.StateHistoryRetention)
36+
assert.Equal(t, uint64(5000), def.Node.RecoveryHistoryDepth)
3737
assert.Equal(t, "file", def.Signer.SignerType)
3838
assert.Equal(t, "config", def.Signer.SignerPath)
3939
assert.Equal(t, "127.0.0.1:7331", def.RPC.Address)
@@ -65,7 +65,7 @@ func TestAddFlags(t *testing.T) {
6565
assertFlagValue(t, flags, FlagReadinessWindowSeconds, DefaultConfig().Node.ReadinessWindowSeconds)
6666
assertFlagValue(t, flags, FlagReadinessMaxBlocksBehind, DefaultConfig().Node.ReadinessMaxBlocksBehind)
6767
assertFlagValue(t, flags, FlagScrapeInterval, DefaultConfig().Node.ScrapeInterval)
68-
assertFlagValue(t, flags, FlagStateHistoryRetention, DefaultConfig().Node.StateHistoryRetention)
68+
assertFlagValue(t, flags, FlagRecoveryHistoryDepth, DefaultConfig().Node.RecoveryHistoryDepth)
6969

7070
// DA flags
7171
assertFlagValue(t, flags, FlagDAAddress, DefaultConfig().DA.Address)

pkg/config/defaults.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const (
1717
// AppConfigDir is the directory name for the app configuration.
1818
AppConfigDir = "config"
1919

20-
defaultStateHistoryRetention = uint64(5000)
20+
defaultRecoveryHistoryDepth = uint64(5000)
2121
)
2222

2323
// DefaultRootDir returns the default root directory for evolve
@@ -68,7 +68,7 @@ func DefaultConfig() Config {
6868
LazyMode: false,
6969
LazyBlockInterval: DurationWrapper{60 * time.Second},
7070
Light: false,
71-
StateHistoryRetention: defaultStateHistoryRetention,
71+
RecoveryHistoryDepth: defaultRecoveryHistoryDepth,
7272
ReadinessWindowSeconds: defaultReadinessWindowSeconds,
7373
ReadinessMaxBlocksBehind: calculateReadinessMaxBlocksBehind(defaultBlockTime.Duration, defaultReadinessWindowSeconds),
7474
ScrapeInterval: DurationWrapper{1 * time.Second},

0 commit comments

Comments
 (0)