Review report

core: PR #35570

1 minor finding · 1 suggestion

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

Findings

Link

[minor] · Fatal errors overwrite the original block-validation reason

For locally corrupted on-disk blocks or local I/O failures, the node loses diagnostic detail before aborting; this does not enable peer-triggered behavior.

Location: src/validation.cpp:2323 (head).

Details and suggested fix

When CheckBlock finds BLOCK_MUTATED in a block read from disk, assigning a fresh fatal-error state replaces the existing result and reason. The BlockChecked callback and ConnectTip log therefore report the generic hardware-failure message rather than the specific merkle-check failure. The early return also skips the Consensus::CheckBlock log. At the DisconnectTip failure site, the same assignment replaces the existing flush error with “Failed to disconnect block,” although the flush notification still logs its cause. These paths require local on-disk corruption or a local I/O failure; received blocks pass CheckBlock before storage, and the node aborts in both versions. Preserve the existing state when recording the fatal notification: call fatalError(msg) and then state.Error(msg.original).


Optional improvements

Link

[suggestion] · Commit message inaccurately describes a kernel C API change

The history suggests the public function signature changed, although the code and public C API are unaffected.

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

Details and suggested fix

Commit 4f95dced says btck_chainstate_manager_process_block_header no longer returns a redundant int alongside an output validation-state parameter. The function already returned btck_BlockValidationState* and accepted only the chainstate manager and header. This change forwards the state returned by ProcessNewBlockHeaders and removes an internal assertion; it does not change the public signature. Reword the commit message to describe this body-only change.


Coverage details

Earlier concerns

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