rpc: Assertion ‘!pindex || pindex->GetBlockHash() == view->GetBestBlock()’ failed during gettxoutsetinfo #34263

issue dergoegge openend this issue on January 12, 2026
  1. dergoegge commented at 2:24 pm on January 12, 2026: member

    The CHECK_NONFATAL check here may fail when gettxoutsetinfo is called.

    0rpc/blockchain.cpp:976 std::optional<kernel::CCoinsStats> GetUTXOStats(CCoinsView *, node::BlockManager &, kernel::CoinStatsHashType, const std::function<void ()> &, const CBlockIndex *, bool): Assertion `!pindex || pindex->GetBlockHash() == view->GetBestBlock()' failed.
    

    I’ve not written a test for this, but looking at the code, it seems that there is a race where the coins view’s best block gets updated in between here and here (e.g. because a new block is connected), causing the check to fail (resulting in an assertion failure in debug builds).

    See attached debug logs for an example.

    gettxoutsetinfo_check_nonfatal.log

    This was found with a test running on Antithesis.

  2. maflcko added the label RPC/REST/ZMQ on Jan 12, 2026
  3. w0xlt referenced this in commit f3c1557288 on Jan 29, 2026
  4. w0xlt commented at 7:28 pm on January 29, 2026: contributor
  5. w0xlt referenced this in commit 0672e1c01c on Feb 3, 2026
  6. w0xlt referenced this in commit 5e77072fa6 on Mar 11, 2026
  7. fanquake closed this on Mar 19, 2026

  8. fanquake referenced this in commit 4169e72d9e on Mar 19, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-05 18:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me