BitDevs Wiki

Source

Transcript

Coins Cache Cleanup (Bitcoin Core Dev Tech, May 2026)

Bitcoin Core Dev Tech 2026 (notes via Bitcoin Transcripts)May 5, 2026

Added to the wiki June 17, 2026 at 06:14 PM UTC · full text archived June 17, 2026 at 06:14 PM UTC

The coins cache — the in-memory and on-disk store of unspent transaction outputs (UTXOs) — currently exposes a single large interface that "promises too much," having grown append-only rather than through deliberate refactoring. The goal discussed was to restrict the interface by context: whether a given method may write to the cache, and whether it is thread-safe, with separate readers, writers, and cache-less access.

The session highlighted side-effecting patterns to remove — for example HaveCoin returning true regardless of whether the data is valid, which caused a spurious "invalid block" that failed a user's initial block download — and contrasted a thread-safe Peek with a not-necessarily-safe Get. It also debated sequencing: whether cleanups should precede or follow functional changes, noting that the line between the two can be muddled, but that five recently merged refactor PRs already simplify validation work such as parallel coin fetch.

Appears in