-
Notifications
You must be signed in to change notification settings - Fork 166
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
Backport: Fix get highest executed and finalized height #5904
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
engine/execution/state/state.go
Outdated
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 | ||
} |
There was a problem hiding this comment.
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)
a8426a5
to
fbf24e0
Compare
Backport: #5903