doc: Clarify -datacarriersize, add -datacarriersize=2 tests #27832

pull maflcko wants to merge 2 commits into bitcoin:master from maflcko:2306-test-dc-2- changing 2 files +31 −5
  1. maflcko commented at 11:52 am on June 6, 2023: member

    Clarify with a test that -datacarriersize applies to the serialized size of the scriptPubKey, not the size of the pushed data. So for example,

    • -datacarriersize=2 will reject a raw(6a01aa), even though only one byte is pushed
    • -datacarriersize=0 (or -datacarrier=0) will reject a raw(6a), even though no byte is pushed
    • -datacarriersize=0 (or -datacarrier=0) will reject a raw(6a00), even though zero bytes are pushed
  2. DrahtBot commented at 11:52 am on June 6, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ajtowns, instagibbs

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #28130 (Remove arbitrary restrictions on OP_RETURN by default by petertodd)
    • #26525 (Remove -mempoolfullrbf option by BitcoinErrorLog)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Tests on Jun 6, 2023
  4. maflcko force-pushed on Jun 6, 2023
  5. DrahtBot added the label CI failed on Jun 6, 2023
  6. DrahtBot removed the label CI failed on Jun 6, 2023
  7. DrahtBot added the label CI failed on Jun 6, 2023
  8. DrahtBot removed the label CI failed on Jun 6, 2023
  9. maflcko renamed this:
    test: Add -datacarriersize=2 tests
    doc: Clarify -datacarriersize, add -datacarriersize=2 tests
    on Jun 6, 2023
  10. maflcko removed the label Tests on Jun 6, 2023
  11. DrahtBot added the label Docs on Jun 6, 2023
  12. DrahtBot added the label CI failed on Jun 6, 2023
  13. ajtowns commented at 9:02 pm on June 6, 2023: contributor
    Concept ACK
  14. glozow added the label Good First Review on Jun 7, 2023
  15. in src/init.cpp:595 in a33333525f outdated
    587@@ -588,7 +588,11 @@ void SetupServerArgs(ArgsManager& argsman)
    588     argsman.AddArg("-dustrelayfee=<amt>", strprintf("Fee rate (in %s/kvB) used to define dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::NODE_RELAY);
    589     argsman.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
    590     argsman.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
    591-    argsman.AddArg("-datacarriersize", strprintf("Maximum size of data in data carrier transactions we relay and mine (default: %u)", MAX_OP_RETURN_RELAY), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
    592+    argsman.AddArg("-datacarriersize",
    593+                   strprintf("Relay and mine transactions whose data-carrying raw scriptPubKey "
    594+                             "is of this size or less (default: %u)",
    595+                             MAX_OP_RETURN_RELAY),
    596+                   ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
    


    petertodd commented at 12:17 pm on June 7, 2023:

    NACK This wording is misleading. OP_Return outputs only contain data if they contain something in addition to the OP_Return opcode.

    A better approach here if we are touching this opcode could be to redefine -datacarriersize to be size in-addition-too the OP_Return opcode that is allowed. Thus -datacarriersize=0 would allow 0 bytes in addition to the 1 byte used by the OP_Return opcode.


    maflcko commented at 12:23 pm on June 7, 2023:
    My goal is to document the current behavior and then behavior changes can be done in a follow-up change. Happy to drop this commit or change to a better wording to describe the current behavior, if you have any suggestions.

    petertodd commented at 12:35 pm on June 7, 2023:

    Since you are updating this, you should change the doc text to make clear that the current behavior is a mistake that needs fixing rathre than continue to incorrectly call them data carrier scriptPubKey’s.

    But it’d be less code churn to just fix the behavior in one shot. We have an ACK on #27261, so there is an argument to fix the bare OP_Return case. Rather than merging #27261 as-is I could make a pull-req that simply fixes the -datacarriersize off-by-one error. Fixing that error would also allow -datacarrier to be dropped entirely, as it is redundant: -datacarriersize=0 prohibits data carrying outputs just fine.


    maflcko commented at 12:40 pm on June 7, 2023:

    Fixing that error would also allow -datacarrier to be dropped entirely, as it is redundant: -datacarriersize=0 prohibits data carrying outputs just fine.

    I think -datacarrier can be dropped regardless of whether the behavior is changed. And this would have been my review comment in #27261 :)

  16. petertodd changes_requested
  17. test: Add -datacarriersize=2 tests 55550e7fe7
  18. doc: Clarify that -datacarriersize applies to the full raw scriptPubKey, not the data push faafc35a77
  19. maflcko force-pushed on Jun 8, 2023
  20. DrahtBot removed the label CI failed on Jun 8, 2023
  21. maflcko commented at 7:51 am on June 9, 2023: member
    Rebased for green CI
  22. fanquake requested review from instagibbs on Jun 12, 2023
  23. DrahtBot requested review from ajtowns on Jun 22, 2023
  24. ajtowns commented at 6:06 am on June 23, 2023: contributor
    ACK faafc35a779745d59fdb0e88698b579215f42b08
  25. DrahtBot removed review request from ajtowns on Jun 23, 2023
  26. maflcko removed review request from instagibbs on Aug 3, 2023
  27. maflcko requested review from instagibbs on Aug 3, 2023
  28. DrahtBot removed review request from instagibbs on Aug 3, 2023
  29. fanquake merged this on Aug 3, 2023
  30. fanquake closed this on Aug 3, 2023

  31. maflcko deleted the branch on Aug 4, 2023
  32. sidhujag referenced this in commit fa525e549f on Aug 9, 2023

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: 2024-11-21 21:12 UTC

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