Skip to content

cmd/geth: add Prague pruning points#33657

Merged
gballet merged 3 commits intoethereum:masterfrom
s1na:prune-pre-cancun
Mar 11, 2026
Merged

cmd/geth: add Prague pruning points#33657
gballet merged 3 commits intoethereum:masterfrom
s1na:prune-pre-cancun

Conversation

@s1na
Copy link
Copy Markdown
Contributor

@s1na s1na commented Jan 21, 2026

This PR allows users to prune their nodes up to the Prague fork. It indirectly depends on #32157 and can't really be merged before eraE files are widely available for download.

The --history.chain flag becomes mandatory for prune-history command. Here I've listed all the edge cases that can happen and how we behave:

prune-history Behavior

From To Result
full postmerge ✅ prunes
full postprague ✅ prunes
postmerge postprague ✅ prunes further
postprague postmerge ❌ can't unprune
any all ❌ use import-history

Node Startup Behavior

DB State Flag Result
fresh postprague ✅ syncs from Prague
full postprague ❌ "run prune-history first"
postmerge postprague ❌ "run prune-history first"
postprague postmerge ❌ "can't unprune, use import-history or fix flag"
pruned all ✅ accepts known prune points

@s1na s1na requested a review from rjl493456442 as a code owner January 21, 2026 17:57
@rjl493456442
Copy link
Copy Markdown
Member

Any particular reason for choosing Cancun? Why not Osaka?

@s1na
Copy link
Copy Markdown
Contributor Author

s1na commented Jan 22, 2026

My thinking was to keep at least a year of history and Cancun was the one that met the criteria. I am open to adding Prague and Osaka as options.

@s1na s1na mentioned this pull request Feb 10, 2026
5 tasks
@s1na
Copy link
Copy Markdown
Contributor Author

s1na commented Mar 5, 2026

Triage discussion: update prune point to Pectra

@s1na s1na removed the status:triage label Mar 5, 2026
@s1na s1na changed the title cmd/geth: add Cancun pruning points cmd/geth: add Prague pruning points Mar 6, 2026
@gballet gballet added this to the 1.17.2 milestone Mar 10, 2026
Comment thread cmd/geth/chaincmd.go Outdated
Comment thread cmd/geth/chaincmd.go Outdated
Comment thread cmd/geth/chaincmd.go
return errors.New("--history.chain flag is required (use 'postmerge' or 'postprague')")
}
var mode history.HistoryMode
if err := mode.UnmarshalText([]byte(ctx.String(utils.ChainHistoryFlag.Name))); err != nil {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bit weird to convert the string to []byte, and then convert it back to string in the function. Better change the function interface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm i see what you mean. just a note that this function wasn't implemented as part of this PR. I believe the goal was to stick to the idiomatic UnmarshalText signature that is widely used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with golang, "idiomatic" often turns into "idiotic". ok, won't die on that hill.

@gballet gballet merged commit 3c20e08 into ethereum:master Mar 11, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants