-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(client/tx): avoid integer uint64->int64 overflow by big.Int conversion #18622
Conversation
Warning Rate Limit Exceeded@odeke-em has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 12 minutes and 49 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughRecent updates to the codebase have focused on enhancing robustness and stability, particularly in the areas of fee calculation and error handling. The conversion of gas values to a decimal representation has been improved to prevent numerical issues. Additionally, the software now handles missing keys and configuration errors more gracefully, avoiding abrupt terminations and panics. These changes contribute to a more reliable and user-friendly system. Changes
TipsChat with CodeRabbit Bot (
|
This comment has been minimized.
This comment has been minimized.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Commits
Files that changed from the base of the PR and between e049998 and d1b9e60dceaf50fcba1880dd5712a76872d8922b.Files selected for processing (1)
- client/tx/factory.go (1 hunks)
Additional comments: 1
client/tx/factory.go (1)
- 311-319: The changes in the
BuildUnsignedTx
method correctly implement the conversion off.gas
tomath.LegacyDec
usingbig.Int.SetUint64(f.gas)
to prevent overflow issues, as per the PR objective. The logic for deriving fees based on gas prices and limits has been updated accordingly.
d1b9e60
to
8b328ba
Compare
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Commits
Files that changed from the base of the PR and between e049998 and 8b328bad212c004870e3d5c7e5923603a031e52f.Files selected for processing (2)
- CHANGELOG.md (1 hunks)
- client/tx/factory.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- client/tx/factory.go
Additional comments: 2
CHANGELOG.md (2)
74-74: There is an inconsistency between the PR objectives and the hunk regarding the behavior of the
keys delete
command. The PR objectives state that the command has been updated to terminate gracefully when a key is not found, while the hunk suggests that it won't terminate under the same condition. Please clarify the intended behavior.74-74: The changes listed in the hunk for the
CHANGELOG.md
correctly reflect the fixes and improvements described in the PR objectives and the generated summaries. The fixes address potential under/overflow issues, configuration parsing, and error handling enhancements.
…rsion Avoids a potential uint64->int64 overflow when creating math.LegacyDec, instead opting to use big.Int.SetUint64(x) Fixes https://github.com/cosmos/cosmos-sdk/security/code-scanning/9412
8b328ba
to
0651ad6
Compare
Avoids a potential uint64->int64 overflow when creating math.LegacyDec, instead opting to use big.Int.SetUint64(x)
Fixes https://github.com/cosmos/cosmos-sdk/security/code-scanning/9412
Summary by CodeRabbit
keys delete
command to terminate correctly when a specified key is not found.GetConsensusParams
function to return an empty struct instead of causing a panic when no parameters are detected.