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

RAPIDE & IPSL: first proof of concept #148

Closed
wants to merge 35 commits into from
Closed

Conversation

Jorropo
Copy link
Contributor

@Jorropo Jorropo commented Jan 31, 2023

This support the code for a proof of concept of RAPIDE which concurrently download from multiple gateways.

Todo:

  • Multithreading
  • dontGoThere map for serverDrivenWorker
  • Racing
  • In memory benchmarks using fake latency and io.Reader shaping.
  • Unit tests.

Include: #33
Fixes ipfs#4 ipfs#2

@Jorropo Jorropo self-assigned this Jan 31, 2023
@Jorropo Jorropo force-pushed the rapide branch 3 times, most recently from 6539fe9 to 7d30d50 Compare January 31, 2023 21:23
@codecov
Copy link

codecov bot commented Jan 31, 2023

Codecov Report

Merging #148 (143cd01) into very-fast-downloads (302b279) will increase coverage by 1.86%.
The diff coverage is 61.48%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           very-fast-downloads     ipfs/go-libipfs#148      +/-   ##
=======================================================
+ Coverage                18.50%   20.37%   +1.86%     
=======================================================
  Files                       96      103       +7     
  Lines                    10337    10807     +470     
=======================================================
+ Hits                      1913     2202     +289     
- Misses                    8152     8320     +168     
- Partials                   272      285      +13     
Impacted Files Coverage Δ
examples/rapido/main.go 0.00% <0.00%> (ø)
rapide/gateway/car.go 0.00% <0.00%> (ø)
ipsl/unixfs/unixfs.go 52.50% <52.50%> (ø)
ipsl/ipsl.go 53.33% <53.33%> (ø)
blocks/blocks.go 64.51% <66.66%> (+0.51%) ⬆️
ipsl/helpers/helpers.go 75.00% <75.00%> (ø)
rapide/rapide.go 76.92% <76.92%> (ø)
rapide/serverdriven.go 80.00% <80.00%> (ø)

@Jorropo Jorropo changed the title rapide: PoC RAPIDE: PoC Jan 31, 2023
@iand
Copy link
Contributor

iand commented Feb 1, 2023

Is there a design doc or spec for rapide? The linked issues don't point me to one.

@Jorropo
Copy link
Contributor Author

Jorropo commented Feb 1, 2023

@iand there is https://www.notion.so/pl-strflt/RAPIDE-3c4fb9e159ae471bb426bb81855cee16 which is a bit outdated (during the implementations I found new tricks which make the implementation much easier, the big arching idea is correct tho).

@Jorropo
Copy link
Contributor Author

Jorropo commented Feb 1, 2023

Presentation of that work here: https://www.youtube.com/watch?v=JZheMPTxvLc

@Jorropo Jorropo force-pushed the rapide branch 3 times, most recently from 78269ef to 719b5e6 Compare February 2, 2023 21:31
@Jorropo Jorropo changed the base branch from main to very-fast-downloads February 3, 2023 10:32
@Jorropo Jorropo marked this pull request as ready for review February 3, 2023 10:33
@Jorropo Jorropo requested review from lidel and hacdias as code owners February 3, 2023 10:33
@Jorropo Jorropo changed the title RAPIDE: PoC RAPIDE & IPSL: first proof of concept Feb 3, 2023
@Jorropo Jorropo force-pushed the rapide branch 3 times, most recently from 74a2a52 to 0932d3b Compare February 3, 2023 11:45
This include a working single threaded structure for RAPIDE.

Todo:
- Multithreading
- dontGoThere map for serverDrivenWorker
- Racing
This help avoiding situations where you go race someone else, in a shallow dag, and you get a block next to them in the traversal.
We do not have consensus nor usecase for the language part of IPSL,
to avoid long debates for some not yet usefull pieces of code,
I've removed it and we will handle merging this part seperately (or never merge it).
In 719b5e6 I changed `download.expand` to release the node lock before returning.
This allows other workers to access the just expanded node while we walk up the chain ancestry.
This mean that when we relock the node later to add it to our list of tasks, someone else may have downloaded some of the blocks already and thus they are not in the childrens slice and thus we wont add them to our list.

This also solve the case where you give a Traversal that is not supported by the underlying protocol,
in that case we want to kill the current download and retry deeper, while previously we would hard error on this and kill the worker.
@Jorropo
Copy link
Contributor Author

Jorropo commented Feb 18, 2023

Moved to ipfs#1

@Jorropo Jorropo closed this Feb 18, 2023
@Jorropo Jorropo deleted the rapide branch February 18, 2023 01:53
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 this pull request may close these issues.

RAPIDE POC
2 participants