mempool: Add the bypass_{csv,cltv} option to testmempoolaccept #25570

pull w0xlt wants to merge 20 commits into bitcoin:master from w0xlt:bypass-op-1 changing 21 files +338 −135
  1. w0xlt commented at 4:51 am on July 8, 2022: contributor

    This PR adds the the bypass_csv and bypass_cltv options to testmempoolaccept RPC, making it possible to bypass CSV / CLTV execution.

    For more context, check #25434#pullrequestreview-1020896809.

    Since this PR is built on top of #25577, #25434 and #25532, only the last 4 commits are new here.

  2. mempool: change `maxfeerate` to be a members of an `options` argument
    `maxfeerate` becomes a member of an "options" object rather than
    a positional argument.
    
    The idea is that any new parameters in the future will also go into
    options.
    199b3148c0
  3. mempool: make `test_accept` parameter explicit 563dd147df
  4. DrahtBot added the label Mempool on Jul 8, 2022
  5. DrahtBot commented at 9:36 am on July 8, 2022: contributor

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #25577 (mempool, refactor: add MemPoolBypass by w0xlt)
    • #25487 ([kernel 3b/n] Decouple {Dump,Load}Mempool from ArgsManager by dongcarl)
    • #24007 ([mempool] allow tx replacement by smaller witness by LarryRuane)
    • #23897 (refactor: Move calculation logic out from CheckSequenceLocksAtTip() by hebasto)

    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.

  6. bvbfan commented at 2:44 pm on July 8, 2022: contributor

    One small note: multi-line comments are evil. Consider a valid code

    0/*
    1func(/*param*/ p);
    

    comment captures entire function. Consider

    0struct ProcessTxCriteria {
    1    bool test_accept;
    2    std::optional<MempoolTestCriteria> test_criteria;
    3} defaultTxCriterias = {};
    4
    5ProcessTransaction(txr, const ProcessTxCriteria& criterias = defaultTxCriterias);
    
  7. validation: Add `MemPoolBypass` for bypassing mempool checks 9e8703ca5f
  8. mempool: add `MemPoolBypass` parameter to `ProcessNewPackage` 14eff472b3
  9. mempool: add `MemPoolBypass` parameter to `AcceptToMemoryPool` 420a3c4dc0
  10. mempool: add `MemPoolBypass` parameter to `ProcessTransaction` 17db819b72
  11. mempool: add `MemPoolBypass` parameter to `ATMPArgs` 26ee1a47e4
  12. validation: add `m_bypass_{relative,absolute}_timelock` 12ac626430
  13. validation: add option to bypass contextual timelock checks
    This is for test_accepts only, and not allowed in an actual submission
    to mempool - see assert statements.
    
    Provide an option to bypass BIP68 nSequence and nLockTime checks. This
    means clients can use testmempoolaccept to check whether L2 transaction
    chains (which typically have timelock conditions) are valid without
    submitting them. Note that BIP112 and BIP65 are still checked since they
    are script (non-contextual) checks. This does not invalidate any
    signature or script caching.
    
    Co-authored-by: glozow <gloriajzhao@gmail.com>
    b70a926081
  14. rpc: add optional bypass_timelocks for testmempoolaccept
    Co-authored-by: glozow <gloriajzhao@gmail.com>
    afc299806c
  15. test: check if `bypass_{absolute,relative}_timelock` works
    Test the bypass_timelock options in testmempoolaccept. This lets us
    bypass BIP68 relative locktime checks (in nSequence) and absolute
    locktime checks (in nLocktime).
    
    Co-authored-by: glozow <gloriajzhao@gmail.com>
    7ec6416310
  16. test: check if bypass_timelocks do not affect scripts
    OP_CSV and OP_CLTV script checks are still done,
    so setting bypass_timelocks=True doesn't mean that
    bad scripts pass.
    
    Co-authored-by: glozow <gloriajzhao@gmail.com>
    a006b8fd5a
  17. validation: Add `bypass_feerate_accuracy` to `MempoolTestCriteria` 20d049dd2e
  18. validation: Add `bypass_feerate_accuracy` validation logic 4bf7da5895
  19. rpc: add `bypass_feerate_accuracy` option to `testmempoolaccept` RPC 9ec3f3b666
  20. test: add functional tests for `bypass_feerate_accuracy` option 7368c07824
  21. validation: Add `m_bypass_{csv,cltv}` to `MempoolTestCriteria` 643126d894
  22. validation: add logic to bypass CSV/CLTV execution 7b4036ea3c
  23. rpc: add `bypass_{csv,cltv}` params to `testmempoolaccept` RPC cbe36c0b8c
  24. test: add tests for `bypass_cltv` and `bypass_csv` 5fa1770da6
  25. w0xlt force-pushed on Jul 15, 2022
  26. DrahtBot added the label Needs rebase on Jul 18, 2022
  27. DrahtBot commented at 3:52 pm on July 18, 2022: contributor

    🐙 This pull request conflicts with the target branch and needs rebase.

    Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a “draft”.

  28. fanquake commented at 2:24 pm on August 1, 2022: member

    Since this PR is built on top of #25577, #25434 and #25532,

    I’m going to close this for now. I don’t think there is a need to have this PR open yet, when it’s building on multiple other PRs, which themselves still need conceptual review. You can always link to branches with example future changes, from the base PRs.

  29. fanquake closed this on Aug 1, 2022

  30. bitcoin locked this on Aug 1, 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-07-03 10:13 UTC

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