-
Notifications
You must be signed in to change notification settings - Fork 7
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
[WILL NOT BE MERGED] Kava v0.50.10 patch #84
base: main
Are you sure you want to change the base?
Conversation
@@ -120,7 +120,7 @@ | |||
|
|||
// Determine the required fees by multiplying each required minimum gas | |||
// price by the gas limit, where fee = ceil(minGasPrice * gasLimit). | |||
glDec := sdk.NewDec(int64(gas)) | |||
glDec := sdkmath.LegacyNewDec(int64(gas)) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion Error
@@ -77,7 +78,7 @@ | |||
|
|||
// Observe which users define a gas limit >> gas used. Note, that | |||
// gas_limit and gas_used are always > 0 | |||
gasLimit := sdk.NewDec(int64(tx.Gas())) | |||
gasLimit := sdkmath.LegacyNewDec(int64(tx.Gas())) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion Error
@@ -406,15 +407,15 @@ | |||
// calculate a minimum amount of gas to be charged to sender if GasLimit | |||
// is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics | |||
// for more info https://github.com/evmos/ethermint/issues/1085 | |||
gasLimit := sdk.NewDec(int64(msg.Gas())) | |||
gasLimit := sdkmath.LegacyNewDec(int64(msg.Gas())) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion Error
minGasMultiplier := k.GetMinGasMultiplier(ctx) | ||
minimumGasUsed := gasLimit.Mul(minGasMultiplier) | ||
|
||
if msg.Gas() < leftoverGas { | ||
return nil, errorsmod.Wrapf(types.ErrGasOverflow, "message gas limit < leftover gas (%d < %d)", msg.Gas(), leftoverGas) | ||
} | ||
|
||
gasUsed := sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(temporaryGasUsed))).TruncateInt().Uint64() | ||
gasUsed := sdkmath.LegacyMaxDec(minimumGasUsed, sdkmath.LegacyNewDec(int64(temporaryGasUsed))).TruncateInt().Uint64() |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion Error
@@ -66,8 +66,8 @@ | |||
// this will be keep BaseFee protected from un-penalized manipulation | |||
// more info here https://github.com/evmos/ethermint/pull/1105#discussion_r888798925 | |||
minGasMultiplier := k.GetParams(ctx).MinGasMultiplier | |||
limitedGasWanted := sdk.NewDec(int64(gasWanted)).Mul(minGasMultiplier) | |||
gasWanted = sdk.MaxDec(limitedGasWanted, sdk.NewDec(int64(gasUsed))).TruncateInt().Uint64() | |||
limitedGasWanted := sdkmath.LegacyNewDec(int64(gasWanted)).Mul(minGasMultiplier) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion Error
limitedGasWanted := sdk.NewDec(int64(gasWanted)).Mul(minGasMultiplier) | ||
gasWanted = sdk.MaxDec(limitedGasWanted, sdk.NewDec(int64(gasUsed))).TruncateInt().Uint64() | ||
limitedGasWanted := sdkmath.LegacyNewDec(int64(gasWanted)).Mul(minGasMultiplier) | ||
gasWanted = sdkmath.LegacyMaxDec(limitedGasWanted, sdkmath.LegacyNewDec(int64(gasUsed))).TruncateInt().Uint64() |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion Error
feemarket.AppModuleBasic{}, | ||
) | ||
// authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), | ||
ac = authcodec.NewBech32Codec(cmdconfig.Bech32PrefixAccAddr) |
Check warning
Code scanning / CodeQL
Directly using the bech32 constants Warning
@@ -354,6 +367,7 @@ | |||
|
|||
// pass false to not commit StateDB | |||
rsp, err = k.ApplyMessageWithConfig(ctx, msg, nil, false, cfg, txConfig) | |||
fmt.Println("Keeper EstimateGas 3", rsp.GasUsed, err) |
Check warning
Code scanning / CodeQL
Missing error check Warning
Fork from main, using this one at kava v50 upgrade staff