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

P2P: Fix net_plugin requesting same range repeatedly #516

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,7 @@ namespace eosio {
return;
}

if( sync_state != lib_catchup || !sync_source ) {
if( sync_state != lib_catchup ) {
set_state( lib_catchup );
sync_last_requested_num = 0;
sync_next_expected_num = chain_info.lib_num + 1;
Expand Down Expand Up @@ -2518,8 +2518,6 @@ namespace eosio {
} else {
if (blk_num == sync_next_expected_num) {
++sync_next_expected_num;
} else if (blk_num < sync_next_expected_num) {
sync_next_expected_num = blk_num + 1;
}
}
if (blk_num >= sync_known_lib_num) {
Expand All @@ -2542,8 +2540,7 @@ namespace eosio {
}
} else { // blk_applied
if (blk_num >= sync_last_requested_num) {
// should not reach as should have hit the above when the block was received but not applied, but
// if we do then request blocks as we are still in lib_catchup
// Did not request blocks ahead, likely because too far ahead of head
fc_dlog(logger, "Requesting blocks, head: ${h} fhead ${fh} blk_num: ${bn} sync_next_expected_num ${nen} "
"sync_last_requested_num: ${lrn}, sync_last_requested_block: ${lrb}",
("h", my_impl->get_chain_head_num())("fh", my_impl->get_fork_head_num())
Expand Down