Review report

core: PR #36326

Design and approach

The C fatal-error callback drops per-error context (src/kernel/bitcoinkernel.h:412, head)

The callback now carries only a btck_FatalError code, and cast_btck_fatal_error() maps the C++ variant to that code while discarding its fields. For example, C callers cannot obtain the block hash from AssumeutxoDataNotFound or tell whether SnapshotValidationFailed includes a failed directory rename and recovery paths. The old callback supplied a formatted message with that context, limiting C consumers' ability to provide equivalent diagnostics or recovery guidance. Is category-only reporting intentionally the complete C API contract? If C consumers should be able to produce similarly actionable reports, expose the relevant fields through a C-compatible tagged payload with defined string and path ownership and encoding. Otherwise, accept and document the reduced diagnostic detail.

🟡 Minor

Error codes are streamed as characters (src/bitcoin-chainstate.cpp:135, head)

FlushError and the btck::FatalError used by this handler have uint8_t underlying types. Streaming the cast value therefore selects character output on supported platforms, so an error code such as zero prints as a NUL instead of a readable number. FatalErrorHandler at line 140 has the same issue. Cast the value to a numeric type such as unsigned int before streaming.