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

chore: Remove last processed height #167

Merged
merged 4 commits into from
Nov 27, 2024
Merged

Conversation

gitferry
Copy link
Member

The lastProcessedHeight was introduced for fast catch up blocks for which the fp does not have voting power. However, this case rarely happens and is unharmful. More discussions can be found here.

Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

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

Nice cleanup!

lastProcessedHeight := fp.GetLastProcessedHeight()
startHeight = fppath.MaxUint64(startHeight, lastProcessedHeight+1)
// consider the height after the last voted height
startHeight = fppath.MaxUint64(startHeight, fp.GetLastVotedHeight()+1)
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
startHeight = fppath.MaxUint64(startHeight, fp.GetLastVotedHeight()+1)
startHeight = max[uint64](startHeight, fp.GetLastVotedHeight()+1)

Copy link
Member

Choose a reason for hiding this comment

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

Nit, let's remove this util function and use go's built-in one. I see that we always pass 2 arguments anyways

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point!

@gitferry gitferry merged commit b4cd6ac into main Nov 27, 2024
12 checks passed
@gitferry gitferry deleted the gai/remove-last-processed-height branch November 27, 2024 15:32
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