Review report

bitcoin/bitcoin: PR #36033

1 major finding · 2 minor findings · 3 suggestions

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

Findings

Link

[major] · Two CI jobs retain incompatible compiler pins

The pinned GCC 12 and Clang/libc++ 17 toolchains cannot compile the new constructs, preventing two active CI configurations from reaching their tests.

Location: CMakeLists.txt:84 (head).

Details and suggested fix

00_setup_env_native_previous_releases.sh still selects gcc-12/g++-12, and 00_setup_env_native_nowallet.sh selects clang++-17 -stdlib=libc++. Depends forwards these selections into the main build. GCC 12 rejects the new non-dependent static_assert(false) in logging/timer.h, and libstdc++ 12 lacks std::views::zip; both jobs enable the kernel library through dev-mode. Clang 17 lacks deduction through alias templates, so constructions such as util::Unexpected{...} now fail in code built even without the wallet, including util/bip32.cpp and common/bip352.cpp. Update the compiler packages, DEP_OPTS, and minimum-supported comments to GCC 13 and Clang 19 with libc++ 19. Preserve the previous-releases job's Python 3.10 coverage when provisioning its newer compiler.


Link

[minor] · Documented compiler minimums still list GCC 12.1 and Clang 17

Builders selecting the documented compiler minimums encounter compile errors because the C++23 bump leaves the dependency table and macOS cross-build requirements stale.

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

Details and suggested fix

doc/dependencies.md still advertises GCC 12.1 and Clang 17.0, while depends/README.md says Clang 18 suffices for macOS cross-builds. GCC 12 rejects the new static_assert(false) pattern, and Clang 17 and 18 lack deduction through the util::Unexpected alias. Both the Unix build instructions and the configure-time feature diagnostic refer users to the stale table. The standard library also needs a separate requirement: kernel builds use std::views::zip, which libstdc++ 12 lacks even with Clang 19. Update the table and cross-build note to GCC 13 and Clang 19, document the libstdc++ 13 minimum for kernel builds, and include the concrete compiler versions in this release note.


Link

[minor] · C++23 bypasses libmultiprocess's Cap'n Proto compatibility check

In C++23 mode, bundled IPC builds can reach incompatible Cap'n Proto headers instead of receiving the existing configure diagnostic and remedies.

Location: CMakeLists.txt:84 (head).

Details and suggested fix

With bundled IPC enabled, libmultiprocess inherits CMAKE_CXX_STANDARD=23; it sets 20 only for standalone builds. Its Cap'n Proto 0.9.x/0.10.x and Clang 16+ compatibility guard requires CMAKE_CXX_STANDARD EQUAL 20, so it now skips the check. The P2468R2 change to reversed operator== candidates also applies in C++23, so the incompatibility described in https://github.com/bitcoin-core/libmultiprocess/issues/199 remains. The separate CVE guard still rejects unpatched releases, but patched 0.9.2 and 0.10.3 can proceed to header compilation errors without the diagnostic suggesting an upgrade, GCC, or -DENABLE_IPC=OFF. IPC defaults to enabled outside Windows. Change the upstream condition to GREATER_EQUAL 20, update the message to say “C++20 or later”, and import that fix with this bump.


Optional improvements

Link

[suggestion] · Configure does not check the newly required C++23 features

A C++23 mode flag and aggregate-CTAD probe do not detect the new language and library requirements, so incompatible toolchains can fail only during compilation.

Location: CMakeLists.txt:84 (head).

Details and suggested fix

CMAKE_CXX_STANDARD_REQUIRED requests a supported language mode, not implementation of every feature used by the tree. The only current feature probe checks aggregate CTAD, so it does not catch GCC 12's rejection of the new static_assert(false) pattern, Clang 17's lack of deduction through util::Unexpected, or libstdc++ 12's missing std::views::zip. Add small check_cxx_source_compiles probes for these requirements to check_cxx_features(), using its existing fatal-error pattern and compiler-documentation link. Gate the zip probe on actually building the kernel library. This would identify unsuitable compiler/library combinations at configure time rather than leaving users to diagnose later source errors.


Link

[suggestion] · The std::expected alias removes guaranteed access checks

Without library assertions, wrong-state *, ->, or error() accesses now have undefined behaviour instead of aborting; no current caller producing such an access was found.

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

Details and suggested fix

Previously, error() checked its state with Assert, while the noexcept dereference operators called the throwing value(), guaranteeing an abort or std::terminate on misuse. std::expected instead makes these accesses preconditions. The repository does not explicitly enable standard-library hardening for release builds, so detection now depends on library defaults; value() remains a checked, throwing accessor. Retaining the util::Expected name conceals this loss of defensive behaviour from future callers. Keep a thin wrapper around std::expected that asserts the required state before forwarding operator*, operator->, and error(), preserving the previous guarantee without retaining the custom storage implementation.


Link

[suggestion] · Kernel import tests do not require supplied files to be read

Dropping supplied paths, or converting them to nonexistent filenames, would leave the current kernel import assertions passing.

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

Details and suggested fix

chainman_reindex_chainstate_test is the only kernel test that passes a nonempty path list. It reuses the directory populated by validation and reindexing, wipes only chainstate, and checks only the boolean returned by ImportBlocks. An unopenable filename merely produces a warning in node::ImportBlocks, after which ActivateBestChains can rebuild from the existing block index. The C API returns zero when nothing throws, which the wrapper treats as success. Consequently, those assertions do not require the rewritten path/length conversion to supply a usable filename. Add a test using a fresh manager with an empty block index, import an external block-file fixture containing blocks it has not seen, and assert 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.