[31.x] Finalise 31.2 #36661

Manually merged
fanquake merged 8 commits from finalise_31_2 into 31.x 2026-10-26 19:35:56 +00:00 AGit
fanquake commented 2026-10-26 12:52:09 +00:00 (Migrated from github.com)

Backports:

Backports: * #36665 * #36667 * #36669
DrahtBot commented 2026-10-26 12:52:24 +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 instagibbs, l0rinc, sedited

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

<!--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/36661 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36661.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36661#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 | [instagibbs](https://github.com/bitcoin/bitcoin/pull/36661#issuecomment-6423493232), [l0rinc](https://github.com/bitcoin/bitcoin/pull/36661#pullrequestreview-5656664673), [sedited](https://github.com/bitcoin/bitcoin/pull/36661#pullrequestreview-5657500564) | 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. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

Base: f2fe67f586d1aa59ac87b2865e6785809c3d8890
Head: de4a5e34b1a421a4c78873ae657b27d7ab835293

Findings

Minor

Select misses error events for send-only sockets (src/util/sock.cpp:217, head)

In the select backend, the exception set is populated only when RECV is requested. A send-only request therefore cannot produce Sock::ERR, unlike the previous implementation and the poll backend, which maps POLLERR and POLLHUP unconditionally. Preserve exception monitoring for sockets with requested I/O. No current caller producing a send-only request was independently confirmed, so production reachability remains unconfirmed.

Suggestions

Add regression coverage for the paused-send timeout (src/net.cpp:2064, head)

This adds a disconnect condition based on how long fPauseSend remains set, but the inspected timeout tests cover handshake and ping timeouts, not the paused-send timer or its reset behavior. Add focused coverage to verify that a sustained pause times out despite recent activity, draining and pausing again starts a fresh interval, and enqueues during one continuous pause do not restart the timer. Mock time can avoid waiting 20 minutes.

Test flat-file positions beyond existing width limits (src/flatfile.cpp:48, head)

The changed seek path is intended to handle positions beyond the old positioning limits, but the inspected flat-file tests use short strings and allocations of at most 200 bytes. Add a boundary test that seeks above INT32_MAX and checks the resulting AutoFile position, plus a FlatFilePos serialization round trip above UINT32_MAX. Seeking beyond EOF can test positioning without writing a multi-gigabyte file.

Design and approach

Complete or constrain 64-bit positioning on 32-bit POSIX (src/util/fs_helpers.h:59, head)

On the supported 32-bit Linux build, the non-Windows branches still use std::fseek and std::ftell, whose long offset and result types remain 32-bit; _FILE_OFFSET_BITS=64 widens off_t, not long. A FlatFilePos above LONG_MAX therefore cannot be reliably sought or reported through these wrappers. If 64-bit positioning is intended across supported platforms, use fseeko and ftello with 64-bit off_t; otherwise, document or constrain the platform guarantee. The checked block-file producer is capped at 128 MiB, so production impact above that range is unconfirmed.

Review coverage was incomplete.

Review limitations
  • verifier: The linked discussions for backports #36665, #36667, and #36669 were not independently verified; the concept assessment relies on the supplied commit descriptions and checkout.
  • verifier: A current production caller producing a SEND-only socket interest was not independently confirmed, so reachability of the socket behavior change is unconfirmed.
  • verifier: No current caller using a position above LONG_MAX on 32-bit POSIX was established; the existing block-file path is capped at 128 MiB.

Full review report

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:61069f0ded2b37aeee28d0416237ff18ab62386bb6fcdafc637bca25f525aaef:86b9a0e22bd2eb7ab1b7eb621b9854197174a699ec1bc40495f2801bb5137d33 --> Base: `f2fe67f586d1aa59ac87b2865e6785809c3d8890` Head: `de4a5e34b1a421a4c78873ae657b27d7ab835293` ##### Findings **Minor** **Select misses error events for send-only sockets** (src/util/sock.cpp:217, head) In the `select` backend, the exception set is populated only when `RECV` is requested. A send-only request therefore cannot produce `Sock::ERR`, unlike the previous implementation and the poll backend, which maps `POLLERR` and `POLLHUP` unconditionally. Preserve exception monitoring for sockets with requested I/O. No current caller producing a send-only request was independently confirmed, so production reachability remains unconfirmed. **Suggestions** **Add regression coverage for the paused-send timeout** (src/net.cpp:2064, head) This adds a disconnect condition based on how long `fPauseSend` remains set, but the inspected timeout tests cover handshake and ping timeouts, not the paused-send timer or its reset behavior. Add focused coverage to verify that a sustained pause times out despite recent activity, draining and pausing again starts a fresh interval, and enqueues during one continuous pause do not restart the timer. Mock time can avoid waiting 20 minutes. **Test flat-file positions beyond existing width limits** (src/flatfile.cpp:48, head) The changed seek path is intended to handle positions beyond the old positioning limits, but the inspected flat-file tests use short strings and allocations of at most 200 bytes. Add a boundary test that seeks above `INT32_MAX` and checks the resulting `AutoFile` position, plus a `FlatFilePos` serialization round trip above `UINT32_MAX`. Seeking beyond EOF can test positioning without writing a multi-gigabyte file. ##### Design and approach **Complete or constrain 64-bit positioning on 32-bit POSIX** (src/util/fs_helpers.h:59, head) On the supported 32-bit Linux build, the non-Windows branches still use `std::fseek` and `std::ftell`, whose `long` offset and result types remain 32-bit; `_FILE_OFFSET_BITS=64` widens `off_t`, not `long`. A `FlatFilePos` above `LONG_MAX` therefore cannot be reliably sought or reported through these wrappers. If 64-bit positioning is intended across supported platforms, use `fseeko` and `ftello` with 64-bit `off_t`; otherwise, document or constrain the platform guarantee. The checked block-file producer is capped at 128 MiB, so production impact above that range is unconfirmed. Review coverage was incomplete. <details> <summary>Review limitations</summary> - verifier: The linked discussions for backports #36665, #36667, and #36669 were not independently verified; the concept assessment relies on the supplied commit descriptions and checkout. - verifier: A current production caller producing a SEND-only socket interest was not independently confirmed, so reachability of the socket behavior change is unconfirmed. - verifier: No current caller using a position above LONG_MAX on 32-bit POSIX was established; the existing block-file path is capped at 128 MiB. </details> [Full review report](<https://review.fish.foo/traces/36661-de4a5e34b1a421a4c78873ae657b27d7ab835293-1391-5.html>)
instagibbs commented 2026-10-26 17:57:47 +00:00 (Migrated from github.com)
ACK https://github.com/bitcoin/bitcoin/pull/36661/commits/de4a5e34b1a421a4c78873ae657b27d7ab835293
l0rinc (Migrated from github.com) approved these changes 2026-10-26 17:59:19 +00:00
l0rinc (Migrated from github.com) left a comment

ACK de4a5e34b1

Reviewed all four cherry-picks manually and checked the remaining commits automatically. The differences from upstream are the older socket event names, clock and logging APIs, and keeping the existing rounding arithmetic.

ACK de4a5e34b1a421a4c78873ae657b27d7ab835293 Reviewed all four cherry-picks manually and checked the remaining commits automatically. The differences from upstream are the older socket event names, clock and logging APIs, and keeping the existing rounding arithmetic.
sedited (Migrated from github.com) approved these changes 2026-10-26 19:03:08 +00:00
sedited (Migrated from github.com) left a comment

Reproduced and tested ACK de4a5e34b1

Reproduced and tested ACK de4a5e34b1a421a4c78873ae657b27d7ab835293
Sjors commented 2026-10-27 11:37:34 +00:00 (Migrated from github.com)
ACK de4a5e34b1a421a4c78873ae657b27d7ab835293
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!36661
No description provided.