You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
db-truncater: make --truncate-after-slot more lenient again (#1203)
Closes#1202
This PR reverts the behavioral change of #1143, specifically
5747d3c. Concretely,
`--truncate-after-slot slotNo` will now remove all blocks with a slot
number higher than `slotNo` in the ImmutableDB, but does not require
that a block with exactly that slot number exists. This is convenient eg
for truncating all blocks after an epoch without having to find out the
exact slot of the last block in the epoch just before.
At the same time, the run time is still much faster than before #1143:
We iteratively check all slot numbers descending from the given one, and
truncate to the first point that is in the ImmutableDB. As realistic
ImmutableDBs are only somewhat sparse (active slot coefficient is `f =
1/20`), this should be very fast (ie still constant time in the length
of the chain if we consider the slot distance between any two adjacent
blocks to be bounded). In addition, we explicitly check whether the
given argument is beyond the tip of the ImmutableDB, and immediately
exit (successfully) in that case.
0 commit comments