This is a remake of D4909, without dependencies. I wouldn't salvage it as it doesn't apply cleanly anymore, so I ended up having to redo it. Previous description:
This code currently classifies a 'deep reorg' based on the length of the new
chain... this is a bit weird for a couple of reasons:
- If there is no reorg at all, but we merely receive a block out-of-order, then our log file will be shitted up with 'Park block' messages for all the future blocks after tip+1 until we actually receive the tip+1 block and can move the tip forward.
- Most people classify a deep reorg based on how many blocks get rewinded, not based on how many new blocks there are. If we only have to rewind a single block it shouldn't count as a deep reorg, but the current code does count it so.
The more conventional sense (a deep reorg is based on the number of blocks
that need to be rewinded) is already used by finalization code, and parking
should be similar.