We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ca29d1f + be877f2 commit 9fd474eCopy full SHA for 9fd474e
2 files changed
.changelog/6445.bugfix.md
@@ -0,0 +1,4 @@
1
+go/worker/storage/committee: Fix prune handler
2
+
3
+Prune handler had an edge case when State DB was empty,
4
+which could cause runtime light history to be pruned prematurely.
go/worker/storage/committee/prune.go
@@ -20,6 +20,9 @@ type pruneHandler struct {
20
// Implements runtime.history.PruneHandler.
21
func (p *pruneHandler) CanPruneRuntime(rounds []uint64) error {
22
lastSycnedRound, _, _ := p.worker.GetLastSynced()
23
+ if lastSycnedRound == defaultUndefinedRound {
24
+ return fmt.Errorf("worker/storage: tried to prune past last synced round (empty state db)")
25
+ }
26
27
for _, round := range rounds {
28
if round >= lastSycnedRound {
0 commit comments