Skip to content

mempool: add reduced-data ignore-reject to relay grandfathered spends#324

Open
kwsantiago wants to merge 1 commit into
bitcoinknots:29.x-knotsfrom
privkeyio:rdts-miner-override
Open

mempool: add reduced-data ignore-reject to relay grandfathered spends#324
kwsantiago wants to merge 1 commit into
bitcoinknots:29.x-knotsfrom
privkeyio:rdts-miner-override

Conversation

@kwsantiago

Copy link
Copy Markdown

Follow-up to #322 (closed). The reduced-data relay rejection is intentional, but a miner should be able to opt into relaying/accepting spends of pre-activation ("grandfathered") UTXOs, which consensus already exempts in ConnectBlock.

Adds a "reduced-data" ignore_rejects token (usable via sendrawtransaction/testmempoolaccept). Default behavior is unchanged: those spends stay rejected at relay. When the token is set, inputs spending pre-activation UTXOs are exempted per-input in both mempool script checks (Policy and Consensus), matching ConnectBlock so the two checks stay consistent. Non-grandfathered spends stay rejected even with the token, since they are genuinely reduced-data-invalid.

Test: feature_reduced_data_utxo_height.py adds a case where the grandfathered OP_IF-tapscript spend is rejected by default, accepted with the token, and a non-grandfathered spend is still rejected with the token.

@pdath

pdath commented Jul 11, 2026

Copy link
Copy Markdown

ctACK 0233128

The complexity of this change exceeds my knowledge, so I can not do a human code review.

I reviewed the code with Code Rabbit and it reported a single "nit" in "feature_reduced_data_utxo_height.py", lines 319-342:
"Assert the reject-reason prefix here
res["allowed"] alone doesn’t distinguish a reduced-data policy hit from an unrelated failure. Check reject-reason too: the grandfathered case should hit mempool-script-verify-flag-failed, and the non-grandfathered case should hit mandatory-script-verify-flag-failed."

I tested using the following commands on Ubuntu 24.04 running on ARMv8-A (64-bit):

git clone https://github.com/bitcoinknots/bitcoin.git pr324
cd pr324
git fetch origin pull/324/head:pr324
git switch pr324

cmake -B build
-DRDTS_CONSENT=IMPLICIT
-DBUILD_GUI=OFF
-DCMAKE_BUILD_TYPE=Release
nice cmake --build build -j4

cd build
ctest -R "validation_tests|mempool_tests" --output-on-failure
python3 test/functional/test_runner.py feature_rdts.py feature_reduced_data_utxo_height.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants