Skip to content

Conversation

theStack
Copy link
Contributor

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).

theStack added 3 commits June 29, 2022 17:28
This assures that changing the internals of the helper function
still leads to the expected outcome sizewise (preparation for the
next commit).
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.
…stead 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.
@fanquake fanquake added the Tests label Jun 29, 2022
@maflcko
Copy link
Member

maflcko commented Jun 29, 2022

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

@theStack
Copy link
Contributor Author

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.

@maflcko
Copy link
Member

maflcko commented Jun 29, 2022

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

@maflcko maflcko merged commit 1ee5978 into bitcoin:master Jun 30, 2022
@theStack theStack deleted the 202206-test-replace_acceptnonstdxn_with_datacarriersize_option branch June 30, 2022 15:10
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 30, 2022
…ing large outputs (instead of `acceptnonstdtxn`)

475aae8 test: pass `datacarriersize` option for tests using large outputs (instead of `acceptnonstdtxn`) (Sebastian Falbesoner)
b1ba3ed test: let `gen_return_txouts` create a single large OP_RETURN output (Sebastian Falbesoner)
f319287 test: assert serialized txouts size of `gen_return_txouts` helper (Sebastian Falbesoner)

Pull request description:

  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](https://github.com/bitcoin/bitcoin/blob/749b80b29e875cc6afa1c2674cccdfd7115cc16a/src/policy/policy.cpp#L149-L153), 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).

Top commit has no ACKs.

Tree-SHA512: c17f032e00d28f5e5880a4d378773fbc8b1995ea9c377f237598d412628fe117f497a44ebdfa8af8cd8a3b1e3127e0cf7692efbf5c833c713764a71a85301f23
@bitcoin bitcoin locked and limited conversation to collaborators Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants