The coins cache (the CCoinsView* stack, CCoinsViewCache, and friends) is a correctness- and performance-critical part of validation, IBD, and assumeutxo.
Over time it has accumulated subtle invariants and legacy states (around cache entry flags, spent coin handling, and error catching), and we have been chipping away at it through focused refactors, bugfixes, tests, and performance work.
This issue tracks the related PRs to help reviewers see how they fit together. The overall aim is fewer error cases, cleaner cache layering, and parallel validation.
PRs needing review
Testing
- #34866 - fuzz: target concurrent leveldb reads
Remove invalid cache states
- #34864 - remove unreachable FRESH-but-not-DIRTY state from code and tests.
Simplify view hierarchy
- #34124 - make
CCoinsViewpurely virtual, add explicitCCoinsViewEmpty. - #34320 - replace
HaveCoin()withGetCoin(). - #34132 - coins: drop error catcher, centralize fatal read handling.
Parallel coin fetching
- #31132 - async input prefetch during
ConnectBlock.
Other
- #34641 - node: scale default -dbcache with system RAM
- #33854 - fix assumevalid ignored during reindex (see #31494).
- #32317 - move UTXO access to
SpendBlock(kernel API, Utreexo, SwiftSync).
Recently merged
- #34692 - increase the default dbcache value from 450MiB to 1024MiB
- #34576 - threadpool: add ranged Submit overload
- #34655 - fuzz: keep coins_view fuzzers within caller contracts
- #34165 - add non-mutating
PeekCoin()to avoid polluting the main cache. - #33512 - track dirty entries so flush progress reflects actual writes.
- #33680 - split
FORCE_SYNC/FORCE_FLUSH, keep cache warm forscantxoutset/gettxoutsetinfo/snapshots. - #34164 - add
Reset()and reusable view to discard failed connects cheaply. - #34207 - ensure
GetCoin()only returns unspent coins, align tests with production. - #34253 - validation: cache tip recency for lock-free IsInitialBlockDownload()
- #33866 - remove always-true return from
BatchWrite. - #33657 - allow reading partial block data (useful for bindex).
- #33602 - reduce map lookups in
BatchWrite. - #33333 - warn when
-dbcacheexceeds RAM cap.
IRC context: https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2026-01-08