3 minor findings · 5 suggestions
Earlier concerns neither republished nor resolved: 2 minor findings · 2 suggestions. See the Run archive for their assessments.
Findings
[minor] · New startup aborts omit the previous rebuild guidance
Startup point-read failures that previously reached initialization recovery handling now abort with generic text, losing both the GUI rebuild offer and the -reindex/-reindex-chainstate instructions.
Location: src/dbwrapper.cpp:369 (head).
Details and suggested fix
FatalReadError() logs the database path but sends users only “Error reading from database, shutting down.” before aborting. This includes the constructor's obfuscation-key read. Previously, eligible startup LevelDB failures reached initialization's rebuild question or restart instructions. Keep the fail-stop behavior, but include the affected database and an owner-appropriate recovery hint in the fatal notification, and document the replacement recovery procedure in the release note. This concerns the newly fatal startup paths; runtime coin-read failures already used a generic abort message.
[minor] · The release note overstates fatal handling for compact txindex lookups
The release note promises fatal optional-index lookup errors, but compact txindex iterator failures can still appear as missing transactions; this behavior is pre-existing, and no production occurrence was identified.
Location: doc/release-notes-34132.md:8 (head).
Details and suggested fix
If a confirmed transaction's only indexed positions lie in a checksum-failing table data block, LevelDB's iterator can skip that block and retain the failure only in status(). CDBIterator never checks that status, so FindTx() can return std::nullopt when no surviving compact or legacy entry matches. The RPC then reports a missing transaction and REST returns HTTP 404 without aborting. Limit the release-note guarantee to point reads and explicitly state that iterator-based lookup behavior remains unchanged.
[minor] · Scratch-database read faults in dumptxoutset now bypass cleanup
A local read fault during disk-backed dumptxoutset rollback now aborts the node and bypasses temporary-database cleanup instead of failing only the RPC; no production occurrence was identified.
Location: src/rpc/blockchain.cpp:3259 (head).
Details and suggested fix
CreateRolledBackUTXOSnapshot() copies the UTXO set into a temporary database and reads it through rollback_cache during DisconnectBlock(). At base, a failed coin read threw and unwinding ran TemporaryUTXODatabase's destructor. The new unconditional abort skips that cleanup, leaving the UTXO-sized temp_utxo_<height> directory beside the output path. This database is disposable scratch state, not the node's persistent chainstate. Give this backend an operation-local read-error status checked after rollback and flush operations, so the RPC can unwind before producing a snapshot. Simply throwing from the notification is insufficient because coin lookups are now noexcept.
Optional improvements
[suggestion] · Local block-file damage becomes fatal through txindex
With -txindex, existing block-file damage now aborts the node through RPC or opt-in REST, even for an explicit blockhash or an unrelated prefix-collision candidate; direct block reads still return errors.
Location: src/index/txindex.cpp:211 (head).
Details and suggested fix
FindTx() opens candidates in sorted order and aborts on open or decode failure before comparing transaction IDs. An unreadable false-positive candidate can therefore terminate a lookup whose actual transaction is in a readable block. GetTransaction() also consults the index when a block_index was supplied, so explicit-blockhash calls do not avoid this behavior. Previously these failures threw catchable lookup errors, as direct block reads still do. Retain that throwing error path for block-file I/O while keeping internal index inconsistencies fatal. This continues distinguishing failed reads from missing transactions without terminating the node.
[suggestion] · The public fatal_error contract omits worker-thread and lock restrictions
After a database read fault, fatal_error can run concurrently on prevout-fetch workers while validation waits for them, but the public contract omits this; no checked-in handler causing a hang was found.
Location: src/kernel/bitcoinkernel.h:542 (head).
Details and suggested fix
A prevout-fetch worker calls base->PeekCoin() before publishing input.ready, and validation can wait on that flag. A failed database read now invokes the host callback synchronously on that worker. A callback that waits for validation can therefore prevent both the lookup and the following abort from completing. Expose the existing internal DBParams warning in the public callback documentation: invocations may come from internal threads, possibly concurrently and while internal locks are held, so handlers must return promptly without re-entering the library or waiting for validation.
[suggestion] · The startup read-error case does not distinguish abort from normal failure
The startup corruption test would also accept a normal failure exit after notification, so it does not enforce the new abort behavior.
Location: test/functional/feature_init.py:169 (head).
Details and suggested fix
The chainstate/*.ldb round uses assert_start_raises_init_error(), which checks only a nonzero exit and a partial stderr match. If the read path called fatalError() and then threw instead of aborting, the notification would still print the expected message and request shutdown. Initialization would catch the exception and exit with failure, leaving this test satisfied. Start this round directly with node.start() and use wait_until_aborted() to check the abort exit codes. Keep the initialization-error helper for the separate CURRENT database-open case.
[suggestion] · The new txindex consistency aborts lack targeted coverage
Existing tests cover LevelDB corruption and missing block files, but not the changed abort behavior for missing sequence mappings, active-chain blocks without data, or legacy txid mismatches.
Location: src/index/txindex.cpp:184 (head).
Details and suggested fix
feature_io_errors.py renames a block file, while feature_coinsdb_read_error.py corrupts LevelDB tables. Neither establishes the logical inconsistencies handled by these three branches, and the existing compact/legacy unit tests exercise successful lookups instead. Reverting one of these branches to a catchable error or a not-found result need not affect those tests. Add targeted cases requiring the branch's diagnostic and an abort, for example erasing a BlockSeqKey while retaining its compact transaction entry.
[suggestion] · The mandatory notification argument forces redundant positional flags
Placing notifications after the boolean settings removes their defaults and makes callers repeat unchanged options just to supply the required notification pointer.
Location: src/index/base.h:69 (head).
Details and suggested fix
BlockFilterIndex now supplies /*f_obfuscate=*/false, /*f_bloom=*/true solely to reach GetNotifications() in BaseIndex::DB's constructor. Put notifications immediately after n_cache_size and restore the previous boolean defaults. This keeps notification wiring mandatory while removing repeated defaults from ordinary callers; indexes needing a non-default bloom setting can still provide it explicitly. No incorrect argument value was found.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [minor]: A throwing read-error callback can bypass termination
- [minor]: A throwing read-error callback can bypass termination
- [suggestion]: Later lookups mask missing HaveInputs cache coverage (earlier report)
- [suggestion]: CCoinsViewBacked::GetCoin forwarding is unused after catcher removal (earlier report)
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
Database read failures were considered a consensus-safety problem, not merely a failed request. The 2015 proposal #5621 warned that faulty storage could leave a node rejecting the longest chain and vulnerable to opportunistic attack; correlated OS or LevelDB faults could also threaten consensus stability. Exceptions alone were insufficient because some callers discarded them.
This is the historical fail-stop rationale behind the coin error catcher and the present move toward a lower-level fatal boundary: an error must not be caught as routine input failure while the node continues making decisions from unreliable state. The argument was specifically grounded in consensus-facing consequences, rather than establishing that all database consumers have identical consequences.
The adopted response was narrower than asserting inside the database wrapper. #5619 described a minimally invasive chainstate read-error catcher and explicitly exempted the block index because it was read only during startup. The shared-library implementation kept UI handling outside common code; writes already had caller-side failure handling.
The previous split was intentional at this boundary: runtime coin reads received special protection, while startup reads and writes could retain caller-controlled handling. The current change replaces that layered arrangement with database-owned point-read termination across more owners.
#34931 introduced explicit read-result discrimination because an undecodable UTXO must not mean an absent UTXO. An absent coin has consensus meaning: spending it can permanently mark a block invalid. TryRead distinguished missing keys, decoding failures, and database errors, while Read deliberately preserved older behavior for other callers to keep the consensus fix narrowly scoped. The proposal also distinguished ordinary disk corruption, normally caught by LevelDB checksums, from malformed serialized coins caused by serialization bugs or pre-storage memory corruption.
This explains both why missing-entry results must remain available and why the base still had overlapping APIs and different error policies. The current change removes a compatibility boundary that was retained deliberately, not because corruption and absence were considered equivalent.
Kernel fatal notifications were introduced to remove the kernel's dependency on the node UI and move away from global interruption infrastructure. The original contract separated notification from control flow: the triggering function should return an error or throw, while the application could log, notify the user, or initiate shutdown.
Passing each database owner's notifications preserves owner-specific reporting and warning policy. However, notification and immediate termination are historically distinct operations: the pinned node callback requests shutdown through AbortNode, whereas the new database path explicitly aborts after notification returns.
Kernel embedding proposals identified limitations of callback-only fatal reporting: higher-level callers could not easily determine whether a nested operation failed, concurrent calls made attribution difficult, and tests could not effectively assert fatal outcomes. #29642 and #29700 therefore proposed carrying error information through return values; #29642 also noted that some useful operations could still complete after a fatal notification.
These are historical embedding requirements affected by the new failure boundary. They explain why an unrecoverable operation was not automatically synonymous with immediate destruction of its host process, and why structured error propagation remained a separate design concern.
Txindex's compact format deliberately admits false-positive candidates: shortened salted hash prefixes save substantial disk space, and collisions are resolved by reading and hashing candidate transactions. Separately, #35728 required genuine I/O failures to be reported as errors rather than missing transactions. Its discussion distinguished expected unavailable data, checked beforehand, from a failure to read data expected to be present.
A successfully decoded candidate with a different txid is normal in the compact index, unlike a legacy full-txid entry pointing to the wrong transaction. Likewise, expected absence and failed access to supposedly available data must remain different outcomes. These historical distinctions explain the classification of failures, though not by themselves the new process-termination policy.
Source 1 · Source 2 · Source 3
Ralph's inferences
Startup provided a controlled recovery boundary rather than treating every database failure as an immediately fatal runtime event. In the pinned base, initialization catches exceptions and returns a load failure; eligible failures offer GUI users one retry with reindexing and give noninteractive users recovery instructions.
This arrangement allowed startup failures to reach an explicit rebuild decision before normal operation began. At head, opening the database still uses exception handling, but point reads—including the constructor's obfuscation-key read—use the aborting path. Thus, the changed boundary removes that recovery offer for point-read failures, not for every initialization failure.
The retained txindex stale-entry cases reflect disagreement between separately persisted index and block state, not necessarily internal corruption of a txindex record. The lookup comments explicitly allow unknown blocks after an unclean shutdown and known non-active blocks without data. Skipping them preserves the search for another usable candidate. By contrast, transaction entries and their block-sequence mapping are written together in one database batch, making a missing sequence mapping inconsistent with the index's own write structure.
This explains why an unknown block is not treated like an unknown sequence number, and why missing data is tolerated only for a non-active candidate. The distinction is between an explainable stale reference and a violated local consistency or availability expectation—not simply whether a lookup returned nothing.
Immediate termination prevents the detected failure from being reduced to a catchable request error or from allowing continued use of suspect state. For coin reads, that directly extends the established consensus-safety rationale; for txindex reads, it is an extension of the earlier requirement to distinguish failure from absence.
The head code makes sequence inconsistencies, unexpectedly absent active-chain data, block-file failures, and legacy txid mismatches notify and then abort. The historical record supports their classification as errors rather than ordinary misses, but supports the necessity of whole-process termination most directly for consensus-facing coin failures.
Source 1 · Source 2 · Source 3
Unresolved disagreements
The inspected history leaves the general scope of fail-stop policy unresolved. One strand emphasizes that exceptions can be swallowed and unreliable consensus state must stop operation; another emphasizes explicit error propagation, application-controlled handling, and identifiable failures for kernel embedders. The original broad database-assert proposal gave way to the narrower coin catcher, while later kernel proposals continued exploring richer return values.
These sources explain the competing requirements behind the new boundary, but do not resolve whether every optional-index failure should end the host process or whether every startup point-read failure should bypass rebuild handling. Historical rationale should therefore not be presented as proof that those broader policies were already required.
Source 1 · Source 2 · Source 3 · Source 4 · Source 5 · Source 6