From 5a7bc03ccda217c32f3704e3b61268e74ca69d94 Mon Sep 17 00:00:00 2001 From: FlyTheElephant1 <259444470+FlyTheElephant1@users.noreply.github.com> Date: Thu, 10 Sep 2026 19:30:36 -0500 Subject: [PATCH 01/11] test from elephant --- ...release-notes-batched-coinbase-maturity.md | 24 ++ src/chainparams.cpp | 11 + src/chainparamsbase.cpp | 1 + src/consensus/consensus.h | 6 + src/consensus/params.h | 17 ++ src/consensus/tx_verify.cpp | 24 +- src/consensus/tx_verify.h | 11 +- src/interfaces/chain.h | 5 + src/kernel/chainparams.cpp | 6 + src/kernel/chainparams.h | 4 + src/node/interfaces.cpp | 11 + src/qt/transactiondesc.cpp | 4 +- src/rpc/blockchain.cpp | 45 +++- src/rpc/mining.cpp | 3 + src/test/fuzz/coins_view.cpp | 2 +- src/test/validation_tests.cpp | 59 +++++ src/txmempool.cpp | 2 +- src/validation.cpp | 30 ++- src/validation.h | 7 + src/wallet/wallet.cpp | 7 +- .../feature_extended_coinbase_maturity.py | 231 ++++++++++++++++++ test/functional/test_runner.py | 1 + 22 files changed, 486 insertions(+), 25 deletions(-) create mode 100644 doc/release-notes-batched-coinbase-maturity.md create mode 100644 test/functional/feature_extended_coinbase_maturity.py diff --git a/doc/release-notes-batched-coinbase-maturity.md b/doc/release-notes-batched-coinbase-maturity.md new file mode 100644 index 000000000000..296309148655 --- /dev/null +++ b/doc/release-notes-batched-coinbase-maturity.md @@ -0,0 +1,24 @@ +### Batched extended coinbase maturity (temporary softfork) + +Coinbase outputs created while this deployment is active use a longer +maturity that is *attached to the creating block*, not to the spend: + +- 1/6 of window blocks (`(height - start) % 6 == 0`): 2016 confirmations +- 2/6 of window blocks (`% 6` in {1,2}): 8064 confirmations +- 1/2 of window blocks (`% 6` in {3,4,5}): 26280 confirmations + +The assignment is by **block height**, so coinbase transaction size does +not change. There is no extra output and no DATUM/script change. + +The window is the same shape as RDTS: first block whose parent MTP +reaches the start time, through the last block whose parent MTP is still +below the RDTS expiry. After expiry, **new** coinbases go back to the +ordinary 100-block maturity. Coinbases created *inside* the window keep +their 2016/8064/26280 lock until they actually mature — expiry does not +unlock them early. + +Outputs created before activation are never affected. + +Mainnet/testnet start time is unset in this patch (flag day later). +Regtest: `-extendedcoinbasematurity=` requires `-rdtsexpiry` and +must precede it. diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 54ab526e2b7c..ca3b2da47a14 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -93,6 +93,17 @@ void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& opti options.rdts_expiry_time = expiry; } + if (const auto arg{args.GetArg("-extendedcoinbasematurity", "")}; !arg.empty()) { + if (!options.rdts_expiry_time) { + throw std::runtime_error("-extendedcoinbasematurity requires -rdtsexpiry=