diff --git a/erigon-lib/config3/config3.go b/erigon-lib/config3/config3.go index af2aa090f37..f5b53fc7d3d 100644 --- a/erigon-lib/config3/config3.go +++ b/erigon-lib/config3/config3.go @@ -23,3 +23,5 @@ const HistoryV3AggregationStep = 1_562_500 // = 100M / 64. Dividers: 2, 5, 10, 2 const EnableHistoryV4InTest = true const MaxReorgDepthV3 = 1024 + +const DefaultPruneDistance = 100_000 diff --git a/turbo/cli/flags.go b/turbo/cli/flags.go index 52e8d727288..03e0ae462b6 100644 --- a/turbo/cli/flags.go +++ b/turbo/cli/flags.go @@ -22,6 +22,7 @@ import ( "time" "github.com/erigontech/erigon-lib/common/hexutil" + "github.com/erigontech/erigon-lib/config3" "github.com/erigontech/erigon-lib/txpool/txpoolcfg" @@ -434,10 +435,10 @@ func ApplyFlagsForEthConfigCobra(f *pflag.FlagSet, cfg *ethconfig.Config) { case "archive": case "full": mode.Blocks = prune.Distance(math.MaxUint64) - mode.History = prune.Distance(0) + mode.History = prune.Distance(config3.DefaultPruneDistance) case "minimal": - mode.Blocks = prune.Distance(2048) // 2048 is just some blocks to allow reorgs - mode.History = prune.Distance(0) + mode.Blocks = prune.Distance(config3.DefaultPruneDistance) // 2048 is just some blocks to allow reorgs and data for rpc + mode.History = prune.Distance(config3.DefaultPruneDistance) default: utils.Fatalf("error: --prune.mode must be one of archive, full, minimal") }