bitcoin core – Why is there a have to flush the UTXO set if you prune blk*.dat and rev*.dat information throughout ibd?

on

|

views

and

comments


Flushing the dbcache is the mechanism by which the database on disk is introduced in sync with the database in reminiscence. For the reason that UTXO set continually adjustments, it is extra performant to cache the newest adjustments in reminiscence slightly than writing every thing out to disk instantly as disk I/O might be fairly sluggish.

As a result of entries contained within the dbcache are usually not at all times on disk, an occasion that kills bitcoind earlier than the flush can happen (resembling sudden energy loss) leads to these UTXO set adjustments being misplaced. However this isn’t catastrophic so long as we nonetheless have the blocks. We are able to simply load up the chainstate with the newest information, and undergo these blocks once more to replace the chainstate.

With pruning, we’re going to be deleting blocks. This introduces a state of affairs the place we have now UTXO set adjustments within the dbcache however not on disk and the blocks originating these adjustments have been eliminated. If bitcoind have been to be killed presently, we might don’t have any manner of recovering the adjustments with out re-downloading the blocks. By flushing the dbcache earlier than eradicating the blk*.dat and undo*.dat information, we will be certain that the UTXO set on disk is updated earlier than the information are pruned.

Share this
Tags

Must-read

Waymo raises $16bn to gas international robotaxi enlargement | Know-how

Self-driving automobile firm Waymo on Monday stated it raised $16bn in a funding spherical that valued the Alphabet subsidiary at $126bn.Waymo co-chief executives...

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here