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

feat: cosmos v0.50 upgrade #3357

Merged
merged 32 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cf51208
bump versions and fix imports
skosito Jan 7, 2025
8b7e53a
update blockers methods and log imports
skosito Jan 7, 2025
596c7c9
fixes
skosito Jan 7, 2025
fed742b
rpc fixes
skosito Jan 7, 2025
8845478
proto changes
skosito Jan 7, 2025
2fa526a
fixes
skosito Jan 7, 2025
57e4e2d
generate
skosito Jan 7, 2025
0f508cc
mocks
skosito Jan 8, 2025
f15043c
fix testutils keepers
skosito Jan 8, 2025
83f7fa7
fixes
skosito Jan 8, 2025
7406be0
sims fixes
skosito Jan 8, 2025
87689e6
parse genesis fixes
skosito Jan 8, 2025
20d41e6
fixes for start cmd
skosito Jan 8, 2025
d073f11
bump ethermint
skosito Jan 9, 2025
f42c7b2
config fixes
skosito Jan 9, 2025
75a6c02
fixes e2e tests working
skosito Jan 16, 2025
0cd7d74
bump ethermint
skosito Jan 20, 2025
13b1554
Merge branch 'develop' into cosmos-v50-upgrade
skosito Jan 20, 2025
cb52349
fmt
skosito Jan 20, 2025
3e5548f
CI fixes
skosito Jan 20, 2025
1ede4ff
CI fixes
skosito Jan 20, 2025
485a876
lint ci fixes
skosito Jan 20, 2025
9923cc7
unit tests fixes
skosito Jan 20, 2025
c602823
unit tests fixes
skosito Jan 20, 2025
74e9fc4
fix parse gen tests
skosito Jan 20, 2025
49b28d1
fix upgrade test light
skosito Jan 22, 2025
349131a
remove redundant replace
skosito Jan 22, 2025
84eb686
fix invalid bond denom in sim tests
skosito Jan 22, 2025
b0fffd9
bump ethermint
skosito Jan 24, 2025
5277b4b
Merge branch 'develop' into cosmos-v50-upgrade
skosito Jan 24, 2025
1917cf4
add autocli opts and fixes after merge
skosito Jan 24, 2025
aa1babe
Merge branch 'develop' into cosmos-v50-upgrade
skosito Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fmt:
### Generation commands ###
###############################################################################

protoVer=0.13.0
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace --user $(shell id -u):$(shell id -g) $(protoImageName)

Expand Down
4 changes: 2 additions & 2 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"runtime/debug"

errorsmod "cosmossdk.io/errors"
tmlog "github.com/cometbft/cometbft/libs/log"
tmlog "cosmossdk.io/log"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand Down Expand Up @@ -177,7 +177,7 @@ func IsSystemTx(tx sdk.Tx, isAuthorizedSigner func(string) bool) bool {
*observertypes.MsgVoteBlockHeader,
*observertypes.MsgVoteTSS,
*observertypes.MsgVoteBlame:
signers := innerMsg.GetSigners()
signers := innerMsg.(sdk.LegacyMsg).GetSigners()
if len(signers) == 1 {
return isAuthorizedSigner(signers[0].String())
}
Expand Down
13 changes: 7 additions & 6 deletions app/ante/fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"math/big"

errorsmod "cosmossdk.io/errors"
sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down Expand Up @@ -108,7 +109,7 @@ func (mpd MinGasPriceDecorator) AnteHandle(
}
}

reductionRate := sdk.MustNewDecFromStr(GasPriceReductionRate)
reductionRate := sdkmath.LegacyMustNewDecFromStr(GasPriceReductionRate)
minGasPrice = minGasPrice.Mul(reductionRate) // discounts min gas price for system tx

evmParams := mpd.evmKeeper.GetParams(ctx)
Expand All @@ -127,7 +128,7 @@ func (mpd MinGasPriceDecorator) AnteHandle(

// Determine the required fees by multiplying each required minimum gas
// price by the gas limit, where fee = ceil(minGasPrice * gasLimit).
gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(gas))
gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(gas))

for _, gp := range minGasPrices {
fee := gp.Amount.Mul(gasLimit).Ceil().RoundInt()
Expand Down Expand Up @@ -196,10 +197,10 @@ func (empd EthMinGasPriceDecorator) AnteHandle(
feeAmt = ethMsg.GetEffectiveFee(baseFee)
}

gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas()))
gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas()))

requiredFee := minGasPrice.Mul(gasLimit)
fee := sdk.NewDecFromBigInt(feeAmt)
fee := sdkmath.LegacyNewDecFromBigInt(feeAmt)

if fee.LT(requiredFee) {
return ctx, errorsmod.Wrapf(
Expand Down Expand Up @@ -250,8 +251,8 @@ func (mfd EthMempoolFeeDecorator) AnteHandle(
)
}

fee := sdk.NewDecFromBigInt(ethMsg.GetFee())
gasLimit := sdk.NewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas()))
fee := sdkmath.LegacyNewDecFromBigInt(ethMsg.GetFee())
gasLimit := sdkmath.LegacyNewDecFromBigInt(new(big.Int).SetUint64(ethMsg.GetGas()))
requiredFee := minGasPrice.Mul(gasLimit)

if fee.LT(requiredFee) {
Expand Down
16 changes: 7 additions & 9 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import (
"fmt"

cosmoserrors "cosmossdk.io/errors"
storetypes "cosmossdk.io/store/types"
txsigning "cosmossdk.io/x/tx/signing"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ethante "github.com/zeta-chain/ethermint/app/ante"
ethermint "github.com/zeta-chain/ethermint/types"
evmtypes "github.com/zeta-chain/ethermint/x/evm/types"
Expand All @@ -43,8 +43,8 @@ type HandlerOptions struct {
FeeMarketKeeper FeeMarketKeeper
EvmKeeper EVMKeeper
FeegrantKeeper ante.FeegrantKeeper
SignModeHandler authsigning.SignModeHandler
SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
SignModeHandler *txsigning.HandlerMap
SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
MaxTxGasWanted uint64
ExtensionOptionChecker ante.ExtensionOptionChecker
TxFeeChecker ante.TxFeeChecker
Expand Down Expand Up @@ -165,8 +165,6 @@ func newCosmosAnteHandlerForSystemTx(options HandlerOptions) sdk.AnteHandler {
)
}

var _ GasTx = (*legacytx.StdTx)(nil) // assert StdTx implements GasTx

// GasTx defines a Tx with a GetGas() method which is needed to use SetUpContextDecorator
type GasTx interface {
sdk.Tx
Expand Down Expand Up @@ -209,7 +207,7 @@ func (sud SetUpContextDecorator) AnteHandle(
defer func() {
if r := recover(); r != nil {
switch rType := r.(type) {
case sdk.ErrorOutOfGas:
case storetypes.ErrorOutOfGas:
log := fmt.Sprintf(
"out of gas in location: %v; gasWanted: %d, gasUsed: %d",
rType.Descriptor, gasTx.GetGas(), newCtx.GasMeter().GasConsumed())
Expand Down
Loading
Loading