Review report

bitcoin/bitcoin: PR #36033

1 major finding · 2 minor findings · 2 suggestions

Earlier concerns neither republished nor resolved: 1 major finding · 1 suggestion. See the Run archive for their assessments.

Findings

Link

[major] · Previous-releases CI still selects an incompatible GCC 12 toolchain

The pinned GCC 12 toolchain cannot compile the new timer assertion or kernel zip loop, preventing the current-source build from reaching the previous-release compatibility tests.

Location: src/logging/timer.h:76 (head).

Details and suggested fix

ci/test/00_setup_env_native_previous_releases.sh still installs GCC 12 and passes CC=gcc-12 CXX=g++-12 through depends into the main build. GCC 12 rejects the non-dependent static_assert(false) when parsing Timer, even when the eventual TimeType selects another branch; deferred evaluation first appeared in GCC 13. Ordinary node sources such as validation.cpp include this header. The job's dev-mode preset also enables the kernel library, whose new std::views::zip loop requires libstdc++ 13. Move this job to GCC 13 or newer while retaining its Python 3.10 coverage.


Link

[minor] · GCC 12 remains documented and passes the compiler feature check

Users following the documented GCC 12.1 minimum can pass the compiler feature check and then fail during compilation of code that now needs GCC 13.

Location: doc/release-notes-36033.md:4 (head).

Details and suggested fix

doc/build-unix.md directs older-distribution users to the compiler table, which still lists GCC 12.1, while this release note only names the language standard. GCC 12 accepts -std=c++23 and passes the sole alias-template CTAD probe, but rejects the new non-dependent assertion in logging/timer.h. The optional kernel library also needs libstdc++ 13 for std::views::zip, including when Clang uses libstdc++. Raise the documented GCC minimum to 13 and name the concrete compiler minimums in the release note, with Clang remaining at 19. Add a deferred-static-assert probe to check_cxx_features() so an unsupported compiler receives an early diagnostic pointing to the corrected table.


Link

[minor] · The C++23 bump disables the old Cap'n Proto/Clang diagnostic

Embedded Clang IPC builds with patched Cap'n Proto 0.9.2 or 0.10.3 now skip the targeted configure error for this already unsupported dependency combination.

Location: CMakeLists.txt:84 (head).

Details and suggested fix

With in-tree IPC enabled, which is the default outside Windows, libmultiprocess inherits CMAKE_CXX_STANDARD=23; its assignment to 20 applies only to standalone builds. The compatibility check requires CMAKE_CXX_STANDARD EQUAL 20, so it no longer runs. C++23 retains the reversed operator== rules behind the incompatibility documented in libmultiprocess#199, and the separate CVE check does not reject patched versions 0.9.2 or 0.10.3. These configurations therefore lose the early error explaining how to upgrade Cap'n Proto, switch to GCC, or disable IPC, leaving compilation to diagnose the incompatibility. Change the upstream condition to GREATER_EQUAL 20, update the message to say “C++20 or later”, and bring that change into the subtree with this bump.


Optional improvements

Link

[suggestion] · The std::expected alias removes always-on state checks

Without library hardening, wrong-state *, ->, or error() access now has undefined behaviour rather than terminating; no current caller triggering this was found.

Location: src/util/expected.h:14 (head).

Details and suggested fix

The previous error() used always-on Assert, while the noexcept dereference and arrow operators called throwing value(), so wrong-state access terminated. std::expected instead gives these accessors state preconditions, as std::optional already does for dereference. Library checks enabled in selected debug/fuzz configurations do not retain the previous guarantee across builds. value() still throws, but its copyability requirement on the error type prevents using it as a general substitute. Keep a thin wrapper over std::expected that checks the state with Assert before forwarding these accessors to preserve the existing hardening.


Link

[suggestion] · Kernel import tests do not verify consumption of supplied files

Dropping supplied paths, or constructing an unopenable filename, would leave the existing kernel import assertions passing.

Location: src/kernel/bitcoinkernel.cpp:1373 (head).

Details and suggested fix

chainman_reindex_chainstate_test is the only kernel test supplying a non-empty path list. It follows validation and reindexing of the height-1 mainnet fixture in the same directory, preserves the block index, wipes only chainstate, and checks only the boolean import result. An empty path list still reaches ActivateBestChains, and an unopenable filename only produces a warning; the C API returns success unless an exception occurs. The existing index lets the manager reconnect those blocks without consuming the supplied file, so merely adding a tip assertion to this fixture would not establish coverage. Add a test with a fresh manager and empty block index that imports an external blk*.dat fixture containing unseen blocks, then asserts the resulting tip height and hash.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.