test: pass `datacarriersize` option for tests using large outputs (instead of `acceptnonstdtxn`) #25503

pull theStack wants to merge 3 commits into bitcoin:master from theStack:202206-test-replace_acceptnonstdxn_with_datacarriersize_option changing 4 files +8 −17
  1. theStack commented at 4:14 PM on June 29, 2022: member

    By specifying the datacarriersize option instead of the more generic acceptnonstdtxn for functional tests, we can be more specific about what part of the transaction is non-standard and can be sure that all other aspects follow the standard policy. Transactions with more than one OP_RETURN output are never considered standard, i.e. we have to change the gen_return_txouts helper to create only a single output in order to get rid of the acceptnonstdxtn option. Note that on master there is currently no test using the datacarriersize parameter, so this PR indirectly also increases the test coverage.

    The change affects the tests mempool_limit.py, mining_prioritisetransaction.py (call gen_return_txouts directly) and feature_maxuploadtarget.py (calls gen_return_txouts indirectly via the mine_large_block(...) helper).

  2. test: assert serialized txouts size of `gen_return_txouts` helper
    This assures that changing the internals of the helper function
    still leads to the expected outcome sizewise (preparation for the
    next commit).
    f319287d81
  3. test: let `gen_return_txouts` create a single large OP_RETURN output
    Transactions with more than one datacarrier (OP_RETURN) output
    are never considered standard, i.e. this change is necessary in
    order to to get rid of the `acceptnonstdtxn` option for some
    tests.
    b1ba3ed155
  4. test: pass `datacarriersize` option for tests using large outputs (instead of `acceptnonstdtxn`)
    By specifying the `datacarriersize` option instead of the more
    generic `acceptnonstdtxn`, we can be more specific about what
    part of the transaction is non-standard and can be sure that all
    other aspects follow the standard policy.
    475aae846e
  5. fanquake added the label Tests on Jun 29, 2022
  6. MarcoFalke commented at 4:27 PM on June 29, 2022: member

    Would it work to use witness programs of length 40 and then add a separate test fro datacarriersize?

  7. MarcoFalke approved
  8. theStack commented at 4:46 PM on June 29, 2022: member

    Would it work to use witness programs of length 40 and then add a separate test fro datacarriersize?

    Interesting idea, didn't even consider that. I think that would work, the only drawback is possibly that tests could slow down due to the quite high number of outputs (>1400 for reaching the same txouts serialized size in gen_return_txouts (vs. 128 on master and 1 on this PR), almost 20k outputs in a block generated by mine_large_block) and the need to add them all to the UTXO set. Will try out the next days if that's a viable way.

  9. MarcoFalke commented at 6:58 PM on June 29, 2022: member

    yeah, your way might actually be preferable or at least a good first step.

  10. MarcoFalke merged this on Jun 30, 2022
  11. MarcoFalke closed this on Jun 30, 2022

  12. theStack deleted the branch on Jun 30, 2022
  13. sidhujag referenced this in commit 7f6df24925 on Jun 30, 2022
  14. DrahtBot locked this on Jun 30, 2023
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me