Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
74fe788
feat: upgrade cosmos/evm from v0.3.2 to v0.4.0
AryaLanjewar3005 May 18, 2026
53aa395
fix: add gasCap parameter to all CallEVM call sites and mock expectat…
AryaLanjewar3005 May 18, 2026
4cb80cb
go.mod and go.sum changes
AryaLanjewar3005 May 18, 2026
8bddb25
fix: make sh-testnet genesis params fix for evm 0.4.0 upgrade
AryaLanjewar3005 May 18, 2026
4d9cbdf
chore: upgrade handler for evm 0.4.0 upgraded added
AryaLanjewar3005 May 19, 2026
673cee7
fix: erc20 precompile upgrade logic added to upgrade handler
AryaLanjewar3005 May 25, 2026
53e25af
feat: evm 0.5.0 upgrade changes
AryaLanjewar3005 May 29, 2026
32a11f8
chore: updated evm dependency to match evm 0.5.0 upgrade
AryaLanjewar3005 Jun 1, 2026
8e67aac
resolve merge conflicts: incorporate main's evm upgrades (params-migr…
AryaLanjewar3005 Jun 10, 2026
822bf01
fix: register upc bank denom metadata and set valid display denom bef…
AryaLanjewar3005 Jun 10, 2026
4f861d6
Merge branch 'main' into evm-upgrade-0.5.0-fix
AryaLanjewar3005 Jun 10, 2026
0f96dab
bump:evm dependency
AryaLanjewar3005 Jun 16, 2026
dc9d20b
bump: evm version with the latest audit-fixes commit
AryaLanjewar3005 Jun 16, 2026
4493e77
chore: remove unused utils/precompile package
0xNilesh Jun 16, 2026
bc52159
ci: add 'test' build tag to make test targets
0xNilesh Jun 16, 2026
1d65877
fix(upgrade): run migrations before InitEvmCoinInfo in evm-v0-5-0
0xNilesh Jun 16, 2026
5b7fbc9
revert: keep RunMigrations last in evm-v0-5-0 handler
0xNilesh Jun 16, 2026
d28d843
fix(test): set EVM coin-info global in SetupApp for v0.5
0xNilesh Jun 16, 2026
8b513c4
chore(denom): rename display denom push -> pushchain
0xNilesh Jun 16, 2026
dc5bb99
test: set EVM coin-info in module state + reset config before app build
0xNilesh Jun 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ test: test-unit
test-all: test-race test-cover test-system

test-unit: build-dkls23
@VERSION=$(VERSION) LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -tags="ledger test_ledger_mock" ./...
@VERSION=$(VERSION) LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -tags="ledger test_ledger_mock test" ./...

test-race: build-dkls23
@VERSION=$(VERSION) LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -race -tags='ledger test_ledger_mock' ./...
@VERSION=$(VERSION) LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -race -tags='ledger test_ledger_mock test' ./...

test-cover: build-dkls23
@LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock' ./...
@LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -timeout 30m -race -coverprofile=coverage.txt -covermode=atomic -tags='ledger test_ledger_mock test' ./...

benchmark: build-dkls23
@LD_LIBRARY_PATH=$$(pwd)/../dkls23-rs/wrapper/go-wrappers:$$(pwd)/../dkls23-rs/target/release:$$LD_LIBRARY_PATH go test -mod=readonly -bench=. ./...
Expand Down
6 changes: 3 additions & 3 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
switch typeURL := opts[0].GetTypeUrl(); typeURL {
case "/cosmos.evm.vm.v1.ExtensionOptionsEthereumTx":
// handle as *evmtypes.MsgEthereumTx
anteHandler = newMonoEVMAnteHandler(options)
anteHandler = newMonoEVMAnteHandler(ctx, options)
case "/cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx":
// cosmos-sdk tx with dynamic fee extension
anteHandler = NewCosmosAnteHandler(options)
anteHandler = NewCosmosAnteHandler(ctx, options)
default:
return ctx, errorsmod.Wrapf(
errortypes.ErrUnknownExtensionOptions,
Expand All @@ -42,7 +42,7 @@ func NewAnteHandler(options HandlerOptions) sdk.AnteHandler {
// handle as totally normal Cosmos SDK tx
switch tx.(type) {
case sdk.Tx:
anteHandler = NewCosmosAnteHandler(options)
anteHandler = NewCosmosAnteHandler(ctx, options)
default:
return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid transaction type: %T", tx)
}
Expand Down
10 changes: 6 additions & 4 deletions app/ante/ante_cosmos.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ import (
cosmosante "github.com/pushchain/push-chain-node/app/cosmos"
)

// newCosmosAnteHandler creates the default ante handler for Cosmos transactions
func NewCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
// NewCosmosAnteHandler creates the default ante handler for Cosmos transactions
func NewCosmosAnteHandler(ctx sdk.Context, options HandlerOptions) sdk.AnteHandler {
feemarketParams := options.FeeMarketKeeper.GetParams(ctx)
txFeeChecker := evmante.NewDynamicFeeChecker(&feemarketParams)

return sdk.ChainAnteDecorators(
cosmosevmcosmosante.NewRejectMessagesDecorator(), // reject MsgEthereumTxs
Expand All @@ -35,9 +37,9 @@ func NewCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
ante.NewValidateMemoDecorator(options.AccountKeeper),
cosmosante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, txFeeChecker),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
evmante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper),
evmante.NewGasWantedDecorator(options.EvmKeeper, options.FeeMarketKeeper, &feemarketParams),
// NewAccountInitDecorator must be called before all signature verification decorators and SetPubKeyDecorator
// - this
// 1. generates the account for the new accounts only for gasless transactions,
Expand Down
6 changes: 5 additions & 1 deletion app/ante/ante_evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,17 @@ func (w evmAccountKeeperWrapper) TryAddUnorderedNonce(_ sdk.Context, _ []byte, _
}

// newMonoEVMAnteHandler creates the sdk.AnteHandler implementation for the EVM transactions.
func newMonoEVMAnteHandler(options HandlerOptions) sdk.AnteHandler {
func newMonoEVMAnteHandler(ctx sdk.Context, options HandlerOptions) sdk.AnteHandler {
evmParams := options.EvmKeeper.GetParams(ctx)
feemarketParams := options.FeeMarketKeeper.GetParams(ctx)
return sdk.ChainAnteDecorators(
evmante.NewEVMMonoDecorator(
evmAccountKeeperWrapper{options.AccountKeeper},
options.FeeMarketKeeper,
options.EvmKeeper,
options.MaxTxGasWanted,
&evmParams,
&feemarketParams,
),
)
}
6 changes: 1 addition & 5 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ type HandlerOptions struct {
ExtensionOptionChecker ante.ExtensionOptionChecker
SignModeHandler *txsigning.HandlerMap
SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
TxFeeChecker ante.TxFeeChecker // safe to be nil

WasmConfig *wasmtypes.NodeConfig
WasmKeeper *wasmkeeper.Keeper
TXCounterStoreService corestoretypes.KVStoreService
Expand All @@ -63,6 +61,7 @@ type HandlerOptions struct {
FeeMarketKeeper anteinterfaces.FeeMarketKeeper
EvmKeeper anteinterfaces.EVMKeeper


IBCKeeper *ibckeeper.Keeper
CircuitKeeper *circuitkeeper.Keeper
}
Expand Down Expand Up @@ -98,9 +97,6 @@ func (options HandlerOptions) Validate() error {
return errorsmod.Wrap(errortypes.ErrLogic, "wasm keeper is required for ante builder")
}

if options.TxFeeChecker == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "tx fee checker is required for AnteHandler")
}
if options.FeeMarketKeeper == nil {
return errorsmod.Wrap(errortypes.ErrLogic, "fee market keeper is required for AnteHandler")
}
Expand Down
32 changes: 19 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import (
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
sdkmempool "github.com/cosmos/cosmos-sdk/types/mempool"
"github.com/cosmos/cosmos-sdk/types/msgservice"
signingtype "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/version"
Expand Down Expand Up @@ -107,10 +108,9 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
cosmosevmante "github.com/cosmos/evm/ante"
cosmosevmevmante "github.com/cosmos/evm/ante/evm"
cosmosevmencoding "github.com/cosmos/evm/encoding"
srvflags "github.com/cosmos/evm/server/flags"
cosmosevmtypes "github.com/cosmos/evm/types"
antetypes "github.com/cosmos/evm/ante/types"
cosmosevmutils "github.com/cosmos/evm/utils"
"github.com/cosmos/evm/x/erc20"
erc20keeper "github.com/cosmos/evm/x/erc20/keeper"
Expand Down Expand Up @@ -232,7 +232,7 @@ var (
BaseDenomUnit int64 = 18

BaseDenom = pushtypes.BaseDenom
DisplayDenom = "MY_DENOM_DISPLAY" // TODO: ?
DisplayDenom = pushtypes.DisplayDenom

// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
Bech32PrefixAccAddr = Bech32Prefix
Expand Down Expand Up @@ -711,8 +711,9 @@ func NewChainApp(
app.BankKeeper,
app.StakingKeeper,
app.FeeMarketKeeper,
app.ConsensusParamsKeeper,
&app.ConsensusParamsKeeper,
&app.Erc20Keeper,
EVMChainID,
tracer,
)

Expand Down Expand Up @@ -790,10 +791,9 @@ func NewChainApp(
*app.StakingKeeper,
app.DistrKeeper,
app.BankKeeper,
app.Erc20Keeper,
app.TransferKeeper,
&app.Erc20Keeper,
&app.TransferKeeper,
app.IBCKeeper.ChannelKeeper,
app.EVMKeeper,
app.GovKeeper,
app.SlashingKeeper,
appCodec,
Expand Down Expand Up @@ -855,7 +855,6 @@ func NewChainApp(
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
app.GetSubspace(ibctransfertypes.ModuleName),
app.RatelimitKeeper, // ICS4Wrapper
//app.IBCFeeKeeper,
app.IBCKeeper.ChannelKeeper,
Expand Down Expand Up @@ -1048,7 +1047,7 @@ func NewChainApp(
packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)),
wasmlc.NewAppModule(app.WasmClientKeeper),
ratelimit.NewAppModule(appCodec, app.RatelimitKeeper),
vm.NewAppModule(app.EVMKeeper, authKeeperEVMWrapper{app.AccountKeeper}, app.AccountKeeper.AddressCodec()),
vm.NewAppModule(app.EVMKeeper, authKeeperEVMWrapper{app.AccountKeeper}, app.BankKeeper, app.AccountKeeper.AddressCodec()),
feemarket.NewAppModule(app.FeeMarketKeeper),
erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper),
uexecutor.NewAppModule(appCodec, app.UexecutorKeeper, app.EVMKeeper, app.FeeMarketKeeper, app.BankKeeper, app.AccountKeeper, app.UregistryKeeper, app.UvalidatorKeeper),
Expand All @@ -1072,7 +1071,8 @@ func NewChainApp(
// NOTE: upgrade module is required to be prioritized
app.ModuleManager.SetOrderPreBlockers(
upgradetypes.ModuleName,
authtypes.ModuleName, // NEW
authtypes.ModuleName,
evmtypes.ModuleName,
)
// During begin block slashing happens after distr.BeginBlocker so that
// there is nothing left over in the validator fee pool, so as to keep the
Expand Down Expand Up @@ -1241,10 +1241,9 @@ func NewChainApp(
CircuitKeeper: &app.CircuitKeeper,

EvmKeeper: app.EVMKeeper,
ExtensionOptionChecker: cosmosevmtypes.HasDynamicFeeExtensionOption,
ExtensionOptionChecker: antetypes.HasDynamicFeeExtensionOption,
SigGasConsumer: cosmosevmante.SigVerificationGasConsumer,
MaxTxGasWanted: cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted)),
TxFeeChecker: cosmosevmevmante.NewDynamicFeeChecker(app.FeeMarketKeeper),
})

// must be before Loading version
Expand Down Expand Up @@ -1378,7 +1377,7 @@ func (a *ChainApp) Configurator() module.Configurator {
// InitChainer application update at chain initialization
func (app *ChainApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {

var genesisState cosmosevmtypes.GenesisState
var genesisState map[string]json.RawMessage
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
Expand Down Expand Up @@ -1452,6 +1451,7 @@ func (a *ChainApp) DefaultGenesis() map[string]json.RawMessage {

evmGenState := evmtypes.DefaultGenesisState()
evmGenState.Params.ActiveStaticPrecompiles = evmtypes.AvailableStaticPrecompiles
evmGenState.Params.EvmDenom = BaseDenom
genesis[evmtypes.ModuleName] = a.appCodec.MustMarshalJSON(evmGenState)

// NOTE: for the example chain implementation we are also adding a default token pair,
Expand Down Expand Up @@ -1562,6 +1562,12 @@ func (app *ChainApp) RegisterPendingTxListener(listener func(common.Hash)) {
app.pendingTxListeners = append(app.pendingTxListeners, listener)
}

// GetMempool returns nil — push-chain does not use the EVM experimental mempool.
// This satisfies the evmserver.Application interface added in cosmos/evm v0.5.
func (app *ChainApp) GetMempool() sdkmempool.ExtMempool {
return nil
}

// GetMaccPerms returns a copy of the module account permissions
//
// NOTE: This is solely to be used for testing purposes.
Expand Down
13 changes: 1 addition & 12 deletions app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var ChainsCoinInfo = map[string]evmtypes.EvmCoinInfo{
Denom: BaseDenom,
ExtendedDenom: BaseDenom,
DisplayDenom: DisplayDenom,
Decimals: evmtypes.EighteenDecimals,
Decimals: evmtypes.EighteenDecimals.Uint32(),
},
}

Expand Down Expand Up @@ -59,17 +59,6 @@ func EVMAppOptions(chainID string) error {
return err
}

ethCfg := evmtypes.DefaultChainConfig(EVMChainID)

err := evmtypes.NewEVMConfigurator().
WithChainConfig(ethCfg).
// NOTE: we're using the 18 decimals
WithEVMCoinInfo(coinInfo).
Configure()
if err != nil {
return err
}

sealed = true
return nil
}
Expand Down
59 changes: 29 additions & 30 deletions app/precompiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
stakingprecompile "github.com/cosmos/evm/precompiles/staking"
erc20Keeper "github.com/cosmos/evm/x/erc20/keeper"
transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper"
evmkeeper "github.com/cosmos/evm/x/vm/keeper"
channelkeeper "github.com/cosmos/ibc-go/v10/modules/core/04-channel/keeper"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/vm"
Expand Down Expand Up @@ -68,10 +67,9 @@ func NewAvailableStaticPrecompiles(
stakingKeeper stakingkeeper.Keeper,
distributionKeeper distributionkeeper.Keeper,
bankKeeper cmn.BankKeeper,
erc20Keeper erc20Keeper.Keeper,
transferKeeper transferkeeper.Keeper,
erc20Kpr *erc20Keeper.Keeper,
transferKeeper *transferkeeper.Keeper,
channelKeeper *channelkeeper.Keeper,
evmKeeper *evmkeeper.Keeper,
govKeeper govkeeper.Keeper,
slashingKeeper slashingkeeper.Keeper,
appCodec codec.Codec,
Expand All @@ -93,46 +91,47 @@ func NewAvailableStaticPrecompiles(
panic(fmt.Errorf("failed to instantiate bech32 precompile: %w", err))
}

stakingPrecompile, err := stakingprecompile.NewPrecompile(stakingKeeper, options.AddressCodec)
if err != nil {
panic(fmt.Errorf("failed to instantiate staking precompile: %w", err))
}
stakingPrecompile := stakingprecompile.NewPrecompile(
stakingKeeper,
stakingkeeper.NewMsgServerImpl(&stakingKeeper),
stakingkeeper.NewQuerier(&stakingKeeper),
bankKeeper,
options.AddressCodec,
)

distributionPrecompile, err := distprecompile.NewPrecompile(
distributionPrecompile := distprecompile.NewPrecompile(
distributionKeeper,
distributionkeeper.NewMsgServerImpl(distributionKeeper),
distributionkeeper.NewQuerier(distributionKeeper),
stakingKeeper,
evmKeeper,
bankKeeper,
options.AddressCodec,
)
if err != nil {
panic(fmt.Errorf("failed to instantiate distribution precompile: %w", err))
}

ibcTransferPrecompile, err := ics20precompile.NewPrecompile(
ibcTransferPrecompile := ics20precompile.NewPrecompile(
bankKeeper,
stakingKeeper,
transferKeeper,
channelKeeper,
evmKeeper,
)
if err != nil {
panic(fmt.Errorf("failed to instantiate ICS20 precompile: %w", err))
}

bankPrecompile, err := bankprecompile.NewPrecompile(bankKeeper, erc20Keeper)
if err != nil {
panic(fmt.Errorf("failed to instantiate bank precompile: %w", err))
}
bankPrecompile := bankprecompile.NewPrecompile(bankKeeper, erc20Kpr)

govPrecompile, err := govprecompile.NewPrecompile(govKeeper, appCodec, options.AddressCodec)
if err != nil {
panic(fmt.Errorf("failed to instantiate gov precompile: %w", err))
}
govPrecompile := govprecompile.NewPrecompile(
govkeeper.NewMsgServerImpl(&govKeeper),
govkeeper.NewQueryServer(&govKeeper),
bankKeeper,
appCodec,
options.AddressCodec,
)

slashingPrecompile, err := slashingprecompile.NewPrecompile(slashingKeeper, options.ValidatorAddrCodec, options.ConsensusAddrCodec)
if err != nil {
panic(fmt.Errorf("failed to instantiate slashing precompile: %w", err))
}
slashingPrecompile := slashingprecompile.NewPrecompile(
slashingKeeper,
slashingkeeper.NewMsgServerImpl(slashingKeeper),
bankKeeper,
options.ValidatorAddrCodec,
options.ConsensusAddrCodec,
)

// Stateless precompiles
precompiles[bech32Precompile.Address()] = bech32Precompile
Expand Down
Loading
Loading