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

Prune ancient data doesn't work in case PathScheme or TrieDirtyDisabled #2923

Open
klim0v opened this issue Feb 26, 2025 · 1 comment
Open
Assignees

Comments

@klim0v
Copy link

klim0v commented Feb 26, 2025

bsc/core/blockchain.go

Lines 1828 to 1836 in df229e7

// If node is running in path mode, skip explicit gc operation
// which is unnecessary in this mode.
if bc.triedb.Scheme() == rawdb.PathScheme {
return nil
}
// If we're running an archive node, always flush
if bc.cacheConfig.TrieDirtyDisabled {
return bc.triedb.Commit(root, false)
}

In either of these two cases, we miss rawdb.WriteSafePointBlockNumber

So, which causes the ancient pruning check to fail

stableStabeNumber := ReadSafePointBlockNumber(nfdb)
switch {
case stableStabeNumber < params.StableStateThreshold:
log.Debug("Stable state block not old enough", "number", stableStabeNumber)
backoff = true
continue

@klim0v
Copy link
Author

klim0v commented Feb 27, 2025

@j75689

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

No branches or pull requests

2 participants