Commit ceddf3c
authored
The +1 introduced in fa6d677 broke two things for deployments
with history_blocks = reorg_threshold + 1:
- strategy() returned None (earliest_block == final_block), so
pruning silently did nothing even though set_earliest_block had
already advanced earliest_block_number in the database
- revert_block_ptr then failed for any reorg because
earliest_block_number > ptr.number - reorg_threshold
Both revert_block_ptr and strategy rely on earliest_block < final_block,
which requires reorg_threshold + 2 actual blocks on disk. The old formula
(earliest_block = latest_block - history_blocks) keeps history_blocks + 1
blocks, providing exactly that buffer when history_blocks >= reorg_threshold + 1.
The copy_nonfinal_entities fix from 46367e7 is preserved.
1 parent 587aa9e commit ceddf3c
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
1065 | 1072 | | |
1066 | 1073 | | |
1067 | 1074 | | |
| |||
0 commit comments