Skip to content

Coins Cache Cleanup checklist #34280

Open

Description

@l0rinc

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

Remove invalid cache states

Simplify view hierarchy

Database and cursor correctness

Parallel validation

Optimizations

Other

Recently merged

IRC context: https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2026-01-08

Activity

  1. changed the title [-]Coins Cache Cleanup tracking issue[/-] [+]Coins Cache Cleanup checklist[/+] on Jan 14, 2026
  2. added
    Tracking Issue
    on Jan 14, 2026
  3. sedited commented on Jan 18, 2026

    @sedited
    Contributor

    The issue seems a bit overladen - I don't think listing all these PRs is useful. Maybe distill this down to just the coins-related PRs? The benefit I would expect from this issue is that I can connect the various PRs touching the coins and see how they relate to each other. Maybe to add to the benefits in the opening paragraph a bit: Fewer error cases, more ergonomic cache layering, and preparation for asynchronous operations.

  4. l0rinc commented on Jan 18, 2026

    @l0rinc
    ContributorAuthor

    Thanks for the suggestions @sedited and @andrewtoth.
    Updated the tracker and grouped the PRs - hopefully this helps reviewers see the structure (though many conflict or overlap depending on merge order).
    I put cleanups first since they'd let us avoid ugly hacks in the larger PRs, culminating in the parallel input fetcher.
    Let me know what else to adjust.

  5. l0rinc commented on Mar 15, 2026

    @l0rinc
    ContributorAuthor

    GitHub doesn't allow me to edit the issue anymore, wanted to try the close/reopen dance here, but apparently I can't reopen. Can someone please reopen and check if they can edit the issue?

  6. reopened this on Mar 15, 2026
  7. added a commit that references this issue on Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Tracking Issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions