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

feat: advance last_common_header even the peer is worse than us #2212

Conversation

keroro520
Copy link
Contributor

last_common_header is like a cursor of block-sync mechanism between the local node and remote peers. The local node only fetches blocks from peers who have a better chain. It means it is not necessary to timely advance the last_common_header of peers whose chain is worse than the local.

However, #2196 adds last_common_header to RPC get_peers. It expects that the returned last_common_header to provide a more realistic picture. Hence I create this PR, timely advance the last_common_header of peers even their chains are worse than the local.

@keroro520 keroro520 requested a review from quake August 6, 2020 05:31
@keroro520 keroro520 requested a review from zhangsoledad as a code owner August 6, 2020 05:31
@keroro520 keroro520 requested a review from a team August 6, 2020 05:31
doitian
doitian previously approved these changes Aug 6, 2020
@keroro520 keroro520 requested review from quake and doitian August 6, 2020 10:43
@keroro520 keroro520 force-pushed the last-common-header-for-peer-with-worse-chain branch from f6bd273 to 6be942a Compare August 6, 2020 15:26
@keroro520 keroro520 force-pushed the last-common-header-for-peer-with-worse-chain branch from 6be942a to 5c42d1b Compare August 7, 2020 04:04
@doitian
Copy link
Member

doitian commented Aug 10, 2020

bors r=quake,doitian

@bors
Copy link
Contributor

bors bot commented Aug 10, 2020

Build succeeded:

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 6f8d256 into nervosnetwork:develop Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants