Repository navigation
Conversation
Replace the fixed end coin height (6930000) with the RDTS expiry, using the boundary knots#468 uses: a coinbase is covered only if the parent of the block that mined it has a median-time-past before RdtsExpiryTime. Expiry only ends coverage of new rewards; a reward covered before it still needs the full 52560 blocks. The first uncovered height is found on the spending branch with the same search as bitcoin#468's CoinbaseMaturityLongEndHeight, and passed to CheckTxInputs in ConnectBlock, mempool acceptance and reorg eviction. Wallet and GUI maturity use it from the active chain. getdeploymentinfo replaces coinbase_end_height (fixed) with coinbase_expiry_time, and reports coinbase_end_height once the queried block has reached the expiry. On regtest, the fourth field of -testcoinbasematurityrolling is replaced by -testcoinbasematurityrollingexpiry=<time>, which must match -rdtsexpiry if both are given.
feature_rolling_maturity_end_bound mines blocks with fixed timestamps so the expiry lands on a known block, and checks the last covered reward, the first uncovered one, and that a covered reward keeps its full depth long after the expiry. mempool_rolling_coinbase_maturity drops the end coin height cases and checks the new option's errors.
Author
|
Closing this: we are going with the 180-day rule from bitcoinknots#468 that is already in the rc. Thanks! |
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.
This is a proposal on top of bitcoinknots#476. It keeps the 1-year rolling maturity
exactly as it is, but makes the coverage stop when RDTS expires instead of
running until the first zero-subsidy height.
The rule after this change, on mainnet:
confirmations, counted from its own block. Unchanged.
the parent of the block that mined it has a median-time-past before
RdtsExpiryTime(1819756800, 2027-09-01 00:00 UTC).date passes. Nothing is released early.
The boundary is the same one bitcoinknots#468 uses, taken from its
Consensus::CoinbaseMaturityLongEndHeight: the first uncovered height is thefirst block whose parent's median-time-past has reached the expiry, searched on
the branch being validated, not on the active chain. It is also the boundary
RDTS uses for its own rules. With this, bitcoinknots#468 and bitcoinknots#476 disagree only on the
maturity depth (25920 vs 52560) and on the 973440–979918 rewards, not on when
coverage ends. If RDTS is extended, the coverage follows the new expiry.
Why: the long maturity is a defence for the RDTS period. Tied to 6930000 it locks every reward for a year for the next century. Ending it with RDTS keeps the protection while it's needed, and extending it later is a soft fork.
Changes:
CoinbaseMaturityRollingEndCoinHeightis replaced byCoinbaseMaturityRollingUntilRdts.Consensus::CoinbaseMaturityRollingEndHeightcomputes the first uncovered height; ConnectBlock, mempool acceptance and
reorg eviction pass it to
CheckTxInputs, and the wallet/GUI maturity usesit from the active chain.
getdeploymentinfodrops the fixedcoinbase_end_heightand reportscoinbase_expiry_time(same name T.Softfork: consensus: 180-day rolling coinbase maturity from height 979919 until RDTS expiry bitcoinknots/bitcoin#468 uses). Once the queried block hasreached the expiry it also reports
coinbase_end_height, the last coveredreward.
-testcoinbasematurityrollingis gone;-testcoinbasematurityrollingexpiry=<time>binds the rule to an RDTS expiry(it must match
-rdtsexpiryif both are set), like T.Softfork: consensus: 180-day rolling coinbase maturity from height 979919 until RDTS expiry bitcoinknots/bitcoin#468's-testcoinbasematuritylongexpiry.rolling_maturity_rdts_end_heightcase on a synthetic chain that checks theboundary block and that it moves by one block when the expiry moves by one
second.
feature_rolling_maturity_end_bound.pynow mines with fixed timestamps sothe expiry falls on a known block, and checks the last covered reward, the
first uncovered one, and that a covered reward still needs its full depth
long after the expiry.
mempool_rolling_coinbase_maturity.pyis updated forthe new option.
Testing done: the full unit test suite (146/146 via ctest), the touched and
related functional tests (feature_rolling_maturity_end_bound,
mempool_rolling_coinbase_maturity, mempool_long_coinbase_maturity,
feature_chainstate_revalidation, rpc_blockchain, mining_basic, mempool_reorg,
wallet_balance and others), and a separate regtest script checking blocks and
mempool on both sides of the boundary, with and without the long window.
Commits:
Happy to change names or split it differently if you prefer.