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

eth/downloader: fetch blocks in chain order, concurrently with fetch hashes #858

Closed
karalabe opened this issue May 5, 2015 · 3 comments
Closed
Assignees

Comments

@karalabe
Copy link
Member

karalabe commented May 5, 2015

Currently the downloader retrieves blocks in a random order due to an unordered underlying fetch queue implementation. This however means that -- statistically -- the entire blockchain needs to be pulled into memory before it's written out to disk, having an O(n) memory complexity, whereas it's possible in O(1). (i.e. if we're aiming for an rpi, this is a must).

On a similar note -- if I'm not mistaking -- all the hashes are retrieved first, and only then does the block downloader start. This should imho be done concurrently, as there is no need to wait for the hashes if there's already something available to pull.

@karalabe karalabe self-assigned this May 5, 2015
@obscuren
Copy link
Contributor

obscuren commented May 5, 2015

Priority queue, yes.

Hashes and downloading blocks concurrently, no. This opens up for attack vectors.

@ebuchman
Copy link
Contributor

ebuchman commented May 6, 2015

related to #604, but shouldn't we fetch in incrementing order rather than decrementing from a self-reported (unverified) best TD?

@karalabe
Copy link
Member Author

Closed by #863.

tony-ricciardi pushed a commit to tony-ricciardi/go-ethereum that referenced this issue Jan 20, 2022
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

No branches or pull requests

3 participants