Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ac47fa4
move tests to remove circular dependency
vladjdk Sep 23, 2025
463ad28
remove ante2
vladjdk Sep 23, 2025
73f5395
Merge branch 'vlad/remove-evmd-dep' into vlad/config-refactor
vladjdk Sep 23, 2025
c3dc99e
wip: move all config files out of evmd
vladjdk Sep 23, 2025
9b9dd66
wip: add todos
vladjdk Sep 23, 2025
dc32dbb
reset config to fix test
vladjdk Sep 23, 2025
019f3d8
fix evmd tests by adding resets to the evmappoptions
vladjdk Sep 23, 2025
3aff36b
remove testutil/config constants
vladjdk Sep 24, 2025
567764f
fix eips test
vladjdk Sep 24, 2025
91d432c
remove all configs except for genesis from testutil/config and consol…
vladjdk Sep 24, 2025
2b13bcf
lints and merge main
vladjdk Sep 24, 2025
6bee431
Merge branch 'main' into vlad/config-refactor
vladjdk Sep 24, 2025
dda4aac
changelogchangelogchangelogchangelogchangelog
vladjdk Sep 24, 2025
e050fc1
Merge remote-tracking branch 'origin/vlad/config-refactor' into vlad/…
vladjdk Sep 24, 2025
94fc72a
lints
vladjdk Sep 24, 2025
fde47c0
wip: removing app options (tests failing)
vladjdk Sep 24, 2025
7e8c25f
begin storing coin info in the vm keeper storage
vladjdk Sep 24, 2025
87904e3
remove debugging artifact
vladjdk Sep 24, 2025
bedbd6d
artifact removal 2
vladjdk Sep 24, 2025
799db42
fix unit tests
vladjdk Sep 24, 2025
5bd1add
wip: fix ibc testing
vladjdk Sep 25, 2025
f16467c
delete all evmappoptions from tests
vladjdk Sep 25, 2025
b9fb2a7
fix ibc precompile integration test balance getters
vladjdk Sep 25, 2025
77a30c2
Merge remote-tracking branch 'origin/main' into vlad/remove-app-options
vladjdk Sep 26, 2025
71b7722
fix all evmd tests
vladjdk Sep 26, 2025
f8c0743
fix precisebank keeper test
vladjdk Sep 26, 2025
de569ea
fix smore tests
vladjdk Sep 26, 2025
0eeb6ec
lol
vladjdk Sep 26, 2025
0995962
add upgrade handler
vladjdk Sep 26, 2025
79d63fc
lints
vladjdk Sep 26, 2025
356d183
changelog
vladjdk Sep 26, 2025
c65a7cb
Fix imports, add upgrade for non-18-decimal chains, and add migration…
vladjdk Sep 27, 2025
6f9190d
Merge branch 'main' into vlad/remove-app-options
vladjdk Oct 7, 2025
20f33be
fix system test
vladjdk Oct 7, 2025
d4b0007
Merge remote-tracking branch 'origin/vlad/remove-app-options' into vl…
vladjdk Oct 7, 2025
dd59c63
Merge branch 'main' into vlad/remove-app-options
vladjdk Oct 7, 2025
47d2ec9
Update docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md
vladjdk Oct 8, 2025
6ec0eea
fix monodecorator test
vladjdk Oct 8, 2025
6efae1b
Merge remote-tracking branch 'origin/vlad/remove-app-options' into vl…
vladjdk Oct 8, 2025
bb572eb
Remove test* denoms and replace with default*
vladjdk Oct 8, 2025
af5caaa
extract var
vladjdk Oct 8, 2025
e8ead26
match vars
vladjdk Oct 8, 2025
cc38dfb
remove chain config from configurator
vladjdk Oct 8, 2025
2d283fa
undo uint8 change
vladjdk Oct 8, 2025
97e8c38
comment fixes
vladjdk Oct 8, 2025
51e5e51
Merge remote-tracking branch 'origin/main' into vlad/remove-app-options
vladjdk Oct 8, 2025
0d932c0
Auto stash before merge of "vlad/remove-app-options" and "origin/main"
vladjdk Oct 8, 2025
a16bba8
set chain config in vm integ tests
vladjdk Oct 8, 2025
949698c
lint
vladjdk Oct 8, 2025
1a51a6f
fix error on test
vladjdk Oct 8, 2025
cbbaa44
fix denoms for ibc chain
vladjdk Oct 9, 2025
0ed773a
Revert "fix denoms for ibc chain"
vladjdk Oct 9, 2025
0b44e5b
use app options chain id instead of passing param
vladjdk Oct 9, 2025
e56e942
lints
vladjdk Oct 9, 2025
8d966ff
revert make race
vladjdk Oct 9, 2025
303f101
Merge branch 'main' into vlad/remove-app-options
vladjdk Oct 9, 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
18 changes: 17 additions & 1 deletion ante/evm/fee_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,24 @@ func TestSDKTxFeeChecker(t *testing.T) {
// london hardfork enableness
chainID := uint64(config.EighteenDecimalsChainID)
encodingConfig := encoding.MakeConfig(chainID)
err := config.EvmAppOptions(chainID)

configurator := evmtypes.NewEVMConfigurator()
configurator.ResetTestConfig()
// set global chain config
ethCfg := evmtypes.DefaultChainConfig(chainID)
if err := evmtypes.SetChainConfig(ethCfg); err != nil {
panic(err)
}
err := configurator.
WithExtendedEips(evmtypes.DefaultCosmosEVMActivators).
WithChainConfig(ethCfg).
// NOTE: we're using the 18 decimals default for the example chain
WithEVMCoinInfo(config.ChainsCoinInfo[chainID]).
Configure()
require.NoError(t, err)
if err != nil {
panic(err)
}

evmDenom := evmtypes.GetEVMCoinDenom()
minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin(evmDenom, math.NewInt(10)))
Expand Down
5 changes: 4 additions & 1 deletion ante/evm/mono_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
Time: uint64(ctx.BlockTime().Unix()), //nolint:gosec
Difficulty: big.NewInt(0),
}

chainConfig := evmtypes.GetEthChainConfig()

if err := txpool.ValidateTransaction(ethTx, &header, decUtils.Signer, &txpool.ValidationOptions{
Config: evmtypes.GetEthChainConfig(),
Config: chainConfig,
Accept: AcceptedTxType,
MaxSize: math.MaxUint64, // tx size is checked in cometbft
MinTip: new(big.Int),
Expand Down
1 change: 0 additions & 1 deletion ante/evm/mono_decorator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func toMsgSlice(msgs []*evmsdktypes.MsgEthereumTx) []sdk.Msg {

func TestMonoDecorator(t *testing.T) {
chainID := uint64(config.EighteenDecimalsChainID)
require.NoError(t, config.EvmAppOptions(chainID))
cfg := encoding.MakeConfig(chainID)

testCases := []struct {
Expand Down
8,785 changes: 5,014 additions & 3,771 deletions api/cosmos/evm/vm/v1/evm.pulsar.go

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,45 @@ var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this
Denom: ExampleChainDenom,
ExtendedDenom: ExampleChainDenom,
DisplayDenom: ExampleDisplayDenom,
Decimals: evmtypes.EighteenDecimals,
Decimals: evmtypes.EighteenDecimals.Uint32(),
},
// SixDecimalsChainID provides a chain ID which is being set up with 6 decimals
SixDecimalsChainID: {
Denom: "utest",
ExtendedDenom: "atest",
DisplayDenom: "test",
Decimals: evmtypes.SixDecimals,
Decimals: evmtypes.SixDecimals.Uint32(),
},
// EVMChainID provides a chain ID used for internal testing
EVMChainID: {
Denom: "atest",
ExtendedDenom: "atest",
DisplayDenom: "test",
Decimals: evmtypes.EighteenDecimals,
Decimals: evmtypes.EighteenDecimals.Uint32(),
},
TwelveDecimalsChainID: {
Denom: "ptest2",
ExtendedDenom: "atest2",
DisplayDenom: "test2",
Decimals: evmtypes.TwelveDecimals,
Decimals: evmtypes.TwelveDecimals.Uint32(),
},
TwoDecimalsChainID: {
Denom: "ctest3",
ExtendedDenom: "atest3",
DisplayDenom: "test3",
Decimals: evmtypes.TwoDecimals,
Decimals: evmtypes.TwoDecimals.Uint32(),
},
TestChainID1: {
Denom: ExampleChainDenom,
ExtendedDenom: ExampleChainDenom,
DisplayDenom: ExampleChainDenom,
Decimals: evmtypes.EighteenDecimals,
Decimals: evmtypes.EighteenDecimals.Uint32(),
},
TestChainID2: {
Denom: ExampleChainDenom,
ExtendedDenom: ExampleChainDenom,
DisplayDenom: ExampleChainDenom,
Decimals: evmtypes.EighteenDecimals,
Decimals: evmtypes.EighteenDecimals.Uint32(),
},
}

Expand All @@ -72,10 +72,12 @@ const (
Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
// DisplayDenom defines the denomination displayed to users in client applications.
DisplayDenom = "atom"
// BaseDenom defines to the default denomination used in the Cosmos EVM example chain.
BaseDenom = "aatom"
// TestDisplayDenom defines the denomination displayed to users in client applications.
TestDisplayDenom = "atom"
// TestEvmDenom defines the non-18-decimal denomination
TestEvmDenom = "uatom"
// TestExtendedDenom defines to the default denomination used in the Cosmos EVM example chain.
TestExtendedDenom = "aatom"
// BaseDenomUnit defines the precision of the base denomination.
BaseDenomUnit = 18
// EVMChainID defines the EIP-155 replay-protection chain id for the current ethereum chain config.
Expand Down
91 changes: 0 additions & 91 deletions config/evm_app_options.go

This file was deleted.

10 changes: 0 additions & 10 deletions config/evm_app_options_prod.go

This file was deleted.

10 changes: 0 additions & 10 deletions config/evm_app_options_testing.go

This file was deleted.

12 changes: 4 additions & 8 deletions evmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ func NewExampleApp(
loadLatest bool,
appOpts servertypes.AppOptions,
evmChainID uint64, // TODO:VLAD - Remove this
evmAppOptions evmconfig.EVMOptionsFn, // TODO:VLAD - Remove this
baseAppOptions ...func(*baseapp.BaseApp),
) *EVMD {
encodingConfig := evmosencoding.MakeConfig(evmChainID) // TODO:VLAD - Remove chain id from this
Expand All @@ -235,12 +234,6 @@ func NewExampleApp(
bApp.SetInterfaceRegistry(interfaceRegistry)
bApp.SetTxEncoder(txConfig.TxEncoder())

// initialize the Cosmos EVM application configuration
// TODO:VLAD - Remove this
if err := evmAppOptions(evmChainID); err != nil {
panic(err)
}

keys := storetypes.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
Expand Down Expand Up @@ -447,6 +440,7 @@ func NewExampleApp(

// Set up EVM keeper
tracer := cast.ToString(appOpts.Get(srvflags.EVMTracer))
evmChainId := cast.ToUint64(appOpts.Get(srvflags.EVMChainID))

// NOTE: it's required to set up the EVM keeper before the ERC-20 keeper, because it is used in its instantiation.
app.EVMKeeper = evmkeeper.NewKeeper(
Expand All @@ -459,6 +453,7 @@ func NewExampleApp(
app.FeeMarketKeeper,
&app.ConsensusParamsKeeper,
&app.Erc20Keeper,
evmChainId,
tracer,
).WithStaticPrecompiles(
precompiletypes.DefaultStaticPrecompiles(
Expand Down Expand Up @@ -574,7 +569,7 @@ func NewExampleApp(
ibctm.NewAppModule(tmLightClientModule),
transferModule,
// Cosmos EVM modules
vm.NewAppModule(app.EVMKeeper, app.AccountKeeper, app.AccountKeeper.AddressCodec()),
vm.NewAppModule(app.EVMKeeper, app.AccountKeeper, app.BankKeeper, app.AccountKeeper.AddressCodec()),
feemarket.NewAppModule(app.FeeMarketKeeper),
erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper),
precisebank.NewAppModule(app.PreciseBankKeeper, app.BankKeeper, app.AccountKeeper),
Expand All @@ -600,6 +595,7 @@ func NewExampleApp(
app.ModuleManager.SetOrderPreBlockers(
upgradetypes.ModuleName,
authtypes.ModuleName,
evmtypes.ModuleName,
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand Down
2 changes: 0 additions & 2 deletions evmd/cmd/evmd/cmd/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func (a appCreator) newApp(
true,
simtestutil.EmptyAppOptions{},
config.EVMChainID,
config.EvmAppOptions,
baseappOptions...,
)
}
Expand Down Expand Up @@ -138,7 +137,6 @@ func (a appCreator) appExport(
loadLatest,
appOpts,
config.EVMChainID,
config.EvmAppOptions,
)

if height != -1 {
Expand Down
19 changes: 4 additions & 15 deletions evmd/cmd/evmd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ func NewRootCmd() *cobra.Command {
// we "pre"-instantiate the application for getting the injected/configured encoding configuration
// and the CLI options for the modules
// add keyring to autocli opts
noOpEvmAppOptions := func(_ uint64) error {
return nil
}
tempApp := evmd.NewExampleApp(
log.NewNopLogger(),
dbm.NewMemDB(),
nil,
true,
simtestutil.EmptyAppOptions{},
config.EVMChainID,
noOpEvmAppOptions,
)

encodingConfig := sdktestutil.TestEncodingConfig{
Expand Down Expand Up @@ -130,7 +126,7 @@ func NewRootCmd() *cobra.Command {
return err
}

customAppTemplate, customAppConfig := config.InitAppConfig(config.BaseDenom, config.EVMChainID) // TODO:VLAD - Remove this
customAppTemplate, customAppConfig := config.InitAppConfig(config.TestExtendedDenom, config.EVMChainID) // TODO:VLAD - Remove this
customTMConfig := initCometConfig()

return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig)
Expand All @@ -147,12 +143,6 @@ func NewRootCmd() *cobra.Command {
panic(err)
}

if initClientCtx.ChainID != "" { // TODO:VLAD - Remove this
if err := config.EvmAppOptions(config.EVMChainID); err != nil {
panic(err)
}
}

return rootCmd
}

Expand Down Expand Up @@ -320,8 +310,7 @@ func newApp(
return evmd.NewExampleApp(
logger, db, traceStore, true,
appOpts,
config.EVMChainID, // TODO:VLAD - Remove this
config.EvmAppOptions, // TODO:VLAD - Remove this
config.EVMChainID, // TODO:VLAD - Remove this
baseappOptions...,
)
}
Expand Down Expand Up @@ -362,13 +351,13 @@ func appExport(
}

if height != -1 {
exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove appoptions and evmchainid
exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove appoptions and evmchainid

if err := exampleApp.LoadHeight(height); err != nil {
return servertypes.ExportedApp{}, err
}
} else {
exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid
exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid
}

return exampleApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
Expand Down
2 changes: 0 additions & 2 deletions evmd/cmd/evmd/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ func NewTestNetworkFixture() network.TestFixture {
true,
simtestutil.EmptyAppOptions{},
config.EVMChainID,
config.EvmAppOptions,
)

appCtr := func(val network.ValidatorI) servertypes.Application {
Expand All @@ -697,7 +696,6 @@ func NewTestNetworkFixture() network.TestFixture {
true,
simtestutil.EmptyAppOptions{},
config.EVMChainID,
config.EvmAppOptions,
)
}

Expand Down
Loading
Loading