Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions pkg/replicas/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,9 @@ import (
"github.com/ethersphere/bee/v2/pkg/swarm"
)

// ErrSwarmageddon is returned in case of a vis mayor called Swarmageddon.
// Swarmageddon is the situation when none of the replicas can be retrieved.
// If 2^{depth} replicas were uploaded and they all have valid postage stamps
// then the probability of Swarmageddon is less than 0.000001
// assuming the error rate of chunk retrievals stays below the level expressed
// as depth by the publisher.
var (
ErrSwarmageddon = errors.New("swarmageddon has begun")
// ErrContentNotFound is returned when content and erasure coded content cannot be found.
ErrContentNotFound = errors.New("erasure coded content not found")
// errGetterExhausted is returned when the retry loop exhausts all levels without
// receiving a result or enough errors to trigger ErrSwarmageddon.
// This path should never be reached under normal operation.
Expand Down Expand Up @@ -115,7 +110,7 @@ func (g *getter) Get(ctx context.Context, addr swarm.Address) (ch swarm.Chunk, e
errs = errors.Join(errs, err)
errcnt++
if errcnt > total {
return nil, errors.Join(ErrSwarmageddon, errs)
return nil, errors.Join(ErrContentNotFound, errs)
}

// ticker switches on the address channel
Expand Down
2 changes: 1 addition & 1 deletion pkg/replicas/getter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func TestGetter(t *testing.T) {

t.Run("returns correct error", func(t *testing.T) {
if tc.level > 0 {
if !errors.Is(err, replicas.ErrSwarmageddon) {
if !errors.Is(err, replicas.ErrContentNotFound) {
t.Fatalf("incorrect error. want Swarmageddon. got %v", err)
}
}
Expand Down
Loading