Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Proposed changes for initial go implementation: Partial response code & @stebalian changes #97

Merged
merged 2 commits into from
Feb 26, 2019

Conversation

hannahhoward
Copy link
Collaborator

@hannahhoward hannahhoward commented Feb 19, 2019

This proposal covers all proposed changes required for the initial go implementation.

It includes:

  1. @Stebalien 's changes, because they make sense, outlined here: graphsync: rework protobufs a bit #89

  2. One additional response code, 14, called a partial response. Here is the rationale:

The original proposal includes an acknowledgement of the request, and two terminal response success codes - one for a completed request with all content, one for a completed request with only partial content, because the server was unable to satisfy all of the potential paths covered by the requested selector.

However, in order to send all of the found blocks in a terminal response code, the server would buffer all of them in memory as it traverses the graph before sending them. Similarly, in order to verify these blocks actually match the selector requested, the client would need to keep all of them in memory as the response is processed.

The proposal for the initial go implementation, in order to optimize memory usage, is to instead have the server send blocks as soon as it finds them, as well as information about what blocks are not available as soon as it knows. Then the client will verify and return blocks to the graphsync caller as soon as it receives them.

To support this, I'm proposing adding a "partial response" code. When this response code is transmitted, the "extra" field of the response becomes metadata about what has been transmitted -- either CIDs of blocks that are included in the response, or CIDs the server knows it doesn't have, or other control messages. For the moment, the content and structure of this extra data is left intentionally ambiguous, because more potential use cases may emerge during the actual implementation of go-graphsync and the IPLD selector library. It's structure will likely be specified more concretely once an implementation has been completed.


This proposal does not address the larger potential issues with the protocol outlined in #96

Stebalien and others added 2 commits February 8, 2019 09:23
1. Remove the indirection (`RequestList`).
2. Rename `full` to `completeRequestList` and document it. I'm still not happy
with the name but it's hopefully a bit less confusing.
3. Avoid abbreviated names.
Support a partial response status code so that blocks and metadata can be sent to the client without
keeping them in memory
Copy link
Contributor

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but probably needs a quick signoff from @jbenet and/or @whyrusleeping (although I don't expect any objections).

Copy link
Contributor

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine to me

@hannahhoward hannahhoward merged commit 565624d into master Feb 26, 2019
@ghost ghost removed awaiting review status/in-progress In progress labels Feb 26, 2019
@Stebalien Stebalien deleted the feat/partial-response-codes branch July 25, 2019 23:23
prataprc pushed a commit to iprs-dev/ipld-specs that referenced this pull request Oct 13, 2020
Proposed changes for initial go implementation: Partial response code & @stebalian changes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants