fix: stewardship re-upload dispersed replicas - #5594
Open
aloknerurkar wants to merge 1 commit into
Open
Conversation
aloknerurkar
requested review from
acud,
akrem-chabchoub,
gacevicljubisa and
sbackend123
September 3, 2026 05:06
gacevicljubisa
requested changes
Sep 3, 2026
| } | ||
|
|
||
| if rLevel != redundancy.NONE { | ||
| rootChunk, err := getter.Get(ctx, root) |
Member
There was a problem hiding this comment.
Dispersed replicas are keyed on the 32 byte content address, but root here can be an encrypted reference, which carries the decryption key in its trailing 32 bytes, so it should be trimmed before the lookup.
| return errors.Join(fmt.Errorf("stamping root chunk for dispersed replicas: %w", err), uploaderSession.Cleanup()) | ||
| } | ||
|
|
||
| if err := replicas.NewPutter(uploaderSession, rLevel).Put(ctx, rootChunk.WithStamp(stamp)); err != nil { |
Member
There was a problem hiding this comment.
We should cehck if rootChank is valid content addressed chunk. Also, the replicas need to be stamped, not the root chunk.
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