policy: count bare data envelopes (OP_2DROP/pushnum runs) as datacarrier#319
Open
kwsantiago wants to merge 2 commits into
Open
policy: count bare data envelopes (OP_2DROP/pushnum runs) as datacarrier#319kwsantiago wants to merge 2 commits into
kwsantiago wants to merge 2 commits into
Conversation
kwsantiago
force-pushed
the
fix-bip110-envelope-datacarrier
branch
from
July 3, 2026 02:39
a169975 to
04e6d16
Compare
kwsantiago
force-pushed
the
fix-bip110-envelope-datacarrier
branch
from
July 3, 2026 02:45
04e6d16 to
3b776a4
Compare
|
tACK 3b776a4 Tested with this transaction (has been mined afterward to be able to share it publicly) on my own signet. |
|
I ran the code changes through a CodeRabbit review, and no issues came up. |
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.
DatacarrierBytesrecognizes inscription data in two forms:OP_FALSE OP_IF ... OP_ENDIFenvelopes and<data> OP_DROP. It does not matchOP_2DROP, so a bare envelope of the formpush <marker> <data>... OP_2DROP...OP_DROPcounts as zero datacarrier bytes and evades the size limit.This is the envelope shape ordinals/ord#4545 adopts to remain valid under BIP-110, which disables
OP_IF/OP_NOTIFin tapscript.Changes:
OP_DROP/OP_2DROP, anchoringdata_beganat the start of the run so the whole run is counted on the first drop rather than just the last push.OP_1NEGATE,OP_1..OP_16) as run members. ord's parser accepts pushnums as payload, so a pushnum interleaved between data pushes must not strand the earlier push from the count. This matches the counting to exactly the grammar ord's envelope parser accepts (pushes, pushnums,OP_DROP,OP_2DROP).This makes counting slightly stricter for any push-run ending in a drop, not only the new envelope. Standard scripts that use
OP_DROPdrop a stack item preceded by a non-push opcode (e.g.<locktime> OP_CHECKLOCKTIMEVERIFY OP_DROP), which breaks the run and is not counted.Testing:
script_DataCarrierBytes): a<data> <data> OP_2DROPrun, and a pushnum-interleaved<data> OP_7 <data> OP_2DROPrun.mempool_datacarrier.py): builds P2TR script-path spends with bare envelope tapscripts and assertstxn-datacarrier-exceededunder default policy, including a pushnum-interleaved envelope, mirroring the existing OPNet case. Reverting the counting change alone makes the tests fail (the tx is accepted).