Skip to content

[5.0] P2P: Fix: Throttling of last block of request caused lost block#1791

Merged
heifner merged 1 commit intorelease/5.0from
GH-1776-throttle-fix-5.0
Oct 18, 2023
Merged

[5.0] P2P: Fix: Throttling of last block of request caused lost block#1791
heifner merged 1 commit intorelease/5.0from
GH-1776-throttle-fix-5.0

Conversation

@heifner
Copy link
Contributor

@heifner heifner commented Oct 17, 2023

When throttling was enabled on a connection, the net_plugin would assume the last block of a peer_requested was sent and reset the peer_requested indicating no other sync blocks need to be sent to the peer. This caused the block to not be sent or rescheduled to be sent later resulting in the peer not receiving the block. The peer would have to wait for a full timeout before requesting the required block from a different peer.

Resolves #1776

@heifner heifner added the OCI Work exclusive to OCI team label Oct 17, 2023
@heifner heifner requested review from greg7mdp and linh2931 October 17, 2023 19:02
@heifner heifner linked an issue Oct 17, 2023 that may be closed by this pull request
Copy link
Contributor

@greg7mdp greg7mdp left a comment

Choose a reason for hiding this comment

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

I think I'd get rid of num, and use cc.fetch_block_by_number( peer_requested->last + 1 ); and peer_requested->last below, but it is a matter of preference.

@heifner heifner merged commit f65b06c into release/5.0 Oct 18, 2023
@heifner heifner deleted the GH-1776-throttle-fix-5.0 branch October 18, 2023 12:45
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: p2p_sync_throttle_test

3 participants