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

tendermint: ensure ValidatorIndex is ≤ i32::MAX #1411

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

mina86
Copy link
Contributor

@mina86 mina86 commented Apr 17, 2024

During conversion from usize to ValidatorIndex first convert the value to i32 to make sure that the value is ≤ i32::MAX. Without that intermediate conversion, u32::MAX as usize is successfully converted into the index.

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Added entry in .changelog/

During conversion from usize to ValidatorIndex first convert the value
to `i32` to make sure that the value is ≤ i32::MAX.  Without that
intermediate conversion, `u32::MAX as usize` is successfully converted
into the index.
@romac romac merged commit 6399b5b into informalsystems:main Apr 17, 2024
22 checks passed
@mina86 mina86 deleted the b branch April 17, 2024 13:00
mina86 added a commit to mina86/tendermint-rs that referenced this pull request Apr 18, 2024
During conversion from usize to ValidatorIndex first convert the value
to `i32` to make sure that the value is ≤ i32::MAX.  Without that
intermediate conversion, `u32::MAX as usize` is successfully converted
into the index.
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