-
Notifications
You must be signed in to change notification settings - Fork 10
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: update toolchain clippy, fix clippy. Fix vulnarabilities #53
Conversation
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.
LGTM, but also it would be good to add a description about why an error occurs in the #Errors section in the doc-comments. But it's probably out of the scope of this PR.
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.
Great job!
runtime/src/lib.rs
Outdated
@@ -445,7 +465,8 @@ impl Config { | |||
|
|||
// See https://eips.ethereum.org/EIPS/eip-3529 | |||
let refund_sstore_clears = if decrease_clears_refund { | |||
(gas_sstore_reset + gas_access_list_storage_key) as i64 | |||
// Avoid signed casting to unsigned as it'll overflow |
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.
// Avoid signed casting to unsigned as it'll overflow | |
// Avoid unsigned casting to signed as it may overflow |
Description
➡️ Updated rust toolchain to
⚠️ Found and fixed vulnerabilities related to
1.80.0
➡️ Added
clippy::pedantic
➡️ Fixed new clippy issues
signed->unsigned
casting. It affectsgas_used
calculations. In some cases, it was possible cases, when castingi64->u64
could produce an unexpected number, andgas_used
calculation may produce wrong result.➡️ Fixed casting logic for
u64->usize
as it can produce truncated numbers fro 32-bit systems (likewasm32
)➡️ Improved numbers casting logic
➡️ Added
clippy::as_conversions