Page MenuHomePhabricator

Reconsider checkpointed block at startup.

Authored by deadalnix on Tue, May 19, 20:11.



Because we know checkpoints are valid blocks, a checkpointed block marked as invalid is an obvious indication that something went wrogn in this datadir, such as running an incompatible node client.

In order to fix this, we make sure to reconsider heckpointed blocks at startup if necessary.

Test Plan

Run a node.

bitcoin-cli invalidateblock 00000000000000000033dfef1fc2d6a5d5520b078c55193a9bf498c5b27530f7

The node reorg a fe days of blockw away.

Restart the node and monitor the logs for.

Reconsidering checkpointed block 00000000000000000033dfef1fc2d6a5d5520b078c55193a9bf498c5b27530f7 ...

And verify that the node sync back to the tip of the chain.

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Tue, May 19, 20:11
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, May 19, 20:11
deadalnix requested review of this revision.Tue, May 19, 20:11
majcosta requested changes to this revision.Tue, May 19, 20:28
majcosta added a subscriber: majcosta.

we should probably add a entry for this feature

1318 ↗(On Diff #20309)

couple typos

This revision now requires changes to proceed.Tue, May 19, 20:28
majcosta accepted this revision.Tue, May 19, 23:06
This revision is now accepted and ready to land.Tue, May 19, 23:06
This revision was landed with ongoing or failed builds.Tue, May 19, 23:15
This revision was automatically updated to reflect the committed changes.

Although this is already landed, I had a 0.20.12 node synced to the non-upgraded chain, so I took the opportunity to test this Diff, and it behaved as expected.

I just started it up, and it synced to the correct chain with no user intervention.

Macro likestamp: