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

adjust state sync timeouts #12425

Merged
merged 13 commits into from
Nov 11, 2024
Merged

Conversation

saketh-are
Copy link
Collaborator

@saketh-are saketh-are commented Nov 10, 2024

This PR improves configurability of state sync by separating the config parameters for different kinds of timeouts:

  • state_sync_timeout is used as it always has been when downloading from external storage.
  • state_sync_p2p_timeout is used when downloading from peers in the network.
  • state_sync_retry_timeout controls time between download attempts.

We also lower the number of retry attempts for p2p state sync from 5 to 3. Why? In testnet we see that requests are generally handled reliably and if a request fails it is usually because the target node is throttling incoming requests. In the case that peers are overwhelmed by traffic we would rather fall back to cloud storage sooner than send more requests (which will be throttled anyway).

Copy link

codecov bot commented Nov 10, 2024

Codecov Report

Attention: Patch coverage is 97.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.42%. Comparing base (c5de08f) to head (a671327).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
chain/client/src/sync/state/mod.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12425      +/-   ##
==========================================
+ Coverage   71.40%   71.42%   +0.01%     
==========================================
  Files         837      837              
  Lines      169023   169049      +26     
  Branches   169023   169049      +26     
==========================================
+ Hits       120699   120739      +40     
+ Misses      42980    42961      -19     
- Partials     5344     5349       +5     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.28% <27.02%> (+<0.01%) ⬆️
integration-tests 39.37% <97.50%> (+0.01%) ⬆️
linux 70.70% <97.50%> (+<0.01%) ⬆️
linux-nightly 71.00% <97.50%> (+0.01%) ⬆️
macos 50.94% <64.86%> (+0.01%) ⬆️
pytests 1.59% <27.02%> (+<0.01%) ⬆️
sanity-checks 1.40% <27.02%> (+<0.01%) ⬆️
unittests 63.94% <64.86%> (+0.01%) ⬆️
upgradability 0.21% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@saketh-are saketh-are marked this pull request as ready for review November 10, 2024 23:32
@saketh-are saketh-are requested a review from a team as a code owner November 10, 2024 23:32
Copy link
Contributor

@VanBarbascu VanBarbascu left a comment

Choose a reason for hiding this comment

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

Other than that name refactoring this looks good.

@saketh-are saketh-are added this pull request to the merge queue Nov 11, 2024
Merged via the queue into near:master with commit f99bb96 Nov 11, 2024
30 of 31 checks passed
@saketh-are saketh-are deleted the adjust-state-sync-timeout branch November 11, 2024 19:50
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.

2 participants