Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ultra-basic protocol prioritization #198

Open
hannahhoward opened this issue Apr 22, 2023 · 0 comments
Open

Ultra-basic protocol prioritization #198

hannahhoward opened this issue Apr 22, 2023 · 0 comments
Assignees

Comments

@hannahhoward
Copy link
Collaborator

Goals

Implement a very first version of protocol prioritization.

Implementation

This prioritization actually just has a single goal: prioritize HTTP retrieval when present, then bitswap, then graphsync. We're not doing full "sequencing" as in completely exhausting all candidates on a protocol until we try the next, but instead reasonably delayed racing.

  1. In the protocol splitter, wait till the first group of candidates arrives then
  2. If HTTP candidates are present:
  • only pass on the HTTP candidates to the HTTP retriever put the remaining in a pool
  • set a 1 or 2 second timer and continue pooling until the timer goes off at which point, if the context wasn't already cancelled cause the retrieval succeeded, move on to bitswap evaluation (see Update to go-data-transfer v2 #3)
  1. If Bitswap candidates are present:
  • only pass on the bitswap candidates to the bitswap retriever put the graphsync candidates in a pool
  • set a 1 or 2 second timer and continue pooling until the timer goes off at which point, if the context wasn't already cancelled cause the retrieval succeeded, release the graphsync candidates.

Open to any other variation on simple logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants