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: Set peer_syncing_from_us to false when a recent block is received #315

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Jun 18, 2024

A node will set peer_syncing_from_us to false on a request_message of none or if it receives a handshake indicating it is synced. This PR sets peer_syncing_from_us to false if a node receive a recent block from the network as blocks are only relayed after they are validated. Therefore, if we receive a recent block from a peer we know that peer can't be syncing from us even if they have failed to send us a handshake letting us know they are up to date.

Resolves #302

@heifner heifner requested review from greg7mdp and linh2931 June 18, 2024 18:55
@heifner heifner added the OCI Work exclusive to OCI team label Jun 18, 2024
@heifner heifner linked an issue Jun 18, 2024 that may be closed by this pull request
if( app().is_quiting() ) {
c->close( false, true );
return;
}
c->latest_blk_time = std::chrono::system_clock::now();
c->block_status_monitor_.accepted();
if (blk_latency.count() < config::block_interval_us && c->peer_syncing_from_us) {
Copy link
Member

Choose a reason for hiding this comment

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

You probably don't need && c->peer_syncing_from_us.

@heifner heifner merged commit 07e63c8 into release/1.0-beta2 Jun 20, 2024
71 checks passed
@heifner heifner deleted the GH-302-sync-beta2 branch June 20, 2024 00:36
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Add cases where we update peer syncing status to more accurately reflect peer syncing from us status.
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.

Test failure: lib_advance_if_test
4 participants