You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit increases the MaxDataCarrierSize from 80 bytes to 100,000
bytes to align with Bitcoin Core v30, which removes the specific
80-byte OP_RETURN data limit.
Rationale:
1. Policy Alignment: Maintains consistency with Bitcoin Core v30,
ensuring btcd nodes accept the same set of standard transactions
as the majority of the network.
2. Fee Estimation: Filtering large OP_RETURN transactions from the
mempool prevents accurate fee estimation by hiding transactions
that are competing for blockspace. Full mempool visibility is
essential for informed fee rate calculation.
3. Validation Performance: Rejecting transactions that will be mined
by other nodes means they must be validated when processing blocks,
without cached results. This delays block validation and
propagation, harming both the node operator and network health.
4. Decentralization: Slow block propagation advantages large mining
operations with preferentially peered nodes, as they get a head
start on the next block. Ensuring all likely-to-be-mined
transactions are pre-validated helps maintain network
decentralization.
Key changes:
- Increase MaxDataCarrierSize constant from 80 to 100000 bytes
- Modify NullDataScript to use AddFullData instead of AddData to
bypass MaxScriptElementSize (520 bytes) since OP_RETURN outputs
are provably unspendable and never executed
- Update AddFullData documentation to reflect legitimate use for
OP_RETURN outputs, not just testing
The practical limit for OP_RETURN data remains around 75KB due to
the maxStandardTxWeight limit of 400,000 weight units (~100KB total
transaction size including inputs and outputs).
Test coverage includes:
- Unit tests for script creation and size validation
- Policy tests for transaction standardness (75KB OP_RETURN)
- Integration tests for mempool acceptance and size limit enforcement
This change maintains backward compatibility while enabling larger
data storage in OP_RETURN outputs for applications like inscriptions,
timestamps, and data anchoring.
0 commit comments