WIP: test: remove usages of MAX_BIP125_RBF_SEQUENCE constant from functional tests #35442

Draft
rkrux wants to merge 13 commits from rbfsequence-test into master AGit
rkrux commented 2026-06-02 13:46:22 +00:00 (Migrated from github.com)

Partially fixes https://github.com/bitcoin/bitcoin/issues/32661.

Depends on https://github.com/bitcoin/bitcoin/pull/35433 from which the
first 11 commits are added here and will be removed when this PR is
undrafted. Only the last 2 commits are specific to this PR.

This is in line with the removal and deprecation of BIP 125 RBF signalling
from the codebase.

Partially fixes https://github.com/bitcoin/bitcoin/issues/32661. Depends on https://github.com/bitcoin/bitcoin/pull/35433 from which the first 11 commits are added here and will be removed when this PR is undrafted. Only the last 2 commits are specific to this PR. This is in line with the removal and deprecation of BIP 125 RBF signalling from the codebase.
DrahtBot commented 2026-06-02 13:46:32 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35543 (test: introduce ExtendedPrivateKey and ExtendedPublicKey classes by rkrux)
  • #35472 (test: add coverage for feebumper uncomputable cluster error path by 151henry151)
  • #35433 (wallet: deprecate replaceable argument from transaction (and psbt) creation (and modification) RPCs by rkrux)
  • #35302 (Silent Payments: Sending (take 2) by Eunovo)
  • #35100 (rpc: Merge joinpsbts locktimes correctly by nervana21)
  • #32468 (rpc: generateblock to allow multiple outputs by polespinasa)
  • #29278 (Wallet: Add maxfeerate wallet startup option by ismaelsadeeq)

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.

LLM Linter (✨ experimental)

Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • walletcreatefundedpsbt(..., False) in test/functional/rpc_psbt.py
  • walletcreatefundedpsbt(..., True) in test/functional/rpc_psbt.py

2026-06-02 13:47:25

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35442 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35442.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35442#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. A summary of reviews will appear here. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35543](https://github.com/bitcoin/bitcoin/pull/35543) (test: introduce ExtendedPrivateKey and ExtendedPublicKey classes by rkrux) * [#35472](https://github.com/bitcoin/bitcoin/pull/35472) (test: add coverage for feebumper uncomputable cluster error path by 151henry151) * [#35433](https://github.com/bitcoin/bitcoin/pull/35433) (wallet: deprecate replaceable argument from transaction (and psbt) creation (and modification) RPCs by rkrux) * [#35302](https://github.com/bitcoin/bitcoin/pull/35302) (Silent Payments: Sending (take 2) by Eunovo) * [#35100](https://github.com/bitcoin/bitcoin/pull/35100) (rpc: Merge joinpsbts locktimes correctly by nervana21) * [#32468](https://github.com/bitcoin/bitcoin/pull/32468) (rpc: generateblock to allow multiple outputs by polespinasa) * [#29278](https://github.com/bitcoin/bitcoin/pull/29278) (Wallet: Add `maxfeerate` wallet startup option by ismaelsadeeq) 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. <!--5faf32d7da4f0f540f40219e4f7537a3--> ### LLM Linter (✨ experimental) Possible places where named args for integral literals may be used (e.g. `func(x, /*named_arg=*/0)` in C++, and `func(x, named_arg=0)` in Python): - `walletcreatefundedpsbt(..., False)` in `test/functional/rpc_psbt.py` - `walletcreatefundedpsbt(..., True)` in `test/functional/rpc_psbt.py` <sup>2026-06-02 13:47:25</sup>
maflcko commented 2026-06-08 11:20:49 +00:00 (Migrated from github.com)

Not sure if a small test-only fixup needs a separate pull request. Can those two commits not just be included in the prior pull?

Also, it seems more important to remove MAX_BIP125_RBF_SEQUENCE from the real source code, so that the risk of pre-existing and future fingerprint vectors in this source code is reduced.

Not sure if a small test-only fixup needs a separate pull request. Can those two commits not just be included in the prior pull? Also, it seems more important to remove `MAX_BIP125_RBF_SEQUENCE` from the real source code, so that the risk of pre-existing and future fingerprint vectors in this source code is reduced.
rkrux commented 2026-06-10 09:45:44 +00:00 (Migrated from github.com)

it seems more important to remove MAX_BIP125_RBF_SEQUENCE from the real source code, so that the risk of pre-existing and future fingerprint vectors in this source code is reduced.

Yes, it is more important but it can't be done cleanly until the feature is removed completely post deprecation.
Whereas it can be done easily in functional tests because all the tests have been updated to not rely on this deprecated feature anymore.

Can those two commits not just be included in the prior pull?

I will look into it.

> it seems more important to remove MAX_BIP125_RBF_SEQUENCE from the real source code, so that the risk of pre-existing and future fingerprint vectors in this source code is reduced. Yes, it is more important but it can't be done cleanly until the feature is removed completely post deprecation. Whereas it can be done easily in functional tests because all the tests have been updated to not rely on this deprecated feature anymore. > Can those two commits not just be included in the prior pull? I will look into it.
rkrux commented 2026-06-10 12:14:50 +00:00 (Migrated from github.com)

I will look into it.

I didn't want to increase the scope of the previous PR, that's why raised this
separate PR here. I have pushed the last two test related commits in #35433
now but might remove them later if I notice they are making the review of that
PR tougher for others.

> I will look into it. I didn't want to increase the scope of the previous PR, that's why raised this separate PR here. I have pushed the last two test related commits in #35433 now but might remove them later if I notice they are making the review of that PR tougher for others.
rkrux commented 2026-06-10 12:24:55 +00:00 (Migrated from github.com)

Actually, no.

The first two commits here are from #35405 due to which these two commits
can't be appended cleanly in #35433. I'll wait on the resolution of #35405.

Actually, no. The first two commits here are from #35405 due to which these two commits can't be appended cleanly in #35433. I'll wait on the resolution of #35405.
pablomartin4btc commented 2026-06-12 19:26:04 +00:00 (Migrated from github.com)

I'll wait on the resolution of #35405.

Perhaps you can add that to the description too ("Depends on https://github.com/bitcoin/bitcoin/pull/35405 - first 2 commits - and #35433 - 9 commits"). Sorry, I'm late to the party and trying to follow the review order from the issue's pending list.

> I'll wait on the resolution of #35405. Perhaps you can add that to the description too ("Depends on https://github.com/bitcoin/bitcoin/pull/35405 - first 2 commits - and #35433 - 9 commits"). Sorry, I'm late to the party and trying to follow the review order from the issue's pending [list](https://github.com/bitcoin/bitcoin/issues/32661#issuecomment-4565515381).
pablomartin4btc (Migrated from github.com) reviewed 2026-06-12 19:49:33 +00:00
pablomartin4btc (Migrated from github.com) commented 2026-06-12 19:49:33 +00:00

I think that needs to be updated according to https://github.com/bitcoin/bitcoin/pull/35405/changes#r3340846939. Just for reference, I know this is still a draft.

I think that needs to be updated according to https://github.com/bitcoin/bitcoin/pull/35405/changes#r3340846939. Just for reference, I know this is still a draft.
DrahtBot commented 2026-06-26 23:00:48 +00:00 (Migrated from github.com)

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

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
DrahtBot commented 2026-09-23 01:20:53 +00:00 (Migrated from github.com)

⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?

  • Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes.
  • Is it no longer relevant? ➡️ Please close.
  • Did the author lose interest or time to work on this? ➡️ Please close it and mark it with one of the labels 'Up for grabs' or 'Insufficient Review', so that it can be picked up in the future.
<!--13523179cfe9479db18ec6c5d236f789--> ⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here? * Is it still relevant? ➡️ Please solve the conflicts to make it ready for review and to ensure the CI passes. * Is it no longer relevant? ➡️ Please close. * Did the author lose interest or time to work on this? ➡️ Please close it and mark it with one of the labels 'Up for grabs' or 'Insufficient Review', so that it can be picked up in the future.
rkrux commented 2026-10-26 13:42:24 +00:00 (Migrated from github.com)
Re https://github.com/bitcoin/bitcoin/pull/35442#issuecomment-5787330791: Waiting on #35433 to get merged and then will see how to progress on this PR.
First-time contributor

Base: dd9d2b919d6a97907417bf9c4f539f182f04cc01
Head: 7e4a0c57fca98407f7cca97886bdab23db6d0e4b

Findings

Major

Default sendall inputs disable locktime activation (src/wallet/rpc/spend.cpp:1452, head)

When sendall selects inputs automatically and the deprecated replaceable override is not enabled, the new default makes rbf false and the automatic-input branch assigns SEQUENCE_FINAL. Final sequences disable nLockTime, so a caller-supplied nonzero locktime is ineffective. The same sequence prevents FinishTransaction from applying anti-fee-sniping; the existing default-path wallet_sendall test expects that behavior. The public sendall RPC is the triggering input path; no external application caller was checked.

Minor

Explicit fee rates override -walletrbf=1 (src/wallet/rpc/spend.cpp:226, head)

With -walletrbf=1, LoadWalletArgs sets wallet.m_signal_rbf to true. If a wallet RPC request supplies fee_rate while its per-request RBF setting is unset, this line engages the coin-control optional as false; CreateTransactionInternal then uses that false value instead of the wallet setting. For example, sendtoaddress calls SetFeeEstimateMode after parsing its replaceable argument. No checked-in caller combining -walletrbf=1 with fee_rate was identified, so production impact is unconfirmed.

Suggestions

Test funded transaction sequences for deprecated replaceable handling (test/functional/wallet_deprecated_rbf.py:59, head)

This case creates an already-RBF transaction, funds it without a replaceable option, then checks raw_tx_hex again rather than the returned funded_tx_hex. The later wallet-result check only confirms that the transaction remains opt-in; it does not verify the funded transaction’s sequence or exercise FundTransaction’s newly gated replaceable handling. Add a case under -deprecatedrpc=bip125 where funding selects wallet inputs and replaceable=true is supplied, then assert the sequence in funded_tx_hex.

Document how to re-enable the deprecated RPC argument (src/rpc/rawtransaction.cpp:120, head)

The changed argument descriptions label replaceable as deprecated but do not tell RPC users that -deprecatedrpc=bip125 restores its behavior. This also affects the wallet RPC descriptions. The developer notes require RPC help to mention the re-enabling flag. Add that guidance and qualify the existing behavior description.

Design and approach

Concept and approach. The test cleanup does not establish that ordinary wallet transactions should change from MAX-2 to MAX-1. Resolve the sequence policy separately from deprecating the RBF control: retain MAX-2 as the default if the reported wallet-developer preference stands, or explain why MAX-1 is preferred. Issue #32661, review discussion, and reported preference

Review coverage was incomplete.

Review limitations
  • adversarial: The inspection limit left the changed sequence-counter consumers in p2p_opportunistic_1p1c.py and later transaction mutations in p2p_segwit.py unchecked.
  • adversarial: Could not verify whether feature_rbf.py enables deprecated RPC behavior before its existing assertions that replaceable=True produces opt-in sequences.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:1e40d4c29146a38cb238a037edaa35c22b13996a5383ed7a85e089a15d569009:c9412d948811529792d161d97aa6951829440e3d548b7c576bb8d4df4183e0d0 --> Base: `dd9d2b919d6a97907417bf9c4f539f182f04cc01` Head: `7e4a0c57fca98407f7cca97886bdab23db6d0e4b` ##### Findings **Major** **Default sendall inputs disable locktime activation** (src/wallet/rpc/spend.cpp:1452, head) When `sendall` selects inputs automatically and the deprecated replaceable override is not enabled, the new default makes `rbf` false and the automatic-input branch assigns `SEQUENCE_FINAL`. Final sequences disable `nLockTime`, so a caller-supplied nonzero locktime is ineffective. The same sequence prevents `FinishTransaction` from applying anti-fee-sniping; the existing default-path `wallet_sendall` test expects that behavior. The public `sendall` RPC is the triggering input path; no external application caller was checked. **Minor** **Explicit fee rates override `-walletrbf=1`** (src/wallet/rpc/spend.cpp:226, head) With `-walletrbf=1`, `LoadWalletArgs` sets `wallet.m_signal_rbf` to true. If a wallet RPC request supplies `fee_rate` while its per-request RBF setting is unset, this line engages the coin-control optional as false; `CreateTransactionInternal` then uses that false value instead of the wallet setting. For example, `sendtoaddress` calls `SetFeeEstimateMode` after parsing its `replaceable` argument. No checked-in caller combining `-walletrbf=1` with `fee_rate` was identified, so production impact is unconfirmed. **Suggestions** **Test funded transaction sequences for deprecated replaceable handling** (test/functional/wallet_deprecated_rbf.py:59, head) This case creates an already-RBF transaction, funds it without a `replaceable` option, then checks `raw_tx_hex` again rather than the returned `funded_tx_hex`. The later wallet-result check only confirms that the transaction remains opt-in; it does not verify the funded transaction’s sequence or exercise `FundTransaction`’s newly gated replaceable handling. Add a case under `-deprecatedrpc=bip125` where funding selects wallet inputs and `replaceable=true` is supplied, then assert the sequence in `funded_tx_hex`. **Document how to re-enable the deprecated RPC argument** (src/rpc/rawtransaction.cpp:120, head) The changed argument descriptions label `replaceable` as deprecated but do not tell RPC users that `-deprecatedrpc=bip125` restores its behavior. This also affects the wallet RPC descriptions. The developer notes require RPC help to mention the re-enabling flag. Add that guidance and qualify the existing behavior description. ##### Design and approach **Concept and approach.** The test cleanup does not establish that ordinary wallet transactions should change from MAX-2 to MAX-1. Resolve the sequence policy separately from deprecating the RBF control: retain MAX-2 as the default if the reported wallet-developer preference stands, or explain why MAX-1 is preferred. [Issue #32661](https://github.com/bitcoin/bitcoin/issues/32661), [review discussion](https://github.com/bitcoin/bitcoin/pull/35405#issuecomment-4678230440), and [reported preference](https://github.com/bitcoin/bitcoin/pull/35405#issuecomment-4705843254) Review coverage was incomplete. <details> <summary>Review limitations</summary> - adversarial: The inspection limit left the changed sequence-counter consumers in p2p_opportunistic_1p1c.py and later transaction mutations in p2p_segwit.py unchecked. - adversarial: Could not verify whether feature_rbf.py enables deprecated RPC behavior before its existing assertions that replaceable=True produces opt-in sequences. </details> [Full review report](<https://review.fish.foo/traces/35442-7e4a0c57fca98407f7cca97886bdab23db6d0e4b-1366-1.html>)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35442
No description provided.