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

Sending a new block request should override the previous one #1324

Open
ImplOfAnImpl opened this issue Nov 1, 2023 · 0 comments
Open

Sending a new block request should override the previous one #1324

ImplOfAnImpl opened this issue Nov 1, 2023 · 0 comments
Labels
p2p p2p related issues
Milestone

Comments

@ImplOfAnImpl
Copy link
Contributor

Currently when handling a block request we append the newly requested block ids to the queue of previously requested ones, which makes it impossible for the peer to "change its mind" about what blocks it wants to download. Also, because the queue has a size limit, the peer has to download previously requested blocks before even making a new block request.
At this moment this is not an issue, because nodes never send a block request until the previous one is fulfilled. However, in the future we're going to optimize block downloading and peers will need an ability to cancel downloading a block that has already been downloaded from another peer.
A possible solution might be to make a new block request effectively cancel the previous one, overwriting the corresponding queue instead of appending to it.

@ImplOfAnImpl ImplOfAnImpl added the p2p p2p related issues label Nov 1, 2023
@TheQuantumPhysicist TheQuantumPhysicist added this to the Phase Alpha milestone Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2p p2p related issues
Projects
None yet
Development

No branches or pull requests

2 participants