Block filter index corruption post reorg and unclean shutdown #34261

issue dergoegge openend this issue on January 12, 2026
  1. dergoegge commented at 11:36 am on January 12, 2026: member

    The block filter index may be left in a corrupted state, preventing the node from restarting (without reindexing), after a series of specific events:

    1. Clean shutdown
    2. Restart combined with an immediate reorg of the previously stored best chain tip
    3. Unclean shutdown after reorg takes place (before chainstate flush)
    4. Restart, leading to the following
    0[        62.579] [               node2] [inf] 2026-01-10T16:58:52Z [all:error] previous block header belongs to unexpected block 44ee2f358de32719802fe11d3985af7a0f9077b90ee5ca16c42f7278a8d89a50; expected 532c10b42179b4f3f5a41f9990108a63bcd7021dd02ba6997f5ff3375d297676
    1[        62.579] [               node2] [inf] 2026-01-10T16:58:52Z [all:error] Cannot read last block filter header; index may be corrupted
    

    See attached debug log for an example of this happening.

    blockfilter_corruption.log

    This was found with a test running on Antithesis.

  2. maflcko added the label UTXO Db and Indexes on Jan 12, 2026
  3. maflcko added the label Data corruption on Jan 12, 2026
  4. mzumsande commented at 1:29 pm on January 12, 2026: contributor
    Looks very similar to #33208 / #33212#pullrequestreview-3140857089 . I did some work on a fix for that in fall (making sure that we never commit an index ahead of the flushed chainstate) but there were some complications with my approach and I never PR’ed it.

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-01-18 03:13 UTC

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