policy: bump TX_MAX_STANDARD_VERSION to 3 #29496

pull glozow wants to merge 4 commits into bitcoin:master from glozow:2024-02-v3-live changing 12 files +58 −35
  1. glozow commented at 10:19 pm on February 27, 2024: member

    Make nVersion=3 (which is currently nonstandard on mainnet) standard.

    Note that we will treat these transactions as Topologically Restricted Until Confirmation (TRUC). Spec is in BIP 431 and implementation is in #28948, #29306, and #29873

    See #27463 for overall project tracking, and #29319 for information about relevance to cluster mempool.

  2. glozow added the label TX fees and policy on Feb 27, 2024
  3. DrahtBot commented at 10:19 pm on February 27, 2024: contributor

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

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK instagibbs, murchandamus, ismaelsadeeq, sdaftuar, achow101
    Concept ACK hernanmarino

    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:

    • #29325 (consensus: Store transaction nVersion as uint32_t by achow101)
    • #28676 ([WIP] Cluster mempool implementation by sdaftuar)
    • #28132 (policy: Enable full-rbf by default by petertodd)

    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.

  4. glozow renamed this:
    policy: make maximum standard transaction version 3
    policy: bump TX_MAX_STANDARD_VERSION to 3
    on Feb 27, 2024
  5. ariard commented at 2:31 am on March 4, 2024: member

    What is your thinking on #29454 ?

    I would still favor to make the 1000 vb limit dynamic and applying on the whole package, not only the child. Doing with v3 itself would present a) a policy signaling mechanism saving and b) avoid some policy bargains like we had with mempoolfullrbf (between LN-vs-0-confs).

    If you prefer to have the discussion on the v3 BIP PR let me know.

  6. ariard commented at 0:16 am on March 7, 2024: member

    What is your thinking on #29454 ?

    Same as said that for sibling evictions - I’ll go to hack a tx-relay jamming / pinning toolkit, that way we’ll have more information on the robustness of those current proposed anti-pinning mitigations. I still maintain there are very incomplete for time-sensitive transaction flows, especially in face of “loophole” and NTA pinnings. I’m incredibly worried for the security of the Lightning Network if we don’t deploy additional anti-pinning mitigations on top of those ones over the future years - We have not seen yet script kiddies attacking the network.

    Under today inertia, we’ll probably converge towards a centralized network of ~50 LSPs relying on traditional social trust rather than relying on trust-minimized confirmation of pre-signed transactions. This is very problematic if they wish to accept channel traffic from low-resources spokes LN nodes, especially in geographical areas where social trust mechanism cannot be afforded by end-users.

    On #29454, I still prefer to keep experimenting on “transaction-issuer selected policy limits” which might encompass more stringent tx-relay jamming on a minor fork of Bitcoin Core. Coming up with a sound technical proposal in matters of tx-relay policy likely demands few rounds of iterations and realistically we already have a severe shortage of qualified review bandwidth in those areas.

    The initial reason closing of #29448 was my own realization that the introduction of differentiated tx-relay policy among the tx-relay network of nodes will probably generate with time tiers of transaction economic traffic priority (I really cannot see how it worsens memory / CPU DoS robustness per se ?). I don’t think this is a phenomena we can do a lot as a full-node implementation, as we’re seeing with the appearance of transaction accelerators by mining pools. There is transaction issuer demand for such services apparently. Yet we should be careful of doing works in parallel to maintain bip152 block propagation and as such long-term decentralization of the base-layer network.

    I’m not opposing the deployment of TX_MAX_STANDARD_VERSION=3 in Bitcoin Core v28.0.

  7. DrahtBot added the label Needs rebase on Mar 12, 2024
  8. glozow force-pushed on Mar 13, 2024
  9. glozow commented at 12:13 pm on March 13, 2024: member
    Rebased
  10. DrahtBot removed the label Needs rebase on Mar 13, 2024
  11. murchandamus commented at 5:56 pm on March 13, 2024: contributor
    Concept ACK and code changes look simple enough. Given that the proposed rules for V3 transactions entail a voluntary topology restriction by the sender on their own transactions, it seems reasonable to me to merge this into the master branch soon
  12. hernanmarino commented at 10:48 pm on April 12, 2024: contributor
    Concept ACK 7b18f0ed94557a93c69b4f19d85c4fd6fd480464
  13. glozow force-pushed on May 23, 2024
  14. glozow force-pushed on May 23, 2024
  15. glozow commented at 1:55 pm on May 23, 2024: member

    Added constant for #29873 (review) Also added a test that wallet does not signal v3 as it uses the default CURRENT_VERSION (this is correct as it wouldn’t be safe to make transactions v3 before any of the network has adopted this change). I believe the nVersion can be changed via CCoinControl::m_version, though I’m not sure if that is accessible so I didn’t write a test for it.

    Rebased on top of #29873 + master (conflict with #29086)

  16. in src/policy/v3_policy.h:18 in ddd9aaa380 outdated
    14@@ -15,8 +15,9 @@
    15 #include <set>
    16 #include <string>
    17 
    18-// This module enforces rules for transactions with nVersion=3 ("v3 transactions") which help make
    19+// This module enforces rules for transactions BIP 431 TRUC transactions (with nVersion=3) which help make
    


    murchandamus commented at 3:17 pm on May 23, 2024:

    There is either too many or too few words here:

    0// This module enforces rules for BIP 431 TRUC transactions (with nVersion=3) which help make
    

    glozow commented at 4:42 pm on May 23, 2024:
    fixed, thanks
  17. in test/functional/wallet_create_tx.py:128 in e41dae322d outdated
    123+
    124+        # While v3 transactions are standard, the CURRENT_VERSION is 2.
    125+        # This test can be removed if CURRENT_VERSION is changed, and replaced with tests that the
    126+        # wallet handles v3 rules properly.
    127+        assert_equal(tx_current_version.nVersion, 2)
    128+        wallet_v3.unloadwallet()
    


    murchandamus commented at 3:18 pm on May 23, 2024:
    Good idea to add this!
  18. murchandamus commented at 3:19 pm on May 23, 2024: contributor

    Still looks good to me

    crACK e41dae322d435cd8b32daf73883b466f30349584

  19. DrahtBot requested review from hernanmarino on May 23, 2024
  20. glozow force-pushed on May 23, 2024
  21. glozow force-pushed on May 24, 2024
  22. glozow commented at 9:32 am on May 24, 2024: member
    Rebased for #30072
  23. in src/validation.cpp:1020 in 00b2a8dfed outdated
    1016@@ -1017,7 +1017,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
    1017             .descendant_count = maybe_rbf_limits.descendant_count + 1,
    1018             .descendant_size_vbytes = maybe_rbf_limits.descendant_size_vbytes + EXTRA_DESCENDANT_TX_SIZE_LIMIT,
    1019         };
    1020-        if (ws.m_vsize > EXTRA_DESCENDANT_TX_SIZE_LIMIT || ws.m_ptx->nVersion == 3) {
    


    instagibbs commented at 2:47 pm on May 30, 2024:

    few remaining spots that I can see:

    0src/test/fuzz/package_eval.cpp:176:                tx_mut.nVersion = fuzzed_data_provider.ConsumeBool() ? 3 : CTransaction::CURRENT_VERSION;
    1src/test/fuzz/tx_pool.cpp:229:            tx_mut.nVersion = fuzzed_data_provider.ConsumeBool() ? 3 : CTransaction::CURRENT_VERSION;
    2src/test/txvalidation_tests.cpp:289:        mtx_many_sigops.nVersion = 3;
    3src/test/util/txmempool.cpp:121:        if (tx_info.tx->nVersion == 3) {
    4src/test/util/txmempool.cpp:136:                Assert(parents.begin()->get().GetSharedTx()->nVersion == 3);
    5src/test/util/txmempool.cpp:141:                Assert(parent.get().GetSharedTx()->nVersion != 3);
    

    can also use this constant


    glozow commented at 7:00 am on June 2, 2024:
    thanks! fixed these now
  24. [refactor] use TRUC_VERSION in place of 3 052ede75af
  25. [policy] make v3 transactions standard
    Note that, as CURRENT_VERSION = 2, the wallet will not make transactions
    with nVersion=3 yet.
    539404fe0f
  26. [test] wallet uses CURRENT_VERSION which is 2 9dbe6a03f0
  27. glozow force-pushed on Jun 2, 2024
  28. [doc] update bips.md for 431 30a01134cd
  29. instagibbs approved
  30. instagibbs commented at 1:35 pm on June 3, 2024: member
    utACK 30a01134cdec37e7467fcd6eee8b0ae3890a131c
  31. DrahtBot requested review from murchandamus on Jun 3, 2024
  32. in src/policy/v3_policy.h:18 in 052ede75af outdated
    14@@ -15,8 +15,9 @@
    15 #include <set>
    16 #include <string>
    17 
    18-// This module enforces rules for transactions with nVersion=3 ("v3 transactions") which help make
    19+// This module enforces rules for BIP 431 TRUC transactions (with nVersion=3) which help make
    


    ismaelsadeeq commented at 1:45 pm on June 3, 2024:

    nit, I think the mention of TRUC transactions suffices, from the BIP specification we know they have nVersion=3?

    0// This module enforces rules for BIP 431 TRUC transactions which help make
    

    murchandamus commented at 3:24 pm on June 6, 2024:
    The file name could also be renamed to refer to TRUC transactions instead of v3_policy.

    glozow commented at 2:02 pm on June 12, 2024:
    done in #30272
  33. in src/policy/v3_policy.cpp:147 in 052ede75af outdated
    145@@ -146,14 +146,14 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v
    146     } else {
    147         // Non-v3 transactions cannot have v3 parents.
    


    ismaelsadeeq commented at 1:52 pm on June 3, 2024:
    Should we replace all v3 mentions with TRUC for clarity and uniformity. The BIP specification refers to this policy rules as TRUC Transactions.

    glozow commented at 12:09 pm on June 6, 2024:
    Sure, can be in another PR

    glozow commented at 2:02 pm on June 12, 2024:
    done in #30272
  34. ismaelsadeeq commented at 2:30 pm on June 3, 2024: member
    Concept ACK
  35. murchandamus commented at 3:26 pm on June 6, 2024: contributor
    ACK 30a01134cdec37e7467fcd6eee8b0ae3890a131c
  36. DrahtBot requested review from ismaelsadeeq on Jun 6, 2024
  37. ismaelsadeeq approved
  38. ismaelsadeeq commented at 9:03 pm on June 6, 2024: member
    ACK 30a01134cdec37e7467fcd6eee8b0ae3890a131c 🛰️
  39. sdaftuar commented at 2:04 pm on June 7, 2024: member
    utACK 30a01134c
  40. achow101 commented at 4:19 pm on June 7, 2024: member
    ACK 30a01134cdec37e7467fcd6eee8b0ae3890a131c
  41. achow101 merged this on Jun 7, 2024
  42. achow101 closed this on Jun 7, 2024

  43. glozow deleted the branch on Jun 10, 2024
  44. 5twelve approved

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-07-01 10:13 UTC

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