Skip to content

Commit

Permalink
enable snapshot pruning when vmtrace=firehose and when hash scheme is…
Browse files Browse the repository at this point in the history
… path
  • Loading branch information
Eduard-Voiculescu committed Nov 26, 2024
1 parent 43f1a6f commit 6a3c4bf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmd/geth/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,21 @@ func pruneState(ctx *cli.Context) error {
chaindb := utils.MakeChainDatabase(ctx, stack, false)
defer chaindb.Close()

if rawdb.ReadStateScheme(chaindb) != rawdb.HashScheme {
scheme := rawdb.ReadStateScheme(chaindb)

flags := ctx.App.Flags
firehoseTracerEnabled := false
for _, flag := range flags {
if flag == utils.VMTraceFlag && flag.String() == "firehose" {
firehoseTracerEnabled = true
break
}
}

if scheme != rawdb.HashScheme && !firehoseTracerEnabled {
log.Crit("Offline pruning is not required for path scheme")
}

prunerconfig := pruner.Config{
Datadir: stack.ResolvePath(""),
BloomSize: ctx.Uint64(utils.BloomFilterSizeFlag.Name),
Expand Down

0 comments on commit 6a3c4bf

Please sign in to comment.