Skip to content

Commit

Permalink
Erigon 3: Use full node as default (#12857)
Browse files Browse the repository at this point in the history
Made full node default, and made prune.mode=minimal,full flexible
  • Loading branch information
Giulio2002 authored Nov 25, 2024
1 parent 80a1472 commit 2595579
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions turbo/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ var (

PruneModeFlag = cli.StringFlag{
Name: "prune.mode",
Usage: `Choose a pruning preset to run onto. Available values: "archive","full","minimal".
Archive: Keep the entire indexed database, aka. no pruning. (Pruning is flexible),
Full: Keep only blocks and latest state (Pruning is not flexible)
Minimal: Keep only latest state (Pruning is not flexible)`,
Value: "archive",
Usage: `Choose a pruning preset to run onto. Available values: "full", "archive", "minimal".
Full: Keep only blocks and latest state,
Archive: Keep the entire indexed database, aka. no pruning,
Minimal: Keep only latest state`,
Value: "full",
}
PruneDistanceFlag = cli.Uint64Flag{
Name: "prune.distance",
Expand Down Expand Up @@ -400,9 +400,7 @@ func ApplyFlagsForEthConfigCobra(f *pflag.FlagSet, cfg *ethconfig.Config) {
pruneDistance := f.Uint64(PruneDistanceFlag.Name, PruneDistanceFlag.Value, PruneDistanceFlag.Usage)

chainId := cfg.NetworkID
if *pruneMode != "archive" && (pruneBlockDistance != nil || pruneDistance != nil) {
utils.Fatalf("error: --prune.distance and --prune.distance.blocks are only allowed with --prune.mode=archive")
}

var distance, blockDistance uint64 = math.MaxUint64, math.MaxUint64
if pruneBlockDistance != nil {
blockDistance = *pruneBlockDistance
Expand Down Expand Up @@ -436,6 +434,9 @@ func ApplyFlagsForEthConfigCobra(f *pflag.FlagSet, cfg *ethconfig.Config) {
default:
utils.Fatalf("error: --prune.mode must be one of archive, full, minimal")
}
mode.Blocks = prune.Distance(blockDistance)
mode.History = prune.Distance(distance)

cfg.Prune = mode

if v := f.String(BatchSizeFlag.Name, BatchSizeFlag.Value, BatchSizeFlag.Usage); v != nil {
Expand Down

0 comments on commit 2595579

Please sign in to comment.