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.2] P2P: Allow irreversible mode syncing to continue when LIB is paused #777

Merged
merged 15 commits into from
Sep 19, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Sep 13, 2024

  • Allow a node to continue syncing ahead when LIB is paused. This is important when running in irreversible mode as the chain_head does not advance until LIB advances.
  • Added some additional debug logging to net_plugin. Also added an info level log when it allows a node to sync ahead past sync-fetch-span of head because LIB is paused.
  • Add new test cases for startup-catchup test.
    • Sync with a sync-fetch-span of 1 while in irreversible mode.
      • Note this only tripped the issue in Savanna mode as the test doesn't run long enough to trigger a LIB catchup in legacy mode. It does a HEAD catchup in legacy mode (at least in my local testing). I didn't modify the test to produce more blocks to force a LIB catchup in legacy mode as the test does already trigger LIB catchup in Savanna mode.

Tested syncing Kylin past the large LIB pause.

Resolves #773

@heifner heifner added the OCI Work exclusive to OCI team label Sep 13, 2024
@heifner heifner linked an issue Sep 13, 2024 that may be closed by this pull request
@heifner heifner marked this pull request as draft September 13, 2024 14:38
plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved
plugins/net_plugin/net_plugin.cpp Show resolved Hide resolved
…ersible mode the chain_head will still be moving and not cause net_plugin to stop syncing.

Only consider if LIB not moving when the span is greater than sync_fetch_span. Otherwise normal operation will cause net_plugin to sync ahead when fork db is just up to date.
…sync when the peer reported even slightly less than sync_known_lib_num which is a very normal condition. For example sync_known_lib_num: 373330666, while peer_fhead: 373330647 when trying to sync block 129728.
@heifner heifner marked this pull request as ready for review September 13, 2024 20:39
plugins/net_plugin/net_plugin.cpp Outdated Show resolved Hide resolved
plugins/net_plugin/net_plugin.cpp Show resolved Hide resolved
@ericpassmore
Copy link
Contributor

Note:start
category: Other
component: Plugins/Cleos/Utils
summary: P2P: Allow irreversible mode syncing to continue when LIB is paused.
Note:end

Comment on lines 2185 to 2188
if (blk_num < head_num) { // avoid underflow on blk_num - head_num
return true;
}
block_num_type num_blocks_not_applied = blk_num - head_num;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (blk_num < head_num) { // avoid underflow on blk_num - head_num
return true;
}
block_num_type num_blocks_not_applied = blk_num - head_num;
block_num_type num_blocks_not_applied = blk_num > head_num ? blk_num - head_num : 0;

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.

Kylin sync stuck
4 participants