fix: stewardship re-upload dispersed replicas - #5594
Open
aloknerurkar wants to merge 2 commits into
Open
Conversation
aloknerurkar
requested review from
acud,
akrem-chabchoub,
gacevicljubisa and
sbackend123
September 3, 2026 05:06
gacevicljubisa
requested changes
Sep 3, 2026
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
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
Testing
Related Issue (Optional)
Fixes #5450
AI Disclosure