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

[1.0.1] P2P: syncing fix #671

Merged
merged 5 commits into from
Sep 5, 2024
Merged

[1.0.1] P2P: syncing fix #671

merged 5 commits into from
Sep 5, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Aug 29, 2024

Two small P2P syncing fixes:

  • Do not request next range of blocks if sync_last_requested_num is 0 as that case is handled in the first part of the if. If we do request a new range, request from a potentially different peer. Noticed that in practice it would often stick to its current peer here as this would be the first time it realized it needs a new range of blocks.
  • Update sync_active_time when a block is received. Noticed this "timer" was firing simply because it was taking too long to apply the blocks. I was testing with sync-fetch-span of 5000.
  • Normalize on using steady_clock for stopwatch functionality.

Resolves #670

…ext_chunk() if sync_last_requested_num > 0 as a request was likely just made.
…plicable when no blocks are being received.
@heifner heifner requested review from greg7mdp and linh2931 August 29, 2024 13:55
@heifner heifner added the OCI Work exclusive to OCI team label Aug 29, 2024
@heifner heifner linked an issue Aug 29, 2024 that may be closed by this pull request
@@ -2485,6 +2483,7 @@ namespace eosio {
return;
}
c->latest_blk_time = std::chrono::system_clock::now();
sync_active_time = std::chrono::steady_clock::now(); // reset when we receive a block
Copy link
Member

Choose a reason for hiding this comment

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

You can do sync_active_time = c->latest_blk_time = std::chrono::system_clock::now(); to guarantee they are all the same.

@greg7mdp
Copy link
Contributor

Looks like latest_msg_time should use steady_clock as well.

heifner added a commit that referenced this pull request Aug 29, 2024
@heifner heifner changed the title [1.0] P2P: syncing fix [1.0.1] P2P: syncing fix Aug 29, 2024
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Peer syncing fixes to improve active sync time, better normalizer timer, and skip unneeded request for additional blocks.
Note:end

@heifner heifner merged commit d808a1a into release/1.0 Sep 5, 2024
36 checks passed
@heifner heifner deleted the GH-670-p2p-sync branch September 5, 2024 18:11
@ericpassmore
Copy link
Contributor

Note:start
category: Other
component: Plugins/Cleos/Utils
summary: Peer syncing fixes to improve active sync time, better normalizer timer, and skip unneeded request for additional blocks.
Note:end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2P syncing re-requesting ranges
4 participants