fix: block history pruning getting stuck#10123
fix: block history pruning getting stuck#10123hirako2000 wants to merge 5 commits intoNethermindEth:masterfrom
Conversation
|
Could you add a test that would not pass without your fix? |
Yes I have not added any tests that demonstrates the bug. Looking at it it's also clear there could be a less invasive fix. I'm putting this PR back as a draft until I get my head around this. My understanding as to why this bug can happen is that the manual pruning likely ran, left block with empty bodies, and the history (rolling pruner) attempts to delete an already pruned block. Still working on it but if a fix needs to be expedited someone else could grab the issue. |
…when some block was already pruned (NethermindEth#10119)
I have revisited the fix to be less invasive. Thank you for the input @flcl42 it prompted further thinking. My understanding of the bug is that it surfaces as edge case scenario, where a manual pruning could have already taken place, conflicting with the history pruner assumptions that block exists if it is to be pruned. |
Fixes #10119
Changes
Adds block to history pruner to handle the edge case where some block was already pruned, to move the delete pointer.
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
All existing unit tests for HistoryPruner still pass.
Added a test to reproduce the issue.
Running the full tests suites locally yields non deterministic errors, but all appear unrelated to this changeset.
Documentation
Requires documentation update
Requires explanation in Release Notes
Remarks
I suspect far many more than 1 block were skipping pruning if my understanding of the bug is right, it may be that the loop returning the blocks to prune may have stopped at the first already pruned block. Thus potentially causing no more pruning at any subsequent run: stuck on infinite attempt to prune a ghost block. If so Release notes may require an explanation.