Skip to content

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:

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