Page MenuHomePhabricator

Reconsider checkpointed block at startup.
ClosedPublic

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

Details

Summary

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.

Event Timeline

majcosta requested changes to this revision.May 19 2020, 20:28
majcosta added a subscriber: majcosta.

we should probably add a release-notes.md entry for this feature

src/init.cpp
1318 ↗(On Diff #20309)

couple typos

This revision now requires changes to proceed.May 19 2020, 20:28
This revision is now accepted and ready to land.May 19 2020, 23:06
This revision was landed with ongoing or failed builds.May 19 2020, 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: