Found it while reviewing #24230 (review).
During a reorg, continuing execution when a block cannot be reversed leaves the coinstats index in an inconsistent state. This was surely overlooked when ‘CustomRewind’ was implemented.
Found it while reviewing #24230 (review).
During a reorg, continuing execution when a block cannot be reversed leaves the coinstats index in an inconsistent state. This was surely overlooked when ‘CustomRewind’ was implemented.
During a reorg, continuing execution when a block cannot be
reversed leaves the coinstats index in an inconsistent state,
which was surely overlooked when 'CustomRewind' was implemented.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | ryanofsky |
Stale ACK | TheCharlatan |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Code review ACK eef595560e9ecf3a0d1db4d8ea7ecc33a49d839f
This seems like it should avoid corrupting the index if ReverseBlock fails, since it avoid writing the best block. It also could prevent assert failures because it avoids subsequent ReverseBlock calls.
It would be good to add [[nodiscard]] to Reverseblock and other functions in indexing code to prevent this problem from happening other places. Grepping a little for functions in src/index/ that write to the database and return bool I see TxIndex::DB::WriteTxs
and CopyHeightIndexToHashIndex
and there may be others.
ACK eef595560e9ecf3a0d1db4d8ea7ecc33a49d839f
As said, adding nodiscard
would be nice.
It would be good to add [[nodiscard]] to Reverseblock and other functions in indexing code to prevent this problem from happening other places. Grepping a little for functions in src/index/ that write to the database and return bool I see TxIndex::DB::WriteTxs and CopyHeightIndexToHashIndex and there may be others.
As said, adding nodiscard would be nice. @furszy do you want to push an additional commit?
It would be good to add [[nodiscard]] to Reverseblock and other functions in indexing code to prevent this problem from happening other places. Grepping a little for functions in src/index/ that write to the database and return bool I see TxIndex::DB::WriteTxs and CopyHeightIndexToHashIndex and there may be others.
As said, adding nodiscard would be nice.
@furszy do you want to push an additional commit?
yep, pushed. A bit late due time zone diff.
Thanks both!