Skip to content

fix: stewardship re-upload dispersed replicas - #5594

Open
aloknerurkar wants to merge 2 commits into
masterfrom
fix/stewardship-dispersed-replicas-5450
Open

fix: stewardship re-upload dispersed replicas#5594
aloknerurkar wants to merge 2 commits into
masterfrom
fix/stewardship-dispersed-replicas-5450

Conversation

@aloknerurkar

@aloknerurkar aloknerurkar commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

PUT /stewardship/{reference} with a non-zero Swarm-Redundancy-Level re-uploads all BMT trie chunks (data + RS parity) but never re-creates the root chunk's dispersed replicas — the SOC-wrapped copies spread across neighborhoods for retrieval resilience. traversal.Traverse only walks the trie; replicas are created separately by replicas.NewPutter at original upload time and are invisible to traversal.

Fix: after traversal succeeds, if rLevel != redundancy.NONE, fetch the root chunk (already local from traversal), re-stamp it, and push it through replicas.NewPutter(uploaderSession, rLevel) before calling uploaderSession.Done(root) — mirroring what the original upload path does.

Changes

  • pkg/steward/steward.go: added the post-traversal replica re-upload step in Reupload.
  • pkg/steward/steward_test.go: updated TestSteward to account for the extra replica traffic on the same push channel (was previously silently absent), and added an assertion that the expected number of dispersed replicas (redundancy.PARANOID.GetReplicaCount()) are actually re-uploaded and retrievable.

Testing

  • go build ./...
  • go vet ./pkg/steward/...
  • go test -race ./pkg/steward/... -count=5 — deterministic pass
  • golangci-lint run ./pkg/steward/...### Open API Spec Version Changes (if applicable)

Related Issue (Optional)

Fixes #5450

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

Comment thread pkg/steward/steward.go Outdated
Comment thread pkg/steward/steward.go Outdated
- Trim encrypted references to the 32-byte content address before
  deriving dispersed replica addresses; replicas are keyed on the
  plain content address, and root can be a 64-byte encrypted
  reference (address + decryption key).
- Validate the fetched root chunk is a valid content-addressed chunk
  before deriving replicas from it.
- Stamp each dispersed replica individually against its own SOC
  address as it is put, instead of stamping the root chunk once and
  reusing that stamp across all replicas (which have different
  addresses and would fail stamp validation on the receiving side).
- Add TestStewardEncryptedReference covering both fixes, with a
  strict-address chunk store and a stamp-recording stamper to
  ensure both regressions are actually caught.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stewardship Reupload Does Not Re-create Dispersed Replicas for Root Chunk

3 participants