There have been a number of questions on this however none, IMO, actually get to the problem:
The rev*.dat information maintain “undo” knowledge for rolling again the UTXO state, block by block,
and so they’re 1::1 with block information (i.e., for a given NNNNN the information blkNNNNN.dat and revNNNNN.dat maintain info for a similar blocks),
and so they’re written and chunked within the order by which blocks are acquired by the node (from the community)
and the UTXO set is computed (can solely be computed) by contemplating blocks in block-chain order,
and in any block the coinbase transaction is unspendable for 101 confirmations (by consensus) which is in order that reorgs of as much as 100 blocks do not trigger critical issues with cash all of a sudden disappearing, and 100 blocks piled on high is outwardly lengthy sufficient to outwait any reorganization …
Then: Are very outdated rev*.dat information ever used? Say, those who belong to blocks buried greater than 100 blocks deep from the highest of the chain? In the event that they are ever used what’s the use case?
(and, w.r.t. the reply right here of the primary query within the following record, what’s the database corruption that happens – presumably to the UTXO state – if the rev information are all deleted and why is it essential to regenerate them?)
(bonus query: given a txindex: is there something within the rev*.dat file that may’t be regenerated just by wanting on the blocks within the corresponding blk*.dat file and utilizing the txindex to search out earlier transactions?
Different questions right here approaching this query however not dupes:
“Are outdated rev*.dat file safely deletable?” – closest to being on level, the accepted reply explains (with out actually explaining) that when you delete them it “successfully corrupts the databases” and likewise that they will be recreated in the event that they’re all deleted. However would not say why they have to be saved indefinitely, which is what I am asking.
“What precisely are the rev00000.dat information?” – immediately solutions what they’re for however does not reply why they have to be saved perpetually
“File format — rev*.dat” – particularly in regards to the format of the contents of the rev information
“What’s uncooked undo knowledge for?” – sadly, the one reply would not even reply the query requested however is the truth is a minimize/paste of the reply to the file format query #57978 immediately above on this record – but, it obtained the OP’s checkmark, go determine…
“Undo information format change and reorg course of query for v0.19” – extraordinarily detailed reply in regards to the format of the contents of the rev information
The tag “undofiles” – 3 questions (earlier than this one) – 2 are listed above and the opposite is somebody’s one-off operational drawback (clean blk and rev information).
This reply is excellent as to when rev*.dat information are used (blockchain reorgs) however would not tackle why they’re saved perpetually.