Details: Uses a src/checkpoint_def.cpp file to store a static array of checkpoints. That file is easily generate-able using -saveblockcheckpointfile and gitian builds require the file as an input.
Compile in the LS 32bits as checkpoints #1577
pull TheBlueMatt wants to merge 6 commits into bitcoin:master from TheBlueMatt:checkpoints changing 8 files +83 −18-
TheBlueMatt commented at 7:58 PM on July 10, 2012: member
-
gavinandresen commented at 12:50 PM on July 13, 2012: contributor
checkpoints_def.cpp needs some newlines-- see http://stackoverflow.com/questions/10519738/source-line-length-limit
And would it be better to NOT check in the full checkpoints_def.cpp to git? gitian builders could generate it themselves or download a copy (using github 'download a file' feature maybe).
-
TheBlueMatt commented at 1:21 PM on July 13, 2012: member
Oops, yea Ill add some \n, I had previously dropped them because of the increase in file size...
Gitian builders are required to have a checkpoints_def.cpp in their inputs, so they have to compile their own in anyway. Its only checked into git so that people who git clone && cd src && make can continue to do that. (and one can't simply build with an empty one as they will end up rejecting the 2 BIP30-invalid blocks which are in the chain before BIP30 was enforced). But if people believe its better to force people building bitcoin to download the file, thats fair too.
-
991419d54a
Replace unused end() and begin() in base_uint. (use first/last)
With ones that return unsigned int, and makes end() actually return the last value.
-
Add code to generate checkpoints_def.cpp (-saveblockcheckpointfile) 966ab27b08
-
TheBlueMatt commented at 12:13 AM on July 17, 2012: member
New version: "\n"s in checkpoints_def.cpp Default checkpoints_def.cpp is now empty with a #warning BIP30 checkpoints are now in checkpoints.cpp using full hashes.
-
Use checkpoints_def.cpp to verify checkpoints. 0c1e8360d6
-
7768c550a8
Force gitian builders to regenerate checkpoints_def.cpp.
Note that the updated checkpoints_def.cpp is not included in the src dir to avoid unnecessarily bloating the release tars.
-
Add manual checkpoints for non BIP30-compliant blocks. 9fa85b8150
-
Check BIP30 on all blocks that aren't checkpointed. b2667bc86e
-
in src/checkpoints_def.cpp:None in 9c1fee83a3 outdated
0 | @@ -0,0 +1 @@ 1 | +const unsigned int LSBCheckpoints[] = {};
gavinandresen commented at 12:24 AM on July 17, 2012:Maybe a nice big comment at the top of this explaining why this do-nothing file exists? Something like:
/* This is a placholder file that should be replaced by the output of bitcoind -saveblockcheckpointfileto It will be filled iwth the least-significant 32 bits of block hashes in the best block chain. By checkpointing the early, difficulty-1 blocks several potential denial-of-service attacks are prevented. */
TheBlueMatt commented at 12:35 AM on July 17, 2012:Done
Diapolo commented at 9:20 AM on July 17, 2012: noneSo, when doing own builds on Windows I have to use
-saveblockcheckpointfiletoto generate a newcheckpoints_def.cpp? If this is the case wouldn't it be nicer if I don't need to specify that filename and even as default src\ is used :)?TheBlueMatt commented at 2:07 PM on July 17, 2012: memberIf you are running bitcoin-qt, the output would be src/checkpoints_def.cpp, or if you are running it on windows, it would be ../src/checkpoints_def.cpp, or if you are running bitcoin it would be checkpoints_def.cpp...I dont really feel like doing some #ifdefs there...
gavinandresen commented at 12:49 AM on July 18, 2012: contributorNot loving this:
If I get rid of the compile #warnings, then I get a dirty tree, and I know sooner or later I'll accidentally commit checkpoints_def.cpp.
It will be considered a dirty git tree during gitian building, yes? That will screw up the auto-version-determination code...
Also, with a generated checkpoints_def.cpp, I get a gazillion: checkpoints_def.cpp:185334: warning: this decimal constant is unsigned only in ISO C90
I think adding the 4 checkpoints and doing BIP30-check-all-except-checkpointed-blocks is the right thing to do.
TheBlueMatt closed this on Jul 18, 2012lateminer referenced this in commit 2205e3d302 on May 6, 2020DrahtBot locked this on Sep 8, 2021Contributors
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-24 15:16 UTC
More mirrored repositories can be found on mirror.b10c.me