diff --git a/pkg/statestore/storeadapter/migration.go b/pkg/statestore/storeadapter/migration.go index 03e3ddb64e4..22ea712d052 100644 --- a/pkg/statestore/storeadapter/migration.go +++ b/pkg/statestore/storeadapter/migration.go @@ -17,6 +17,7 @@ func allSteps() migration.Steps { 2: deletePrefix("sync_interval"), 3: deletePrefix("sync_interval"), 4: deletePrefix("blocklist"), + 5: deletePrefix("batchstore"), } } diff --git a/pkg/storer/internal/reserve/reserve.go b/pkg/storer/internal/reserve/reserve.go index b48f5075e8c..8e7f9a121e8 100644 --- a/pkg/storer/internal/reserve/reserve.go +++ b/pkg/storer/internal/reserve/reserve.go @@ -25,9 +25,11 @@ import ( // loggerName is the tree path name of the logger for this package. const loggerName = "reserve" - const reserveNamespace = "reserve" +// hack: make sures the network's storage radius does not fall below a certain value +const minRadius = 9 + /* pull by bin - binID evict by bin - batchID @@ -69,7 +71,7 @@ func New( if err != nil && !errors.Is(err, storage.ErrNotFound) { return nil, err } - rs.radius.Store(uint32(rItem.Radius)) + rs.radius.Store(uint32(max(rItem.Radius, minRadius))) epochItem := &EpochItem{} err = store.Get(epochItem) @@ -463,6 +465,7 @@ func (r *Reserve) EvictionTarget() int { } func (r *Reserve) SetRadius(store storage.Store, rad uint8) error { + rad = max(rad, minRadius) r.radius.Store(uint32(rad)) r.radiusSetter.SetStorageRadius(rad) return store.Put(&radiusItem{Radius: rad})