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

fix(network): increase state concurrency and syncer lookahead #3455

Merged
merged 3 commits into from
Feb 2, 2022

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Feb 2, 2022

Motivation

On my machine, the syncer can get 4000-6000 blocks ahead of the state. This causes the sync downloader to hit its lookahead limit, and return an error.

This bug happens a lot on testnet, and occasionally on mainnet.

These logs and stalls make it hard to test the other code I'm working on. (And they are a usability issue.)

Solution

  • increase the state buffer bound to the maximum of the sync, inbound, and mempool buffers
  • increase the sync downloader lookahead limit to 6000 blocks by default

This is a temporary quick fix to #3438, but it doesn't close that ticket.

With these changes, my testnet instance syncs in 1 hour, and my mainnet instance syncs in 6 hours. This fix significantly reduces the number of syncer stalls on both networks.

Review

@jvff can review this PR.

I am looking for a quick review to make sure these temporary changes don't break anything.
I expect we will make more changes when we actually schedule #3438 in a sprint.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

It seems like the recent tokio upgrade made this code even more efficient,
so on testnet we can have around 6000 blocks in flight.
@teor2345 teor2345 added C-bug Category: This is a bug P-Low ❄️ I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use A-network Area: Network protocol updates or fixes labels Feb 2, 2022
@teor2345 teor2345 requested a review from jvff February 2, 2022 07:45
@teor2345 teor2345 self-assigned this Feb 2, 2022
@codecov
Copy link

codecov bot commented Feb 2, 2022

Codecov Report

Merging #3455 (fac5caf) into main (499ae89) will decrease coverage by 0.02%.
The diff coverage is 75.88%.

@@            Coverage Diff             @@
##             main    #3455      +/-   ##
==========================================
- Coverage   78.34%   78.31%   -0.03%     
==========================================
  Files         267      272       +5     
  Lines       31526    31549      +23     
==========================================
+ Hits        24698    24707       +9     
- Misses       6828     6842      +14     

zebrad/src/commands/start.rs Show resolved Hide resolved
@mergify mergify bot merged commit fa07156 into main Feb 2, 2022
@mergify mergify bot deleted the state-concurrency-lookahead branch February 2, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes C-bug Category: This is a bug I-slow Problems with performance or responsiveness I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants