diff --git a/ethdb/prune/storage_mode.go b/ethdb/prune/storage_mode.go index c889bbc4c96..f2884278faf 100644 --- a/ethdb/prune/storage_mode.go +++ b/ethdb/prune/storage_mode.go @@ -85,6 +85,11 @@ type Mode struct { Experiments Experiments } +func (m *Mode) SetPruneMode(blocks, history uint64) { + m.Blocks = Distance(blocks) + m.History = Distance(history) +} + type BlockAmount interface { PruneTo(stageHead uint64) uint64 Enabled() bool diff --git a/turbo/cli/flags.go b/turbo/cli/flags.go index 365e868829b..d63f715ba45 100644 --- a/turbo/cli/flags.go +++ b/turbo/cli/flags.go @@ -306,15 +306,18 @@ func ApplyFlagsForEthConfig(ctx *cli.Context, cfg *ethconfig.Config, logger log. if err != nil { utils.Fatalf(fmt.Sprintf("error while parsing mode: %v", err)) } + // Full mode prunes all but the latest state if ctx.String(PruneModeFlag.Name) == "full" { - mode.Blocks = prune.Distance(math.MaxUint64) - mode.History = prune.Distance(0) + mode.SetPruneMode(math.MaxUint64, 0) } // Minimal mode prunes all but the latest state including blocks if ctx.String(PruneModeFlag.Name) == "minimal" { - mode.Blocks = prune.Distance(2048) // 2048 is just some blocks to allow reorgs - mode.History = prune.Distance(0) + if chainId == 56 { + mode.SetPruneMode(90_000, 90_000) // 90_000 about 3 day + } else { + mode.SetPruneMode(2048, 0) // 2048 is just some blocks to allow reorgs + } } cfg.BlobPrune = ctx.Bool(PruneBscBlobSidecarsFlag.Name)