Skip to content

Commit

Permalink
up-bump alpha6
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulio2002 committed Dec 11, 2024
1 parent 1bda1bd commit 7876731
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions turbo/cli/default_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var DefaultFlags = []cli.Flag{
&utils.TxPoolCommitEveryFlag,
&PruneDistanceFlag,
&PruneBlocksDistanceFlag,
&PruneKeepAllBlocksFlag,
&PruneModeFlag,
&BatchSizeFlag,
&BodyCacheLimitFlag,
Expand Down
17 changes: 15 additions & 2 deletions turbo/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ var (
Name: "prune.distance",
Usage: `Keep state history for the latest N blocks (default: everything)`,
}
PruneKeepAllBlocksFlag = cli.BoolFlag{
Name: "prune.keep-all-blocks",
Usage: `Keep the entire block history.`,
}
PruneBlocksDistanceFlag = cli.Uint64Flag{
Name: "prune.distance.blocks",
Usage: `Keep block history for the latest N blocks (default: everything)`,
Usage: `Keep block history for the latest N blocks (default: pre-merge history)`,
}
ExperimentsFlag = cli.StringFlag{
Name: "experiments",
Expand Down Expand Up @@ -450,7 +454,16 @@ 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)

var keepAllBlocks bool
keepAllBlocksFlagVal := f.Bool(PruneKeepAllBlocksFlag.Name, PruneKeepAllBlocksFlag.Value, PruneKeepAllBlocksFlag.Usage)
if keepAllBlocksFlagVal != nil {
keepAllBlocks = *keepAllBlocksFlagVal
}

if keepAllBlocks || blockDistance != math.MaxUint64 {
mode.Blocks = prune.Distance(blockDistance)
}
mode.History = prune.Distance(distance)

cfg.Prune = mode
Expand Down

0 comments on commit 7876731

Please sign in to comment.