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

fix(chain): handle long block height gap #3155

Merged
merged 4 commits into from
Aug 16, 2020

Conversation

bowenwang1996
Copy link
Collaborator

Currently we drop blocks when they are more than 500 heights from our head. However, this means that if the network stalled for some time and recover, a valid block whose height is more than 500 ahead but whose prev block is our head may be dropped and will cause the node to stall.

Test plan

test_long_gap_between_blocks

@gitpod-io
Copy link

gitpod-io bot commented Aug 13, 2020

@codecov
Copy link

codecov bot commented Aug 13, 2020

Codecov Report

Merging #3155 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3155   +/-   ##
=======================================
  Coverage   87.94%   87.94%           
=======================================
  Files         212      212           
  Lines       43004    43004           
=======================================
  Hits        37819    37819           
  Misses       5185     5185           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d2839ca...8ef1d5b. Read the comment docs.

@SkidanovAlex
Copy link
Collaborator

Can we test that if a block has height u64::max, we do not crash in any way before we reject it as having incorrect approvals?
Or keep the limit, but set it to something very large, like 4B?

@bowenwang1996
Copy link
Collaborator Author

@bowenwang1996 bowenwang1996 merged commit d3faebd into master Aug 16, 2020
@bowenwang1996 bowenwang1996 deleted the fix-block-height-long-gap branch August 16, 2020 21:13
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.

2 participants