mempool: honor reduced-data grandfathering when relaying spends#322
Closed
kwsantiago wants to merge 1 commit into
Closed
mempool: honor reduced-data grandfathering when relaying spends#322kwsantiago wants to merge 1 commit into
kwsantiago wants to merge 1 commit into
Conversation
Collaborator
|
The current behaviour is intentional |
Author
|
Agreed, the policy rejection is intentional (a grandfathered spend's change output typically reuses the same script). Closing this. I'll follow up with a way for miners to manually override the rejection instead, as you suggested. |
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.
Reduced-data (RDTS) exempts inputs spending UTXOs created before activation from the reduced-data rules. Consensus applies this per-input in ConnectBlock (validation.cpp), but the mempool script checks do not: PolicyScriptChecks and ConsensusScriptChecks apply the reduced-data flags uniformly to every input. As a result a spend of a grandfathered UTXO is valid in a block but rejected as non-standard at relay, so Knots nodes won't propagate it.
This strips the reduced-data flags for inputs spending pre-activation UTXOs in both mempool script checks, using the per-input flags that CheckInputScripts already supports and mirroring ConnectBlock. Pre-activation behavior is unchanged (nothing is exempted, the relay filter still applies).
Test: feature_reduced_data_utxo_height.py gains a mempool case, a spend of a grandfathered OP_IF-tapscript UTXO is relayable, while a newly-created one is still rejected. (OP_IF-in-tapscript is used rather than an oversized push because the latter is masked by the unrelated 80-byte witness-stack-item standardness rule.)