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: increase downloader block body allowance #23074

Merged
merged 2 commits into from
Jun 25, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Jun 20, 2021

This PR increases the cache size from 64 to 256 Mb for block bodies. Benchmarks have shown this to be one bottleneck when trying to achieve higher download speeds.

Plus some minor changes to reduce lookups.

// If the header is already known, skip it, otherwise store
if !hc.HasHeader(hash, number) {
alreadyKnown := parentKnown && hc.HasHeader(hash, number)
if !alreadyKnown {
Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason, the way the check is written here seems unintuitive. I spent quite a bit of time trying to find a better way, but couldn't figure it out.

@fjl fjl merged commit 2d4eff2 into ethereum:master Jun 25, 2021
@fjl fjl added this to the 1.10.5 milestone Jun 25, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
)

This change increases the cache size from 64 to 256 Mb for block bodies.
Benchmarks have shown this to be one bottleneck when trying to achieve
higher download speeds.

The commit also includes a minor optimization for header inserts in package
core: previously, the presence of headers in the database was checked for
every header before writing it. With the change, if one header fails the
presence check, all subsequent headers are also assumed to be missing.
This is an improvement because in practice, the headers are almost always
missing during sync.
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