-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Checkpoints: The hash of the genesis block it's the genesis checkpoint #6230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
15cabcd
to
8b9ed6e
Compare
408d2b4
to
dc16119
Compare
dbbb53f
to
29f02d6
Compare
Rebased after merging #6299. Apart from its original form, now this PR additionally has the a removal of the now-unnecessary check for the genesis hash block (and an additional big indentation commit). |
3a42c88
to
e9adf7b
Compare
f904b87
to
8d940d2
Compare
8d940d2
to
bd6aafa
Compare
Yes, @sdaftuar , you're right, this is no alternative fix of #6299 . In summary and to reiterate, there's no reason not to have the genesis block as a checkpoint: it's the best checkpoint you will ever have! by definition! |
bd6aafa
to
0c576b2
Compare
Closing for now. I will reopen again with the version with the tests. In the meantime @luke-jr can take this for his PR if he wants to. |
It's nicer to have all the hardcoded hashes of the genesis blocks of the respective supported chains together.
More importantly, all chains should have the genesis block as checkpoint. That way the checkpoint logic can always trust the first checkpoint and hopefully we will be able to save some
if (block.GetHash() != chainparams.GetConsensus().hashGenesisBlock)
here and there.I also add some tests to checkpoints. They're not very important since the asserts in chainparams would already detect any change in the genesis block, but it makes sure that "the checkpoint logic can always trust the first checkpoint".
In fact, the genesis checkpoint is that is immune to reorgs, by definition.
The genesis block is the first rule and the only true chain ID (because one based in names would require a memorable-ID system [and those are centralized and/or vulnerable to squatting]).
(Shares base commit with #6229)