Skip to content

Commit

Permalink
Document how object fetching is implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Feb 13, 2025
1 parent e92a5b0 commit 96e2da5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions shared/subspace-data-retrieval/src/object_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ where
}

/// Single object fetching and assembling.
///
/// Each piece is initially turned into a PartialData struct. When there are enough pieces to
/// calculate the object's length(s), those pieces are turned into a PartialObject struct.
/// After that, each new piece becomes a PartialData (to track padding and segment headers),
/// then gets added to the PartialObject.
///
/// When the PartialObject has enough data for its shortest length, the data (and corresponding
/// padding) is checked against the object hash. If that fails, we check more padding lengths,
/// or fetch more data.
//
// TODO: return last downloaded piece from fetch_object() and pass them to the next fetch_object()
async fn fetch_object(&self, mapping: GlobalObject) -> Result<Vec<u8>, Error> {
let GlobalObject {
Expand Down

0 comments on commit 96e2da5

Please sign in to comment.