We reject blocks that contain a tx that conflicts with a finalized one, so this assumption should never break. It's cheap enough that we can assert this on debug bulds to increase confidence.
Details
- Reviewers
bytesofman - Group Reviewers
Restricted Project - Commits
- rABC95d4f6748c8e: [avalanche] Add a debug check that we never remove a finalized transaction for…
With debug:
ninja check-functional
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| src/txmempool.cpp | ||
|---|---|---|
| 310 ↗ | (On Diff #54361) | if I understand correctly, we are actually already assuming this condition before this diff? But now, in calling Assume, we are asserting it is not true -- meaning we can catch if this happens in debug builds? so we aren't really adding an assumption so much as a check for if this does end up ever happening |
| src/txmempool.cpp | ||
|---|---|---|
| 310 ↗ | (On Diff #54361) | 100% correct. This function is called when a block is connected, and removes from the mempool the txs that conflict with the txs from the block. With preconsensus the blocks that contain a transaction conflicting with a finalized one are rejected so this should never happen. If this ever happens we are either forcing the situation in a test or we have a bug, in both cases it's better to raise an error so we can examine the situation |