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

Download fetches from closest node #49

Closed
3 tasks done
Eknir opened this issue Apr 1, 2020 · 0 comments · Fixed by #104
Closed
3 tasks done

Download fetches from closest node #49

Eknir opened this issue Apr 1, 2020 · 0 comments · Fixed by #104
Assignees

Comments

@Eknir
Copy link
Contributor

Eknir commented Apr 1, 2020

Epic

Story

As a user of Swarm, I want to know to which node I should ask for delivery of a certain chunk, such that chunk that exists in the network is found by the node whom I ask.

Background

Global vs local closest

If chunk are stored by the node whose address is closest to the chunk (see #48), then the node should request chunk delivery from the node whose address is closest to the chunk. In a network with full connectivity, the node who is closest (local) is also the node who is closest (global), but when we implement partial connectivity, the decision to ask the closest (local) node should be a step in the direction towards the closest (global).

Incentivized protocol

The retrieval protocol was incentivized in the old Swarm. The incentives team made a post-mortem based on their work. For the acceptance criteria for this PR, it is not needed to be incentivized, but the ground should be made ready for this protocol to become incentivized.

Acceptance criteria

  • In a network where n random chunks are stored at the nodes whose addresses are closest to the respective chunks (see Upload syncs to closest node #48), a node is able to download all n chunks with 1 attempt per chunk

Dependencies

  • Adjust full topology ChunkPeer method to return closest peer
  • Introduce notion of NetStore. Strong emphasis on how we are going to do caching
  • Wire HTTP JSON API to try to retrieve chunk from localstore; when that fails - initiate network request through retrieval protocol, get the chunk, optionally store it then serve it to the requester
@Eknir Eknir added the Epic label Apr 1, 2020
@acud acud self-assigned this Apr 14, 2020
@Eknir Eknir added this to the Sprint 1 milestone Apr 14, 2020
@acud acud changed the title Download from closest node Download fetches from closest node Apr 15, 2020
@acud acud closed this as completed in #104 Apr 21, 2020
acud added a commit that referenced this issue Apr 21, 2020
* netstore: introduce netstore
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

Successfully merging a pull request may close this issue.

2 participants