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

Backport: Fix get highest executed and finalized height #5904

Merged
merged 2 commits into from May 14, 2024

Conversation

zhangchiqing
Copy link
Member

@zhangchiqing zhangchiqing commented May 13, 2024

Backport: #5903

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.75%. Comparing base (5fd8467) to head (235fe48).
Report is 2 commits behind head on v0.33.

Additional details and impacted files
@@             Coverage Diff             @@
##            v0.33    #5904       +/-   ##
===========================================
- Coverage   55.94%   43.75%   -12.20%     
===========================================
  Files         353        8      -345     
  Lines       31192      432    -30760     
===========================================
- Hits        17451      189    -17262     
+ Misses      12355      238    -12117     
+ Partials     1386        5     -1381     
Flag Coverage Δ
unittests 43.75% <ø> (-12.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhangchiqing zhangchiqing marked this pull request as ready for review May 13, 2024 18:37
Comment on lines 531 to 535
if finalizedHeight >= executedHeight {
finalizedID, err = s.headers.BlockIDByHeight(executedHeight)
if err != nil {
return 0, fmt.Errorf("could not get header by height %v: %w", executedHeight, err)
}
highest = executedHeight
} else {
finalizedID, err = s.headers.BlockIDByHeight(finalizedHeight)
if err != nil {
return 0, fmt.Errorf("could not get header by height %v: %w", executedHeight, err)
}
highest = finalizedHeight
}
Copy link
Member

Choose a reason for hiding this comment

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

maybe:

highest := math.Max(executedHeight, finalizedHeight)

@zhangchiqing zhangchiqing force-pushed the leo/v0.33-fix-get-highest-executed-and-finalized branch from a8426a5 to fbf24e0 Compare May 14, 2024 16:55
@zhangchiqing zhangchiqing merged commit ebb172e into v0.33 May 14, 2024
51 checks passed
@zhangchiqing zhangchiqing deleted the leo/v0.33-fix-get-highest-executed-and-finalized branch May 14, 2024 17:03
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.

None yet

4 participants