Skip to content

Conversation

w0xlt
Copy link
Contributor

@w0xlt w0xlt commented Jul 8, 2022

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

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

w0xlt added 2 commits July 1, 2022 15:48
`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.
@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 8, 2022

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.

@bvbfan
Copy link
Contributor

bvbfan commented Jul 8, 2022

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

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

comment captures entire function.
Consider

struct ProcessTxCriteria {
    bool test_accept;
    std::optional<MempoolTestCriteria> test_criteria;
} defaultTxCriterias = {};

ProcessTransaction(txr, const ProcessTxCriteria& criterias = defaultTxCriterias);

w0xlt and others added 10 commits July 9, 2022 20:38
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>
Co-authored-by: glozow <gloriajzhao@gmail.com>
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>
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>
@w0xlt
Copy link
Contributor Author

w0xlt commented Jul 15, 2022

Rebased on top of 972674c.

@bvbfan Good suggestion. A similar struct was implemented in 9e8703c

@DrahtBot
Copy link
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".

@fanquake
Copy link
Member

fanquake commented Aug 1, 2022

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.

@fanquake fanquake closed this Aug 1, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants