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 overflow in state sync eta #1195

Merged
merged 5 commits into from
May 30, 2024
Merged

Fix overflow in state sync eta #1195

merged 5 commits into from
May 30, 2024

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented May 29, 2024

Why this should be merged

This calculation has the potential to overflow:
now.Sub(t.triesStartTime) * time.Duration(t.triesRemaining)

How this works

time.Duration(t.triesRemaining/t.triesSynced) is less likely to overflow as the ratio decreases as the time passed goes on.

How this was tested

CI

How is this documented

N/A

@darioush darioush marked this pull request as ready for review May 29, 2024 19:31
@darioush darioush requested a review from ceyonur as a code owner May 29, 2024 19:31
@ceyonur ceyonur enabled auto-merge (squash) May 30, 2024 12:04
@ceyonur ceyonur merged commit 3958b59 into master May 30, 2024
12 checks passed
@ceyonur ceyonur deleted the overflow-statesync-eta branch May 30, 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
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants