Repository navigation
consensus: matching policy for Part 1 of the CBM. - #483
Open
FlyTheElephant1 wants to merge 1 commit into
Open
FlyTheElephant1 wants to merge 1 commit into
FlyTheElephant1 wants to merge 1 commit into
Conversation
FlyTheElephant1
force-pushed
the
lock-sticks-consensus-matches-policy
branch
from
October 25, 2026 12:42
478c1e3 to
3284d2b
Compare
…-979918 This aligns consensus with existing policy already applied to those coins. Attach the 6480-block requirement to the creating height so historical-window coins keep the longer lock under consensus past the old release height of 979920.
FlyTheElephant1
force-pushed
the
lock-sticks-consensus-matches-policy
branch
from
October 25, 2026 12:44
3284d2b to
c5de7d0
Compare
|
Tested c5de7d0 on top of 58398ba (Ubuntu on WSL2, GCC 15.2).
Notes: the heights 973440/979920 are hard-coded in CheckTxInputs. A trial merge onto #468 (8a4ca1b) conflicts in tx_verify.cpp. I did not test it combined with #468. |
Author
|
Thanks geobees. Yea #477 is this built to be compatible with #468 and do what this does. Every other proposal from everyone except for #468 already solves the problem that this solves, #483 is a fallback option if we think we need to do the simplest possible conclusion to part1. I just made it so it would be here if we need it and simple enough to audit rapidly. I think in pretty much all cases, #480 makes more sense than this except in the edge case that people cant reach consensus on that but could on this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On current 29.x-knots (with #419), policy already holds coinbase outputs created in the temporary window to 6480-block maturity. The mempool path always passes
long_maturity_start_height = 0, so those coins are not relayed or accepted into the mempool until 6480 confirmations.Consensus does not. In
ConnectBlock, the long rule is only applied while the spend height is still inside the temporary window (CoinbaseMaturityLongActiveAt). Once spend height reaches 979920,long_maturity_start_heightbecomesINT_MAXand every coinbase created in[973440, 979920)drops back to 100-block maturity under consensus.This change resolves a consensus/policy discrepancy: nodes following policy will not relay or accept into the mempool a spend that consensus still considers valid but will accept a block containing it without this. Without this there is a single-height cliff at 979920 where every historical-window coinbase becomes spendable at once under consensus.
This change attaches the 6480 requirement to the creating height so coins mined in the original window keep the lock under consensus past 979920. Each coin matures individually (973440 at 979920, 973450 at 979930, etc.). Coins created after the window remain at 100 blocks. This makes consensus match the policy already applied to those coins and will not cause a split for any nodes running it or not except for nodes rewriting the code for their node to rip out policy can be split from those running this code or any equivalent or tighter code if they submit a block that contains transactions that violate the policy that we already run.
This does not extend the temporary rule to any coins created after the original window; it only ensures that coins which were already subject to 6480 under both consensus and policy continue to be subject to it under consensus.
Tests
src/test/coinbase_maturity_tests.cpp(historical_window_lock_sticks) covers the new spendability boundaries after the temporary window has closed:./build/bin/test_bitcoin --run_test=coinbase_maturity_testsreports no errors.