Review report

bitcoin/bitcoin: PR #35570

1 minor finding · 2 suggestions

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

Findings

Link

[minor] · Reorg disconnection replaces the specific flush error

A local flush failure during reorg disconnection now loses its specific reason in RPC errors and activation-failure logs.

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

Details and suggested fix

If DisconnectTip's IF_NEEDED flush must write because the coins cache is critical or pruning requires a flush, a local disk-space or I/O failure returns an Error with a specific reason. This assignment replaces it with a fresh Error containing "Failed to disconnect block." Previously, FatalError(..., state, ...) called state.Error(), which kept an existing Error's reason. ActivateBestChain propagates the replacement to RPC callers and ProcessNewBlock's activation-failure log. Preserve an existing Error while still issuing the fatal notification, assigning the generic Error only when state was valid. The earlier flush notification still reports the root cause and shutdown behavior is unchanged, so the regression is diagnostic. No production occurrence was identified.


Optional improvements

Link

[suggestion] · Stale invariant comment labels normal block rejections as impossible

After the consistency guard is removed, the comment incorrectly describes normal CheckBlock rejections as impossible.

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

Details and suggested fix

The removed if (state.IsValid()) NONFATAL_UNREACHABLE(); was the impossible condition described by this comment. The remaining branch is the ordinary return path for a non-valid CheckBlock result. For example, a fresh getblocktemplate proposal extending the current tip reaches it when its merkle root is wrong, because proposal mode enables merkle-root checking. Delete the two comment lines; validation and rejection reporting stay unchanged.


Link

[suggestion] · Commit ca7af24 describes a C API change absent from the diff

The message claims removal of an int return from btck_chainstate_manager_process_block_header, but that function already returned a validation-state pointer and its public signature is unchanged.

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

Details and suggested fix

The commit message says this function previously returned an int and used a validation-state output parameter. At base, both its declaration and implementation already return btck_BlockValidationState* and take only chainstate_manager and header; bitcoinkernel.h is unchanged. This diff adapts the wrapper's body to ProcessNewBlockHeaders returning a state, drops the internal boolean and consistency assertion, and constructs the returned handle after processing. Reword the commit message to describe that internal refactor, so kernel API users do not infer a public signature change.


Coverage details

Earlier concerns

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