Bugfix: Fix testnet-in-a-box use case #5987
pull luke-jr wants to merge 1 commits into bitcoin:master from luke-jr:bugfix_tniab changing 3 files +6 −1-
luke-jr commented at 11:56 am on April 9, 2015: memberRemove testnet checkpoint and allow for older tip blocks
-
in src/main.cpp: in f976f982d6 outdated
1199@@ -1200,7 +1200,7 @@ bool IsInitialBlockDownload() 1200 if (lockIBDState) 1201 return false; 1202 bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 || 1203- pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60); 1204+ pindexBestHeader->GetBlockTime() < GetTime() - Params().MaxTipAge());
laanwj commented at 11:54 am on April 10, 2015:Why change this? It only determines whether the client is in initial block download, it shouldn’t prevent the client from accepting blocks.
luke-jr commented at 11:58 am on April 10, 2015:IsInitialBlockDownload disables mining.
laanwj commented at 11:31 am on April 15, 2015:Oh right, that’s ugly…
jtimon commented at 12:39 pm on April 25, 2015:would you mind to declareconst CChainParams& chainparams = Params();
at the beginning of the function and use chainparams.MaxTipAge() instead? That will make passing CChainParams as an argument to IsInitialBlockDownload() simpler later.laanwj added the label Mining on Apr 24, 2015luke-jr force-pushed on Apr 25, 2015jtimon commented at 1:11 pm on June 21, 2015: contributorut ACK, though it needs rebaseluke-jr closed this on Jun 23, 2015
luke-jr force-pushed on Jun 23, 2015luke-jr reopened this on Jun 23, 2015
luke-jr commented at 8:38 am on June 23, 2015: memberRebased.in src/chainparams.cpp: in 2fa12bf8b2 outdated
180@@ -179,9 +181,9 @@ class CTestNetParams : public CMainParams { 181 182 checkpointData = (Checkpoints::CCheckpointData) { 183 boost::assign::map_list_of 184- ( 546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")),
jtimon commented at 9:54 am on June 26, 2015:Why remove the checkpoint? why not just add the genesis checkpoint as in https://github.com/jtimon/bitcoin/commit/dc1611925dd36f07d1cf3412237610b864a99bcc ? Also, why not just use consensus.hashGenesisBlock in the genesis checkpoint instead of repeating the hardcoded value?
jtimon commented at 10:02 am on June 26, 2015:In fact, why not add the genesis checkpoint (the genesis block, the only checkpoint that cannot be reorged) to the mainchain too (and while at it use consensus.hashGenesisBlock for regtest’s gensis checkpoint for uniformity).jtimon commented at 12:39 pm on June 29, 2015: contributorAny thoughts on the nits and proposed changes to this PR?jtimon commented at 8:35 pm on September 15, 2015: contributorThe op says:
Remove testnet checkpoint
why?
…and allow for older tip blocks
I want this (like in https://github.com/jtimon/bitcoin/commit/dc1611925dd36f07d1cf3412237610b864a99bcc). jgarzik seems not to want this for some reason.
jgarzik commented at 8:46 pm on September 15, 2015: contributorI have no real opinion. Just moving things along.luke-jr commented at 0:32 am on September 20, 2015: memberCheckpoints beyond the genesis block are a problem because testnet-in-a-box networks won’t have those blocks.
MaxTipAge is needed because otherwise mining the first (non-genesis) block is impossible on such a network.
luke-jr force-pushed on Sep 20, 2015jtimon commented at 8:31 am on September 21, 2015: contributorCheckpoints beyond the genesis block are a problem because testnet-in-a-box networks won’t have those blocks.
I see. They could also disable checkpoints in their test, but I don’t have a strong opinion: I’m fine removing it if that’s the motivation. What about the rest of my feedback (ie making sure all ghains have a genesis checkpoint and using hardcoded values as little as possible)?
laanwj commented at 4:17 pm on September 22, 2015: memberInstead of removing the checkpoint, users of testnet-in-a-box could specify the option
-checkpoints=0
- right?I don’t see a simple alternative solution for the tip age, though I still think having it per network is hacky.
jtimon commented at 5:29 pm on September 22, 2015: contributorBugfix: Allow mining on top of old tip blocks for testnet (fixes testnet-in-a-box use case) e761d7a94fluke-jr force-pushed on Sep 29, 2015luke-jr commented at 7:47 pm on September 29, 2015: memberSorry for the delay, done.jgarzik commented at 10:22 am on October 1, 2015: contributorut ACKlaanwj commented at 12:06 pm on October 1, 2015: memberutACKlaanwj merged this on Oct 1, 2015laanwj closed this on Oct 1, 2015
laanwj referenced this in commit 4899a04c24 on Oct 1, 2015laanwj referenced this in commit 64360f1304 on Dec 14, 2015deadalnix referenced this in commit d9ec1a7db1 on Jan 11, 2017deadalnix referenced this in commit 27d238fdb1 on Jan 11, 2017deadalnix referenced this in commit a193ba35df on Jan 15, 2017deadalnix referenced this in commit 890e1c1dda on Jan 16, 2017deadalnix referenced this in commit 398d02958b on Jan 17, 2017deadalnix referenced this in commit 3015c86761 on Jan 19, 2017deadalnix referenced this in commit e442224c4b on Jan 19, 2017deadalnix referenced this in commit 36cf0f2266 on Jan 19, 2017deadalnix referenced this in commit 1164b55292 on Jan 26, 2017deadalnix referenced this in commit 85a832d6a6 on Feb 12, 2017sickpig referenced this in commit 52db63687f on Feb 25, 2017deadalnix referenced this in commit c2a143452c on Feb 27, 2017deadalnix referenced this in commit fa68b4bcd3 on Feb 27, 2017MarcoFalke locked this on Sep 8, 2021
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: 2024-11-17 15:12 UTC
More mirrored repositories can be found on mirror.b10c.me