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

feat: fnet-163 process dag-pb unixfs files #26

Merged
merged 30 commits into from
Sep 4, 2024

Conversation

jproyo
Copy link
Contributor

@jproyo jproyo commented Sep 2, 2024

No description provided.

@jproyo jproyo requested a review from kckeiks September 3, 2024 10:54
core/origin-ipfs/src/decoder.rs Show resolved Hide resolved
lib/fleek-ipld/src/walker/processor.rs Show resolved Hide resolved
lib/fleek-ipld/src/walker/processor.rs Show resolved Hide resolved
Comment on lines +76 to +81
async fn request(&self, cid: &Cid) -> Result<Bytes, IpldError> {
let url = self.ipfs_url.clone();
let url = url.join(&format!("ipfs/{}?format=raw", cid))?;
let response = reqwest::get(url).await?;
response.bytes().await.map_err(Into::into)
}
Copy link
Member

Choose a reason for hiding this comment

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

It seems like we're making an individual request for each ipld block here, however it would be much faster to gather blocks from a streamed CAR file and lazily evaluate whole files/folders from them as we get each block. Since car archives would include every ipld block needed for the root cid, and we'd no longer have to deal with TLS roundtripping in between each small piece of data, we'd maintain better network throughput and reduce latency on cold content

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice tip. I will address this in the next PR where I will also improve memory management.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created this ticket that I am going to address today https://linear.app/fleekxyz/issue/FNET-191/improve-ipld-download-and-memory-management @ozwaldorf. If you are ok, I will improve this in another PR.
Thanks for taking the time to review it @ozwaldorf

@jproyo jproyo merged commit 2c550dc into main Sep 4, 2024
10 checks passed
@jproyo jproyo deleted the feat/fnet-163/map-ipld-dag-pb-to-b3fs branch September 4, 2024 07:42
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.

3 participants