Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove outdated prune-block/pruneancient tool, implement it by tail-deletion #2809

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

galaio
Copy link
Contributor

@galaio galaio commented Dec 17, 2024

Description

This PR will remove prune-block/pruneancient tool, it can be replaced by tail-deletion, which is more easy & efficient for managing block history.

The PR will auto-detect the legacy offset metadata from db, and reset the tail metadata of freezer tables. So it's safe to run --history.blocks with the old pruneancient/prune-block feature.

Changes

Notable changes:

  • misc: remove outdated prune-block tools
  • chain: support new online prune block tool;
  • freezer: remove prunedfreezer;
  • freezer: support online prune by block history;

@NathanBSC
Copy link
Contributor

validator which has used tool pruneBlock still can run their nodes?

eth/backend.go Outdated
log.Warn("The node enables PruneAncientData, BlockHistory wille force to 0")
config.BlockHistory = 0
}
if err = eth.blockchain.PruneBlockHistory(config.BlockHistory); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

run PruneBlockHistory when start nodes?
the prune is not revertable, so I think make user to use it as a tool is better.
when they use this tool, they make their purpose unambiguously

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The node runs as normal in default config(BlockHistory=0), they must set BlockHistory>0 that will trigger the pruning.

@zzzckck
Copy link
Collaborator

zzzckck commented Dec 19, 2024

it would disable the prune-block tool, to avoid impacting the current users, better to be delivered in a separate maintenance release after Pascal hardfork.

@galaio galaio changed the title refactor: remove outdated prune-block tool, implement it by tail-deletion refactor: remove outdated prune-block/pruneancient tool, implement it by tail-deletion Dec 27, 2024
@@ -158,7 +158,7 @@ type FreezerEnv struct {
// AncientFreezer defines the help functions for freezing ancient data
type AncientFreezer interface {
// SetupFreezerEnv provides params.ChainConfig for checking hark forks, like isCancun.
SetupFreezerEnv(env *FreezerEnv) error
Copy link
Contributor

Choose a reason for hiding this comment

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

blockHistory is similar to BlobExtraReserve?
if so, maybe can add it as a field of FreezerEnv

@NathanBSC
Copy link
Contributor

Good Job!

@galaio galaio force-pushed the remove-prune-block branch from a13f681 to 70d074f Compare January 3, 2025 07:12
AlphaOmega113 referenced this pull request Jan 6, 2025
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.

3 participants