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-beta2] P2P: Prevent syncing from running ahead of chain head #282

Merged
merged 4 commits into from
Jun 13, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Jun 13, 2024

P2P syncing was using fork database head for a limited factor on how far ahead to request blocks. With the recent change to ingest blocks quickly into the fork database (AntelopeIO/leap#2385), this allowed the fork database to load hundred of thousands of blocks ahead of chain head.

Use chain head instead of fork database head for sync ahead calculation.

Resolves #278

@heifner heifner requested review from greg7mdp and linh2931 June 13, 2024 11:39
@heifner heifner added the OCI Work exclusive to OCI team label Jun 13, 2024
@heifner heifner linked an issue Jun 13, 2024 that may be closed by this pull request
@@ -3153,10 +3156,10 @@ namespace eosio {
pending_message_buffer.advance_read_ptr( message_length );
return true;
}
peer_dlog( this, "received block ${num}, id ${id}..., latency: ${latency}ms, head ${h}",
peer_dlog( this, "received block ${num}, id ${id}..., latency: ${latency}ms, head ${h}, fdb_head ${f}",
Copy link
Member Author

Choose a reason for hiding this comment

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

Used fdb_head as having fork in the logs can causes confusion.

plugins/net_plugin/net_plugin.cpp Show resolved Hide resolved
plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved
plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved
plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved
@heifner heifner merged commit 169d422 into release/1.0-beta2 Jun 13, 2024
36 checks passed
@heifner heifner deleted the GH-278-p2p-sync-beta2 branch June 13, 2024 19:08
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: P2P prevent syncing from running ahead o chain head, use chain head instead of fork database head for sync ahead calculation.
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 into network runs ahead
4 participants