core, ethdb, trie: mode dirty data to clean cache on flush (#19307)
This PR is a more advanced form of the dirty-to-clean cacher (#18995), where we reuse previous database write batches as datasets to uncache, saving a dirty-trie-iteration and a dirty-trie-rlp-reencoding per block.
This commit is contained in:
committed by
Felix Lange
parent
df717abc99
commit
59e1953246
@ -301,7 +301,7 @@ func (bc *BlockChain) SetHead(head uint64) error {
|
||||
defer bc.chainmu.Unlock()
|
||||
|
||||
// Rewind the header chain, deleting all block bodies until then
|
||||
delFn := func(db ethdb.Deleter, hash common.Hash, num uint64) {
|
||||
delFn := func(db ethdb.Writer, hash common.Hash, num uint64) {
|
||||
rawdb.DeleteBody(db, hash, num)
|
||||
}
|
||||
bc.hc.SetHead(head, delFn)
|
||||
|
Reference in New Issue
Block a user