Summary
The Swarm-Redundancy-Level header is inconsistently handled across API endpoints and internal components. Some handlers respect the user-specified redundancy level while others ignore it and use hardcoded values (PARANOID or DefaultLevel). This creates unpredictable behavior and potential performance issues.
This issue requires input from research and product teams to determine appropriate defaults and whether all operations should respect the header.
Current State Analysis
Handler Behavior
| Handler |
Endpoint |
Default |
Respects Header |
Issue |
bytesUploadHandler |
POST /bytes |
NONE |
✅ |
None |
bzzUploadHandler |
POST /bzz |
NONE |
✅ |
None |
bzzDownloadHandler |
GET /bzz/{address}/{path} |
PARANOID |
❌ |
loadsave.NewReadonly ignores header |
bzzHeadHandler |
HEAD /bzz/{address}/{path} |
PARANOID |
❌ |
loadsave.NewReadonly ignores header |
downloadHandler |
GET /bytes/{address} |
PARANOID |
✅ |
None |
Problem Details
Critical Issues in API Handlers
BZZ Download Handlers (pkg/api/bzz.go)
Location: serveReference() method, line ~409
// BUG: Always uses redundancy.DefaultLevel (PARANOID) instead of rLevel variable
ls := loadsave.NewReadonly(s.storer.Download(cache), s.storer.Cache(), redundancy.DefaultLevel)
The header is parsed but ignored. This affects:
GET /bzz/{address}/{path} - always uses PARANOID
HEAD /bzz/{address}/{path} - always uses PARANOID
Hardcoded Redundancy Levels in Other Components
Stewardship Service (pkg/steward/steward.go)
- Line 44:
traversal.New(ns.Download(true), joinerPutter, redundancy.DefaultLevel)
- Line 45:
traversal.New(&netGetter{r}, joinerPutter, redundancy.DefaultLevel)
Node Bootstrap (pkg/node/bootstrap.go)
- Line 285:
loadsave.NewReadonly(st, putter, redundancy.DefaultLevel)
Access Control Handlers (pkg/api/accesscontrol.go)
All access control operations hardcode redundancy.PARANOID:
actDecryptionHandler (line 129)
actListGranteesHandler (line 207)
actEncryptionHandler (line 162)
actGrantRevokeHandler (lines 347-348)
actCreateGranteesHandler (lines 501-502)
Pin Operations (pkg/api/pin.go)
- Line 56:
traverser := traversal.New(getter, s.storer.Cache(), redundancy.PARANOID)
Performance Impact
Critical Concerns
-
Forced Maximum Redundancy: When hardcoded to PARANOID, operations use the highest redundancy level (16 replicas) regardless of user needs
- Increases network traffic by up to 16x
- Increases storage requirements across the network
- Slows down upload/download operations
- Wastes node resources and bandwidth
-
No User Control: Users cannot optimize performance for their use case:
- Cannot use lower redundancy for temporary or non-critical data
- Cannot balance cost vs. reliability for different content types
- Cannot reduce resource usage when appropriate
-
Inconsistent Behavior: Different endpoints with different defaults create confusion and make it difficult to predict system behavior
Questions for Research & Product Teams
Research Team:
Product Team:
Summary
The
Swarm-Redundancy-Levelheader is inconsistently handled across API endpoints and internal components. Some handlers respect the user-specified redundancy level while others ignore it and use hardcoded values (PARANOIDorDefaultLevel). This creates unpredictable behavior and potential performance issues.This issue requires input from research and product teams to determine appropriate defaults and whether all operations should respect the header.
Current State Analysis
Handler Behavior
bytesUploadHandlerPOST /bytesNONEbzzUploadHandlerPOST /bzzNONEbzzDownloadHandlerGET /bzz/{address}/{path}PARANOIDbzzHeadHandlerHEAD /bzz/{address}/{path}PARANOIDdownloadHandlerGET /bytes/{address}PARANOIDProblem Details
Critical Issues in API Handlers
BZZ Download Handlers (
pkg/api/bzz.go)Location:
serveReference()method, line ~409The header is parsed but ignored. This affects:
GET /bzz/{address}/{path}- always usesPARANOIDHEAD /bzz/{address}/{path}- always usesPARANOIDHardcoded Redundancy Levels in Other Components
Stewardship Service (
pkg/steward/steward.go)traversal.New(ns.Download(true), joinerPutter, redundancy.DefaultLevel)traversal.New(&netGetter{r}, joinerPutter, redundancy.DefaultLevel)Node Bootstrap (
pkg/node/bootstrap.go)loadsave.NewReadonly(st, putter, redundancy.DefaultLevel)Access Control Handlers (
pkg/api/accesscontrol.go)All access control operations hardcode
redundancy.PARANOID:actDecryptionHandler(line 129)actListGranteesHandler(line 207)actEncryptionHandler(line 162)actGrantRevokeHandler(lines 347-348)actCreateGranteesHandler(lines 501-502)Pin Operations (
pkg/api/pin.go)traverser := traversal.New(getter, s.storer.Cache(), redundancy.PARANOID)Performance Impact
Critical Concerns
Forced Maximum Redundancy: When hardcoded to
PARANOID, operations use the highest redundancy level (16 replicas) regardless of user needsNo User Control: Users cannot optimize performance for their use case:
Inconsistent Behavior: Different endpoints with different defaults create confusion and make it difficult to predict system behavior
Questions for Research & Product Teams
Research Team:
Swarm-Redundancy-Levelheader, or are there security/reliability reasons for forcingPARANOIDon specific operations (e.g., access control, pinning)?Product Team:
PARANOIDis desirable?