vote: Use wrapping pow with min lockout history in lockout() calculation#92
Merged
jstarry merged 1 commit intoanza-xyz:masterfrom Mar 31, 2025
mjain-jump:master
Merged
vote: Use wrapping pow with min lockout history in lockout() calculation#92jstarry merged 1 commit intoanza-xyz:masterfrom mjain-jump:master
lockout() calculation#92jstarry merged 1 commit intoanza-xyz:masterfrom
mjain-jump:master
Conversation
lockout() calculationlockout() calculation
…ation to avoid panics
Contributor
|
This seems reasonable but I have a slight preference to saturating_pow because then lockouts from invalid conf counts would be a bit more apparent vs hidden with your current approach, @AshwinSekar thoughts? |
Contributor
Author
How about standard |
AshwinSekar
approved these changes
Mar 31, 2025
Contributor
AshwinSekar
left a comment
There was a problem hiding this comment.
I'm fine with the min approach
grod220
added a commit
that referenced
this pull request
Mar 9, 2026
* Add support for PodList * Review updates * Fix test + add more specific doc string * Review updates * ListView entrypoint pattern * Add sizing methods to trait * Review updates
grod220
added a commit
that referenced
this pull request
Mar 16, 2026
* Add support for PodList * Review updates * Fix test + add more specific doc string * Review updates * ListView entrypoint pattern * Add sizing methods to trait * Review updates
grod220
added a commit
that referenced
this pull request
Mar 18, 2026
* Add support for PodList * Review updates * Fix test + add more specific doc string * Review updates * ListView entrypoint pattern * Add sizing methods to trait * Review updates
grod220
added a commit
that referenced
this pull request
Mar 19, 2026
* Add support for PodList * Review updates * Fix test + add more specific doc string * Review updates * ListView entrypoint pattern * Add sizing methods to trait * Review updates
grod220
added a commit
that referenced
this pull request
Mar 19, 2026
* Add support for PodList * Review updates * Fix test + add more specific doc string * Review updates * ListView entrypoint pattern * Add sizing methods to trait * Review updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default behavior in the vote lockouts calculation is to panic on larger confirmation counts. This case never gets hit in production / mainnet, but our fuzzers often hit this case when fuzzing at the instruction / transaction level and providing arbitrary confirmation counts within the account data. Since this case is incredibly difficult to prevent in the fuzzer's mutations, we choose to handle this behavior more gracefully by avoiding the panic due to overflow.