net_processing: always disconnect for SENDTXRCNCL after VERACK #36752

Manually merged
vasild merged 1 commit from sendtxrcncl_after_verack into master 2026-11-06 10:20:56 +00:00 AGit
vasild commented 2026-11-04 09:00:23 +00:00 (Migrated from github.com)

As mandated by BIP 330:

If "sendtxrcncl" was sent after "verack", the sender should be disconnected.

So, always disconnect such a peer, regardless of the value of -txreconciliation. Previously the code would ignore and not disconnect such a peer if -txreconciliation=0.

As mandated by BIP 330: > If "sendtxrcncl" was sent after "verack", the sender should be disconnected. So, always disconnect such a peer, regardless of the value of `-txreconciliation`. Previously the code would ignore and not disconnect such a peer if `-txreconciliation=0`.
DrahtBot commented 2026-11-04 09:00:31 +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.

Type Reviewers
ACK maflcko, w0xlt

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #35502 (refactor: extract per-message helpers from ProcessMessage (move-only) by w0xlt)

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.

<!--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/36752 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36752.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36752#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. | Type | Reviewers | | ---- | --------- | | ACK | [maflcko](https://github.com/bitcoin/bitcoin/pull/36752#issuecomment-6627616139), [w0xlt](https://github.com/bitcoin/bitcoin/pull/36752#pullrequestreview-5794270778) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#35502](https://github.com/bitcoin/bitcoin/pull/35502) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35502.svg"></sub> (refactor: extract per-message helpers from ProcessMessage (move-only) by w0xlt) 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-->
maflcko (Migrated from github.com) approved these changes 2026-11-04 09:12:09 +00:00
maflcko (Migrated from github.com) left a comment

The bip is in draft for ~7 years and this is basically dead code, but it lgtm to be more consistent here

The bip is in draft for ~7 years and this is basically dead code, but it lgtm to be more consistent here
maflcko (Migrated from github.com) commented 2026-11-04 09:10:38 +00:00
            LogDebug(BCLog::NET, "sendtxrcncl from peer=%d ignored, as our node does not have txreconciliation enabled", pfrom.GetId());

nit: Remove to avoid having to touch this line yet again?

```suggestion LogDebug(BCLog::NET, "sendtxrcncl from peer=%d ignored, as our node does not have txreconciliation enabled", pfrom.GetId()); ``` nit: Remove to avoid having to touch this line yet again?
vasild commented 2026-11-04 09:29:37 +00:00 (Migrated from github.com)

a1b6a7b4502218368556e87029be26e6d7212380...87310779af88aec0233c704350df875284d40f34: do https://github.com/bitcoin/bitcoin/pull/36752#discussion_r4465719122

`a1b6a7b4502218368556e87029be26e6d7212380...87310779af88aec0233c704350df875284d40f34`: do https://github.com/bitcoin/bitcoin/pull/36752#discussion_r4465719122
vasild (Migrated from github.com) reviewed 2026-11-04 09:29:57 +00:00
vasild (Migrated from github.com) commented 2026-11-04 09:29:57 +00:00

Done, thanks!

Done, thanks!
First-time contributor

🔵 Suggestion · Functional tests miss the disabled-reconciliation post-VERACK disconnect

The functional tests never send SENDTXRCNCL after VERACK with reconciliation disabled, so they do not protect the behavior added by this PR.

Location: src/net_processing.cpp:4265 (head).

Review coverage was incomplete.


Reviewed: 87310779af88 · Full review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:4d44b6ffa09c54db24f8f0ab27ae388beae06a733efcae741ca64db76bb1c938:7efd3c3ba41667382004cfa7a7db56605da7d8f9b7ab69bc483f27117390ba48 --> <!-- ralph-base:ed3d34ba0c0b28bb281b265eaca62222aae3a796 --> <!-- ralph-head:87310779af88aec0233c704350df875284d40f34 --> <!-- ralph-case:eea5335841f807ba1610fb742f6cccbb03d9ad6780100cfd291e143bffa25e77 --> **🔵 Suggestion · Functional tests miss the disabled-reconciliation post-VERACK disconnect** The functional tests never send SENDTXRCNCL after VERACK with reconciliation disabled, so they do not protect the behavior added by this PR. Location: [`src/net_processing.cpp:4265`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/87310779af88aec0233c704350df875284d40f34/src/net_processing.cpp#L4265>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`87310779af88`](<https://git.fish.foo/bitcoin/bitcoin/commit/87310779af88aec0233c704350df875284d40f34>) · [Full review report](<https://review.fish.foo/traces/36752-87310779af88aec0233c704350df875284d40f34-2110-2.html>) · [Previous reports](<https://review.fish.foo/traces/36752/>) [permalink](<https://review.fish.foo/traces/36752-87310779af88aec0233c704350df875284d40f34-2110-2.html>)
maflcko commented 2026-11-04 09:39:06 +00:00 (Migrated from github.com)

The code is correct before and after this change, but it seems fine to change for negotiation consistency.

I'd say one could even argue that BIP 330 should be changed to adopt the new feature msg type for even more consistency?

review ACK 87310779af 👈

Show signature

Signature:

untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: review ACK 87310779af88aec0233c704350df875284d40f34 👈
15Zc//6VLV5erocf79RGwDZHEp7b2+uxFPV097FvHSe98Sv2eNDduucvp5hYyI2IfZVHsz6qepSwdduRAQ5dDA==
The code is correct before and after this change, but it seems fine to change for negotiation consistency. I'd say one could even argue that BIP 330 should be changed to adopt the new `feature` msg type for even more consistency? review ACK 87310779af88aec0233c704350df875284d40f34 👈 <details><summary>Show signature</summary> Signature: ``` untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= trusted comment: review ACK 87310779af88aec0233c704350df875284d40f34 👈 15Zc//6VLV5erocf79RGwDZHEp7b2+uxFPV097FvHSe98Sv2eNDduucvp5hYyI2IfZVHsz6qepSwdduRAQ5dDA== ``` </details>
w0xlt (Migrated from github.com) reviewed 2026-11-06 00:53:43 +00:00
w0xlt (Migrated from github.com) left a comment
ACK 87310779af88aec0233c704350df875284d40f34
sedited commented 2026-11-06 10:15:33 +00:00 (Migrated from github.com)

Seems fine to me, but would also prefer feature negotiation to actually be done consistently in the future.

Seems fine to me, but would also prefer feature negotiation to actually be done consistently in the future.
sr-gi commented 2026-11-13 12:05:08 +00:00 (Migrated from github.com)

Given BIP-330 is draft, as pointed out by @maflcko, I think it'd be worth updating it to use BIP-434 and get rid of the custom negotiation, now that we have a standardized way of doing so.

This can also enable us to move some parts of Erlay as optional and agreed on during feature negotiation, such as extensions.

Given BIP-330 is draft, as pointed out by @maflcko, I think it'd be worth updating it to use BIP-434 and get rid of the custom negotiation, now that we have a standardized way of doing so. This can also enable us to move some parts of Erlay as optional and agreed on during feature negotiation, such as extensions.
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!36752
No description provided.