Skip to content

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

@klim0v

Description

@klim0v

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions