Page MenuHomePhabricator

[Chronik] Fix: `tx_writer.insert` in `handle_block_disconnected`
ClosedPublic

Authored by tobias_ruck on Mar 28 2023, 13:33.

Details

Summary

chronik_tx didn't include a test for when a block gets removed. This allowed an undetected oversight to slip in: When disconnecting a block, instead of removing txs from the tx index, we would add them.

This fixes it and adds a test to handle this case.

Test Plan

ninja && ./test/functional/test_runner.py chronik_tx

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien added inline comments.
chronik/chronik-indexer/src/indexer.rs
276 ↗(On Diff #38998)

Macro lolfail:

This revision is now accepted and ready to land.Mar 28 2023, 21:01