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

Split big storage proof requests into smaller ones #1209

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Oct 11, 2023

cc #692 (probably fixes it, but I'm not sure) @josepot

This PR adds some code that dynamically splits big storage requests into smaller ones.

The way it works is pretty simple: we estimate the number of nodes that will be returned by the remote, and if it's above a certain cap we send the request in preparation now and will send the rest later.

Additionally, if there's a timeout or something like that, we reduce the cap.
Note that this gives the possibility for a malicious peer to intentionally not respond and reduce the cap, but given that peers selection is in principle random this is in practice normally not a problem.

I haven't tested whether this PR works as intended or not. I've tested whether storage proofs in general still work, and they do, but I don't know how to test whether big requests work.

@tomaka tomaka enabled auto-merge October 11, 2023 09:54
@tomaka tomaka added this pull request to the merge queue Oct 11, 2023
Merged via the queue into smol-dot:main with commit c6a3996 Oct 11, 2023
21 checks passed
@tomaka tomaka deleted the split-big-rqs branch October 11, 2023 10:52
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.

1 participant