Forces the block reward to zero when right shift in GetBlockValue() is undefined, after 64 reward halvings (block height 13,440,000).
Fix for GetBlockValue() after block 13,440,000 #3842
pull ditto-b wants to merge 2 commits into bitcoin:master from ditto-b:master changing 2 files +7 −2-
ditto-b commented at 12:04 AM on March 11, 2014: contributor
-
c5a9d2ca9e
Fix for GetBlockValue() after block 13,440,000
Forces the block reward to zero when right shift in GetBlockValue() is undefined, after 64 reward halvings (block height 13,440,000).
-
petertodd commented at 6:17 AM on March 11, 2014: contributor
NACK
We should make use of the ~250 years we have to study this issue more carefully.
-
bf0d7998-81ec-48d1-b236-076ed3c77581 commented at 1:38 AM on March 12, 2014: none
I'm sure the altcoin creators can figure this out of themselves right?
-
ditto-b commented at 1:43 AM on March 12, 2014: contributor
UUID guy is giving altcoin devs way too much credit.
-
laanwj commented at 7:19 AM on March 14, 2014: member
Code change looks fine to me. Any value of halvings>32 will already bring the subsidy to 0, so regarding it as zero for halvings>=64 is safe.
-
laanwj commented at 1:57 PM on April 1, 2014: member
Are we going to merge this, or not? It appears safe to me but as it involves critical part of the consensus code I don't want to make this decision on my own. @sipa @gmaxwell @gavinandresen
-
petertodd commented at 2:06 PM on April 1, 2014: contributor
@ditto-b Could you please do up a test script that actually exercises this code? regtest mode has a shortened halving interval and a trivial PoW so creating the blocks and submitting them locally shouldn't be too hard. You can use https://github.com/petertodd/python-bitcoinlib/ if you know python - it has both the CBlock/CTransaction stuff to make the blocks, and easy access to the RPC interface. I'd be happy to help review it for you.
-
laanwj commented at 2:17 PM on April 1, 2014: member
We do have a test for the function (subsidy_limit_test) but it only runs until block 7 000 000. Would be trivial to increase, though.
-
gmaxwell commented at 10:14 PM on April 1, 2014: contributor
ACK. This is an implementation of BIP42.
Though we should make the trivial change of improving the test too.
-
gergomiho commented at 12:47 AM on April 2, 2014: none
I think this is a great fix. When I first read about Bitcoin I loved the idea that it has finite coins, and this is how it should be in my opinion.
-
genjix commented at 2:05 AM on April 2, 2014: none
:S in 250 years we'll be using qubits, flying around the galaxy and mating with space honeys
i'm glad you have eternal faith in c++
-
parentmap commented at 5:44 AM on April 2, 2014: none
Code is moving away from it's comments. Keep the comment about halving with the actual halving math (l 1085 -> 1079)
-
aceat64 commented at 5:50 PM on April 2, 2014: none
This is clearly a bug and one serious enough that I believe if we do not fix it in a timely manner it could destroy confidence in the Bitcoin network.
-
gmaxwell commented at 5:57 PM on April 2, 2014: contributor
Timely manner? ... Well I'm absolutely confident that it will be fixed sometime in the hundreds of years required before it matters.
-
aceat64 commented at 6:11 PM on April 2, 2014: none
The longer we delay, the more likely it is that a miner alive today could live until this bug occurs. This gives them a greater incentive to not implement the fix. This is particularly true for any toddlers or infants in charge of sizeable farms.
-
gmaxwell commented at 6:17 PM on April 2, 2014: contributor
It doesn't matter what miners implement, it matters what the rest of bitcoin nodes run. If you mine with rules inconsistent with the network you are simply not mining.
-
aceat64 commented at 6:40 PM on April 2, 2014: none
I feel as though the tone of my message has been misunderstood. I attempted to clarify with my mention of toddlers and infants running large mining farms.
-
gmaxwell commented at 6:54 PM on April 2, 2014: contributor
Thanks. :)
-
5cfd3a70a6
Edit subsidy_limit_test to account for BIP42
Because no one wants 4 gold mines being discovered every mibillenium.
-
rebroad commented at 12:50 AM on April 3, 2014: contributor
I'm not particularly concerned about what happens to bitcoin in 250 years as I don't expect to be around by then. Is this really likely to be the PR disaster that some people are suggesting?!
-
BitcoinPullTester commented at 1:27 AM on April 3, 2014: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/5cfd3a70a67ba707a8f074a1730724a6e86353b8 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
- gavinandresen referenced this in commit 8556b0298d on Apr 3, 2014
- gavinandresen merged this on Apr 3, 2014
- gavinandresen closed this on Apr 3, 2014
- sidhujag referenced this in commit 247a5f9511 on Dec 13, 2020
- DrahtBot locked this on Sep 8, 2021