nethermind
nethermind copied to clipboard
Save progress of `SnapRanges` when turning client off
Right now we are saving progress of SnapRanges only once - when it is finished. We are losing progress with every restart. It can be easily changed by:
- making
ProgressTracker:IDisposable - add
Dispose()like:
public void Dispose()
{
_db.Set(ACC_PROGRESS_KEY, NextAccountPath.Bytes);
_logger.Info($"Disposed ProgressTracker, SNAP progress of State Ranges (Phase 1): {NextAccountPath.Bytes}");
}
- in
InitializeNetwork, just after initializingProgressTracker, push it toDisposeStack:_api.DisposeStack.Push(progressTracker);
I made a quick try with that logic, but faced db corruption after restart - it needs deeper debugging
@marcindsobczak it cannot be "easily changed", that's why we don't have that yet :) It's low priority and at the same time quite risky. We can end up with "synced" state that is corrupted without even noticing it.