Tachyon: Allow multiple OP_RETURN outputs in a transaction
After the Tachyon upgrade, a standard transaction can now use any number
of data carrier outputs, as long as the total script size of these
outputs does not exceed the pre-existing limit of 223 bytes. The number
223 remains user-configurable (-datacarriersize=<n>
).
Cumulative size of OP_RETURN outputs is counted in a
CScript::size_type
(currently uint32_t
) and checked only once at the
end (for optimal performance for standard transactions). Because of the
consensus and standardness transaction size limits, there is no risk of
overflow. The new per-transaction size check makes the old per-output
size check redundant, also before the upgrade, and hence the latter has
been removed.
Specification effort: https://bitcoincashresearch.org/t/multiple-op-returns-this-time-for-real/315
Includes tests:
- Unit test for both pre-upgrade and post-upgrade standardness logic.
- Functional test for activation, based on the OP_RETURN limit increase in the Monolith (May 2018) upgrade (removed in commit 9e563fa4).
After the upgrade activates, the pre-upgrade logic and the functional test can be removed.
Test plan: ninja check check-functional
Merge request reports
Activity
changed milestone to %v23.0.0
added HODL GANG for-review release-blocking standardness labels
added 1 commit
- a8930cae - Tachyon: Allow multiple OP_RETURN outputs in a transaction
mentioned in merge request !1117 (merged)
mentioned in issue #256 (closed)
Technical spec: https://github.com/ActorForth/Auction-Protocol/pull/3/files
Reviewed and tested. I have no technical reservations, only a readability nit on the new boolean parameter for
IsStandardTx()
, as I do not find code calling it to be very clear (due to the "what does true/false mean here?" question it always raises for a reader).Might be an idea to use the inline commenting syntax that Calin uses for bool constants as parameter values, this is also explicitly suggested in the LLVM coding guidelines from which our current guidelines (
doc/developer-notes.md
) take their cues.IsStandardTx(CTransaction(txFrom), reason, /* allowMultipleOpReturn */ false); IsStandardTx(CTransaction(txFrom), reason, /* allowMultipleOpReturn */ true);
added 1 commit
- 58ee973d - Tachyon: Allow multiple OP_RETURN outputs in a transaction
removed HODL GANG label
mentioned in commit fc1dae57
mentioned in merge request bitcoinunlimited/BCHUnlimited!2453 (closed)