docs: auto-update for PR #2970 — fix(sync): bound inbound blob stream and discard on hash mismatch#2987
Draft
meroreviewer[bot] wants to merge 2 commits into
Draft
docs: auto-update for PR #2970 — fix(sync): bound inbound blob stream and discard on hash mismatch#2987meroreviewer[bot] wants to merge 2 commits into
meroreviewer[bot] wants to merge 2 commits into
Conversation
Contributor
Author
There was a problem hiding this comment.
🤖 AI Code Reviewer
Reviewed by 1 agents | Quality score: 85% | Review time: 28.8s
✅ No Issues Found
All agents reviewed the code and found no issues. LGTM! 🎉
🤖 Generated by AI Code Reviewer | Review ID: review-a40847b6
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.
Automatic Documentation Update
Opened automatically after PR #2970 merged.
Each block shows the documentation change as a diff (added lines in green, removed in red); expand "Why this changed" for the source rationale.
Documentation changes
architecture/crates/node.html— Add MAX_BLOB_STREAM_SIZE_BYTES constant (500 MiB); Always pass a size limit to add_blob, capping unknown-size streams; Delete persisted blob on hash mismatch to avoid storing corrupt dataWhy this changed (source: PR #2970)
A new u64 constant MAX_BLOB_STREAM_SIZE_BYTES (500 MiB) is introduced in constants.rs to serve as a hard ceiling on any single blob received over the sync wire protocol. It is typed u64 to match the wire-protocol
size: u64field and avoid truncation on 32-bit targets.Previously, when a peer advertised size==0 (meaning 'unknown'), expected_size was set to None and passed to add_blob, leaving the receive loop with no upper bound on accepted data. Now a size_limit is computed unconditionally: the advertised size capped at MAX_BLOB_STREAM_SIZE_BYTES when size>0, or MAX_BLOB_STREAM_SIZE_BYTES itself when size==0. Some(size_limit) is always passed to add_blob.
After a full blob receive, if the computed blob-id does not match the advertised blob-id, the code now calls delete_blob on the incorrectly-hashed blob before returning an error. A warning log is emitted that includes the expected id, the received id, and the advertised size. A secondary warning is logged if the delete itself fails.
architecture/crates/sync.html— Add MAX_BLOB_STREAM_SIZE_BYTES constant (500 MiB); Always pass a size limit to add_blob, capping unknown-size streams; Delete persisted blob on hash mismatch to avoid storing corrupt dataWhy this changed (source: PR #2970)
A new u64 constant MAX_BLOB_STREAM_SIZE_BYTES (500 MiB) is introduced in constants.rs to serve as a hard ceiling on any single blob received over the sync wire protocol. It is typed u64 to match the wire-protocol
size: u64field and avoid truncation on 32-bit targets.Previously, when a peer advertised size==0 (meaning 'unknown'), expected_size was set to None and passed to add_blob, leaving the receive loop with no upper bound on accepted data. Now a size_limit is computed unconditionally: the advertised size capped at MAX_BLOB_STREAM_SIZE_BYTES when size>0, or MAX_BLOB_STREAM_SIZE_BYTES itself when size==0. Some(size_limit) is always passed to add_blob.
After a full blob receive, if the computed blob-id does not match the advertised blob-id, the code now calls delete_blob on the incorrectly-hashed blob before returning an error. A warning log is emitted that includes the expected id, the received id, and the advertised size. A secondary warning is logged if the delete itself fails.
Generated by
ai-reviewer update-docs. Nothing was auto-merged.