This PR expands the control and testing of datacarrier transactions by decoupling the total bytes limit from the policy configuration.
While doing this, the historical money-first defaults for OP_RETURN outputs were reverted.
The motivation for this PR is to continue allowing each node to decide/signal their mempool relay (and mining) policy. However, the open-data relaying capacity of v30.0 is acknowledged and build upon.
The unlimited datacarrier policy is possible with the following configuration:
0# open-data policy
1datacarrier=1 # not required
2datacarriersize=0
3datacarriercount=0
But even without the reversion of defaults, the main scope of this PR still applies.
First, for more robust and complete testing. And second, to allow full backwards compatibility of datacarrier policy. Specifically, to allow limiting the amount of OP_RETURN outputs to just 1.
0# money-first policy
1datacarriersize=83
2datacarriercount=1 # used to be hardcoded
This configuration mimics the exact historical (default) datacarrier policy, which is not possible in v30.0.
Note that nDataOut, which counted the number of OP_RETURN outputs, was removed in #32406. Without a count check, v30.0 nodes with -datacarriersize=83 are still relaying transactions with multiple OP_RETURN outputs, transactions which all nodes prior to v30.0 will reject…