Skip to content
Draft
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3225549
refactor: remove authz dependency from test suite and EvmApp interfac…
cloudgray Nov 12, 2025
b1b3d74
Add NOTICE file for Cosmos Labs attribution and license
aljo242 Nov 12, 2025
d450ea1
fix (#824)
aljo242 Nov 12, 2025
cd4f406
fix: align GetCoinbaseAddress to handle empty proposer address in con…
mmsqe Nov 12, 2025
65900e1
Delete .github/workflows/check-changelog.yml
aljo242 Nov 12, 2025
a48de71
fix: validate decimals before conversion to prevent panic in GetBaseF…
mmsqe Nov 13, 2025
ee23828
refactor(test): separate test app interface (#829)
cloudgray Nov 14, 2025
381a354
test: adjusts precisebank module account balance to expected amount (…
mmsqe Nov 14, 2025
1cc187c
refactor: replace unnecessary keeper dependencies from tests (#838)
cloudgray Nov 17, 2025
741ddbc
feat: speedtest (#827)
technicallyty Nov 17, 2025
70486f9
Merge branch 'main' into cloudgray/evmd-refactor
cloudgray Nov 19, 2025
279449c
refactor: add mint module to basic app
cloudgray Nov 19, 2025
db537ef
refactor(evmd): modify basic keeper getters
cloudgray Nov 19, 2025
eed864f
refactor: modify testing app interfaces
cloudgray Nov 19, 2025
93adab3
test: inject evmd to slashing precompile test
cloudgray Nov 19, 2025
1e59de6
test: inject evmd to distr precompile test
cloudgray Nov 19, 2025
c791c54
test: fix distr precompile test setup
cloudgray Nov 19, 2025
7a38370
fix: events emitted in hooks are duplicated (#814)
yihuang Nov 19, 2025
5ca1990
chore: cleanup speedtest cmd (#843)
technicallyty Nov 19, 2025
f9f7bf4
test: fix address codec
cloudgray Nov 20, 2025
4b5dd3c
test: fix distr precompile test setup
cloudgray Nov 20, 2025
86f2f4c
chore: remove unnecessary app wrapping for distribution precompile
cloudgray Nov 20, 2025
2e0a109
refactor: inject new evmd to bank precompile tests
cloudgray Nov 20, 2025
44cf2d4
chore: fix comment
cloudgray Nov 20, 2025
2efedee
WIP: fix precisebank test
cloudgray Nov 20, 2025
cb68a1b
fix(test): avoid mutation of global int256 variable (#842)
mmsqe Nov 21, 2025
9663503
Merge branch 'main' into cloudgray/evmd-refactor
cloudgray Nov 21, 2025
15b2ff3
WIP: fix precisebank test
cloudgray Nov 21, 2025
7a41a3c
chore(app): disable block-stm
cloudgray Nov 24, 2025
e946656
fix(ante): fix incorrect denom usage in ante handler
cloudgray Nov 24, 2025
3229dad
WIP: fix ibc tests
cloudgray Nov 24, 2025
3a14106
WIP: fix ibc app for test
cloudgray Nov 25, 2025
16c134c
WIP: fix ibc app for test
cloudgray Nov 25, 2025
5d29ef2
fix ibc app for tes
cloudgray Nov 25, 2025
63b23c6
WIP: fix ibc app for ics20 precompile test
cloudgray Nov 25, 2025
1a2ef83
test: fix coin decimals as 18 for ibc tests
cloudgray Nov 26, 2025
42a67a2
test: add ibc tests
cloudgray Nov 26, 2025
dfbec16
chore(app): remove temp method
cloudgray Nov 26, 2025
b812165
WIP: add ics20 recursive precompile calls test
cloudgray Nov 26, 2025
d20bb0d
fix ibc test setup
cloudgray Nov 27, 2025
c3a47bd
chore(app): implement GetConsensusParamsKeeper method
cloudgray Nov 27, 2025
a666f04
refactor test file locations
cloudgray Nov 27, 2025
67240e2
chore: refactor test app config
cloudgray Nov 27, 2025
7965dab
remove test case with wevmos contract
cloudgray Nov 27, 2025
c8582d8
fix x/vm test
cloudgray Nov 27, 2025
9e50c09
fix precisebank test
cloudgray Nov 27, 2025
ca50502
add erc20 precompile test
cloudgray Nov 27, 2025
8ff28ac
fix staking precompile test
cloudgray Nov 27, 2025
7b43a84
rollback incorrect fix of vm test
cloudgray Nov 27, 2025
7414f1c
fix ante handler test
cloudgray Nov 27, 2025
94304ef
chore: refactor test app for ibc test
cloudgray Nov 27, 2025
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
53 changes: 0 additions & 53 deletions .github/workflows/check-changelog.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- [\#758](https://github.com/cosmos/evm/pull/758) Cleanup precompiles abi.json.
- [\#810](https://github.com/cosmos/evm/pull/810) Fix integration test suite to resolve lock contention problem from external app injection
- [\#811](https://github.com/cosmos/evm/pull/811) Use sdk's DefaultBondDenom for default evm denom in genesis.
- [\#823](https://github.com/cosmos/evm/pull/823) Remove authz dependency from test suite and EvmApp interface
- [\#829](https://github.com/cosmos/evm/pull/829) Seperate test app interface

### FEATURES

Expand All @@ -27,7 +29,9 @@
- [\#774](https://github.com/cosmos/evm/pull/774) Emit proper allowance amount in erc20 event.
- [\#790](https://github.com/cosmos/evm/pull/790) fix panic in historical query due to missing EvmCoinInfo.
- [\#800](https://github.com/cosmos/evm/pull/800) Fix denom exponent validation in virtual fee deduct in vm module.
- [\#817](https://github.com/cosmos/evm/pull/817) Align GetCoinbaseAddress to handle empty proposer address in contexts like CheckTx where proposer doesn't exist.
- [\#816](https://github.com/cosmos/evm/pull/816) Avoid nil pointer when RPC requests execute before evmCoinInfo initialization in PreBlock with defaultEvmCoinInfo fallback.
- [\#828](https://github.com/cosmos/evm/pull/828) Validate decimals before conversion to prevent panic when coininfo is missing in historical queries.

## v0.5.0

Expand Down
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
NOTICE

About Cosmos Labs

Cosmos Labs is the development and growth organization behind the Cosmos stack of technologies and ecosystem, the world leading blockchain platform powering more than 200 production chains in finance, payments, and real-world assets. Cosmos Labs leads the development of the Cosmos technology stack, including the Cosmos SDK, CometBFT, and IBC protocols that enable sovereign, interoperable blockchains, in tandem with the Interchain Foundation. Cosmos Labs offers blockchain solutions for enterprises and finance, learn more by visiting: https://cosmos.network/, https://cosmoslabs.io/

Licence

This product This product includes software developed by Cosmos Labs and is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Attribution

If you distribute this software or derivative works, you must include a copy of this NOTICE file (or equivalent attribution) in your distribution, as required by Section 4(d) of the Apache License, Version 2.0.
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ coverage:
project:
default:
threshold: 1% # allow this much decrease on project
target: 90%
target: auto
changes: false

comment:
Expand Down
55 changes: 37 additions & 18 deletions evmd/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,25 @@ import (
"context"
"encoding/json"
"fmt"
evmconfig "github.com/cosmos/evm/evmd/cmd/evmd/config"
ibctesting "github.com/cosmos/ibc-go/v10/testing"
"io"
"os"
goruntime "runtime"

"github.com/spf13/cast"

// Needed for some reason? TODO: Figure out if needed and why
"github.com/ethereum/go-ethereum/common"
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"

abci "github.com/cometbft/cometbft/abci/types"

dbm "github.com/cosmos/cosmos-db"
baseevmante "github.com/cosmos/evm/ante"
antetypes "github.com/cosmos/evm/ante/types"
evmosencoding "github.com/cosmos/evm/encoding"
evmaddress "github.com/cosmos/evm/encoding/address"
evmconfig "github.com/cosmos/evm/evmd/cmd/evmd/config"
evmmempool "github.com/cosmos/evm/mempool"
cosmosevmserver "github.com/cosmos/evm/server"
srvflags "github.com/cosmos/evm/server/flags"
Expand All @@ -24,12 +33,7 @@ import (
evmkeeper "github.com/cosmos/evm/x/vm/keeper"
evmtypes "github.com/cosmos/evm/x/vm/types"
"github.com/cosmos/gogoproto/proto"
"github.com/ethereum/go-ethereum/common"
"github.com/spf13/cast"

// Needed for some reason? TODO: Figure out if needed and why
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"
ibctesting "github.com/cosmos/ibc-go/v10/testing"

autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
Expand All @@ -49,7 +53,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
Expand All @@ -63,7 +66,6 @@ import (
"github.com/cosmos/cosmos-sdk/types/msgservice"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
"github.com/cosmos/cosmos-sdk/x/auth/posthandler"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
Expand All @@ -83,15 +85,16 @@ import (
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/cosmos/cosmos-sdk/x/mint"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

abci "github.com/cometbft/cometbft/abci/types"

ibc "github.com/cosmos/ibc-go/v10/modules/core"
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
Expand All @@ -108,6 +111,7 @@ var (
maccPerms = map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
minttypes.ModuleName: {authtypes.Minter},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
Expand Down Expand Up @@ -147,6 +151,7 @@ type App struct {
BankKeeper bankkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistributionKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
IBCKeeper *ibckeeper.Keeper
Expand Down Expand Up @@ -194,7 +199,7 @@ func New(
bApp.SetTxEncoder(txConfig.TxEncoder())

keys := storetypes.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey,
distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey,
upgradetypes.StoreKey, consensustypes.StoreKey, ibcexported.StoreKey,
// Cosmos EVM store keys
Expand Down Expand Up @@ -249,7 +254,7 @@ func New(
runtime.NewKVStoreService(keys[authtypes.StoreKey]),
authtypes.ProtoBaseAccount,
maccPerms,
address.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
sdk.GetConfig().GetBech32AccountAddrPrefix(),
authAddr,
)
Expand All @@ -264,7 +269,16 @@ func New(
)
app.BankKeeper = app.BankKeeper.WithObjStoreKey(oKeys[banktypes.ObjectStoreKey])
app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authAddr, address.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()), address.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
appCodec,
runtime.NewKVStoreService(keys[stakingtypes.StoreKey]),
app.AccountKeeper,
app.BankKeeper,
authAddr,
evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
)
app.MintKeeper = mintkeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(keys[minttypes.StoreKey]), app.StakingKeeper, app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authAddr,
)

app.DistributionKeeper = distrkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, authtypes.FeeCollectorName, authAddr)
Expand Down Expand Up @@ -361,6 +375,7 @@ func New(
auth.NewAppModule(appCodec, app.AccountKeeper, nil, nil),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, nil),
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, nil),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, nil),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil, app.interfaceRegistry),
distribution.NewAppModule(appCodec, app.DistributionKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, nil),
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, nil),
Expand Down Expand Up @@ -399,6 +414,8 @@ func New(
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.ModuleManager.SetOrderBeginBlockers(
minttypes.ModuleName,

// Cosmos EVM BeginBlockers
distrtypes.ModuleName,
slashingtypes.ModuleName,
Expand Down Expand Up @@ -427,6 +444,7 @@ func New(
feemarkettypes.ModuleName,

// no-ops
minttypes.ModuleName,
genutiltypes.ModuleName,
upgradetypes.ModuleName,
)
Expand All @@ -441,6 +459,7 @@ func New(
stakingtypes.ModuleName,
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
ibcexported.ModuleName,

// Cosmos EVM modules
Expand Down Expand Up @@ -696,9 +715,9 @@ func (app *App) AutoCliOpts() autocli.AppOptions {
return autocli.AppOptions{
Modules: modules,
ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.ModuleManager.Modules),
AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
AddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
ValidatorAddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
}
}

Expand Down
15 changes: 15 additions & 0 deletions evmd/app/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import (
"github.com/cosmos/cosmos-sdk/types/mempool"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/cosmos/ibc-go/v10/modules/core/keeper"
)
Expand Down Expand Up @@ -54,3 +57,15 @@ func (app *App) GetAccountKeeper() authkeeper.AccountKeeper {
func (app *App) GetStakingKeeper() *stakingkeeper.Keeper {
return app.StakingKeeper
}

func (app App) GetMintKeeper() mintkeeper.Keeper {
return app.MintKeeper
}

func (app App) GetSlashingKeeper() slashingkeeper.Keeper {
return app.SlashingKeeper
}

func (app App) GetDistrKeeper() distrkeeper.Keeper {
return app.DistributionKeeper
}
7 changes: 4 additions & 3 deletions evmd/app/precompiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package app

import (
"fmt"
"maps"

distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
evmaddress "github.com/cosmos/evm/encoding/address"
distributionprecompile "github.com/cosmos/evm/precompiles/distribution"
"maps"

evmibcutils "github.com/cosmos/evm/ibc"
"github.com/cosmos/evm/precompiles/bech32"
Expand All @@ -17,7 +19,6 @@ import (
"github.com/ethereum/go-ethereum/core/vm"

"github.com/cosmos/cosmos-sdk/codec"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
sdk "github.com/cosmos/cosmos-sdk/types"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand Down Expand Up @@ -46,7 +47,7 @@ func StaticPrecompiles(
// Clone the mapping from the latest EVM fork.
precompiles := maps.Clone(vm.PrecompiledContractsPrague)

addrCodec := addresscodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix())
addrCodec := evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix())

// Stateless precompiles
bech32Precompile, err := bech32.NewPrecompile(defaultBech32BaseGas)
Expand Down
18 changes: 0 additions & 18 deletions evmd/app/temp_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ import (
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
consensuskeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
erc20keeper "github.com/cosmos/evm/x/erc20/keeper"
"github.com/cosmos/evm/x/ibc/callbacks/keeper"
transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper"
Expand All @@ -24,11 +21,6 @@ func (app App) SetErc20Keeper(keeper erc20keeper.Keeper) {
panic("implement me")
}

func (app App) GetSlashingKeeper() slashingkeeper.Keeper {
//TODO implement me
panic("implement me")
}

func (app App) GetEvidenceKeeper() *evidencekeeper.Keeper {
//TODO implement me
panic("implement me")
Expand All @@ -39,16 +31,6 @@ func (app App) GetAuthzKeeper() authzkeeper.Keeper {
panic("implement me")
}

func (app App) GetDistrKeeper() distrkeeper.Keeper {
//TODO implement me
panic("implement me")
}

func (app App) GetMintKeeper() mintkeeper.Keeper {
//TODO implement me
panic("implement me")
}

func (app App) GetPreciseBankKeeper() *precisebankkeeper.Keeper {
//TODO implement me
panic("implement me")
Expand Down
Loading
Loading