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 Finalized Epoch Checks #7364

Merged
merged 7 commits into from
Sep 30, 2020
Merged

Fix Finalized Epoch Checks #7364

merged 7 commits into from
Sep 30, 2020

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Sep 28, 2020

What type of PR is this?

  • Feature Addition

What does this PR do? Why is it needed?

  • We now verify the provided finalized epoch with the finalized root. This involved reading
    and finalized blocks and its relevant child blocks and verifying that their respective slots match up.

Which issues(s) does this PR fix?

Fixes #5827

Other notes for review

@nisdas nisdas requested a review from a team as a code owner September 28, 2020 15:59
Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

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

Looks good. Just one comment on test

// TODO(#5827) Verify the finalized block with the epoch in the
// status message
return nil
if helpers.SlotToEpoch(blk.Block.Slot) == msg.FinalizedEpoch {
Copy link
Member

Choose a reason for hiding this comment

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

Tests for these new chunk of code?

@codecov
Copy link

codecov bot commented Sep 28, 2020

Codecov Report

Merging #7364 into master will decrease coverage by 0.12%.
The diff coverage is 32.43%.

@@            Coverage Diff             @@
##           master    #7364      +/-   ##
==========================================
- Coverage   60.20%   60.08%   -0.13%     
==========================================
  Files         418      418              
  Lines       30067    30018      -49     
==========================================
- Hits        18101    18035      -66     
- Misses       9017     9036      +19     
+ Partials     2949     2947       -2     

Comment on lines 210 to 212
if err != nil {
traceutil.AnnotateError(span, err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if err != nil {
traceutil.AnnotateError(span, err)
}
traceutil.AnnotateError(span, err)

AnnotateError is a no-op if err is nil, no need to check here

@nisdas nisdas merged commit 3b5ef50 into master Sep 30, 2020
@delete-merged-branch delete-merged-branch bot deleted the addBetterStatusChecks branch September 30, 2020 00:25
@farazdagi farazdagi mentioned this pull request Oct 1, 2020
61 tasks
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.

Mismatch between Finalized Block And Epoch
3 participants