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

[WILL NOT BE MERGED] Kava v0.50.10 patch #84

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open

Conversation

boodyvo
Copy link

@boodyvo boodyvo commented Oct 23, 2024

Fork from main, using this one at kava v50 upgrade staff

@@ -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

Potential integer overflow by integer type conversion
@@ -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

Potential integer overflow by integer type conversion
@@ -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

Potential integer overflow by integer type conversion
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

Potential integer overflow by integer type conversion
@@ -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

Potential integer overflow by integer type conversion
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

Potential integer overflow by integer type conversion
x/evm/module.go Fixed Show fixed Hide fixed
app/app.go Fixed Show fixed Hide fixed
feemarket.AppModuleBasic{},
)
// authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
ac = authcodec.NewBech32Codec(cmdconfig.Bech32PrefixAccAddr)

Check warning

Code scanning / CodeQL

Directly using the bech32 constants Warning

Directly using the bech32 constants instead of the configuration values
app/app.go Fixed Show fixed Hide fixed
app/app.go Fixed Show fixed Hide fixed
cmd/ethermintd/root.go Fixed Show fixed Hide fixed
cmd/ethermintd/root.go Fixed Show fixed Hide fixed
app/ante/eip712_legacy.go Fixed Show fixed Hide fixed
app/ante/eip712_legacy.go Fixed Show fixed Hide fixed
app/ante/eip712_legacy.go Fixed Show fixed Hide fixed
app/ante/eip712_types.go Fixed Show fixed Hide fixed
@@ -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

rsp
may be nil at this dereference because
err
may not have been checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants