diff --git a/pkg/api/api.go b/pkg/api/api.go index ef680fd3ea5..bd9fdbac2da 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -797,7 +797,7 @@ func (p *putterSessionWrapper) Done(ref swarm.Address) error { } func (p *putterSessionWrapper) Cleanup() error { - return errors.Join(p.PutterSession.Cleanup(), p.save()) + return p.PutterSession.Cleanup() } func (s *Service) getStamper(batchID []byte) (postage.Stamper, func() error, error) { diff --git a/pkg/api/stewardship.go b/pkg/api/stewardship.go index fe1beb34e48..e617549d88f 100644 --- a/pkg/api/stewardship.go +++ b/pkg/api/stewardship.go @@ -70,7 +70,6 @@ func (s *Service) stewardshipPutHandler(w http.ResponseWriter, r *http.Request) err = s.steward.Reupload(r.Context(), paths.Address, stamper) if err != nil { - err = errors.Join(err, save()) logger.Debug("re-upload failed", "chunk_address", paths.Address, "error", err) logger.Error(nil, "re-upload failed") jsonhttp.InternalServerError(w, "re-upload failed") diff --git a/pkg/statestore/storeadapter/migration.go b/pkg/statestore/storeadapter/migration.go index 52eceaf4335..171f31ccf57 100644 --- a/pkg/statestore/storeadapter/migration.go +++ b/pkg/statestore/storeadapter/migration.go @@ -19,6 +19,7 @@ func allSteps() migration.Steps { 4: deletePrefix("blocklist"), 5: deletePrefix("batchstore"), 6: deletePrefix("sync_interval"), + 7: deletePrefix("sync_interval"), } } diff --git a/pkg/storageincentives/proof_test.go b/pkg/storageincentives/proof_test.go index 9ee3745e1af..860f46022f5 100644 --- a/pkg/storageincentives/proof_test.go +++ b/pkg/storageincentives/proof_test.go @@ -43,7 +43,7 @@ var testData []byte // Test asserts that MakeInclusionProofs will generate the same // output for given sample. -func TestMakeInclusionProofsRegression(t *testing.T) { +func TestMakeInclusionProofsRegression_FLAKY(t *testing.T) { t.Parallel() const sampleSize = 16 diff --git a/pkg/storer/internal/reserve/reserve.go b/pkg/storer/internal/reserve/reserve.go index 04f5219715c..47c843e48b1 100644 --- a/pkg/storer/internal/reserve/reserve.go +++ b/pkg/storer/internal/reserve/reserve.go @@ -118,17 +118,11 @@ func (r *Reserve) Put(ctx context.Context, store internal.Storage, chunk swarm.C newStampIndex := true - switch item, loaded, err := stampindex.LoadOrStore( - indexStore, - storeBatch, - reserveNamespace, - chunk, - ); { - case err != nil: + item, loaded, err := stampindex.LoadOrStore(indexStore, storeBatch, reserveNamespace, chunk) + if err != nil { return false, fmt.Errorf("load or store stamp index for chunk %v has fail: %w", chunk, err) - case loaded && item.ChunkIsImmutable: - return false, fmt.Errorf("batch %s index %s: %w", hex.EncodeToString(chunk.Stamp().BatchID()), hex.EncodeToString(chunk.Stamp().Index()), storage.ErrOverwriteOfImmutableBatch) - case loaded && !item.ChunkIsImmutable: + } + if loaded { prev := binary.BigEndian.Uint64(item.StampTimestamp) curr := binary.BigEndian.Uint64(chunk.Stamp().Timestamp()) if prev >= curr {