From 763729dbb89eaf8535694267cf6a141e57e61aff Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 11:19:26 -0400 Subject: [PATCH 01/17] Move types to respective folders --- ante/cosmos/eip712.go | 8 +-- ante/evm/08_gas_consume.go | 6 +- ante/evm/10_gas_wanted.go | 2 +- ante/evm/fee_checker.go | 2 +- ante/evm/fee_checker_test.go | 2 +- {types => ante/types}/block.go | 0 {types => ante/types}/dynamic_fee.go | 0 {types => ante/types}/dynamic_fee.pb.go | 11 ++-- crypto/hd/algorithm_test.go | 14 ++--- crypto/hd/benchmark_test.go | 6 +- {types => crypto/hd}/hdpath.go | 2 +- encoding/codec/codec.go | 7 +-- {types => ethereum/eip712}/codec.go | 5 +- ethereum/eip712/preprocess.go | 4 +- ethereum/eip712/preprocess_test.go | 3 +- {types => ethereum/eip712}/web3.pb.go | 43 +++++++------- evmd/ante/evm_antehandler_benchmark_test.go | 2 +- evmd/ante/validate_handler_options_test.go | 2 +- evmd/app.go | 9 +-- evmd/cmd/evmd/config/config.go | 8 +-- evmd/tests/network/network.go | 25 ++++---- evmd/testutil/eth_setup.go | 8 +-- indexer/kv_indexer.go | 14 ++--- proto/cosmos/evm/types/v1/dynamic_fee.proto | 2 +- proto/cosmos/evm/types/v1/indexer.proto | 2 +- proto/cosmos/evm/types/v1/web3.proto | 2 +- rpc/apis.go | 25 ++++---- rpc/backend/backend.go | 10 ++-- rpc/backend/blocks.go | 5 +- rpc/backend/tx_info.go | 15 ++--- rpc/backend/utils.go | 5 +- rpc/namespaces/ethereum/eth/api.go | 3 +- rpc/namespaces/ethereum/personal/api.go | 5 +- rpc/stream/rpc.go | 2 +- rpc/types/block.go | 5 +- rpc/types/events.go | 2 +- {types => rpc/types}/protocol.go | 0 rpc/types/utils.go | 21 +++++++ server/indexer_service.go | 7 +-- server/json_rpc.go | 9 ++- server/start.go | 11 ++-- {types => server/types}/indexer.go | 0 {types => server/types}/indexer.pb.go | 40 ++++++------- tests/integration/ante/test_evm_fee_market.go | 2 +- tests/integration/rpc/backend/test_tx_info.go | 2 +- testutil/config/config.go | 8 +-- {types => testutil}/genesis.go | 4 +- testutil/integration/evm/network/amounts.go | 4 +- testutil/integration/evm/network/network.go | 3 +- testutil/integration/evm/network/setup.go | 32 +++++----- testutil/tx/eip712.go | 10 ++-- types/errors.go | 11 ---- {types => utils}/int.go | 2 +- {types => utils}/power.go | 2 +- utils/utils.go | 58 +------------------ utils/utils_test.go | 6 +- {types => utils}/validation.go | 2 +- {types => utils}/validation_test.go | 13 ++--- x/erc20/client/cli/tx.go | 2 +- x/erc20/keeper/grpc_query.go | 2 +- x/erc20/types/proposal.go | 3 +- x/erc20/types/token_pair.go | 3 +- x/feemarket/keeper/eip1559.go | 4 +- x/feemarket/types/utils.go | 30 ++++++++++ x/ibc/callbacks/keeper/keeper.go | 2 +- x/vm/keeper/grpc_query.go | 4 +- x/vm/keeper/state_transition.go | 6 +- {types => x/vm/types}/gasmeter.go | 0 x/vm/types/genesis.go | 5 +- x/vm/types/logs.go | 3 +- x/vm/types/params.go | 6 +- 71 files changed, 275 insertions(+), 308 deletions(-) rename {types => ante/types}/block.go (100%) rename {types => ante/types}/dynamic_fee.go (100%) rename {types => ante/types}/dynamic_fee.pb.go (96%) rename {types => crypto/hd}/hdpath.go (98%) rename {types => ethereum/eip712}/codec.go (88%) rename {types => ethereum/eip712}/web3.pb.go (82%) rename {types => rpc/types}/protocol.go (100%) rename {types => server/types}/indexer.go (100%) rename {types => server/types}/indexer.pb.go (85%) rename {types => testutil}/genesis.go (88%) delete mode 100644 types/errors.go rename {types => utils}/int.go (99%) rename {types => utils}/power.go (96%) rename {types => utils}/validation.go (98%) rename {types => utils}/validation_test.go (87%) create mode 100644 x/feemarket/types/utils.go rename {types => x/vm/types}/gasmeter.go (100%) diff --git a/ante/cosmos/eip712.go b/ante/cosmos/eip712.go index 5a209880c..470788bbf 100644 --- a/ante/cosmos/eip712.go +++ b/ante/cosmos/eip712.go @@ -8,12 +8,10 @@ import ( "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/signer/core/apitypes" + errorsmod "cosmossdk.io/errors" anteinterfaces "github.com/cosmos/evm/ante/interfaces" "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/ethereum/eip712" - "github.com/cosmos/evm/types" - - errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -30,7 +28,7 @@ var evmCodec codec.ProtoCodecMarshaler func init() { registry := codectypes.NewInterfaceRegistry() - types.RegisterInterfaces(registry) + eip712.RegisterInterfaces(registry) evmCodec = codec.NewProtoCodec(registry) } @@ -204,7 +202,7 @@ func VerifySignature( return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "tx doesn't contain expected amount of extension options") } - extOpt, ok := opts[0].GetCachedValue().(*types.ExtensionOptionsWeb3Tx) + extOpt, ok := opts[0].GetCachedValue().(*eip712.ExtensionOptionsWeb3Tx) if !ok { return errorsmod.Wrap(errortypes.ErrUnknownExtensionOptions, "unknown extension option") } diff --git a/ante/evm/08_gas_consume.go b/ante/evm/08_gas_consume.go index 6580d43e2..6a6221616 100644 --- a/ante/evm/08_gas_consume.go +++ b/ante/evm/08_gas_consume.go @@ -1,13 +1,13 @@ package evm import ( + types2 "github.com/cosmos/evm/ante/types" "math/big" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" anteinterfaces "github.com/cosmos/evm/ante/interfaces" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" @@ -99,7 +99,7 @@ func GetMsgPriority( // TODO: (@fedekunze) Why is this necessary? This seems to be a duplicate from the CheckGasWanted function. func CheckBlockGasLimit(ctx sdktypes.Context, gasWanted uint64, minPriority int64) (sdktypes.Context, error) { - blockGasLimit := types.BlockGasLimit(ctx) + blockGasLimit := types2.BlockGasLimit(ctx) // return error if the tx gas is greater than the block limit (max gas) @@ -122,7 +122,7 @@ func CheckBlockGasLimit(ctx sdktypes.Context, gasWanted uint64, minPriority int6 // FIXME: use a custom gas configuration that doesn't add any additional gas and only // takes into account the gas consumed at the end of the EVM transaction. ctx = ctx. - WithGasMeter(types.NewInfiniteGasMeterWithLimit(gasWanted)). + WithGasMeter(evmtypes.NewInfiniteGasMeterWithLimit(gasWanted)). WithPriority(minPriority) return ctx, nil diff --git a/ante/evm/10_gas_wanted.go b/ante/evm/10_gas_wanted.go index 4dbb1d0fe..679800d9b 100644 --- a/ante/evm/10_gas_wanted.go +++ b/ante/evm/10_gas_wanted.go @@ -1,10 +1,10 @@ package evm import ( + "github.com/cosmos/evm/ante/types" "math/big" anteinterfaces "github.com/cosmos/evm/ante/interfaces" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/ante/evm/fee_checker.go b/ante/evm/fee_checker.go index fb4467de3..5a5d617ad 100644 --- a/ante/evm/fee_checker.go +++ b/ante/evm/fee_checker.go @@ -1,12 +1,12 @@ package evm import ( + cosmosevmtypes "github.com/cosmos/evm/ante/types" "math" "github.com/ethereum/go-ethereum/params" anteinterfaces "github.com/cosmos/evm/ante/interfaces" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index a5cbc3734..d914966f9 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -1,6 +1,7 @@ package evm_test import ( + "github.com/cosmos/evm/ante/types" "math/big" "testing" @@ -13,7 +14,6 @@ import ( "github.com/cosmos/evm/encoding" "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" - "github.com/cosmos/evm/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" diff --git a/types/block.go b/ante/types/block.go similarity index 100% rename from types/block.go rename to ante/types/block.go diff --git a/types/dynamic_fee.go b/ante/types/dynamic_fee.go similarity index 100% rename from types/dynamic_fee.go rename to ante/types/dynamic_fee.go diff --git a/types/dynamic_fee.pb.go b/ante/types/dynamic_fee.pb.go similarity index 96% rename from types/dynamic_fee.pb.go rename to ante/types/dynamic_fee.pb.go index 29fd6621e..479792fef 100644 --- a/types/dynamic_fee.pb.go +++ b/ante/types/dynamic_fee.pb.go @@ -75,7 +75,7 @@ func init() { } var fileDescriptor_3385bb4614fa656c = []byte{ - // 253 bytes of a gzipped FileDescriptorProto + // 259 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x8e, 0x4f, 0x4b, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, @@ -88,10 +88,11 @@ var fileDescriptor_3385bb4614fa656c = []byte{ 0x27, 0xcf, 0x70, 0xeb, 0x9e, 0xbc, 0x34, 0xc4, 0x01, 0xc5, 0x29, 0xd9, 0x7a, 0x99, 0xf9, 0xfa, 0xb9, 0x89, 0x25, 0x19, 0x7a, 0x3e, 0xa9, 0xe9, 0x89, 0xc9, 0x95, 0x2e, 0xa9, 0xc9, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x12, 0xc8, 0x4d, 0xac, 0x08, 0x80, 0x1a, 0x11, 0x00, 0x32, 0xc1, 0xc9, - 0xf4, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, - 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0xa4, 0xd3, 0x33, 0x4b, 0x32, - 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd1, 0x03, 0x20, 0x89, 0x0d, 0xec, 0x68, 0x63, 0x40, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x06, 0x83, 0x4f, 0xe5, 0x1b, 0x01, 0x00, 0x00, + 0xea, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, + 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x14, 0xd2, 0x33, 0x4b, 0x32, + 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x91, 0x02, 0x20, 0x31, 0xaf, 0x24, 0x15, 0x12, 0x0a, + 0x49, 0x6c, 0x60, 0x97, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x7a, 0xae, 0x40, 0x20, + 0x01, 0x00, 0x00, } func (m *ExtensionOptionDynamicFeeTx) Marshal() (dAtA []byte, err error) { diff --git a/crypto/hd/algorithm_test.go b/crypto/hd/algorithm_test.go index 3d736975c..f4e01db92 100644 --- a/crypto/hd/algorithm_test.go +++ b/crypto/hd/algorithm_test.go @@ -8,13 +8,11 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" - cryptocodec "github.com/cosmos/evm/crypto/codec" - enccodec "github.com/cosmos/evm/encoding/codec" - cosmosevmtypes "github.com/cosmos/evm/types" - amino "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" + cryptocodec "github.com/cosmos/evm/crypto/codec" + enccodec "github.com/cosmos/evm/encoding/codec" ) var TestCodec amino.Codec @@ -49,7 +47,7 @@ func TestKeyring(t *testing.T) { require.Nil(t, info) mockIn.Reset("password\npassword\n") - info, mnemonic, err := kr.NewMnemonic("foo", keyring.English, cosmosevmtypes.BIP44HDPath, keyring.DefaultBIP39Passphrase, EthSecp256k1) + info, mnemonic, err := kr.NewMnemonic("foo", keyring.English, BIP44HDPath, keyring.DefaultBIP39Passphrase, EthSecp256k1) require.NoError(t, err) require.NotEmpty(t, mnemonic) require.Equal(t, "foo", info.Name) @@ -58,7 +56,7 @@ func TestKeyring(t *testing.T) { require.NoError(t, err) require.Equal(t, string(EthSecp256k1Type), pubKey.Type()) - hdPath := cosmosevmtypes.BIP44HDPath + hdPath := BIP44HDPath bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, hdPath) require.NoError(t, err) @@ -84,7 +82,7 @@ func TestKeyring(t *testing.T) { } func TestDerivation(t *testing.T) { - bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, cosmosevmtypes.BIP44HDPath) + bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, BIP44HDPath) require.NoError(t, err) require.NotEmpty(t, bz) @@ -102,7 +100,7 @@ func TestDerivation(t *testing.T) { wallet, err := NewFromMnemonic(mnemonic) require.NoError(t, err) - path := MustParseDerivationPath(cosmosevmtypes.BIP44HDPath) + path := MustParseDerivationPath(BIP44HDPath) account, err := wallet.Derive(path, false) require.NoError(t, err) diff --git a/crypto/hd/benchmark_test.go b/crypto/hd/benchmark_test.go index 281af9df2..66a782700 100644 --- a/crypto/hd/benchmark_test.go +++ b/crypto/hd/benchmark_test.go @@ -3,8 +3,6 @@ package hd import ( "testing" - "github.com/cosmos/evm/types" - "github.com/cosmos/cosmos-sdk/crypto/keyring" ) @@ -12,14 +10,14 @@ func BenchmarkEthSecp256k1Algo_Derive(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { deriveFn := EthSecp256k1.Derive() - if _, err := deriveFn(mnemonic, keyring.DefaultBIP39Passphrase, types.BIP44HDPath); err != nil { + if _, err := deriveFn(mnemonic, keyring.DefaultBIP39Passphrase, BIP44HDPath); err != nil { b.Fatal(err) } } } func BenchmarkEthSecp256k1Algo_Generate(b *testing.B) { - bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, types.BIP44HDPath) + bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, BIP44HDPath) if err != nil { b.Fatal(err) } diff --git a/types/hdpath.go b/crypto/hd/hdpath.go similarity index 98% rename from types/hdpath.go rename to crypto/hd/hdpath.go index 7c55ddc1a..2a7dd0566 100644 --- a/types/hdpath.go +++ b/crypto/hd/hdpath.go @@ -1,4 +1,4 @@ -package types +package hd import ( ethaccounts "github.com/ethereum/go-ethereum/accounts" diff --git a/encoding/codec/codec.go b/encoding/codec/codec.go index 4f43282c9..f33a79f88 100644 --- a/encoding/codec/codec.go +++ b/encoding/codec/codec.go @@ -1,13 +1,12 @@ package codec import ( - cryptocodec "github.com/cosmos/evm/crypto/codec" - "github.com/cosmos/evm/types" - "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" sdk "github.com/cosmos/cosmos-sdk/types" + cryptocodec "github.com/cosmos/evm/crypto/codec" + "github.com/cosmos/evm/ethereum/eip712" ) // RegisterLegacyAminoCodec registers Interfaces from types, crypto, and SDK std. @@ -21,5 +20,5 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) { std.RegisterInterfaces(interfaceRegistry) cryptocodec.RegisterInterfaces(interfaceRegistry) - types.RegisterInterfaces(interfaceRegistry) + eip712.RegisterInterfaces(interfaceRegistry) } diff --git a/types/codec.go b/ethereum/eip712/codec.go similarity index 88% rename from types/codec.go rename to ethereum/eip712/codec.go index d41102085..f81ce1308 100644 --- a/types/codec.go +++ b/ethereum/eip712/codec.go @@ -1,10 +1,11 @@ -package types +package eip712 import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + types2 "github.com/cosmos/evm/ante/types" ) // RegisterInterfaces registers the CometBFT concrete client-related @@ -23,6 +24,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*tx.TxExtensionOptionI)(nil), &ExtensionOptionsWeb3Tx{}, - &ExtensionOptionDynamicFeeTx{}, + &types2.ExtensionOptionDynamicFeeTx{}, ) } diff --git a/ethereum/eip712/preprocess.go b/ethereum/eip712/preprocess.go index 3e18b7f58..1c2593126 100644 --- a/ethereum/eip712/preprocess.go +++ b/ethereum/eip712/preprocess.go @@ -3,8 +3,6 @@ package eip712 import ( "fmt" - "github.com/cosmos/evm/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -55,7 +53,7 @@ func PreprocessLedgerTx(evmChainID uint64, keyType cosmoskr.KeyType, txBuilder c } // Add ExtensionOptionsWeb3Tx extension with signature var option *codectypes.Any - option, err = codectypes.NewAnyWithValue(&types.ExtensionOptionsWeb3Tx{ + option, err = codectypes.NewAnyWithValue(&ExtensionOptionsWeb3Tx{ FeePayer: feePayerAddr, TypedDataChainID: evmChainID, FeePayerSig: sigBytes, diff --git a/ethereum/eip712/preprocess_test.go b/ethereum/eip712/preprocess_test.go index c0376fda0..f8cd93f5a 100644 --- a/ethereum/eip712/preprocess_test.go +++ b/ethereum/eip712/preprocess_test.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/evm/ethereum/eip712" "github.com/cosmos/evm/testutil/constants" utiltx "github.com/cosmos/evm/testutil/tx" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/math" @@ -81,7 +80,7 @@ func TestLedgerPreprocessing(t *testing.T) { require.True(t, ok) require.True(t, len(hasExtOptsTx.GetExtensionOptions()) == 1) - expectedExt := types.ExtensionOptionsWeb3Tx{ + expectedExt := eip712.ExtensionOptionsWeb3Tx{ TypedDataChainID: 9001, FeePayer: feePayerAddress, FeePayerSig: tc.expectedSignatureBytes, diff --git a/types/web3.pb.go b/ethereum/eip712/web3.pb.go similarity index 82% rename from types/web3.pb.go rename to ethereum/eip712/web3.pb.go index d48e6a634..225ae6a4f 100644 --- a/types/web3.pb.go +++ b/ethereum/eip712/web3.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: cosmos/evm/types/v1/web3.proto -package types +package eip712 import ( fmt "fmt" @@ -77,26 +77,27 @@ func init() { func init() { proto.RegisterFile("cosmos/evm/types/v1/web3.proto", fileDescriptor_8a9cacdd2daddb96) } var fileDescriptor_8a9cacdd2daddb96 = []byte{ - // 300 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, - 0x2f, 0x4f, 0x4d, 0x32, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0xc8, 0xeb, 0xa5, - 0x96, 0xe5, 0xea, 0x81, 0xe5, 0xf5, 0xca, 0x0c, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xf2, - 0xfa, 0x20, 0x16, 0x44, 0xa9, 0xd2, 0x57, 0x46, 0x2e, 0x31, 0xd7, 0x8a, 0x92, 0xd4, 0xbc, 0xe2, - 0xcc, 0xfc, 0x3c, 0xff, 0x82, 0x92, 0xcc, 0xfc, 0xbc, 0xe2, 0xf0, 0xd4, 0x24, 0xe3, 0x90, 0x0a, - 0xa1, 0x44, 0x2e, 0x61, 0x90, 0xe6, 0x94, 0xf8, 0x94, 0xc4, 0x92, 0xc4, 0xf8, 0xe4, 0x8c, 0xc4, - 0xcc, 0xbc, 0xf8, 0xcc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x16, 0x27, 0xa3, 0x47, 0xf7, 0xe4, - 0x05, 0x42, 0x40, 0xd2, 0x2e, 0x89, 0x25, 0x89, 0xce, 0x20, 0x49, 0x4f, 0x97, 0x57, 0xf7, 0xe4, - 0xa5, 0x4a, 0xd0, 0xc4, 0x74, 0xf2, 0x73, 0x33, 0x4b, 0x52, 0x73, 0x0b, 0x4a, 0x2a, 0x83, 0x04, - 0xd0, 0xe4, 0x52, 0x84, 0x8c, 0xb9, 0x38, 0xd3, 0x52, 0x53, 0xe3, 0x0b, 0x12, 0x2b, 0x53, 0x8b, - 0x24, 0x98, 0x14, 0x18, 0x35, 0x38, 0x9d, 0xc4, 0x5e, 0xdd, 0x93, 0x17, 0x4a, 0x4b, 0x4d, 0x0d, - 0x00, 0x89, 0x21, 0x69, 0xe6, 0x80, 0x89, 0x09, 0xd9, 0x72, 0xf1, 0xc2, 0x35, 0xc5, 0x17, 0x67, - 0xa6, 0x4b, 0x30, 0x2b, 0x30, 0x6a, 0xf0, 0x38, 0x49, 0xbe, 0xba, 0x27, 0x2f, 0x0a, 0x53, 0x14, - 0x9c, 0x99, 0x8e, 0xa4, 0x97, 0x1b, 0x49, 0xd8, 0x8a, 0xa5, 0x63, 0x81, 0x3c, 0x83, 0x93, 0xe9, - 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, - 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x49, 0xa7, 0x67, 0x96, 0x64, 0x94, - 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa3, 0x87, 0x73, 0x12, 0x1b, 0x38, 0xd4, 0x8c, 0x01, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x3e, 0x08, 0x6e, 0x8c, 0x82, 0x01, 0x00, 0x00, + // 313 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x31, 0x4b, 0xc3, 0x40, + 0x18, 0x86, 0x73, 0x5a, 0xc4, 0x46, 0x85, 0x92, 0x6a, 0xa9, 0x1d, 0x2e, 0x45, 0x10, 0x3a, 0x48, + 0x8e, 0x36, 0x83, 0x20, 0x88, 0x10, 0xeb, 0xe0, 0xa4, 0x68, 0x41, 0x70, 0x09, 0x97, 0xe6, 0x6b, + 0x7a, 0xc3, 0xe5, 0x8e, 0xde, 0x35, 0xb6, 0xff, 0xc0, 0xd1, 0x9f, 0xe0, 0xcf, 0x71, 0xec, 0xe8, + 0x14, 0x24, 0xdd, 0xba, 0xbb, 0x4b, 0x52, 0x2a, 0xa1, 0xdb, 0xc7, 0xf3, 0x7c, 0xcf, 0xf2, 0x9a, + 0x78, 0x28, 0x14, 0x17, 0x8a, 0x40, 0xc2, 0x89, 0x9e, 0x4b, 0x50, 0x24, 0xe9, 0x92, 0x37, 0x08, + 0x5c, 0x47, 0x4e, 0x84, 0x16, 0x56, 0x7d, 0xed, 0x1d, 0x48, 0xb8, 0x53, 0x78, 0x27, 0xe9, 0xb6, + 0x8e, 0x23, 0x11, 0x89, 0xc2, 0x93, 0xfc, 0x5a, 0xbf, 0x9e, 0xfd, 0x22, 0xb3, 0x71, 0x37, 0xd3, + 0x10, 0x2b, 0x26, 0xe2, 0x07, 0xa9, 0x99, 0x88, 0xd5, 0x0b, 0x04, 0xee, 0x60, 0x66, 0x51, 0xb3, + 0x9e, 0xc7, 0xa1, 0x1f, 0x52, 0x4d, 0xfd, 0xe1, 0x98, 0xb2, 0xd8, 0x67, 0x61, 0x13, 0xb5, 0x51, + 0xa7, 0xe2, 0xf5, 0xb2, 0xd4, 0xae, 0x0d, 0x72, 0xdd, 0xa7, 0x9a, 0xde, 0xe6, 0xf2, 0xbe, 0xbf, + 0x4a, 0xed, 0x96, 0xde, 0x62, 0x17, 0x82, 0x33, 0x0d, 0x5c, 0xea, 0xf9, 0x53, 0x6d, 0xcb, 0x85, + 0x96, 0x6b, 0x56, 0x47, 0x00, 0xbe, 0xa4, 0x73, 0x98, 0x34, 0x77, 0xda, 0xa8, 0x53, 0xf5, 0x1a, + 0xab, 0xd4, 0xb6, 0x46, 0x00, 0x8f, 0x39, 0x2b, 0xc5, 0xfb, 0x1b, 0x66, 0x5d, 0x9b, 0x47, 0xff, + 0x91, 0xaf, 0x58, 0xd4, 0xdc, 0x6d, 0xa3, 0xce, 0xa1, 0x77, 0xba, 0x4a, 0xed, 0x93, 0xcd, 0xd3, + 0x33, 0x8b, 0x4a, 0xed, 0x41, 0x09, 0x5f, 0x55, 0xde, 0x3f, 0x6d, 0xc3, 0xbb, 0xf9, 0xca, 0x30, + 0x5a, 0x64, 0x18, 0xfd, 0x64, 0x18, 0x7d, 0x2c, 0xb1, 0xb1, 0x58, 0x62, 0xe3, 0x7b, 0x89, 0x8d, + 0xd7, 0xf3, 0x88, 0xe9, 0xf1, 0x34, 0x70, 0x86, 0x82, 0x93, 0xd2, 0xce, 0xa0, 0xc7, 0x30, 0x81, + 0x29, 0x27, 0xc0, 0xe4, 0x65, 0xb7, 0x17, 0xec, 0x15, 0xfb, 0xb9, 0x7f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x6f, 0x5f, 0x74, 0x4e, 0x8c, 0x01, 0x00, 0x00, } func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error) { diff --git a/evmd/ante/evm_antehandler_benchmark_test.go b/evmd/ante/evm_antehandler_benchmark_test.go index 5724aa8d9..289a5f6ed 100644 --- a/evmd/ante/evm_antehandler_benchmark_test.go +++ b/evmd/ante/evm_antehandler_benchmark_test.go @@ -2,6 +2,7 @@ package ante_test import ( "fmt" + cosmosevmtypes "github.com/cosmos/evm/ante/types" "math/big" "testing" @@ -14,7 +15,6 @@ import ( "github.com/cosmos/evm/testutil/integration/evm/grpc" "github.com/cosmos/evm/testutil/integration/evm/network" testkeyring "github.com/cosmos/evm/testutil/keyring" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/errors" diff --git a/evmd/ante/validate_handler_options_test.go b/evmd/ante/validate_handler_options_test.go index 881f14a8a..825b1f541 100644 --- a/evmd/ante/validate_handler_options_test.go +++ b/evmd/ante/validate_handler_options_test.go @@ -1,6 +1,7 @@ package ante_test import ( + "github.com/cosmos/evm/ante/types" "testing" "github.com/ethereum/go-ethereum/common" @@ -10,7 +11,6 @@ import ( ethante "github.com/cosmos/evm/ante/evm" "github.com/cosmos/evm/evmd/tests/integration" "github.com/cosmos/evm/testutil/integration/evm/network" - "github.com/cosmos/evm/types" ) //nolint:thelper // RunValidateHandlerOptionsTest is not a helper function; it's an externally called benchmark entry point diff --git a/evmd/app.go b/evmd/app.go index e47152852..4c5d31cfd 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -4,7 +4,9 @@ import ( "encoding/json" "errors" "fmt" + types2 "github.com/cosmos/evm/ante/types" precompiletypes "github.com/cosmos/evm/precompiles/types" + "github.com/cosmos/evm/utils" "io" "os" @@ -26,7 +28,6 @@ import ( "github.com/cosmos/evm/evmd/ante" evmmempool "github.com/cosmos/evm/mempool" srvflags "github.com/cosmos/evm/server/flags" - cosmosevmtypes "github.com/cosmos/evm/types" "github.com/cosmos/evm/x/erc20" erc20keeper "github.com/cosmos/evm/x/erc20/keeper" erc20types "github.com/cosmos/evm/x/erc20/types" @@ -136,7 +137,7 @@ import ( func init() { // manually update the power reduction by replacing micro (u) -> atto (a) evmos - sdk.DefaultPowerReduction = cosmosevmtypes.AttoPowerReduction + sdk.DefaultPowerReduction = utils.AttoPowerReduction defaultNodeHome = evmdconfig.MustGetDefaultNodeHome() } @@ -821,7 +822,7 @@ func (app *EVMD) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) { Cdc: app.appCodec, AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, - ExtensionOptionChecker: cosmosevmtypes.HasDynamicFeeExtensionOption, + ExtensionOptionChecker: types2.HasDynamicFeeExtensionOption, EvmKeeper: app.EVMKeeper, FeegrantKeeper: app.FeeGrantKeeper, IBCKeeper: app.IBCKeeper, @@ -884,7 +885,7 @@ func (app *EVMD) Configurator() module.Configurator { // InitChainer application update at chain initialization func (app *EVMD) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { - var genesisState cosmosevmtypes.GenesisState + var genesisState GenesisState if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { panic(err) } diff --git a/evmd/cmd/evmd/config/config.go b/evmd/cmd/evmd/config/config.go index 2699ca0b6..f14476202 100644 --- a/evmd/cmd/evmd/config/config.go +++ b/evmd/cmd/evmd/config/config.go @@ -1,7 +1,7 @@ package config import ( - "github.com/cosmos/evm/types" + "github.com/cosmos/evm/crypto/hd" evmtypes "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -67,7 +67,7 @@ func SetBech32Prefixes(config *sdk.Config) { // SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets. func SetBip44CoinType(config *sdk.Config) { - config.SetCoinType(types.Bip44CoinType) - config.SetPurpose(sdk.Purpose) // Shared - config.SetFullFundraiserPath(types.BIP44HDPath) //nolint: staticcheck + config.SetCoinType(hd.Bip44CoinType) + config.SetPurpose(sdk.Purpose) // Shared + config.SetFullFundraiserPath(hd.BIP44HDPath) //nolint: staticcheck } diff --git a/evmd/tests/network/network.go b/evmd/tests/network/network.go index 51fb9133f..49c53ae57 100644 --- a/evmd/tests/network/network.go +++ b/evmd/tests/network/network.go @@ -6,6 +6,8 @@ import ( "encoding/json" "errors" "fmt" + testutil2 "github.com/cosmos/evm/testutil" + "github.com/cosmos/evm/utils" "net/http" "net/url" "os" @@ -33,7 +35,6 @@ import ( "github.com/cosmos/evm/server/config" testconfig "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" - cosmosevmtypes "github.com/cosmos/evm/types" "cosmossdk.io/log" "cosmossdk.io/math" @@ -78,14 +79,14 @@ type Config struct { InterfaceRegistry codectypes.InterfaceRegistry TxConfig client.TxConfig AccountRetriever client.AccountRetriever - AppConstructor AppConstructor // the ABCI application constructor - GenesisState cosmosevmtypes.GenesisState // custom gensis state to provide - TimeoutCommit time.Duration // the consensus commitment timeout - AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) - StakingTokens math.Int // the amount of tokens each validator has available to stake - BondedTokens math.Int // the amount of tokens each validator stakes - NumValidators int // the total number of validators to create and bond - ChainID string // the network chain-id + AppConstructor AppConstructor // the ABCI application constructor + GenesisState testutil2.GenesisState // custom gensis state to provide + TimeoutCommit time.Duration // the consensus commitment timeout + AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) + StakingTokens math.Int // the amount of tokens each validator has available to stake + BondedTokens math.Int // the amount of tokens each validator stakes + NumValidators int // the total number of validators to create and bond + ChainID string // the network chain-id EVMChainID uint64 BondDenom string // the staking bond denomination MinGasPrices string // the minimum gas prices each validator will accept @@ -125,9 +126,9 @@ func DefaultConfig() Config { NumValidators: 4, BondDenom: testconstants.ExampleAttoDenom, MinGasPrices: fmt.Sprintf("0.000006%s", testconstants.ExampleAttoDenom), - AccountTokens: sdk.TokensFromConsensusPower(1000000000000000000, cosmosevmtypes.AttoPowerReduction), - StakingTokens: sdk.TokensFromConsensusPower(500000000000000000, cosmosevmtypes.AttoPowerReduction), - BondedTokens: sdk.TokensFromConsensusPower(100000000000000000, cosmosevmtypes.AttoPowerReduction), + AccountTokens: sdk.TokensFromConsensusPower(1000000000000000000, utils.AttoPowerReduction), + StakingTokens: sdk.TokensFromConsensusPower(500000000000000000, utils.AttoPowerReduction), + BondedTokens: sdk.TokensFromConsensusPower(100000000000000000, utils.AttoPowerReduction), PruningStrategy: pruningtypes.PruningOptionNothing, CleanupDir: true, SigningAlgo: string(hd.EthSecp256k1Type), diff --git a/evmd/testutil/eth_setup.go b/evmd/testutil/eth_setup.go index 64b1f8dcb..0c7f66984 100644 --- a/evmd/testutil/eth_setup.go +++ b/evmd/testutil/eth_setup.go @@ -1,12 +1,12 @@ package testutil import ( + "github.com/cosmos/evm/testutil" "time" cmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm" - cosmosevmtypes "github.com/cosmos/evm/types" "cosmossdk.io/math" @@ -48,7 +48,7 @@ var EthDefaultConsensusParams = &cmtypes.ConsensusParams{ // // TODO: are these different genesis functions necessary or can they all be refactored into one? // there's also other genesis state functions; some like app.DefaultGenesis() or others in test helpers only. -func NewTestGenesisState(app evm.EvmApp) cosmosevmtypes.GenesisState { +func NewTestGenesisState(app evm.EvmApp) testutil.GenesisState { privVal := mock.NewPV() pubKey, err := privVal.GetPubKey() if err != nil { @@ -70,10 +70,10 @@ func NewTestGenesisState(app evm.EvmApp) cosmosevmtypes.GenesisState { return genesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balance) } -func genesisStateWithValSet(codec codec.Codec, genesisState cosmosevmtypes.GenesisState, +func genesisStateWithValSet(codec codec.Codec, genesisState testutil.GenesisState, valSet *cmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance, -) cosmosevmtypes.GenesisState { +) testutil.GenesisState { // set genesis accounts authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) genesisState[authtypes.ModuleName] = codec.MustMarshalJSON(authGenesis) diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index ae8941acf..ff6e3f239 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -2,6 +2,7 @@ package indexer import ( "fmt" + "github.com/cosmos/evm/server/types" "github.com/ethereum/go-ethereum/common" @@ -10,7 +11,6 @@ import ( dbm "github.com/cosmos/cosmos-db" rpctypes "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" @@ -30,7 +30,7 @@ const ( TxIndexKeyLength = 1 + 8 + 8 ) -var _ cosmosevmtypes.EVMTxIndexer = &KVIndexer{} +var _ types.EVMTxIndexer = &KVIndexer{} // KVIndexer implements a eth tx indexer on a KV db. type KVIndexer struct { @@ -84,7 +84,7 @@ func (kv *KVIndexer) IndexBlock(block *cmttypes.Block, txResults []*abci.ExecTxR ethMsg := msg.(*evmtypes.MsgEthereumTx) txHash := ethMsg.Hash() - txResult := cosmosevmtypes.TxResult{ + txResult := types.TxResult{ Height: height, TxIndex: uint32(txIndex), //#nosec G115 -- int overflow is not a concern here MsgIndex: uint32(msgIndex), //#nosec G115 -- int overflow is not a concern here @@ -134,7 +134,7 @@ func (kv *KVIndexer) FirstIndexedBlock() (int64, error) { } // GetByTxHash finds eth tx by eth tx hash -func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*cosmosevmtypes.TxResult, error) { +func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*types.TxResult, error) { bz, err := kv.db.Get(TxHashKey(hash)) if err != nil { return nil, errorsmod.Wrapf(err, "GetByTxHash %s", hash.Hex()) @@ -142,7 +142,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*cosmosevmtypes.TxResult, er if len(bz) == 0 { return nil, fmt.Errorf("tx not found, hash: %s", hash.Hex()) } - var txKey cosmosevmtypes.TxResult + var txKey types.TxResult if err := kv.clientCtx.Codec.Unmarshal(bz, &txKey); err != nil { return nil, errorsmod.Wrapf(err, "GetByTxHash %s", hash.Hex()) } @@ -150,7 +150,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*cosmosevmtypes.TxResult, er } // GetByBlockAndIndex finds eth tx by block number and eth tx index -func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*cosmosevmtypes.TxResult, error) { +func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*types.TxResult, error) { bz, err := kv.db.Get(TxIndexKey(blockNumber, txIndex)) if err != nil { return nil, errorsmod.Wrapf(err, "GetByBlockAndIndex %d %d", blockNumber, txIndex) @@ -213,7 +213,7 @@ func isEthTx(tx sdk.Tx) bool { } // saveTxResult index the txResult into the kv db batch -func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *cosmosevmtypes.TxResult) error { +func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *types.TxResult) error { bz := codec.MustMarshal(txResult) if err := batch.Set(TxHashKey(txHash), bz); err != nil { return errorsmod.Wrap(err, "set tx-hash key") diff --git a/proto/cosmos/evm/types/v1/dynamic_fee.proto b/proto/cosmos/evm/types/v1/dynamic_fee.proto index bca7e6498..e4ce481c2 100644 --- a/proto/cosmos/evm/types/v1/dynamic_fee.proto +++ b/proto/cosmos/evm/types/v1/dynamic_fee.proto @@ -5,7 +5,7 @@ package cosmos.evm.types.v1; import "amino/amino.proto"; import "gogoproto/gogo.proto"; -option go_package = "github.com/cosmos/evm/types"; +option go_package = "github.com/cosmos/evm/ante/types"; // ExtensionOptionDynamicFeeTx is an extension option that specifies the // maxPrioPrice for cosmos tx diff --git a/proto/cosmos/evm/types/v1/indexer.proto b/proto/cosmos/evm/types/v1/indexer.proto index aaee57961..00a657dcf 100644 --- a/proto/cosmos/evm/types/v1/indexer.proto +++ b/proto/cosmos/evm/types/v1/indexer.proto @@ -4,7 +4,7 @@ package cosmos.evm.types.v1; import "gogoproto/gogo.proto"; -option go_package = "github.com/cosmos/evm/types"; +option go_package = "github.com/cosmos/evm/server/types"; // TxResult is the value stored in eth tx indexer message TxResult { diff --git a/proto/cosmos/evm/types/v1/web3.proto b/proto/cosmos/evm/types/v1/web3.proto index b52851dca..98fd97dd8 100644 --- a/proto/cosmos/evm/types/v1/web3.proto +++ b/proto/cosmos/evm/types/v1/web3.proto @@ -4,7 +4,7 @@ package cosmos.evm.types.v1; import "gogoproto/gogo.proto"; -option go_package = "github.com/cosmos/evm/types"; +option go_package = "github.com/cosmos/evm/ethereum/eip712"; // ExtensionOptionsWeb3Tx is an extension option that specifies the typed chain // id, the fee payer as well as its signature data. diff --git a/rpc/apis.go b/rpc/apis.go index e969f86e5..f17908000 100644 --- a/rpc/apis.go +++ b/rpc/apis.go @@ -2,9 +2,12 @@ package rpc import ( "fmt" + server2 "github.com/cosmos/evm/server/types" "github.com/ethereum/go-ethereum/rpc" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server" evmmempool "github.com/cosmos/evm/mempool" "github.com/cosmos/evm/rpc/backend" "github.com/cosmos/evm/rpc/namespaces/ethereum/debug" @@ -16,10 +19,6 @@ import ( "github.com/cosmos/evm/rpc/namespaces/ethereum/txpool" "github.com/cosmos/evm/rpc/namespaces/ethereum/web3" "github.com/cosmos/evm/rpc/stream" - "github.com/cosmos/evm/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/server" ) // RPC namespaces and API version @@ -47,7 +46,7 @@ type APICreator = func( clientCtx client.Context, stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API @@ -60,7 +59,7 @@ func init() { clientCtx client.Context, stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -79,7 +78,7 @@ func init() { }, } }, - Web3Namespace: func(*server.Context, client.Context, *stream.RPCStream, bool, types.EVMTxIndexer, *evmmempool.ExperimentalEVMMempool) []rpc.API { + Web3Namespace: func(*server.Context, client.Context, *stream.RPCStream, bool, server2.EVMTxIndexer, *evmmempool.ExperimentalEVMMempool) []rpc.API { return []rpc.API{ { Namespace: Web3Namespace, @@ -89,7 +88,7 @@ func init() { }, } }, - NetNamespace: func(ctx *server.Context, clientCtx client.Context, _ *stream.RPCStream, _ bool, _ types.EVMTxIndexer, _ *evmmempool.ExperimentalEVMMempool) []rpc.API { + NetNamespace: func(ctx *server.Context, clientCtx client.Context, _ *stream.RPCStream, _ bool, _ server2.EVMTxIndexer, _ *evmmempool.ExperimentalEVMMempool) []rpc.API { return []rpc.API{ { Namespace: NetNamespace, @@ -103,7 +102,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -120,7 +119,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -137,7 +136,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -154,7 +153,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -175,7 +174,7 @@ func GetRPCAPIs(ctx *server.Context, clientCtx client.Context, stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer server2.EVMTxIndexer, selectedAPIs []string, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { diff --git a/rpc/backend/backend.go b/rpc/backend/backend.go index de169ff75..78a0f1dd8 100644 --- a/rpc/backend/backend.go +++ b/rpc/backend/backend.go @@ -3,6 +3,7 @@ package backend import ( "context" "fmt" + "github.com/cosmos/evm/server/types" "math/big" "time" @@ -20,7 +21,6 @@ import ( evmmempool "github.com/cosmos/evm/mempool" rpctypes "github.com/cosmos/evm/rpc/types" "github.com/cosmos/evm/server/config" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" @@ -100,8 +100,8 @@ type EVMBackend interface { // Tx Info GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransaction, error) - GetTxByEthHash(txHash common.Hash) (*cosmosevmtypes.TxResult, error) - GetTxByTxIndex(height int64, txIndex uint) (*cosmosevmtypes.TxResult, error) + GetTxByEthHash(txHash common.Hash) (*types.TxResult, error) + GetTxByTxIndex(height int64, txIndex uint) (*types.TxResult, error) GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error) GetTransactionLogs(hash common.Hash) ([]*ethtypes.Log, error) @@ -166,7 +166,7 @@ type Backend struct { EvmChainID *big.Int Cfg config.Config AllowUnprotectedTxs bool - Indexer cosmosevmtypes.EVMTxIndexer + Indexer types.EVMTxIndexer ProcessBlocker ProcessBlocker Mempool *evmmempool.ExperimentalEVMMempool } @@ -181,7 +181,7 @@ func NewBackend( logger log.Logger, clientCtx client.Context, allowUnprotectedTxs bool, - indexer cosmosevmtypes.EVMTxIndexer, + indexer types.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) *Backend { appConf, err := config.GetConfig(ctx.Viper) diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index 737fdc3f5..ce4f10e7d 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -2,6 +2,8 @@ package backend import ( "fmt" + "github.com/cosmos/evm/server/types" + cosmosevmtypes "github.com/cosmos/evm/utils" "math/big" "strconv" @@ -17,7 +19,6 @@ import ( cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" rpctypes "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -581,7 +582,7 @@ func (b *Backend) GetBlockReceipts( func (b *Backend) formatTxReceipt( ethMsg *evmtypes.MsgEthereumTx, - txResult *cosmosevmtypes.TxResult, + txResult *types.TxResult, blockRes *cmtrpctypes.ResultBlockResults, blockHeaderHash string, ) (map[string]interface{}, error) { diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index e23a93086..98dd91637 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -2,6 +2,8 @@ package backend import ( "fmt" + types2 "github.com/cosmos/evm/server/types" + "github.com/cosmos/evm/utils" "math" "math/big" "time" @@ -19,7 +21,6 @@ import ( "github.com/cosmos/evm/mempool/txpool" rpctypes "github.com/cosmos/evm/rpc/types" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" @@ -131,7 +132,7 @@ func (b *Backend) GetTransactionByHashPending(txHash common.Hash) (*rpctypes.RPC } // GetGasUsed returns gasUsed from transaction -func (b *Backend) GetGasUsed(res *types.TxResult, price *big.Int, gas uint64) uint64 { +func (b *Backend) GetGasUsed(res *types2.TxResult, price *big.Int, gas uint64) uint64 { return res.GasUsed } @@ -144,7 +145,7 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ maxRetries := 10 baseDelay := 50 * time.Millisecond - var res *types.TxResult + var res *types2.TxResult var err error for attempt := 0; attempt <= maxRetries; attempt++ { @@ -216,7 +217,7 @@ func (b *Backend) GetTransactionLogs(hash common.Hash) ([]*ethtypes.Log, error) b.Logger.Debug("block result not found", "number", res.Height, "error", err.Error()) return nil, nil } - height, err := types.SafeUint64(resBlockResult.Height) + height, err := utils.SafeUint64(resBlockResult.Height) if err != nil { return nil, err } @@ -277,7 +278,7 @@ func (b *Backend) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNum // GetTxByEthHash uses `/tx_query` to find transaction by ethereum tx hash // TODO: Don't need to convert once hashing is fixed on CometBFT // https://github.com/cometbft/cometbft/issues/6539 -func (b *Backend) GetTxByEthHash(hash common.Hash) (*types.TxResult, error) { +func (b *Backend) GetTxByEthHash(hash common.Hash) (*types2.TxResult, error) { if b.Indexer != nil { return b.Indexer.GetByTxHash(hash) } @@ -294,7 +295,7 @@ func (b *Backend) GetTxByEthHash(hash common.Hash) (*types.TxResult, error) { } // GetTxByTxIndex uses `/tx_query` to find transaction by tx index of valid ethereum txs -func (b *Backend) GetTxByTxIndex(height int64, index uint) (*types.TxResult, error) { +func (b *Backend) GetTxByTxIndex(height int64, index uint) (*types2.TxResult, error) { int32Index := int32(index) //#nosec G115 -- checked for int overflow already if b.Indexer != nil { return b.Indexer.GetByBlockAndIndex(height, int32Index) @@ -315,7 +316,7 @@ func (b *Backend) GetTxByTxIndex(height int64, index uint) (*types.TxResult, err } // QueryCometTxIndexer query tx in CometBFT tx indexer -func (b *Backend) QueryCometTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*types.TxResult, error) { +func (b *Backend) QueryCometTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*types2.TxResult, error) { resTxs, err := b.ClientCtx.Client.TxSearch(b.Ctx, query, false, nil, nil, "") if err != nil { return nil, err diff --git a/rpc/backend/utils.go b/rpc/backend/utils.go index 6fbfd3922..d236e4cd0 100644 --- a/rpc/backend/utils.go +++ b/rpc/backend/utils.go @@ -18,7 +18,6 @@ import ( cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/types" "github.com/cosmos/evm/utils" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -171,7 +170,7 @@ func (b *Backend) ProcessBlock( if err != nil { return err } - nextBaseFee, err := utils.CalcBaseFee(cfg, &header, params.Params) + nextBaseFee, err := types.CalcBaseFee(cfg, &header, params.Params) if err != nil { return err } @@ -260,7 +259,7 @@ func ShouldIgnoreGasUsed(res *abci.ExecTxResult) bool { // GetLogsFromBlockResults returns the list of event logs from the CometBFT block result response func GetLogsFromBlockResults(blockRes *cmtrpctypes.ResultBlockResults) ([][]*ethtypes.Log, error) { - height, err := cosmosevmtypes.SafeUint64(blockRes.Height) + height, err := utils.SafeUint64(blockRes.Height) if err != nil { return nil, err } diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index 35ea3aa24..f1a14954f 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/evm/rpc/backend" rpctypes "github.com/cosmos/evm/rpc/types" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" @@ -297,7 +296,7 @@ func (e *PublicAPI) Call(args evmtypes.TransactionArgs, // ProtocolVersion returns the supported Ethereum protocol version. func (e *PublicAPI) ProtocolVersion() hexutil.Uint { e.logger.Debug("eth_protocolVersion") - return hexutil.Uint(types.ProtocolVersion) + return hexutil.Uint(rpctypes.ProtocolVersion) } // GasPrice returns the current gas price based on Cosmos EVM's gas price oracle. diff --git a/rpc/namespaces/ethereum/personal/api.go b/rpc/namespaces/ethereum/personal/api.go index 7fc22c350..63a388a9f 100644 --- a/rpc/namespaces/ethereum/personal/api.go +++ b/rpc/namespaces/ethereum/personal/api.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/evm/crypto/hd" "github.com/cosmos/evm/rpc/backend" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" @@ -26,7 +25,7 @@ import ( type PrivateAccountAPI struct { backend backend.EVMBackend logger log.Logger - hdPathIter types.HDPathIterator + hdPathIter hd.HDPathIterator } // NewAPI creates an instance of the public Personal Eth API. @@ -37,7 +36,7 @@ func NewAPI( cfg := sdk.GetConfig() basePath := cfg.GetFullBIP44Path() - iterator, err := types.NewHDPathIterator(basePath, true) + iterator, err := hd.NewHDPathIterator(basePath, true) if err != nil { panic(err) } diff --git a/rpc/stream/rpc.go b/rpc/stream/rpc.go index 621657927..3312a81d8 100644 --- a/rpc/stream/rpc.go +++ b/rpc/stream/rpc.go @@ -3,6 +3,7 @@ package stream import ( "context" "fmt" + cosmosevmtypes "github.com/cosmos/evm/utils" "sync" "github.com/ethereum/go-ethereum/common" @@ -14,7 +15,6 @@ import ( cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" diff --git a/rpc/types/block.go b/rpc/types/block.go index 55c698569..bcc7eb872 100644 --- a/rpc/types/block.go +++ b/rpc/types/block.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/cosmos/evm/utils" "math" "math/big" "strings" @@ -14,8 +15,6 @@ import ( "github.com/spf13/cast" "google.golang.org/grpc/metadata" - "github.com/cosmos/evm/types" - grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) @@ -182,7 +181,7 @@ func (bnh *BlockNumberOrHash) decodeFromString(input string) error { return err } - bnInt, err := types.SafeInt64(blockNumber) + bnInt, err := utils.SafeInt64(blockNumber) if err != nil { return err } diff --git a/rpc/types/events.go b/rpc/types/events.go index 749a50bd3..0e35394f1 100644 --- a/rpc/types/events.go +++ b/rpc/types/events.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "github.com/cosmos/evm/server/types" "strconv" "github.com/ethereum/go-ethereum/common" @@ -9,7 +10,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/types/protocol.go b/rpc/types/protocol.go similarity index 100% rename from types/protocol.go rename to rpc/types/protocol.go diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 6a600881c..7e1f94653 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -3,6 +3,8 @@ package types import ( "context" "fmt" + types2 "github.com/cosmos/evm/x/feemarket/types" + "github.com/pkg/errors" "math/big" "strings" @@ -334,3 +336,22 @@ func TxStateDBCommitError(res *abci.ExecTxResult) bool { func TxSucessOrExpectedFailure(res *abci.ExecTxResult) bool { return res.Code == 0 || TxExceedBlockGasLimit(res) || TxStateDBCommitError(res) } + +// CalcBaseFee calculates the basefee of the header. +func CalcBaseFee(config *params.ChainConfig, parent *ethtypes.Header, p types2.Params) (*big.Int, error) { + // If the current block is the first EIP-1559 block, return the InitialBaseFee. + if !config.IsLondon(parent.Number) { + return new(big.Int).SetUint64(params.InitialBaseFee), nil + } + if p.ElasticityMultiplier == 0 { + return nil, errors.New("ElasticityMultiplier cannot be 0 as it's checked in the params validation") + } + parentGasTarget := parent.GasLimit / uint64(p.ElasticityMultiplier) + + factor := evmtypes.GetEVMCoinDecimals().ConversionFactor() + minGasPrice := p.MinGasPrice.Mul(sdkmath.LegacyNewDecFromInt(factor)) + return types2.CalcGasBaseFee( + parent.GasUsed, parentGasTarget, uint64(p.BaseFeeChangeDenominator), + sdkmath.LegacyNewDecFromBigInt(parent.BaseFee), sdkmath.LegacyOneDec(), minGasPrice, + ).TruncateInt().BigInt(), nil +} diff --git a/server/indexer_service.go b/server/indexer_service.go index 6cfad6f56..6240eede0 100644 --- a/server/indexer_service.go +++ b/server/indexer_service.go @@ -2,14 +2,13 @@ package server import ( "context" + types2 "github.com/cosmos/evm/server/types" "time" "github.com/cometbft/cometbft/libs/service" rpcclient "github.com/cometbft/cometbft/rpc/client" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" - - cosmosevmtypes "github.com/cosmos/evm/types" ) const ( @@ -22,13 +21,13 @@ const ( type EVMIndexerService struct { service.BaseService - txIdxr cosmosevmtypes.EVMTxIndexer + txIdxr types2.EVMTxIndexer client rpcclient.Client } // NewEVMIndexerService returns a new service instance. func NewEVMIndexerService( - txIdxr cosmosevmtypes.EVMTxIndexer, + txIdxr types2.EVMTxIndexer, client rpcclient.Client, ) *EVMIndexerService { is := &EVMIndexerService{txIdxr: txIdxr, client: client} diff --git a/server/json_rpc.go b/server/json_rpc.go index 802e986e0..9b71bc799 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -3,6 +3,7 @@ package server import ( "context" "fmt" + "github.com/cosmos/evm/server/types" "log/slog" "net/http" "time" @@ -15,14 +16,12 @@ import ( rpcclient "github.com/cometbft/cometbft/rpc/client" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server" evmmempool "github.com/cosmos/evm/mempool" "github.com/cosmos/evm/rpc" "github.com/cosmos/evm/rpc/stream" serverconfig "github.com/cosmos/evm/server/config" - cosmosevmtypes "github.com/cosmos/evm/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/server" ) const shutdownTimeout = 200 * time.Millisecond @@ -38,7 +37,7 @@ func StartJSONRPC( clientCtx client.Context, g *errgroup.Group, config *serverconfig.Config, - indexer cosmosevmtypes.EVMTxIndexer, + indexer types.EVMTxIndexer, app AppWithPendingTxStream, mempool *evmmempool.ExperimentalEVMMempool, ) (*http.Server, error) { diff --git a/server/start.go b/server/start.go index 1a08fcb0d..3298522c6 100644 --- a/server/start.go +++ b/server/start.go @@ -3,6 +3,7 @@ package server import ( "context" "fmt" + types2 "github.com/cosmos/evm/server/types" "io" "net" "os" @@ -26,6 +27,9 @@ import ( "github.com/cometbft/cometbft/rpc/client/local" cmttypes "github.com/cometbft/cometbft/types" + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" + pruningtypes "cosmossdk.io/store/pruning/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/evm/indexer" evmmempool "github.com/cosmos/evm/mempool" @@ -33,11 +37,6 @@ import ( ethdebug "github.com/cosmos/evm/rpc/namespaces/ethereum/debug" cosmosevmserverconfig "github.com/cosmos/evm/server/config" srvflags "github.com/cosmos/evm/server/flags" - cosmosevmtypes "github.com/cosmos/evm/types" - - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/log" - pruningtypes "cosmossdk.io/store/pruning/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -467,7 +466,7 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start ethmetricsexp.Setup(config.JSONRPC.MetricsAddress) } - var idxer cosmosevmtypes.EVMTxIndexer + var idxer types2.EVMTxIndexer if config.JSONRPC.EnableIndexer { idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { diff --git a/types/indexer.go b/server/types/indexer.go similarity index 100% rename from types/indexer.go rename to server/types/indexer.go diff --git a/types/indexer.pb.go b/server/types/indexer.pb.go similarity index 85% rename from types/indexer.pb.go rename to server/types/indexer.pb.go index 93ccbc8a5..3a36a31c6 100644 --- a/types/indexer.pb.go +++ b/server/types/indexer.pb.go @@ -84,26 +84,26 @@ func init() { func init() { proto.RegisterFile("cosmos/evm/types/v1/indexer.proto", fileDescriptor_b69626dfe9e578b6) } var fileDescriptor_b69626dfe9e578b6 = []byte{ - // 295 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0x86, 0x73, 0xb6, 0x4d, 0xe3, 0xa1, 0x83, 0xa9, 0x94, 0x68, 0xe1, 0x3c, 0x9d, 0x32, 0xdd, - 0x51, 0xc4, 0xc5, 0xd1, 0x45, 0x5c, 0x8f, 0xba, 0xb8, 0x84, 0xb4, 0xf9, 0xbc, 0x04, 0x7a, 0x5e, - 0xe9, 0x5d, 0x42, 0xfc, 0x07, 0x8e, 0xfe, 0x04, 0x7f, 0x8e, 0x63, 0x47, 0x47, 0x69, 0xf1, 0x7f, - 0x48, 0x2e, 0xa1, 0x82, 0xdb, 0xf7, 0xf2, 0x3c, 0x1f, 0x2f, 0xbc, 0xf8, 0x72, 0xa1, 0x8d, 0xd2, - 0x86, 0x43, 0xa5, 0xb8, 0x7d, 0x5d, 0x81, 0xe1, 0xd5, 0x94, 0x17, 0x2f, 0x19, 0xd4, 0xb0, 0x66, - 0xab, 0xb5, 0xb6, 0x3a, 0x1c, 0xb5, 0x0a, 0x83, 0x4a, 0x31, 0xa7, 0xb0, 0x6a, 0x7a, 0x7e, 0x2a, - 0xb5, 0xd4, 0x8e, 0xf3, 0xe6, 0x6a, 0xd5, 0xab, 0x1f, 0x84, 0x83, 0x59, 0x2d, 0xc0, 0x94, 0x4b, - 0x1b, 0x8e, 0xb1, 0x9f, 0x43, 0x21, 0x73, 0x1b, 0x21, 0x8a, 0xe2, 0x9e, 0xe8, 0x52, 0x78, 0x86, - 0x03, 0x5b, 0x27, 0xae, 0x23, 0x3a, 0xa0, 0x28, 0x3e, 0x16, 0x43, 0x5b, 0x3f, 0x34, 0x31, 0x9c, - 0xe0, 0x43, 0x65, 0x64, 0xc7, 0x7a, 0x8e, 0x05, 0xca, 0xc8, 0x16, 0x52, 0x7c, 0x04, 0x36, 0x4f, - 0xf6, 0xbf, 0x7d, 0x8a, 0xe2, 0x81, 0xc0, 0x60, 0xf3, 0x59, 0xf7, 0x3e, 0xc6, 0xfe, 0x73, 0x5a, - 0x2c, 0x21, 0x8b, 0x06, 0x14, 0xc5, 0x81, 0xe8, 0x52, 0xd3, 0x28, 0x53, 0x93, 0x94, 0x06, 0xb2, - 0xc8, 0xa7, 0x28, 0xee, 0x8b, 0xa1, 0x4c, 0xcd, 0xa3, 0x81, 0x2c, 0x64, 0x78, 0xb4, 0x28, 0x55, - 0xb9, 0x4c, 0x6d, 0x51, 0x41, 0xb2, 0xb7, 0x86, 0xce, 0x3a, 0xf9, 0x43, 0xf7, 0xad, 0x7f, 0xdb, - 0x7f, 0xfb, 0xb8, 0xf0, 0xee, 0x6e, 0x3e, 0xb7, 0x04, 0x6d, 0xb6, 0x04, 0x7d, 0x6f, 0x09, 0x7a, - 0xdf, 0x11, 0x6f, 0xb3, 0x23, 0xde, 0xd7, 0x8e, 0x78, 0x4f, 0x13, 0x59, 0xd8, 0xbc, 0x9c, 0xb3, - 0x85, 0x56, 0xfc, 0xff, 0xb4, 0x73, 0xdf, 0xad, 0x74, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x05, - 0x03, 0xd2, 0x18, 0x75, 0x01, 0x00, 0x00, + // 301 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xc3, 0x30, + 0x14, 0x45, 0x63, 0xda, 0xa6, 0xc1, 0x82, 0x81, 0x14, 0x55, 0x01, 0xa4, 0x60, 0x3a, 0x65, 0xb2, + 0x55, 0xb1, 0x21, 0x26, 0x16, 0xc4, 0x6a, 0x95, 0x85, 0x25, 0x4a, 0x9b, 0x87, 0x13, 0xa9, 0xc6, + 0x55, 0xec, 0x58, 0xe1, 0x0f, 0x18, 0xf9, 0x04, 0x3e, 0x87, 0xb1, 0x23, 0x23, 0x6a, 0xc5, 0x7f, + 0xa0, 0x3a, 0x51, 0x61, 0x7b, 0x57, 0xe7, 0x3c, 0x5d, 0xe9, 0xe2, 0xab, 0x85, 0xd2, 0x52, 0x69, + 0x06, 0x56, 0x32, 0xf3, 0xba, 0x02, 0xcd, 0xec, 0x94, 0x95, 0x2f, 0x39, 0x34, 0x50, 0xd1, 0x55, + 0xa5, 0x8c, 0x0a, 0x47, 0xad, 0x42, 0xc1, 0x4a, 0xea, 0x14, 0x6a, 0xa7, 0xe7, 0xa7, 0x42, 0x09, + 0xe5, 0x38, 0xdb, 0x5d, 0xad, 0x3a, 0xf9, 0x41, 0x38, 0x98, 0x35, 0x1c, 0x74, 0xbd, 0x34, 0xe1, + 0x18, 0xfb, 0x05, 0x94, 0xa2, 0x30, 0x11, 0x22, 0x28, 0xe9, 0xf1, 0x2e, 0x85, 0x67, 0x38, 0x30, + 0x4d, 0xea, 0x3a, 0xa2, 0x03, 0x82, 0x92, 0x63, 0x3e, 0x34, 0xcd, 0xc3, 0x2e, 0x86, 0x17, 0xf8, + 0x50, 0x6a, 0xd1, 0xb1, 0x9e, 0x63, 0x81, 0xd4, 0xa2, 0x85, 0x04, 0x1f, 0x81, 0x29, 0xd2, 0xfd, + 0x6f, 0x9f, 0xa0, 0x64, 0xc0, 0x31, 0x98, 0x62, 0xd6, 0xbd, 0x8f, 0xb1, 0xff, 0x9c, 0x95, 0x4b, + 0xc8, 0xa3, 0x01, 0x41, 0x49, 0xc0, 0xbb, 0xb4, 0x6b, 0x14, 0x99, 0x4e, 0x6b, 0x0d, 0x79, 0xe4, + 0x13, 0x94, 0xf4, 0xf9, 0x50, 0x64, 0xfa, 0x51, 0x43, 0x1e, 0x52, 0x3c, 0x5a, 0xd4, 0xb2, 0x5e, + 0x66, 0xa6, 0xb4, 0x90, 0xee, 0xad, 0xa1, 0xb3, 0x4e, 0xfe, 0xd0, 0x7d, 0xeb, 0xdf, 0xf4, 0xdf, + 0x3e, 0x2e, 0xbd, 0xbb, 0xdb, 0xcf, 0x4d, 0x8c, 0xd6, 0x9b, 0x18, 0x7d, 0x6f, 0x62, 0xf4, 0xbe, + 0x8d, 0xbd, 0xf5, 0x36, 0xf6, 0xbe, 0xb6, 0xb1, 0xf7, 0x34, 0x11, 0xa5, 0x29, 0xea, 0x39, 0x5d, + 0x28, 0xc9, 0xfe, 0x4d, 0xab, 0xa1, 0xb2, 0x50, 0xb5, 0x0b, 0xcf, 0x7d, 0x37, 0xd6, 0xf5, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x15, 0x69, 0x03, 0x7c, 0x01, 0x00, 0x00, } func (m *TxResult) Marshal() (dAtA []byte, err error) { diff --git a/tests/integration/ante/test_evm_fee_market.go b/tests/integration/ante/test_evm_fee_market.go index 5008f0c9d..75568ef0d 100644 --- a/tests/integration/ante/test_evm_fee_market.go +++ b/tests/integration/ante/test_evm_fee_market.go @@ -1,6 +1,7 @@ package ante import ( + "github.com/cosmos/evm/ante/types" "math/big" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -10,7 +11,6 @@ import ( "github.com/cosmos/evm/testutil" testconstants "github.com/cosmos/evm/testutil/constants" utiltx "github.com/cosmos/evm/testutil/tx" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" sdkmath "cosmossdk.io/math" diff --git a/tests/integration/rpc/backend/test_tx_info.go b/tests/integration/rpc/backend/test_tx_info.go index 3c74471aa..376ad1ef8 100644 --- a/tests/integration/rpc/backend/test_tx_info.go +++ b/tests/integration/rpc/backend/test_tx_info.go @@ -3,6 +3,7 @@ package backend import ( "errors" "fmt" + cosmosevmtypes "github.com/cosmos/evm/server/types" "math/big" "github.com/ethereum/go-ethereum/common" @@ -18,7 +19,6 @@ import ( "github.com/cosmos/evm/indexer" "github.com/cosmos/evm/rpc/backend/mocks" rpctypes "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" diff --git a/testutil/config/config.go b/testutil/config/config.go index 7ea385bdb..0369655b6 100644 --- a/testutil/config/config.go +++ b/testutil/config/config.go @@ -1,7 +1,7 @@ package config import ( - "github.com/cosmos/evm/types" + "github.com/cosmos/evm/crypto/hd" evmtypes "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -59,7 +59,7 @@ func SetBech32Prefixes(config *sdk.Config) { // SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets. func SetBip44CoinType(config *sdk.Config) { - config.SetCoinType(types.Bip44CoinType) - config.SetPurpose(sdk.Purpose) // Shared - config.SetFullFundraiserPath(types.BIP44HDPath) //nolint: staticcheck + config.SetCoinType(hd.Bip44CoinType) + config.SetPurpose(sdk.Purpose) // Shared + config.SetFullFundraiserPath(hd.BIP44HDPath) //nolint: staticcheck } diff --git a/types/genesis.go b/testutil/genesis.go similarity index 88% rename from types/genesis.go rename to testutil/genesis.go index 1697c7fff..33febd28e 100644 --- a/types/genesis.go +++ b/testutil/genesis.go @@ -1,9 +1,9 @@ -package types +package testutil import "encoding/json" // GenesisState of the blockchain is represented here as a map of raw json -// messages key'd by a identifier string. +// messages key'd by an identifier string. // The identifier is used to determine which module genesis information belongs // to so it may be appropriately routed during init chain. // Within this application default genesis information is retrieved from diff --git a/testutil/integration/evm/network/amounts.go b/testutil/integration/evm/network/amounts.go index a70b6d239..0f134912c 100644 --- a/testutil/integration/evm/network/amounts.go +++ b/testutil/integration/evm/network/amounts.go @@ -1,10 +1,10 @@ package network import ( + "github.com/cosmos/evm/utils" "math/big" testconstants "github.com/cosmos/evm/testutil/constants" - "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/math" @@ -54,7 +54,7 @@ func GetInitialBondedAmount(decimals evmtypes.Decimals) math.Int { // initialBondedAmount represents the amount of tokens that each validator will // have initially bonded expressed in the 18 decimals representation. sdk.DefaultPowerReduction = math.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(int64(decimals)), nil)) - initialBondedAmount := sdk.TokensFromConsensusPower(1, types.AttoPowerReduction) + initialBondedAmount := sdk.TokensFromConsensusPower(1, utils.AttoPowerReduction) return initialBondedAmount.Quo(decimals.ConversionFactor()) } diff --git a/testutil/integration/evm/network/network.go b/testutil/integration/evm/network/network.go index b1db05400..72fa3ad03 100644 --- a/testutil/integration/evm/network/network.go +++ b/testutil/integration/evm/network/network.go @@ -18,7 +18,6 @@ import ( "github.com/cosmos/evm" "github.com/cosmos/evm/testutil/integration" basenetwork "github.com/cosmos/evm/testutil/integration/base/network" - "github.com/cosmos/evm/types" erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -250,7 +249,7 @@ func (n *IntegrationNetwork) configureAndInitChain(evmApp evm.EvmApp) error { n.app = evmApp n.ctx = n.ctx.WithConsensusParams(*consensusParams) - n.ctx = n.ctx.WithBlockGasMeter(types.NewInfiniteGasMeterWithLimit(blockMaxGas)) + n.ctx = n.ctx.WithBlockGasMeter(evmtypes.NewInfiniteGasMeterWithLimit(blockMaxGas)) n.validators = validators n.valSet = valSet diff --git a/testutil/integration/evm/network/setup.go b/testutil/integration/evm/network/setup.go index f352bd4af..c1e9896fd 100644 --- a/testutil/integration/evm/network/setup.go +++ b/testutil/integration/evm/network/setup.go @@ -2,6 +2,7 @@ package network import ( "fmt" + "github.com/cosmos/evm/testutil" "maps" "slices" "time" @@ -10,7 +11,6 @@ import ( "github.com/cosmos/evm" testconstants "github.com/cosmos/evm/testutil/constants" - cosmosevmtypes "github.com/cosmos/evm/types" erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -34,7 +34,7 @@ import ( ) // genSetupFn is the type for the module genesis setup functions -type genSetupFn func(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, customGenesis interface{}) (cosmosevmtypes.GenesisState, error) +type genSetupFn func(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, customGenesis interface{}) (testutil.GenesisState, error) // defaultGenesisParams contains the params that are needed to // setup the default genesis for the testing setup @@ -59,7 +59,7 @@ var genesisSetupFunctions = map[string]genSetupFn{ minttypes.ModuleName: genStateSetter[*minttypes.GenesisState](minttypes.ModuleName), banktypes.ModuleName: setBankGenesisState, authtypes.ModuleName: setAuthGenesisState, - consensustypes.ModuleName: func(_ evm.EvmApp, genesisState cosmosevmtypes.GenesisState, _ interface{}) (cosmosevmtypes.GenesisState, error) { + consensustypes.ModuleName: func(_ evm.EvmApp, genesisState testutil.GenesisState, _ interface{}) (testutil.GenesisState, error) { // no-op. Consensus does not have a genesis state on the application // but the params are used on it // (e.g. block max gas, max bytes). @@ -70,7 +70,7 @@ var genesisSetupFunctions = map[string]genSetupFn{ // genStateSetter is a generic function to set module-specific genesis state func genStateSetter[T proto.Message](moduleName string) genSetupFn { - return func(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, customGenesis interface{}) (cosmosevmtypes.GenesisState, error) { + return func(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, customGenesis interface{}) (testutil.GenesisState, error) { moduleGenesis, ok := customGenesis.(T) if !ok { return nil, fmt.Errorf("invalid type %T for %s module genesis state", customGenesis, moduleName) @@ -279,7 +279,7 @@ type StakingCustomGenesisState struct { } // setDefaultStakingGenesisState sets the default staking genesis state -func setDefaultStakingGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, overwriteParams StakingCustomGenesisState) cosmosevmtypes.GenesisState { +func setDefaultStakingGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams StakingCustomGenesisState) testutil.GenesisState { // Set staking params stakingParams := stakingtypes.DefaultParams() stakingParams.BondDenom = overwriteParams.denom @@ -299,7 +299,7 @@ type BankCustomGenesisState struct { } // setDefaultBankGenesisState sets the default bank genesis state -func setDefaultBankGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, overwriteParams BankCustomGenesisState) cosmosevmtypes.GenesisState { +func setDefaultBankGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams BankCustomGenesisState) testutil.GenesisState { bankGenesis := banktypes.NewGenesisState( banktypes.DefaultGenesisState().Params, overwriteParams.balances, @@ -320,7 +320,7 @@ type SlashingCustomGenesisState struct { } // setDefaultSlashingGenesisState sets the default slashing genesis state -func setDefaultSlashingGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, overwriteParams SlashingCustomGenesisState) cosmosevmtypes.GenesisState { +func setDefaultSlashingGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams SlashingCustomGenesisState) testutil.GenesisState { slashingGen := slashingtypes.DefaultGenesisState() slashingGen.SigningInfos = overwriteParams.signingInfo slashingGen.MissedBlocks = overwriteParams.missedBlocks @@ -330,7 +330,7 @@ func setDefaultSlashingGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmos } // setBankGenesisState updates the bank genesis state with custom genesis state -func setBankGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, customGenesis interface{}) (cosmosevmtypes.GenesisState, error) { +func setBankGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, customGenesis interface{}) (testutil.GenesisState, error) { customGen, ok := customGenesis.(*banktypes.GenesisState) if !ok { return nil, fmt.Errorf("invalid type %T for bank module genesis state", customGenesis) @@ -382,14 +382,14 @@ func addBondedModuleAccountToFundedBalances( } // setDefaultAuthGenesisState sets the default auth genesis state -func setDefaultAuthGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, genAccs []authtypes.GenesisAccount) cosmosevmtypes.GenesisState { +func setDefaultAuthGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, genAccs []authtypes.GenesisAccount) testutil.GenesisState { defaultAuthGen := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) genesisState[authtypes.ModuleName] = cosmosEVMApp.AppCodec().MustMarshalJSON(defaultAuthGen) return genesisState } // setAuthGenesisState updates the bank genesis state with custom genesis state -func setAuthGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, customGenesis interface{}) (cosmosevmtypes.GenesisState, error) { +func setAuthGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, customGenesis interface{}) (testutil.GenesisState, error) { customGen, ok := customGenesis.(*authtypes.GenesisState) if !ok { return nil, fmt.Errorf("invalid type %T for auth module genesis state", customGenesis) @@ -414,7 +414,7 @@ type GovCustomGenesisState struct { } // setDefaultGovGenesisState sets the default gov genesis state -func setDefaultGovGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, overwriteParams GovCustomGenesisState) cosmosevmtypes.GenesisState { +func setDefaultGovGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams GovCustomGenesisState) testutil.GenesisState { govGen := govtypesv1.DefaultGenesisState() updatedParams := govGen.Params minDepositAmt := sdkmath.NewInt(1e18).Quo(evmtypes.GetEVMCoinDecimals().ConversionFactor()) @@ -431,7 +431,7 @@ type FeeMarketCustomGenesisState struct { } // setDefaultFeeMarketGenesisState sets the default fee market genesis state -func setDefaultFeeMarketGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, overwriteParams FeeMarketCustomGenesisState) cosmosevmtypes.GenesisState { +func setDefaultFeeMarketGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams FeeMarketCustomGenesisState) testutil.GenesisState { fmGen := feemarkettypes.DefaultGenesisState() fmGen.Params.BaseFee = overwriteParams.baseFee genesisState[feemarkettypes.ModuleName] = cosmosEVMApp.AppCodec().MustMarshalJSON(fmGen) @@ -448,7 +448,7 @@ type MintCustomGenesisState struct { // setDefaultGovGenesisState sets the default gov genesis state // // NOTE: for the testing network we don't want to have any minting -func setDefaultMintGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmtypes.GenesisState, overwriteParams MintCustomGenesisState) cosmosevmtypes.GenesisState { +func setDefaultMintGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams MintCustomGenesisState) testutil.GenesisState { mintGen := minttypes.DefaultGenesisState() updatedParams := mintGen.Params updatedParams.MintDenom = overwriteParams.denom @@ -460,7 +460,7 @@ func setDefaultMintGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmt return genesisState } -func setDefaultErc20GenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, genesisState cosmosevmtypes.GenesisState) cosmosevmtypes.GenesisState { +func setDefaultErc20GenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, genesisState testutil.GenesisState) testutil.GenesisState { // NOTE: here we are using the setup from the example chain erc20Gen := newErc20GenesisState() updatedErc20Gen := updateErc20GenesisStateForChainID(testconstants.ChainID{ @@ -487,7 +487,7 @@ func newErc20GenesisState() *erc20types.GenesisState { // defaultAuthGenesisState sets the default genesis state // for the testing setup -func newDefaultGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, params defaultGenesisParams) cosmosevmtypes.GenesisState { +func newDefaultGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, params defaultGenesisParams) testutil.GenesisState { genesisState := cosmosEVMApp.DefaultGenesis() genesisState = setDefaultAuthGenesisState(cosmosEVMApp, genesisState, params.genAccounts) @@ -504,7 +504,7 @@ func newDefaultGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, params d // customizeGenesis modifies genesis state if there are any custom genesis state // for specific modules -func customizeGenesis(cosmosEVMApp evm.EvmApp, customGen CustomGenesisState, genesisState cosmosevmtypes.GenesisState) (cosmosevmtypes.GenesisState, error) { +func customizeGenesis(cosmosEVMApp evm.EvmApp, customGen CustomGenesisState, genesisState testutil.GenesisState) (testutil.GenesisState, error) { var err error for mod, modGenState := range customGen { if fn, found := genesisSetupFunctions[mod]; found { diff --git a/testutil/tx/eip712.go b/testutil/tx/eip712.go index 009a658ed..5ff00e2b1 100644 --- a/testutil/tx/eip712.go +++ b/testutil/tx/eip712.go @@ -6,11 +6,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" - "github.com/cosmos/evm" - cryptocodec "github.com/cosmos/evm/crypto/codec" - "github.com/cosmos/evm/ethereum/eip712" - "github.com/cosmos/evm/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -19,6 +14,9 @@ import ( signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + "github.com/cosmos/evm" + cryptocodec "github.com/cosmos/evm/crypto/codec" + "github.com/cosmos/evm/ethereum/eip712" ) type EIP712TxArgs struct { @@ -164,7 +162,7 @@ func signCosmosEIP712Tx( func createTypedData(args typedDataArgs, useLegacy bool) (apitypes.TypedData, error) { if useLegacy { registry := codectypes.NewInterfaceRegistry() - types.RegisterInterfaces(registry) + eip712.RegisterInterfaces(registry) cryptocodec.RegisterInterfaces(registry) evmCodec := codec.NewProtoCodec(registry) diff --git a/types/errors.go b/types/errors.go deleted file mode 100644 index 37dacc870..000000000 --- a/types/errors.go +++ /dev/null @@ -1,11 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" -) - -// RootCodespace is the codespace for all errors defined in this package -const RootCodespace = "Cosmos EVM" - -// ErrInvalidChainID returns an error resulting from an invalid chain ID. -var ErrInvalidChainID = errorsmod.Register(RootCodespace, 3, "invalid chain ID") diff --git a/types/int.go b/utils/int.go similarity index 99% rename from types/int.go rename to utils/int.go index 941963eac..b9ad3d1c0 100644 --- a/types/int.go +++ b/utils/int.go @@ -1,4 +1,4 @@ -package types +package utils import ( fmt "fmt" diff --git a/types/power.go b/utils/power.go similarity index 96% rename from types/power.go rename to utils/power.go index 7f6311eae..72c90fd3c 100644 --- a/types/power.go +++ b/utils/power.go @@ -1,4 +1,4 @@ -package types +package utils import ( "math/big" diff --git a/utils/utils.go b/utils/utils.go index 57f8bd0f4..ea347f9a8 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -7,20 +7,12 @@ import ( "sort" "strings" - "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/holiman/uint256" - "github.com/pkg/errors" - "github.com/cosmos/evm/crypto/ethsecp256k1" - feemarkettypes "github.com/cosmos/evm/x/feemarket/types" - evmtypes "github.com/cosmos/evm/x/vm/types" ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" + "github.com/ethereum/go-ethereum/common" + "github.com/holiman/uint256" errorsmod "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" @@ -207,52 +199,6 @@ func Uint256FromBigInt(i *big.Int) (*uint256.Int, error) { return result, nil } -// CalcBaseFee calculates the basefee of the header. -func CalcBaseFee(config *params.ChainConfig, parent *ethtypes.Header, p feemarkettypes.Params) (*big.Int, error) { - // If the current block is the first EIP-1559 block, return the InitialBaseFee. - if !config.IsLondon(parent.Number) { - return new(big.Int).SetUint64(params.InitialBaseFee), nil - } - if p.ElasticityMultiplier == 0 { - return nil, errors.New("ElasticityMultiplier cannot be 0 as it's checked in the params validation") - } - parentGasTarget := parent.GasLimit / uint64(p.ElasticityMultiplier) - - factor := evmtypes.GetEVMCoinDecimals().ConversionFactor() - minGasPrice := p.MinGasPrice.Mul(sdkmath.LegacyNewDecFromInt(factor)) - return CalcGasBaseFee( - parent.GasUsed, parentGasTarget, uint64(p.BaseFeeChangeDenominator), - sdkmath.LegacyNewDecFromBigInt(parent.BaseFee), sdkmath.LegacyOneDec(), minGasPrice, - ).TruncateInt().BigInt(), nil -} - -func CalcGasBaseFee(gasUsed, gasTarget, baseFeeChangeDenom uint64, baseFee, minUnitGas, minGasPrice sdkmath.LegacyDec) sdkmath.LegacyDec { - // If the parent gasUsed is the same as the target, the baseFee remains unchanged. - if gasUsed == gasTarget { - return baseFee - } - - if gasTarget == 0 { - return sdkmath.LegacyZeroDec() - } - - num := sdkmath.LegacyNewDecFromInt(sdkmath.NewIntFromUint64(gasUsed).Sub(sdkmath.NewIntFromUint64(gasTarget)).Abs()) - num = num.Mul(baseFee) - num = num.QuoInt(sdkmath.NewIntFromUint64(gasTarget)) - num = num.QuoInt(sdkmath.NewIntFromUint64(baseFeeChangeDenom)) - - if gasUsed > gasTarget { - // If the parent block used more gas than its target, the baseFee should increase. - // max(1, parentBaseFee * gasUsedDelta / parentGasTarget / baseFeeChangeDenominator) - baseFeeDelta := sdkmath.LegacyMaxDec(num, minUnitGas) - return baseFee.Add(baseFeeDelta) - } - - // Otherwise if the parent block used less gas than its target, the baseFee should decrease. - // max(minGasPrice, parentBaseFee * gasUsedDelta / parentGasTarget / baseFeeChangeDenominator) - return sdkmath.LegacyMaxDec(baseFee.Sub(num), minGasPrice) -} - // Bytes32ToString converts a bytes32 value to string by trimming null bytes func Bytes32ToString(data [32]byte) string { // Find the first null byte diff --git a/utils/utils_test.go b/utils/utils_test.go index c6d7d331f..086d53222 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -3,6 +3,7 @@ package utils_test import ( "bytes" "fmt" + "github.com/cosmos/evm/rpc/types" "math/big" "testing" @@ -15,7 +16,6 @@ import ( "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/crypto/hd" "github.com/cosmos/evm/testutil/constants" - "github.com/cosmos/evm/types" "github.com/cosmos/evm/utils" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -384,7 +384,7 @@ func TestAccountEquivalence(t *testing.T) { // account using ethsecp // and coin type 60 - evmKey, err := kb.NewAccount(uid, mnemonic, keyring.DefaultBIP39Passphrase, types.BIP44HDPath, algoEvm) + evmKey, err := kb.NewAccount(uid, mnemonic, keyring.DefaultBIP39Passphrase, hd.BIP44HDPath, algoEvm) require.NoError(t, err) // verify that none of these three keys are equal @@ -721,7 +721,7 @@ func TestCalcBaseFee(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - result, err := utils.CalcBaseFee(tc.config, tc.parent, tc.params) + result, err := types.CalcBaseFee(tc.config, tc.parent, tc.params) if tc.expectedError != "" { require.Error(t, err) diff --git a/types/validation.go b/utils/validation.go similarity index 98% rename from types/validation.go rename to utils/validation.go index 2bacefc4b..346f45973 100644 --- a/types/validation.go +++ b/utils/validation.go @@ -1,4 +1,4 @@ -package types +package utils import ( "bytes" diff --git a/types/validation_test.go b/utils/validation_test.go similarity index 87% rename from types/validation_test.go rename to utils/validation_test.go index 39d49a9e9..ebbf4f762 100644 --- a/types/validation_test.go +++ b/utils/validation_test.go @@ -1,4 +1,4 @@ -package types_test +package utils_test import ( "testing" @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/require" utiltx "github.com/cosmos/evm/testutil/tx" - "github.com/cosmos/evm/types" ) func TestIsEmptyHash(t *testing.T) { @@ -29,7 +28,7 @@ func TestIsEmptyHash(t *testing.T) { } for _, tc := range testCases { - require.Equal(t, tc.expEmpty, types.IsEmptyHash(tc.hash), tc.name) + require.Equal(t, tc.expEmpty, IsEmptyHash(tc.hash), tc.name) } } @@ -52,7 +51,7 @@ func TestIsZeroAddress(t *testing.T) { } for _, tc := range testCases { - require.Equal(t, tc.expEmpty, types.IsZeroAddress(tc.address), tc.name) + require.Equal(t, tc.expEmpty, IsZeroAddress(tc.address), tc.name) } } @@ -77,7 +76,7 @@ func TestValidateAddress(t *testing.T) { } for _, tc := range testCases { - err := types.ValidateAddress(tc.address) + err := ValidateAddress(tc.address) if tc.expError { require.Error(t, err, tc.name) @@ -108,7 +107,7 @@ func TestValidateNonZeroAddress(t *testing.T) { } for _, tc := range testCases { - err := types.ValidateNonZeroAddress(tc.address) + err := ValidateNonZeroAddress(tc.address) if tc.expError { require.Error(t, err, tc.name) @@ -133,7 +132,7 @@ func TestSafeInt64(t *testing.T) { } for _, tc := range testCases { - value, err := types.SafeInt64(tc.value) + value, err := SafeInt64(tc.value) if tc.expError { require.Error(t, err, tc.name) continue diff --git a/x/erc20/client/cli/tx.go b/x/erc20/client/cli/tx.go index 647630ddd..aebea0981 100644 --- a/x/erc20/client/cli/tx.go +++ b/x/erc20/client/cli/tx.go @@ -2,11 +2,11 @@ package cli import ( "fmt" + cosmosevmtypes "github.com/cosmos/evm/utils" "github.com/ethereum/go-ethereum/common" "github.com/spf13/cobra" - cosmosevmtypes "github.com/cosmos/evm/types" "github.com/cosmos/evm/x/erc20/types" "cosmossdk.io/math" diff --git a/x/erc20/keeper/grpc_query.go b/x/erc20/keeper/grpc_query.go index 8932de2ba..c4be344bc 100644 --- a/x/erc20/keeper/grpc_query.go +++ b/x/erc20/keeper/grpc_query.go @@ -2,11 +2,11 @@ package keeper import ( "context" + cosmosevmtypes "github.com/cosmos/evm/utils" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - cosmosevmtypes "github.com/cosmos/evm/types" "github.com/cosmos/evm/x/erc20/types" "cosmossdk.io/store/prefix" diff --git a/x/erc20/types/proposal.go b/x/erc20/types/proposal.go index ac1d44b84..661f3d94a 100644 --- a/x/erc20/types/proposal.go +++ b/x/erc20/types/proposal.go @@ -3,10 +3,9 @@ package types import ( "errors" "fmt" + cosmosevmtypes "github.com/cosmos/evm/utils" "strings" - cosmosevmtypes "github.com/cosmos/evm/types" - errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/erc20/types/token_pair.go b/x/erc20/types/token_pair.go index 0b19df00f..4da8ba4b4 100644 --- a/x/erc20/types/token_pair.go +++ b/x/erc20/types/token_pair.go @@ -5,7 +5,6 @@ import ( "github.com/cometbft/cometbft/crypto/tmhash" - cosmosevmtypes "github.com/cosmos/evm/types" "github.com/cosmos/evm/utils" sdk "github.com/cosmos/cosmos-sdk/types" @@ -56,7 +55,7 @@ func (tp TokenPair) Validate() error { return err } - return cosmosevmtypes.ValidateAddress(tp.Erc20Address) + return utils.ValidateAddress(tp.Erc20Address) } // IsNativeCoin returns true if the owner of the ERC20 contract is the diff --git a/x/feemarket/keeper/eip1559.go b/x/feemarket/keeper/eip1559.go index d2f1d3944..dc53e8558 100644 --- a/x/feemarket/keeper/eip1559.go +++ b/x/feemarket/keeper/eip1559.go @@ -1,9 +1,9 @@ package keeper import ( + "github.com/cosmos/evm/x/feemarket/types" "math" - "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" sdkmath "cosmossdk.io/math" @@ -58,7 +58,7 @@ func (k Keeper) CalculateBaseFee(ctx sdk.Context) sdkmath.LegacyDec { } factor := evmtypes.GetEVMCoinDecimals().ConversionFactor() - return utils.CalcGasBaseFee( + return types.CalcGasBaseFee( parentGasUsed, parentGasTargetInt.Uint64(), uint64(params.BaseFeeChangeDenominator), diff --git a/x/feemarket/types/utils.go b/x/feemarket/types/utils.go new file mode 100644 index 000000000..cc07a1cef --- /dev/null +++ b/x/feemarket/types/utils.go @@ -0,0 +1,30 @@ +package types + +import "cosmossdk.io/math" + +func CalcGasBaseFee(gasUsed, gasTarget, baseFeeChangeDenom uint64, baseFee, minUnitGas, minGasPrice math.LegacyDec) math.LegacyDec { + // If the parent gasUsed is the same as the target, the baseFee remains unchanged. + if gasUsed == gasTarget { + return baseFee + } + + if gasTarget == 0 { + return math.LegacyZeroDec() + } + + num := math.LegacyNewDecFromInt(math.NewIntFromUint64(gasUsed).Sub(math.NewIntFromUint64(gasTarget)).Abs()) + num = num.Mul(baseFee) + num = num.QuoInt(math.NewIntFromUint64(gasTarget)) + num = num.QuoInt(math.NewIntFromUint64(baseFeeChangeDenom)) + + if gasUsed > gasTarget { + // If the parent block used more gas than its target, the baseFee should increase. + // max(1, parentBaseFee * gasUsedDelta / parentGasTarget / baseFeeChangeDenominator) + baseFeeDelta := math.LegacyMaxDec(num, minUnitGas) + return baseFee.Add(baseFeeDelta) + } + + // Otherwise if the parent block used less gas than its target, the baseFee should decrease. + // max(minGasPrice, parentBaseFee * gasUsedDelta / parentGasTarget / baseFeeChangeDenominator) + return math.LegacyMaxDec(baseFee.Sub(num), minGasPrice) +} diff --git a/x/ibc/callbacks/keeper/keeper.go b/x/ibc/callbacks/keeper/keeper.go index eab3a6d87..ea86e4630 100644 --- a/x/ibc/callbacks/keeper/keeper.go +++ b/x/ibc/callbacks/keeper/keeper.go @@ -1,6 +1,7 @@ package keeper import ( + types2 "github.com/cosmos/evm/x/vm/types" "math/big" "github.com/ethereum/go-ethereum/common" @@ -8,7 +9,6 @@ import ( "github.com/cosmos/evm/contracts" "github.com/cosmos/evm/ibc" callbacksabi "github.com/cosmos/evm/precompiles/callbacks" - types2 "github.com/cosmos/evm/types" "github.com/cosmos/evm/utils" erc20types "github.com/cosmos/evm/x/erc20/types" "github.com/cosmos/evm/x/ibc/callbacks/types" diff --git a/x/vm/keeper/grpc_query.go b/x/vm/keeper/grpc_query.go index a748d29d6..921a798b3 100644 --- a/x/vm/keeper/grpc_query.go +++ b/x/vm/keeper/grpc_query.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + cosmosevmtypes "github.com/cosmos/evm/utils" "math/big" "time" @@ -21,7 +22,6 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - cosmosevmtypes "github.com/cosmos/evm/types" evmante "github.com/cosmos/evm/x/vm/ante" "github.com/cosmos/evm/x/vm/statedb" "github.com/cosmos/evm/x/vm/types" @@ -784,5 +784,5 @@ func (k Keeper) Config(_ context.Context, _ *types.QueryConfigRequest) (*types.Q // 2. calling BuildEvmExecutionCtx to set up gas configs consistent with Ethereum transaction execution. func buildTraceCtx(ctx sdk.Context, gasLimit uint64) sdk.Context { return evmante.BuildEvmExecutionCtx(ctx). - WithGasMeter(cosmosevmtypes.NewInfiniteGasMeterWithLimit(gasLimit)) + WithGasMeter(types.NewInfiniteGasMeterWithLimit(gasLimit)) } diff --git a/x/vm/keeper/state_transition.go b/x/vm/keeper/state_transition.go index fafa49463..14589bad0 100644 --- a/x/vm/keeper/state_transition.go +++ b/x/vm/keeper/state_transition.go @@ -2,6 +2,7 @@ package keeper import ( "fmt" + types2 "github.com/cosmos/evm/ante/types" "math/big" "github.com/ethereum/go-ethereum/common" @@ -14,7 +15,6 @@ import ( cmttypes "github.com/cometbft/cometbft/types" - cosmosevmtypes "github.com/cosmos/evm/types" "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/vm/statedb" "github.com/cosmos/evm/x/vm/types" @@ -48,7 +48,7 @@ func (k *Keeper) NewEVM( Transfer: core.Transfer, GetHash: k.GetHashFn(ctx), Coinbase: cfg.CoinBase, - GasLimit: cosmosevmtypes.BlockGasLimit(ctx), + GasLimit: types2.BlockGasLimit(ctx), BlockNumber: big.NewInt(ctx.BlockHeight()), Time: uint64(ctx.BlockHeader().Time.Unix()), //#nosec G115 -- int overflow is not a concern here Difficulty: big.NewInt(0), // unused. Only required in PoW context @@ -84,7 +84,7 @@ func (k *Keeper) NewEVM( // 3. The requested height is from a height greater than the latest one func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc { return func(height uint64) common.Hash { - h, err := cosmosevmtypes.SafeInt64(height) + h, err := utils.SafeInt64(height) if err != nil { k.Logger(ctx).Error("failed to cast height to int64", "error", err) return common.Hash{} diff --git a/types/gasmeter.go b/x/vm/types/gasmeter.go similarity index 100% rename from types/gasmeter.go rename to x/vm/types/gasmeter.go diff --git a/x/vm/types/genesis.go b/x/vm/types/genesis.go index f7190d294..c3af3b44f 100644 --- a/x/vm/types/genesis.go +++ b/x/vm/types/genesis.go @@ -2,13 +2,12 @@ package types import ( "fmt" - - "github.com/cosmos/evm/types" + "github.com/cosmos/evm/utils" ) // Validate performs a basic validation of a GenesisAccount fields. func (ga GenesisAccount) Validate() error { - if err := types.ValidateAddress(ga.Address); err != nil { + if err := utils.ValidateAddress(ga.Address); err != nil { return err } return ga.Storage.Validate() diff --git a/x/vm/types/logs.go b/x/vm/types/logs.go index 5409a2097..c622c2810 100644 --- a/x/vm/types/logs.go +++ b/x/vm/types/logs.go @@ -3,11 +3,10 @@ package types import ( "errors" "fmt" + cosmosevmtypes "github.com/cosmos/evm/utils" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - - cosmosevmtypes "github.com/cosmos/evm/types" ) // NewTransactionLogs creates a new NewTransactionLogs instance. diff --git a/x/vm/types/params.go b/x/vm/types/params.go index 5b3e8d400..8c09cf92c 100644 --- a/x/vm/types/params.go +++ b/x/vm/types/params.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "github.com/cosmos/evm/utils" "math/big" "slices" @@ -9,7 +10,6 @@ import ( "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" - "github.com/cosmos/evm/types" channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v10/modules/core/24-host" @@ -167,7 +167,7 @@ func validateAllowlistAddresses(i interface{}) error { } for _, address := range addresses { - if err := types.ValidateAddress(address); err != nil { + if err := utils.ValidateAddress(address); err != nil { return fmt.Errorf("invalid whitelist address: %s", address) } } @@ -210,7 +210,7 @@ func ValidatePrecompiles(i interface{}) error { return fmt.Errorf("duplicate precompile %s", precompile) } - if err := types.ValidateAddress(precompile); err != nil { + if err := utils.ValidateAddress(precompile); err != nil { return fmt.Errorf("invalid precompile %s", precompile) } From 3fa184ec3b9571e3388c8735fcf102dfab7cad18 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:11:40 -0400 Subject: [PATCH 02/17] fix validation test --- utils/validation_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/validation_test.go b/utils/validation_test.go index ebbf4f762..5d8a726c7 100644 --- a/utils/validation_test.go +++ b/utils/validation_test.go @@ -1,6 +1,7 @@ package utils_test import ( + "github.com/cosmos/evm/utils" "testing" "github.com/ethereum/go-ethereum/common" @@ -28,7 +29,7 @@ func TestIsEmptyHash(t *testing.T) { } for _, tc := range testCases { - require.Equal(t, tc.expEmpty, IsEmptyHash(tc.hash), tc.name) + require.Equal(t, tc.expEmpty, utils.IsEmptyHash(tc.hash), tc.name) } } @@ -51,7 +52,7 @@ func TestIsZeroAddress(t *testing.T) { } for _, tc := range testCases { - require.Equal(t, tc.expEmpty, IsZeroAddress(tc.address), tc.name) + require.Equal(t, tc.expEmpty, utils.IsZeroAddress(tc.address), tc.name) } } @@ -76,7 +77,7 @@ func TestValidateAddress(t *testing.T) { } for _, tc := range testCases { - err := ValidateAddress(tc.address) + err := utils.ValidateAddress(tc.address) if tc.expError { require.Error(t, err, tc.name) @@ -107,7 +108,7 @@ func TestValidateNonZeroAddress(t *testing.T) { } for _, tc := range testCases { - err := ValidateNonZeroAddress(tc.address) + err := utils.ValidateNonZeroAddress(tc.address) if tc.expError { require.Error(t, err, tc.name) @@ -132,7 +133,7 @@ func TestSafeInt64(t *testing.T) { } for _, tc := range testCases { - value, err := SafeInt64(tc.value) + value, err := utils.SafeInt64(tc.value) if tc.expError { require.Error(t, err, tc.name) continue From 19cf9900741121cb5377708c015aa09bdbcf0c7f Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:12:30 -0400 Subject: [PATCH 03/17] use genesis type --- evmd/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evmd/app.go b/evmd/app.go index 4c5d31cfd..659ec6706 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -933,7 +933,7 @@ func (app *EVMD) TxConfig() client.TxConfig { } // DefaultGenesis returns a default genesis from the registered AppModuleBasic's. -func (app *EVMD) DefaultGenesis() map[string]json.RawMessage { +func (app *EVMD) DefaultGenesis() GenesisState { genesis := app.BasicModuleManager.DefaultGenesis(app.appCodec) mintGenState := NewMintGenesisState() From bc08d5c02d069adbdfdc23a3425a55ad35f027f0 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:13:42 -0400 Subject: [PATCH 04/17] Revert "use genesis type" This reverts commit 19cf9900741121cb5377708c015aa09bdbcf0c7f. --- evmd/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evmd/app.go b/evmd/app.go index 659ec6706..4c5d31cfd 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -933,7 +933,7 @@ func (app *EVMD) TxConfig() client.TxConfig { } // DefaultGenesis returns a default genesis from the registered AppModuleBasic's. -func (app *EVMD) DefaultGenesis() GenesisState { +func (app *EVMD) DefaultGenesis() map[string]json.RawMessage { genesis := app.BasicModuleManager.DefaultGenesis(app.appCodec) mintGenState := NewMintGenesisState() From 1f8d01933aa6adaeff5e4adf45056ffcaf48b6b6 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:15:51 -0400 Subject: [PATCH 05/17] lints --- ante/cosmos/eip712.go | 3 ++- ante/evm/08_gas_consume.go | 2 +- ante/evm/10_gas_wanted.go | 2 +- ante/evm/fee_checker.go | 2 +- ante/evm/fee_checker_test.go | 2 +- crypto/hd/algorithm_test.go | 5 +++-- crypto/hd/hdpath.go | 4 ++-- encoding/codec/codec.go | 5 +++-- ethereum/eip712/codec.go | 3 ++- indexer/kv_indexer.go | 2 +- rpc/apis.go | 7 ++++--- rpc/backend/backend.go | 2 +- rpc/backend/blocks.go | 4 ++-- rpc/backend/tx_info.go | 4 ++-- rpc/namespaces/ethereum/personal/api.go | 2 +- rpc/stream/rpc.go | 2 +- rpc/types/block.go | 3 ++- rpc/types/events.go | 2 +- rpc/types/utils.go | 4 ++-- server/indexer_service.go | 3 ++- server/json_rpc.go | 7 ++++--- server/start.go | 9 +++++---- tests/integration/ante/test_evm_fee_market.go | 2 +- tests/integration/rpc/backend/test_tx_info.go | 2 +- testutil/integration/evm/network/amounts.go | 2 +- testutil/integration/evm/network/setup.go | 2 +- testutil/tx/eip712.go | 7 ++++--- utils/utils.go | 6 ++++-- utils/utils_test.go | 2 +- utils/validation_test.go | 2 +- x/erc20/client/cli/tx.go | 2 +- x/erc20/keeper/grpc_query.go | 2 +- x/erc20/types/proposal.go | 3 ++- x/feemarket/keeper/eip1559.go | 2 +- x/ibc/callbacks/keeper/keeper.go | 2 +- x/vm/keeper/grpc_query.go | 2 +- x/vm/keeper/state_transition.go | 2 +- x/vm/types/genesis.go | 1 + x/vm/types/logs.go | 3 ++- x/vm/types/params.go | 2 +- 40 files changed, 70 insertions(+), 55 deletions(-) diff --git a/ante/cosmos/eip712.go b/ante/cosmos/eip712.go index 470788bbf..e800cee0f 100644 --- a/ante/cosmos/eip712.go +++ b/ante/cosmos/eip712.go @@ -8,11 +8,12 @@ import ( "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/signer/core/apitypes" - errorsmod "cosmossdk.io/errors" anteinterfaces "github.com/cosmos/evm/ante/interfaces" "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/ethereum/eip712" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" diff --git a/ante/evm/08_gas_consume.go b/ante/evm/08_gas_consume.go index 6a6221616..d55111029 100644 --- a/ante/evm/08_gas_consume.go +++ b/ante/evm/08_gas_consume.go @@ -1,13 +1,13 @@ package evm import ( - types2 "github.com/cosmos/evm/ante/types" "math/big" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" anteinterfaces "github.com/cosmos/evm/ante/interfaces" + types2 "github.com/cosmos/evm/ante/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/ante/evm/10_gas_wanted.go b/ante/evm/10_gas_wanted.go index 679800d9b..bc6cd4bd4 100644 --- a/ante/evm/10_gas_wanted.go +++ b/ante/evm/10_gas_wanted.go @@ -1,10 +1,10 @@ package evm import ( - "github.com/cosmos/evm/ante/types" "math/big" anteinterfaces "github.com/cosmos/evm/ante/interfaces" + "github.com/cosmos/evm/ante/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/ante/evm/fee_checker.go b/ante/evm/fee_checker.go index 5a5d617ad..d95e7d0a9 100644 --- a/ante/evm/fee_checker.go +++ b/ante/evm/fee_checker.go @@ -1,12 +1,12 @@ package evm import ( - cosmosevmtypes "github.com/cosmos/evm/ante/types" "math" "github.com/ethereum/go-ethereum/params" anteinterfaces "github.com/cosmos/evm/ante/interfaces" + cosmosevmtypes "github.com/cosmos/evm/ante/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index d914966f9..4558522e8 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -1,7 +1,6 @@ package evm_test import ( - "github.com/cosmos/evm/ante/types" "math/big" "testing" @@ -11,6 +10,7 @@ import ( "github.com/cosmos/evm/ante/evm" anteinterfaces "github.com/cosmos/evm/ante/interfaces" + "github.com/cosmos/evm/ante/types" "github.com/cosmos/evm/encoding" "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" diff --git a/crypto/hd/algorithm_test.go b/crypto/hd/algorithm_test.go index f4e01db92..d518ce3d9 100644 --- a/crypto/hd/algorithm_test.go +++ b/crypto/hd/algorithm_test.go @@ -8,11 +8,12 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + cryptocodec "github.com/cosmos/evm/crypto/codec" + enccodec "github.com/cosmos/evm/encoding/codec" + amino "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/keyring" - cryptocodec "github.com/cosmos/evm/crypto/codec" - enccodec "github.com/cosmos/evm/encoding/codec" ) var TestCodec amino.Codec diff --git a/crypto/hd/hdpath.go b/crypto/hd/hdpath.go index 2a7dd0566..f53aff180 100644 --- a/crypto/hd/hdpath.go +++ b/crypto/hd/hdpath.go @@ -13,12 +13,12 @@ var ( ) type ( - HDPathIterator func() ethaccounts.DerivationPath + PathIterator func() ethaccounts.DerivationPath ) // NewHDPathIterator receives a base path as a string and a boolean for the desired iterator type and // returns a function that iterates over the base HD path, returning the string. -func NewHDPathIterator(basePath string, ledgerIter bool) (HDPathIterator, error) { +func NewHDPathIterator(basePath string, ledgerIter bool) (PathIterator, error) { hdPath, err := ethaccounts.ParseDerivationPath(basePath) if err != nil { return nil, err diff --git a/encoding/codec/codec.go b/encoding/codec/codec.go index f33a79f88..bd1b8dbb6 100644 --- a/encoding/codec/codec.go +++ b/encoding/codec/codec.go @@ -1,12 +1,13 @@ package codec import ( + cryptocodec "github.com/cosmos/evm/crypto/codec" + "github.com/cosmos/evm/ethereum/eip712" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" sdk "github.com/cosmos/cosmos-sdk/types" - cryptocodec "github.com/cosmos/evm/crypto/codec" - "github.com/cosmos/evm/ethereum/eip712" ) // RegisterLegacyAminoCodec registers Interfaces from types, crypto, and SDK std. diff --git a/ethereum/eip712/codec.go b/ethereum/eip712/codec.go index f81ce1308..aef5dfc97 100644 --- a/ethereum/eip712/codec.go +++ b/ethereum/eip712/codec.go @@ -1,11 +1,12 @@ package eip712 import ( + types2 "github.com/cosmos/evm/ante/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - types2 "github.com/cosmos/evm/ante/types" ) // RegisterInterfaces registers the CometBFT concrete client-related diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index ff6e3f239..759f4d9c6 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -2,7 +2,6 @@ package indexer import ( "fmt" - "github.com/cosmos/evm/server/types" "github.com/ethereum/go-ethereum/common" @@ -11,6 +10,7 @@ import ( dbm "github.com/cosmos/cosmos-db" rpctypes "github.com/cosmos/evm/rpc/types" + "github.com/cosmos/evm/server/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/rpc/apis.go b/rpc/apis.go index f17908000..729908b7f 100644 --- a/rpc/apis.go +++ b/rpc/apis.go @@ -2,12 +2,9 @@ package rpc import ( "fmt" - server2 "github.com/cosmos/evm/server/types" "github.com/ethereum/go-ethereum/rpc" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/server" evmmempool "github.com/cosmos/evm/mempool" "github.com/cosmos/evm/rpc/backend" "github.com/cosmos/evm/rpc/namespaces/ethereum/debug" @@ -19,6 +16,10 @@ import ( "github.com/cosmos/evm/rpc/namespaces/ethereum/txpool" "github.com/cosmos/evm/rpc/namespaces/ethereum/web3" "github.com/cosmos/evm/rpc/stream" + server2 "github.com/cosmos/evm/server/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server" ) // RPC namespaces and API version diff --git a/rpc/backend/backend.go b/rpc/backend/backend.go index 78a0f1dd8..59c53caac 100644 --- a/rpc/backend/backend.go +++ b/rpc/backend/backend.go @@ -3,7 +3,6 @@ package backend import ( "context" "fmt" - "github.com/cosmos/evm/server/types" "math/big" "time" @@ -21,6 +20,7 @@ import ( evmmempool "github.com/cosmos/evm/mempool" rpctypes "github.com/cosmos/evm/rpc/types" "github.com/cosmos/evm/server/config" + "github.com/cosmos/evm/server/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index ce4f10e7d..7709dbdb8 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -2,8 +2,6 @@ package backend import ( "fmt" - "github.com/cosmos/evm/server/types" - cosmosevmtypes "github.com/cosmos/evm/utils" "math/big" "strconv" @@ -19,6 +17,8 @@ import ( cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" rpctypes "github.com/cosmos/evm/rpc/types" + "github.com/cosmos/evm/server/types" + cosmosevmtypes "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index 98dd91637..e4b00229f 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -2,8 +2,6 @@ package backend import ( "fmt" - types2 "github.com/cosmos/evm/server/types" - "github.com/cosmos/evm/utils" "math" "math/big" "time" @@ -21,6 +19,8 @@ import ( "github.com/cosmos/evm/mempool/txpool" rpctypes "github.com/cosmos/evm/rpc/types" + types2 "github.com/cosmos/evm/server/types" + "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/rpc/namespaces/ethereum/personal/api.go b/rpc/namespaces/ethereum/personal/api.go index 63a388a9f..51a5b73c6 100644 --- a/rpc/namespaces/ethereum/personal/api.go +++ b/rpc/namespaces/ethereum/personal/api.go @@ -25,7 +25,7 @@ import ( type PrivateAccountAPI struct { backend backend.EVMBackend logger log.Logger - hdPathIter hd.HDPathIterator + hdPathIter hd.PathIterator } // NewAPI creates an instance of the public Personal Eth API. diff --git a/rpc/stream/rpc.go b/rpc/stream/rpc.go index 3312a81d8..44b028c32 100644 --- a/rpc/stream/rpc.go +++ b/rpc/stream/rpc.go @@ -3,7 +3,6 @@ package stream import ( "context" "fmt" - cosmosevmtypes "github.com/cosmos/evm/utils" "sync" "github.com/ethereum/go-ethereum/common" @@ -15,6 +14,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm/rpc/types" + cosmosevmtypes "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" diff --git a/rpc/types/block.go b/rpc/types/block.go index bcc7eb872..f4a0400db 100644 --- a/rpc/types/block.go +++ b/rpc/types/block.go @@ -5,7 +5,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/cosmos/evm/utils" "math" "math/big" "strings" @@ -15,6 +14,8 @@ import ( "github.com/spf13/cast" "google.golang.org/grpc/metadata" + "github.com/cosmos/evm/utils" + grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) diff --git a/rpc/types/events.go b/rpc/types/events.go index 0e35394f1..34761d811 100644 --- a/rpc/types/events.go +++ b/rpc/types/events.go @@ -2,7 +2,6 @@ package types import ( "fmt" - "github.com/cosmos/evm/server/types" "strconv" "github.com/ethereum/go-ethereum/common" @@ -10,6 +9,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" + "github.com/cosmos/evm/server/types" evmtypes "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 7e1f94653..8952c24a8 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -3,8 +3,6 @@ package types import ( "context" "fmt" - types2 "github.com/cosmos/evm/x/feemarket/types" - "github.com/pkg/errors" "math/big" "strings" @@ -12,11 +10,13 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + "github.com/pkg/errors" abci "github.com/cometbft/cometbft/abci/types" cmtrpcclient "github.com/cometbft/cometbft/rpc/client" cmttypes "github.com/cometbft/cometbft/types" + types2 "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" diff --git a/server/indexer_service.go b/server/indexer_service.go index 6240eede0..8693c001d 100644 --- a/server/indexer_service.go +++ b/server/indexer_service.go @@ -2,13 +2,14 @@ package server import ( "context" - types2 "github.com/cosmos/evm/server/types" "time" "github.com/cometbft/cometbft/libs/service" rpcclient "github.com/cometbft/cometbft/rpc/client" coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" + + types2 "github.com/cosmos/evm/server/types" ) const ( diff --git a/server/json_rpc.go b/server/json_rpc.go index 9b71bc799..c490d342d 100644 --- a/server/json_rpc.go +++ b/server/json_rpc.go @@ -3,7 +3,6 @@ package server import ( "context" "fmt" - "github.com/cosmos/evm/server/types" "log/slog" "net/http" "time" @@ -16,12 +15,14 @@ import ( rpcclient "github.com/cometbft/cometbft/rpc/client" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/server" evmmempool "github.com/cosmos/evm/mempool" "github.com/cosmos/evm/rpc" "github.com/cosmos/evm/rpc/stream" serverconfig "github.com/cosmos/evm/server/config" + "github.com/cosmos/evm/server/types" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/server" ) const shutdownTimeout = 200 * time.Millisecond diff --git a/server/start.go b/server/start.go index 3298522c6..13e348274 100644 --- a/server/start.go +++ b/server/start.go @@ -3,7 +3,6 @@ package server import ( "context" "fmt" - types2 "github.com/cosmos/evm/server/types" "io" "net" "os" @@ -27,9 +26,6 @@ import ( "github.com/cometbft/cometbft/rpc/client/local" cmttypes "github.com/cometbft/cometbft/types" - errorsmod "cosmossdk.io/errors" - "cosmossdk.io/log" - pruningtypes "cosmossdk.io/store/pruning/types" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/evm/indexer" evmmempool "github.com/cosmos/evm/mempool" @@ -37,6 +33,11 @@ import ( ethdebug "github.com/cosmos/evm/rpc/namespaces/ethereum/debug" cosmosevmserverconfig "github.com/cosmos/evm/server/config" srvflags "github.com/cosmos/evm/server/flags" + types2 "github.com/cosmos/evm/server/types" + + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/log" + pruningtypes "cosmossdk.io/store/pruning/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" diff --git a/tests/integration/ante/test_evm_fee_market.go b/tests/integration/ante/test_evm_fee_market.go index 75568ef0d..1a8180986 100644 --- a/tests/integration/ante/test_evm_fee_market.go +++ b/tests/integration/ante/test_evm_fee_market.go @@ -1,12 +1,12 @@ package ante import ( - "github.com/cosmos/evm/ante/types" "math/big" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/cosmos/evm/ante/evm" + "github.com/cosmos/evm/ante/types" "github.com/cosmos/evm/server/config" "github.com/cosmos/evm/testutil" testconstants "github.com/cosmos/evm/testutil/constants" diff --git a/tests/integration/rpc/backend/test_tx_info.go b/tests/integration/rpc/backend/test_tx_info.go index 376ad1ef8..864108d19 100644 --- a/tests/integration/rpc/backend/test_tx_info.go +++ b/tests/integration/rpc/backend/test_tx_info.go @@ -3,7 +3,6 @@ package backend import ( "errors" "fmt" - cosmosevmtypes "github.com/cosmos/evm/server/types" "math/big" "github.com/ethereum/go-ethereum/common" @@ -19,6 +18,7 @@ import ( "github.com/cosmos/evm/indexer" "github.com/cosmos/evm/rpc/backend/mocks" rpctypes "github.com/cosmos/evm/rpc/types" + cosmosevmtypes "github.com/cosmos/evm/server/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" diff --git a/testutil/integration/evm/network/amounts.go b/testutil/integration/evm/network/amounts.go index 0f134912c..af440ef55 100644 --- a/testutil/integration/evm/network/amounts.go +++ b/testutil/integration/evm/network/amounts.go @@ -1,10 +1,10 @@ package network import ( - "github.com/cosmos/evm/utils" "math/big" testconstants "github.com/cosmos/evm/testutil/constants" + "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/math" diff --git a/testutil/integration/evm/network/setup.go b/testutil/integration/evm/network/setup.go index c1e9896fd..992a88513 100644 --- a/testutil/integration/evm/network/setup.go +++ b/testutil/integration/evm/network/setup.go @@ -2,7 +2,6 @@ package network import ( "fmt" - "github.com/cosmos/evm/testutil" "maps" "slices" "time" @@ -10,6 +9,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm" + "github.com/cosmos/evm/testutil" testconstants "github.com/cosmos/evm/testutil/constants" erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" diff --git a/testutil/tx/eip712.go b/testutil/tx/eip712.go index 5ff00e2b1..89b4a57ae 100644 --- a/testutil/tx/eip712.go +++ b/testutil/tx/eip712.go @@ -6,6 +6,10 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" + "github.com/cosmos/evm" + cryptocodec "github.com/cosmos/evm/crypto/codec" + "github.com/cosmos/evm/ethereum/eip712" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -14,9 +18,6 @@ import ( signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - "github.com/cosmos/evm" - cryptocodec "github.com/cosmos/evm/crypto/codec" - "github.com/cosmos/evm/ethereum/eip712" ) type EIP712TxArgs struct { diff --git a/utils/utils.go b/utils/utils.go index ea347f9a8..573b38829 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -7,12 +7,14 @@ import ( "sort" "strings" - "github.com/cosmos/evm/crypto/ethsecp256k1" - ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" "github.com/ethereum/go-ethereum/common" "github.com/holiman/uint256" + "github.com/cosmos/evm/crypto/ethsecp256k1" + ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" + errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" diff --git a/utils/utils_test.go b/utils/utils_test.go index 086d53222..f5b81274e 100644 --- a/utils/utils_test.go +++ b/utils/utils_test.go @@ -3,7 +3,6 @@ package utils_test import ( "bytes" "fmt" - "github.com/cosmos/evm/rpc/types" "math/big" "testing" @@ -15,6 +14,7 @@ import ( cryptocodec "github.com/cosmos/evm/crypto/codec" "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/crypto/hd" + "github.com/cosmos/evm/rpc/types" "github.com/cosmos/evm/testutil/constants" "github.com/cosmos/evm/utils" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" diff --git a/utils/validation_test.go b/utils/validation_test.go index 5d8a726c7..fae0aa0dc 100644 --- a/utils/validation_test.go +++ b/utils/validation_test.go @@ -1,13 +1,13 @@ package utils_test import ( - "github.com/cosmos/evm/utils" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" utiltx "github.com/cosmos/evm/testutil/tx" + "github.com/cosmos/evm/utils" ) func TestIsEmptyHash(t *testing.T) { diff --git a/x/erc20/client/cli/tx.go b/x/erc20/client/cli/tx.go index aebea0981..a139c8fa4 100644 --- a/x/erc20/client/cli/tx.go +++ b/x/erc20/client/cli/tx.go @@ -2,11 +2,11 @@ package cli import ( "fmt" - cosmosevmtypes "github.com/cosmos/evm/utils" "github.com/ethereum/go-ethereum/common" "github.com/spf13/cobra" + cosmosevmtypes "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/erc20/types" "cosmossdk.io/math" diff --git a/x/erc20/keeper/grpc_query.go b/x/erc20/keeper/grpc_query.go index c4be344bc..bfefaf314 100644 --- a/x/erc20/keeper/grpc_query.go +++ b/x/erc20/keeper/grpc_query.go @@ -2,11 +2,11 @@ package keeper import ( "context" - cosmosevmtypes "github.com/cosmos/evm/utils" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + cosmosevmtypes "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/erc20/types" "cosmossdk.io/store/prefix" diff --git a/x/erc20/types/proposal.go b/x/erc20/types/proposal.go index 661f3d94a..78d1a4b26 100644 --- a/x/erc20/types/proposal.go +++ b/x/erc20/types/proposal.go @@ -3,9 +3,10 @@ package types import ( "errors" "fmt" - cosmosevmtypes "github.com/cosmos/evm/utils" "strings" + cosmosevmtypes "github.com/cosmos/evm/utils" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/feemarket/keeper/eip1559.go b/x/feemarket/keeper/eip1559.go index dc53e8558..21e3546b7 100644 --- a/x/feemarket/keeper/eip1559.go +++ b/x/feemarket/keeper/eip1559.go @@ -1,9 +1,9 @@ package keeper import ( - "github.com/cosmos/evm/x/feemarket/types" "math" + "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" sdkmath "cosmossdk.io/math" diff --git a/x/ibc/callbacks/keeper/keeper.go b/x/ibc/callbacks/keeper/keeper.go index ea86e4630..a501e4d1d 100644 --- a/x/ibc/callbacks/keeper/keeper.go +++ b/x/ibc/callbacks/keeper/keeper.go @@ -1,7 +1,6 @@ package keeper import ( - types2 "github.com/cosmos/evm/x/vm/types" "math/big" "github.com/ethereum/go-ethereum/common" @@ -13,6 +12,7 @@ import ( erc20types "github.com/cosmos/evm/x/erc20/types" "github.com/cosmos/evm/x/ibc/callbacks/types" evmante "github.com/cosmos/evm/x/vm/ante" + types2 "github.com/cosmos/evm/x/vm/types" callbacktypes "github.com/cosmos/ibc-go/v10/modules/apps/callbacks/types" transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" diff --git a/x/vm/keeper/grpc_query.go b/x/vm/keeper/grpc_query.go index 921a798b3..c2bbbabd3 100644 --- a/x/vm/keeper/grpc_query.go +++ b/x/vm/keeper/grpc_query.go @@ -5,7 +5,6 @@ import ( "encoding/json" "errors" "fmt" - cosmosevmtypes "github.com/cosmos/evm/utils" "math/big" "time" @@ -22,6 +21,7 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + cosmosevmtypes "github.com/cosmos/evm/utils" evmante "github.com/cosmos/evm/x/vm/ante" "github.com/cosmos/evm/x/vm/statedb" "github.com/cosmos/evm/x/vm/types" diff --git a/x/vm/keeper/state_transition.go b/x/vm/keeper/state_transition.go index 14589bad0..bf3a025b6 100644 --- a/x/vm/keeper/state_transition.go +++ b/x/vm/keeper/state_transition.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - types2 "github.com/cosmos/evm/ante/types" "math/big" "github.com/ethereum/go-ethereum/common" @@ -15,6 +14,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" + types2 "github.com/cosmos/evm/ante/types" "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/vm/statedb" "github.com/cosmos/evm/x/vm/types" diff --git a/x/vm/types/genesis.go b/x/vm/types/genesis.go index c3af3b44f..039b8f580 100644 --- a/x/vm/types/genesis.go +++ b/x/vm/types/genesis.go @@ -2,6 +2,7 @@ package types import ( "fmt" + "github.com/cosmos/evm/utils" ) diff --git a/x/vm/types/logs.go b/x/vm/types/logs.go index c622c2810..50073bf0b 100644 --- a/x/vm/types/logs.go +++ b/x/vm/types/logs.go @@ -3,10 +3,11 @@ package types import ( "errors" "fmt" - cosmosevmtypes "github.com/cosmos/evm/utils" "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" + + cosmosevmtypes "github.com/cosmos/evm/utils" ) // NewTransactionLogs creates a new NewTransactionLogs instance. diff --git a/x/vm/types/params.go b/x/vm/types/params.go index 8c09cf92c..4062b6f56 100644 --- a/x/vm/types/params.go +++ b/x/vm/types/params.go @@ -2,7 +2,6 @@ package types import ( "fmt" - "github.com/cosmos/evm/utils" "math/big" "slices" @@ -10,6 +9,7 @@ import ( "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/params" + "github.com/cosmos/evm/utils" channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v10/modules/core/24-host" From 6714313c0fa1e527931d86f93c68d81cd94f09f6 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:16:18 -0400 Subject: [PATCH 06/17] lints - cont. --- crypto/hd/utils_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/hd/utils_test.go b/crypto/hd/utils_test.go index 1c1bc03cd..7a5de9f09 100644 --- a/crypto/hd/utils_test.go +++ b/crypto/hd/utils_test.go @@ -135,7 +135,7 @@ func (w *Wallet) derivePrivateKey(path accounts.DerivationPath) (*ecdsa.PrivateK if w.fixIssue172 && key.IsAffectedByIssue172() { key, err = key.Derive(n) } else { - key, err = key.DeriveNonStandard(n) //nolint:staticcheck // SA1019 this is used for testing only + key, err = key.DeriveNonStandard(n) } if err != nil { return nil, err From 454e039cefaaea51a15ad60e55e45957918785f3 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:26:25 -0400 Subject: [PATCH 07/17] changelog, reference fixes --- CHANGELOG.md | 1 + docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md | 14 +++++++++++++- evmd/ante/evm_antehandler_benchmark_test.go | 4 ++-- evmd/ante/validate_handler_options_test.go | 6 +++--- evmd/app.go | 4 ++-- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90165d117..ba67d2d80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - [\#609](https://github.com/cosmos/evm/pull/609) Make `erc20Keeper` optional in the EVM keeper - [\#624](https://github.com/cosmos/evm/pull/624) Cleanup unnecessary `fix-revert-gas-refund-height`. - [\#635](https://github.com/cosmos/evm/pull/635) Move DefaultStaticPrecompiles to /evm and allow projects to set it by default alongside the keeper. +- [\#639](https://github.com/cosmos/evm/pull/639) Remove `/types` from top-level repo and move files to respective areas. ### FEATURES diff --git a/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md b/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md index 10fc61266..8d4930cca 100644 --- a/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md +++ b/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md @@ -18,7 +18,19 @@ go mod tidy --- -## 2) App wiring in `app.go` +## 2) Fix `"github.com/cosmos/evm/types" imports` + +`v0.5.0` removes `github.com/cosmos/evm/types` and moves files to their respective areas. For a complete list of changes, refer to [this PR](https://github.com/cosmos/evm/pull/639). +The following are references within `evmd` that have been moved. + +- `Bip44CoinType`, `BIP44HDPath` was moved to `"github.com/cosmos/evm/crypto/hd"` +- `HasDynamicFeeExtensionOption` was moved `"github.com/cosmos/evm/ante/types"` +- `GenesisState` was removed as a duplicate object can be found in the `evmd` folder and a testing version is in `"github.com/cosmos/evm/testutil"` +- `AttoPowerReduction` was moved to `"github.com/cosmos/evm/utils"` + +--- + +## 3) App wiring in `app.go` ### Mempool diff --git a/evmd/ante/evm_antehandler_benchmark_test.go b/evmd/ante/evm_antehandler_benchmark_test.go index 289a5f6ed..011f21a1a 100644 --- a/evmd/ante/evm_antehandler_benchmark_test.go +++ b/evmd/ante/evm_antehandler_benchmark_test.go @@ -2,7 +2,7 @@ package ante_test import ( "fmt" - cosmosevmtypes "github.com/cosmos/evm/ante/types" + antetypes "github.com/cosmos/evm/ante/types" "math/big" "testing" @@ -148,7 +148,7 @@ func (s *benchmarkSuite) generateHandlerOptions() ante.HandlerOptions { Cdc: s.network.App.AppCodec(), AccountKeeper: s.network.App.GetAccountKeeper(), BankKeeper: s.network.App.GetBankKeeper(), - ExtensionOptionChecker: cosmosevmtypes.HasDynamicFeeExtensionOption, + ExtensionOptionChecker: antetypes.HasDynamicFeeExtensionOption, EvmKeeper: s.network.App.GetEVMKeeper(), FeegrantKeeper: s.network.App.GetFeeGrantKeeper(), IBCKeeper: s.network.App.GetIBCKeeper(), diff --git a/evmd/ante/validate_handler_options_test.go b/evmd/ante/validate_handler_options_test.go index 825b1f541..a894b184f 100644 --- a/evmd/ante/validate_handler_options_test.go +++ b/evmd/ante/validate_handler_options_test.go @@ -1,7 +1,7 @@ package ante_test import ( - "github.com/cosmos/evm/ante/types" + antetypes "github.com/cosmos/evm/ante/types" "testing" "github.com/ethereum/go-ethereum/common" @@ -124,7 +124,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op Cdc: nw.App.AppCodec(), AccountKeeper: nw.App.GetAccountKeeper(), BankKeeper: nw.App.GetBankKeeper(), - ExtensionOptionChecker: types.HasDynamicFeeExtensionOption, + ExtensionOptionChecker: antetypes.HasDynamicFeeExtensionOption, EvmKeeper: nw.App.GetEVMKeeper(), FeegrantKeeper: nw.App.GetFeeGrantKeeper(), IBCKeeper: nw.App.GetIBCKeeper(), @@ -143,7 +143,7 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op Cdc: nw.App.AppCodec(), AccountKeeper: nw.App.GetAccountKeeper(), BankKeeper: nw.App.GetBankKeeper(), - ExtensionOptionChecker: types.HasDynamicFeeExtensionOption, + ExtensionOptionChecker: antetypes.HasDynamicFeeExtensionOption, EvmKeeper: nw.App.GetEVMKeeper(), FeegrantKeeper: nw.App.GetFeeGrantKeeper(), IBCKeeper: nw.App.GetIBCKeeper(), diff --git a/evmd/app.go b/evmd/app.go index 4c5d31cfd..5163bb1ba 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "fmt" - types2 "github.com/cosmos/evm/ante/types" + antetypes "github.com/cosmos/evm/ante/types" precompiletypes "github.com/cosmos/evm/precompiles/types" "github.com/cosmos/evm/utils" "io" @@ -822,7 +822,7 @@ func (app *EVMD) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) { Cdc: app.appCodec, AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, - ExtensionOptionChecker: types2.HasDynamicFeeExtensionOption, + ExtensionOptionChecker: antetypes.HasDynamicFeeExtensionOption, EvmKeeper: app.EVMKeeper, FeegrantKeeper: app.FeeGrantKeeper, IBCKeeper: app.IBCKeeper, From 9f3fd127dcc9605c7c7e25123ee4bd3a74906639 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:29:23 -0400 Subject: [PATCH 08/17] migration fix --- docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md b/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md index 8d4930cca..43be11e3c 100644 --- a/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md +++ b/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md @@ -20,8 +20,9 @@ go mod tidy ## 2) Fix `"github.com/cosmos/evm/types" imports` -`v0.5.0` removes `github.com/cosmos/evm/types` and moves files to their respective areas. For a complete list of changes, refer to [this PR](https://github.com/cosmos/evm/pull/639). -The following are references within `evmd` that have been moved. +`v0.5.0` removes `github.com/cosmos/evm/types` and moves files to their folders, respective to function. +For a complete list of changes, refer to [this PR](https://github.com/cosmos/evm/pull/639). The +following list includes references within `evmd` that have been moved. - `Bip44CoinType`, `BIP44HDPath` was moved to `"github.com/cosmos/evm/crypto/hd"` - `HasDynamicFeeExtensionOption` was moved `"github.com/cosmos/evm/ante/types"` From 2d92a92b474a75408e8fbb4c621933b3e264f3c1 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 12:29:59 -0400 Subject: [PATCH 09/17] lint --- crypto/hd/utils_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/hd/utils_test.go b/crypto/hd/utils_test.go index 7a5de9f09..1c1bc03cd 100644 --- a/crypto/hd/utils_test.go +++ b/crypto/hd/utils_test.go @@ -135,7 +135,7 @@ func (w *Wallet) derivePrivateKey(path accounts.DerivationPath) (*ecdsa.PrivateK if w.fixIssue172 && key.IsAffectedByIssue172() { key, err = key.Derive(n) } else { - key, err = key.DeriveNonStandard(n) + key, err = key.DeriveNonStandard(n) //nolint:staticcheck // SA1019 this is used for testing only } if err != nil { return nil, err From 64574798c7c208c836c6144529ebb4a401f4570a Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 14:13:54 -0400 Subject: [PATCH 10/17] apply fixes --- ante/evm/08_gas_consume.go | 4 ++-- ethereum/eip712/codec.go | 4 ++-- evmd/ante/evm_antehandler_benchmark_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ante/evm/08_gas_consume.go b/ante/evm/08_gas_consume.go index d55111029..18dbad747 100644 --- a/ante/evm/08_gas_consume.go +++ b/ante/evm/08_gas_consume.go @@ -7,7 +7,7 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" anteinterfaces "github.com/cosmos/evm/ante/interfaces" - types2 "github.com/cosmos/evm/ante/types" + antetypes "github.com/cosmos/evm/ante/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" @@ -99,7 +99,7 @@ func GetMsgPriority( // TODO: (@fedekunze) Why is this necessary? This seems to be a duplicate from the CheckGasWanted function. func CheckBlockGasLimit(ctx sdktypes.Context, gasWanted uint64, minPriority int64) (sdktypes.Context, error) { - blockGasLimit := types2.BlockGasLimit(ctx) + blockGasLimit := antetypes.BlockGasLimit(ctx) // return error if the tx gas is greater than the block limit (max gas) diff --git a/ethereum/eip712/codec.go b/ethereum/eip712/codec.go index aef5dfc97..f8a6391f3 100644 --- a/ethereum/eip712/codec.go +++ b/ethereum/eip712/codec.go @@ -1,7 +1,7 @@ package eip712 import ( - types2 "github.com/cosmos/evm/ante/types" + antetypes "github.com/cosmos/evm/ante/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdktypes "github.com/cosmos/cosmos-sdk/types" @@ -25,6 +25,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations( (*tx.TxExtensionOptionI)(nil), &ExtensionOptionsWeb3Tx{}, - &types2.ExtensionOptionDynamicFeeTx{}, + &antetypes.ExtensionOptionDynamicFeeTx{}, ) } diff --git a/evmd/ante/evm_antehandler_benchmark_test.go b/evmd/ante/evm_antehandler_benchmark_test.go index 011f21a1a..ae163a330 100644 --- a/evmd/ante/evm_antehandler_benchmark_test.go +++ b/evmd/ante/evm_antehandler_benchmark_test.go @@ -2,12 +2,12 @@ package ante_test import ( "fmt" - antetypes "github.com/cosmos/evm/ante/types" "math/big" "testing" "github.com/cosmos/evm/ante" ethante "github.com/cosmos/evm/ante/evm" + antetypes "github.com/cosmos/evm/ante/types" evmdante "github.com/cosmos/evm/evmd/ante" "github.com/cosmos/evm/evmd/tests/integration" basefactory "github.com/cosmos/evm/testutil/integration/base/factory" From c7747f8314cb63f1171ed90530293801a1599c7f Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 19 Sep 2025 15:31:49 -0400 Subject: [PATCH 11/17] some more 2 imports --- evmd/tests/ibc/ibc_middleware_test.go | 26 +++++++++++++------------- evmd/tests/network/network.go | 22 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/evmd/tests/ibc/ibc_middleware_test.go b/evmd/tests/ibc/ibc_middleware_test.go index f704a3704..a1acc0298 100644 --- a/evmd/tests/ibc/ibc_middleware_test.go +++ b/evmd/tests/ibc/ibc_middleware_test.go @@ -20,9 +20,9 @@ import ( "github.com/cosmos/evm/x/erc20" erc20Keeper "github.com/cosmos/evm/x/erc20/keeper" "github.com/cosmos/evm/x/erc20/types" - testutil2 "github.com/cosmos/evm/x/ibc/callbacks/testutil" - types2 "github.com/cosmos/evm/x/ibc/callbacks/types" - types3 "github.com/cosmos/evm/x/vm/types" + ibctestutil "github.com/cosmos/evm/x/ibc/callbacks/testutil" + callbacktypes "github.com/cosmos/evm/x/ibc/callbacks/types" + evmtypes "github.com/cosmos/evm/x/vm/types" ibctransfer "github.com/cosmos/ibc-go/v10/modules/apps/transfer" transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" @@ -74,7 +74,7 @@ func TestMiddlewareTestSuite(t *testing.T) { func (suite *MiddlewareTestSuite) TestOnRecvPacketWithCallback() { var packet channeltypes.Packet - var contractData types3.CompiledContract + var contractData evmtypes.CompiledContract var contractAddr common.Address var voucherDenom string var path *evmibctesting.Path @@ -314,10 +314,10 @@ func (suite *MiddlewareTestSuite) TestOnRecvPacketWithCallback() { // Generate the isolated address for the sender sendAmt := ibctesting.DefaultCoinAmount - isolatedAddr := types2.GenerateIsolatedAddress(path.EndpointA.ChannelID, suite.chainB.SenderAccount.GetAddress().String()) + isolatedAddr := callbacktypes.GenerateIsolatedAddress(path.EndpointA.ChannelID, suite.chainB.SenderAccount.GetAddress().String()) // Get callback tester contract and deploy it - contractData, err = testutil2.LoadCounterWithCallbacksContract() + contractData, err = ibctestutil.LoadCounterWithCallbacksContract() suite.Require().NoError(err) deploymentData := testutiltypes.ContractDeploymentData{ @@ -639,12 +639,12 @@ func (suite *MiddlewareTestSuite) TestOnRecvPacketNativeErc20() { chainBNativeErc20Denom.Path(), recvAmt.String(), chainBAccount.String(), - types2.GenerateIsolatedAddress(path.EndpointA.ChannelID, suite.chainB.SenderAccount.GetAddress().String()).String(), + callbacktypes.GenerateIsolatedAddress(path.EndpointA.ChannelID, suite.chainB.SenderAccount.GetAddress().String()).String(), "", ) // get callback tester contract and deploy it - contractData, err := testutil2.LoadCounterWithCallbacksContract() + contractData, err := ibctestutil.LoadCounterWithCallbacksContract() suite.Require().NoError(err) deploymentData := testutiltypes.ContractDeploymentData{ @@ -741,7 +741,7 @@ func (suite *MiddlewareTestSuite) TestOnRecvPacketNativeErc20() { // the packet that failed conversion due to the minting restriction should instead remain as the bank token // and will be in the isolated address used to invoke the callback - trappedBal := evmApp.BankKeeper.GetBalance(evmCtx, types2.GenerateIsolatedAddress(path.EndpointA.ChannelID, + trappedBal := evmApp.BankKeeper.GetBalance(evmCtx, callbacktypes.GenerateIsolatedAddress(path.EndpointA.ChannelID, suite.chainB.SenderAccount.GetAddress().String()), nativeErc20.Denom) suite.Require().Equal(recvAmt.String(), trappedBal.Amount.String()) } @@ -751,7 +751,7 @@ func (suite *MiddlewareTestSuite) TestOnAcknowledgementPacketWithCallback() { var ( packet channeltypes.Packet ack []byte - contractData types3.CompiledContract + contractData evmtypes.CompiledContract contractAddr common.Address ) @@ -1008,7 +1008,7 @@ func (suite *MiddlewareTestSuite) TestOnAcknowledgementPacketWithCallback() { receiver := suite.chainB.SenderAccount.GetAddress() // Deploy callback contract on source chain (evmChainA) - contractData, err = testutil2.LoadCounterWithCallbacksContract() + contractData, err = ibctestutil.LoadCounterWithCallbacksContract() suite.Require().NoError(err) deploymentData := testutiltypes.ContractDeploymentData{ @@ -1624,7 +1624,7 @@ func (suite *MiddlewareTestSuite) TestOnTimeoutPacket() { func (suite *MiddlewareTestSuite) TestOnTimeoutPacketWithCallback() { var ( packet channeltypes.Packet - contractData types3.CompiledContract + contractData evmtypes.CompiledContract contractAddr common.Address ) @@ -1835,7 +1835,7 @@ func (suite *MiddlewareTestSuite) TestOnTimeoutPacketWithCallback() { receiver := suite.chainB.SenderAccount.GetAddress() // Deploy callback contract on source chain (evmChainA) - contractData, err = testutil2.LoadCounterWithCallbacksContract() + contractData, err = ibctestutil.LoadCounterWithCallbacksContract() suite.Require().NoError(err) deploymentData := testutiltypes.ContractDeploymentData{ diff --git a/evmd/tests/network/network.go b/evmd/tests/network/network.go index 49c53ae57..2a3ac7793 100644 --- a/evmd/tests/network/network.go +++ b/evmd/tests/network/network.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "fmt" - testutil2 "github.com/cosmos/evm/testutil" "github.com/cosmos/evm/utils" "net/http" "net/url" @@ -33,6 +32,7 @@ import ( "github.com/cosmos/evm/evmd" evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" "github.com/cosmos/evm/server/config" + evmtestutil "github.com/cosmos/evm/testutil" testconfig "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" @@ -51,7 +51,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" srvconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/testutil" + sdktestutil "github.com/cosmos/cosmos-sdk/testutil" simutils "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -79,14 +79,14 @@ type Config struct { InterfaceRegistry codectypes.InterfaceRegistry TxConfig client.TxConfig AccountRetriever client.AccountRetriever - AppConstructor AppConstructor // the ABCI application constructor - GenesisState testutil2.GenesisState // custom gensis state to provide - TimeoutCommit time.Duration // the consensus commitment timeout - AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) - StakingTokens math.Int // the amount of tokens each validator has available to stake - BondedTokens math.Int // the amount of tokens each validator stakes - NumValidators int // the total number of validators to create and bond - ChainID string // the network chain-id + AppConstructor AppConstructor // the ABCI application constructor + GenesisState evmtestutil.GenesisState // custom gensis state to provide + TimeoutCommit time.Duration // the consensus commitment timeout + AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) + StakingTokens math.Int // the amount of tokens each validator has available to stake + BondedTokens math.Int // the amount of tokens each validator stakes + NumValidators int // the total number of validators to create and bond + ChainID string // the network chain-id EVMChainID uint64 BondDenom string // the staking bond denomination MinGasPrices string // the minimum gas prices each validator will accept @@ -392,7 +392,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - addr, secret, err := testutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) + addr, secret, err := sdktestutil.GenerateSaveCoinKey(kb, nodeDirName, "", true, algo) if err != nil { return nil, err } From 8a1e9af9a65ca6e6ef32e09fce6a7fcf2f6add35 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 13:13:48 -0400 Subject: [PATCH 12/17] lints --- rpc/backend/blocks.go | 3 +++ rpc/types/utils.go | 7 +++---- tests/integration/ante/test_validate_handler_options.go | 2 +- testutil/integration/evm/network/setup.go | 8 ++++---- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index 2cc3e94d4..6f1db5833 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -217,6 +217,9 @@ func (b *Backend) GetBlockReceipts( } result[i], err = rpctypes.RPCMarshalReceipt(receipts[i], tx, from) + if err != nil { + return nil, fmt.Errorf("failed to marshal receipt") + } } return result, nil } diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 00798cbb0..4efaa37fc 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -10,9 +10,8 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus/misc/eip1559" ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/params" - "github.com/pkg/errors" ethparams "github.com/ethereum/go-ethereum/params" + "github.com/pkg/errors" abci "github.com/cometbft/cometbft/abci/types" cmtrpcclient "github.com/cometbft/cometbft/rpc/client" @@ -357,10 +356,10 @@ func TxSucessOrExpectedFailure(res *abci.ExecTxResult) bool { } // CalcBaseFee calculates the basefee of the header. -func CalcBaseFee(config *params.ChainConfig, parent *ethtypes.Header, p types2.Params) (*big.Int, error) { +func CalcBaseFee(config *ethparams.ChainConfig, parent *ethtypes.Header, p types2.Params) (*big.Int, error) { // If the current block is the first EIP-1559 block, return the InitialBaseFee. if !config.IsLondon(parent.Number) { - return new(big.Int).SetUint64(params.InitialBaseFee), nil + return new(big.Int).SetUint64(ethparams.InitialBaseFee), nil } if p.ElasticityMultiplier == 0 { return nil, errors.New("ElasticityMultiplier cannot be 0 as it's checked in the params validation") diff --git a/tests/integration/ante/test_validate_handler_options.go b/tests/integration/ante/test_validate_handler_options.go index 41c6c1b45..ccd2c1eea 100644 --- a/tests/integration/ante/test_validate_handler_options.go +++ b/tests/integration/ante/test_validate_handler_options.go @@ -1,13 +1,13 @@ package ante import ( - antetypes "github.com/cosmos/evm/ante/types" "testing" "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" "github.com/cosmos/evm/ante" + antetypes "github.com/cosmos/evm/ante/types" "github.com/cosmos/evm/testutil/integration/evm/network" ) diff --git a/testutil/integration/evm/network/setup.go b/testutil/integration/evm/network/setup.go index 2e4867787..5a7a74d98 100644 --- a/testutil/integration/evm/network/setup.go +++ b/testutil/integration/evm/network/setup.go @@ -2,7 +2,6 @@ package network import ( "fmt" - testconstants "github.com/cosmos/evm/testutil/constants" "maps" "slices" "time" @@ -11,6 +10,7 @@ import ( "github.com/cosmos/evm" "github.com/cosmos/evm/testutil" + testconstants "github.com/cosmos/evm/testutil/constants" erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -414,13 +414,13 @@ type GovCustomGenesisState struct { } // setDefaultGovGenesisState sets the default gov genesis state -func setDefaultGovGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams GovCustomGenesisState, evmChainID uint64) testutil.GenesisState { +func setDefaultGovGenesisState(cosmosEVMApp evm.EvmApp, genesisState testutil.GenesisState, overwriteParams GovCustomGenesisState) testutil.GenesisState { govGen := govtypesv1.DefaultGenesisState() denomConfig := DefaultChainCoins() updatedParams := govGen.Params - minDepositAmt := sdkmath.NewInt(1e18).Quo(evmtypes.Decimals(denomConfig.BaseDecimals()).ConversionFactor()) + minDepositAmt := sdkmath.NewInt(1e18).Quo(denomConfig.BaseDecimals().ConversionFactor()) updatedParams.MinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(overwriteParams.denom, minDepositAmt)) updatedParams.ExpeditedMinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(overwriteParams.denom, minDepositAmt)) govGen.Params = updatedParams @@ -509,7 +509,7 @@ func newDefaultGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, params d genesisState = setDefaultAuthGenesisState(cosmosEVMApp, genesisState, params.genAccounts) genesisState = setDefaultStakingGenesisState(cosmosEVMApp, genesisState, params.staking) genesisState = setDefaultBankGenesisState(cosmosEVMApp, genesisState, params.bank, evmChainID) - genesisState = setDefaultGovGenesisState(cosmosEVMApp, genesisState, params.gov, evmChainID) + genesisState = setDefaultGovGenesisState(cosmosEVMApp, genesisState, params.gov) genesisState = setDefaultFeeMarketGenesisState(cosmosEVMApp, genesisState, params.feemarket) genesisState = setDefaultSlashingGenesisState(cosmosEVMApp, genesisState, params.slashing) genesisState = setDefaultMintGenesisState(cosmosEVMApp, genesisState, params.mint) From c2e9c416daad4e071287a34ab20d3b202a85da61 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 13:21:12 -0400 Subject: [PATCH 13/17] types2 no more --- indexer/kv_indexer.go | 14 +++---- rpc/apis.go | 20 +++++----- rpc/backend/backend.go | 68 ++++++++++++++++---------------- rpc/backend/blocks.go | 12 +++--- rpc/backend/tx_info.go | 12 +++--- rpc/stream/rpc.go | 4 +- rpc/types/utils.go | 6 +-- server/indexer_service.go | 6 +-- server/start.go | 4 +- x/erc20/client/cli/tx.go | 8 ++-- x/erc20/keeper/grpc_query.go | 4 +- x/erc20/types/proposal.go | 8 ++-- x/ibc/callbacks/keeper/keeper.go | 8 ++-- x/vm/keeper/grpc_query.go | 12 +++--- x/vm/keeper/state_transition.go | 4 +- x/vm/types/logs.go | 10 ++--- 16 files changed, 100 insertions(+), 100 deletions(-) diff --git a/indexer/kv_indexer.go b/indexer/kv_indexer.go index 759f4d9c6..9bf85ccdc 100644 --- a/indexer/kv_indexer.go +++ b/indexer/kv_indexer.go @@ -10,7 +10,7 @@ import ( dbm "github.com/cosmos/cosmos-db" rpctypes "github.com/cosmos/evm/rpc/types" - "github.com/cosmos/evm/server/types" + servertypes "github.com/cosmos/evm/server/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" @@ -30,7 +30,7 @@ const ( TxIndexKeyLength = 1 + 8 + 8 ) -var _ types.EVMTxIndexer = &KVIndexer{} +var _ servertypes.EVMTxIndexer = &KVIndexer{} // KVIndexer implements a eth tx indexer on a KV db. type KVIndexer struct { @@ -84,7 +84,7 @@ func (kv *KVIndexer) IndexBlock(block *cmttypes.Block, txResults []*abci.ExecTxR ethMsg := msg.(*evmtypes.MsgEthereumTx) txHash := ethMsg.Hash() - txResult := types.TxResult{ + txResult := servertypes.TxResult{ Height: height, TxIndex: uint32(txIndex), //#nosec G115 -- int overflow is not a concern here MsgIndex: uint32(msgIndex), //#nosec G115 -- int overflow is not a concern here @@ -134,7 +134,7 @@ func (kv *KVIndexer) FirstIndexedBlock() (int64, error) { } // GetByTxHash finds eth tx by eth tx hash -func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*types.TxResult, error) { +func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*servertypes.TxResult, error) { bz, err := kv.db.Get(TxHashKey(hash)) if err != nil { return nil, errorsmod.Wrapf(err, "GetByTxHash %s", hash.Hex()) @@ -142,7 +142,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*types.TxResult, error) { if len(bz) == 0 { return nil, fmt.Errorf("tx not found, hash: %s", hash.Hex()) } - var txKey types.TxResult + var txKey servertypes.TxResult if err := kv.clientCtx.Codec.Unmarshal(bz, &txKey); err != nil { return nil, errorsmod.Wrapf(err, "GetByTxHash %s", hash.Hex()) } @@ -150,7 +150,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*types.TxResult, error) { } // GetByBlockAndIndex finds eth tx by block number and eth tx index -func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*types.TxResult, error) { +func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*servertypes.TxResult, error) { bz, err := kv.db.Get(TxIndexKey(blockNumber, txIndex)) if err != nil { return nil, errorsmod.Wrapf(err, "GetByBlockAndIndex %d %d", blockNumber, txIndex) @@ -213,7 +213,7 @@ func isEthTx(tx sdk.Tx) bool { } // saveTxResult index the txResult into the kv db batch -func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *types.TxResult) error { +func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *servertypes.TxResult) error { bz := codec.MustMarshal(txResult) if err := batch.Set(TxHashKey(txHash), bz); err != nil { return errorsmod.Wrap(err, "set tx-hash key") diff --git a/rpc/apis.go b/rpc/apis.go index 729908b7f..2ea7100ef 100644 --- a/rpc/apis.go +++ b/rpc/apis.go @@ -16,7 +16,7 @@ import ( "github.com/cosmos/evm/rpc/namespaces/ethereum/txpool" "github.com/cosmos/evm/rpc/namespaces/ethereum/web3" "github.com/cosmos/evm/rpc/stream" - server2 "github.com/cosmos/evm/server/types" + servertypes "github.com/cosmos/evm/server/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server" @@ -47,7 +47,7 @@ type APICreator = func( clientCtx client.Context, stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API @@ -60,7 +60,7 @@ func init() { clientCtx client.Context, stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -79,7 +79,7 @@ func init() { }, } }, - Web3Namespace: func(*server.Context, client.Context, *stream.RPCStream, bool, server2.EVMTxIndexer, *evmmempool.ExperimentalEVMMempool) []rpc.API { + Web3Namespace: func(*server.Context, client.Context, *stream.RPCStream, bool, servertypes.EVMTxIndexer, *evmmempool.ExperimentalEVMMempool) []rpc.API { return []rpc.API{ { Namespace: Web3Namespace, @@ -89,7 +89,7 @@ func init() { }, } }, - NetNamespace: func(ctx *server.Context, clientCtx client.Context, _ *stream.RPCStream, _ bool, _ server2.EVMTxIndexer, _ *evmmempool.ExperimentalEVMMempool) []rpc.API { + NetNamespace: func(ctx *server.Context, clientCtx client.Context, _ *stream.RPCStream, _ bool, _ servertypes.EVMTxIndexer, _ *evmmempool.ExperimentalEVMMempool) []rpc.API { return []rpc.API{ { Namespace: NetNamespace, @@ -103,7 +103,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -120,7 +120,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -137,7 +137,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -154,7 +154,7 @@ func init() { clientCtx client.Context, _ *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer, mempool) @@ -175,7 +175,7 @@ func GetRPCAPIs(ctx *server.Context, clientCtx client.Context, stream *stream.RPCStream, allowUnprotectedTxs bool, - indexer server2.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, selectedAPIs []string, mempool *evmmempool.ExperimentalEVMMempool, ) []rpc.API { diff --git a/rpc/backend/backend.go b/rpc/backend/backend.go index 838d82670..4a62e5067 100644 --- a/rpc/backend/backend.go +++ b/rpc/backend/backend.go @@ -19,9 +19,9 @@ import ( tmrpctypes "github.com/cometbft/cometbft/rpc/core/types" evmmempool "github.com/cosmos/evm/mempool" - rpctypes "github.com/cosmos/evm/rpc/types" + "github.com/cosmos/evm/rpc/types" "github.com/cosmos/evm/server/config" - "github.com/cosmos/evm/server/types" + servertypes "github.com/cosmos/evm/server/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" @@ -64,31 +64,31 @@ type EVMBackend interface { // Blocks Info BlockNumber() (hexutil.Uint64, error) - GetHeaderByNumber(blockNum rpctypes.BlockNumber) (map[string]interface{}, error) + GetHeaderByNumber(blockNum types.BlockNumber) (map[string]interface{}, error) GetHeaderByHash(hash common.Hash) (map[string]interface{}, error) - GetBlockByNumber(blockNum rpctypes.BlockNumber, fullTx bool) (map[string]interface{}, error) + GetBlockByNumber(blockNum types.BlockNumber, fullTx bool) (map[string]interface{}, error) GetBlockByHash(hash common.Hash, fullTx bool) (map[string]interface{}, error) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint - GetBlockTransactionCountByNumber(blockNum rpctypes.BlockNumber) *hexutil.Uint - CometBlockByNumber(blockNum rpctypes.BlockNumber) (*tmrpctypes.ResultBlock, error) + GetBlockTransactionCountByNumber(blockNum types.BlockNumber) *hexutil.Uint + CometBlockByNumber(blockNum types.BlockNumber) (*tmrpctypes.ResultBlock, error) CometBlockByHash(blockHash common.Hash) (*tmrpctypes.ResultBlock, error) - BlockNumberFromComet(blockNrOrHash rpctypes.BlockNumberOrHash) (rpctypes.BlockNumber, error) + BlockNumberFromComet(blockNrOrHash types.BlockNumberOrHash) (types.BlockNumber, error) BlockNumberFromCometByHash(blockHash common.Hash) (*big.Int, error) EthMsgsFromCometBlock(block *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults) []*evmtypes.MsgEthereumTx BlockBloomFromCometBlock(blockRes *tmrpctypes.ResultBlockResults) (ethtypes.Bloom, error) - HeaderByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Header, error) + HeaderByNumber(blockNum types.BlockNumber) (*ethtypes.Header, error) HeaderByHash(blockHash common.Hash) (*ethtypes.Header, error) RPCBlockFromCometBlock(resBlock *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults, fullTx bool) (map[string]interface{}, error) - EthBlockByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Block, error) + EthBlockByNumber(blockNum types.BlockNumber) (*ethtypes.Block, error) EthBlockFromCometBlock(resBlock *tmrpctypes.ResultBlock, blockRes *tmrpctypes.ResultBlockResults) (*ethtypes.Block, error) - GetBlockReceipts(blockNrOrHash rpctypes.BlockNumberOrHash) ([]map[string]interface{}, error) + GetBlockReceipts(blockNrOrHash types.BlockNumberOrHash) ([]map[string]interface{}, error) // Account Info - GetCode(address common.Address, blockNrOrHash rpctypes.BlockNumberOrHash) (hexutil.Bytes, error) - GetBalance(address common.Address, blockNrOrHash rpctypes.BlockNumberOrHash) (*hexutil.Big, error) - GetStorageAt(address common.Address, key string, blockNrOrHash rpctypes.BlockNumberOrHash) (hexutil.Bytes, error) - GetProof(address common.Address, storageKeys []string, blockNrOrHash rpctypes.BlockNumberOrHash) (*rpctypes.AccountResult, error) - GetTransactionCount(address common.Address, blockNum rpctypes.BlockNumber) (*hexutil.Uint64, error) + GetCode(address common.Address, blockNrOrHash types.BlockNumberOrHash) (hexutil.Bytes, error) + GetBalance(address common.Address, blockNrOrHash types.BlockNumberOrHash) (*hexutil.Big, error) + GetStorageAt(address common.Address, key string, blockNrOrHash types.BlockNumberOrHash) (hexutil.Bytes, error) + GetProof(address common.Address, storageKeys []string, blockNrOrHash types.BlockNumberOrHash) (*types.AccountResult, error) + GetTransactionCount(address common.Address, blockNum types.BlockNumber) (*hexutil.Uint64, error) // Chain Info ChainID() (*hexutil.Big, error) @@ -98,26 +98,26 @@ type EVMBackend interface { CurrentHeader() (*ethtypes.Header, error) PendingTransactions() ([]*sdk.Tx, error) GetCoinbase() (sdk.AccAddress, error) - FeeHistory(blockCount math.HexOrDecimal64, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*rpctypes.FeeHistoryResult, error) + FeeHistory(blockCount math.HexOrDecimal64, lastBlock rpc.BlockNumber, rewardPercentiles []float64) (*types.FeeHistoryResult, error) SuggestGasTipCap(baseFee *big.Int) (*big.Int, error) // Tx Info - GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransaction, error) - GetTxByEthHash(txHash common.Hash) (*types.TxResult, error) - GetTxByTxIndex(height int64, txIndex uint) (*types.TxResult, error) - GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) + GetTransactionByHash(txHash common.Hash) (*types.RPCTransaction, error) + GetTxByEthHash(txHash common.Hash) (*servertypes.TxResult, error) + GetTxByTxIndex(height int64, txIndex uint) (*servertypes.TxResult, error) + GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, idx hexutil.Uint) (*types.RPCTransaction, error) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error) GetTransactionLogs(hash common.Hash) ([]*ethtypes.Log, error) - GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) - GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNumber, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) - CreateAccessList(args evmtypes.TransactionArgs, blockNrOrHash rpctypes.BlockNumberOrHash, overrides *json.RawMessage) (*rpctypes.AccessListResult, error) + GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*types.RPCTransaction, error) + GetTransactionByBlockNumberAndIndex(blockNum types.BlockNumber, idx hexutil.Uint) (*types.RPCTransaction, error) + CreateAccessList(args evmtypes.TransactionArgs, blockNrOrHash types.BlockNumberOrHash, overrides *json.RawMessage) (*types.AccessListResult, error) // Send Transaction Resend(args evmtypes.TransactionArgs, gasPrice *hexutil.Big, gasLimit *hexutil.Uint64) (common.Hash, error) SendRawTransaction(data hexutil.Bytes) (common.Hash, error) SetTxDefaults(args evmtypes.TransactionArgs) (evmtypes.TransactionArgs, error) - EstimateGas(args evmtypes.TransactionArgs, blockNrOptional *rpctypes.BlockNumber) (hexutil.Uint64, error) - DoCall(args evmtypes.TransactionArgs, blockNr rpctypes.BlockNumber, overrides *json.RawMessage) (*evmtypes.MsgEthereumTxResponse, error) + EstimateGas(args evmtypes.TransactionArgs, blockNrOptional *types.BlockNumber) (hexutil.Uint64, error) + DoCall(args evmtypes.TransactionArgs, blockNr types.BlockNumber, overrides *json.RawMessage) (*evmtypes.MsgEthereumTxResponse, error) GasPrice() (*hexutil.Big, error) // Filter API @@ -126,14 +126,14 @@ type EVMBackend interface { BloomStatus() (uint64, uint64) // TxPool API - Content() (map[string]map[string]map[string]*rpctypes.RPCTransaction, error) - ContentFrom(address common.Address) (map[string]map[string]*rpctypes.RPCTransaction, error) + Content() (map[string]map[string]map[string]*types.RPCTransaction, error) + ContentFrom(address common.Address) (map[string]map[string]*types.RPCTransaction, error) Inspect() (map[string]map[string]map[string]string, error) Status() (map[string]hexutil.Uint, error) // Tracing - TraceTransaction(hash common.Hash, config *rpctypes.TraceConfig) (interface{}, error) - TraceBlock(height rpctypes.BlockNumber, config *rpctypes.TraceConfig, block *tmrpctypes.ResultBlock) ([]*evmtypes.TxTraceResult, error) + TraceTransaction(hash common.Hash, config *types.TraceConfig) (interface{}, error) + TraceBlock(height types.BlockNumber, config *types.TraceConfig, block *tmrpctypes.ResultBlock) ([]*evmtypes.TxTraceResult, error) } var _ BackendI = (*Backend)(nil) @@ -156,7 +156,7 @@ type ProcessBlocker func( ethBlock *map[string]interface{}, rewardPercentiles []float64, tendermintBlockResult *tmrpctypes.ResultBlockResults, - targetOneFeeHistory *rpctypes.OneFeeHistory, + targetOneFeeHistory *types.OneFeeHistory, ) error // Backend implements the BackendI interface @@ -164,12 +164,12 @@ type Backend struct { Ctx context.Context ClientCtx client.Context RPCClient tmrpcclient.SignClient - QueryClient *rpctypes.QueryClient // gRPC query client + QueryClient *types.QueryClient // gRPC query client Logger log.Logger EvmChainID *big.Int Cfg config.Config AllowUnprotectedTxs bool - Indexer types.EVMTxIndexer + Indexer servertypes.EVMTxIndexer ProcessBlocker ProcessBlocker Mempool *evmmempool.ExperimentalEVMMempool } @@ -184,7 +184,7 @@ func NewBackend( logger log.Logger, clientCtx client.Context, allowUnprotectedTxs bool, - indexer types.EVMTxIndexer, + indexer servertypes.EVMTxIndexer, mempool *evmmempool.ExperimentalEVMMempool, ) *Backend { appConf, err := config.GetConfig(ctx.Viper) @@ -201,7 +201,7 @@ func NewBackend( Ctx: context.Background(), ClientCtx: clientCtx, RPCClient: rpcClient, - QueryClient: rpctypes.NewQueryClient(clientCtx), + QueryClient: types.NewQueryClient(clientCtx), Logger: logger.With("module", "backend"), EvmChainID: big.NewInt(int64(appConf.EVM.EVMChainID)), //nolint:gosec // G115 // won't exceed uint64 Cfg: appConf, diff --git a/rpc/backend/blocks.go b/rpc/backend/blocks.go index 6f1db5833..e3b8aa105 100644 --- a/rpc/backend/blocks.go +++ b/rpc/backend/blocks.go @@ -12,7 +12,7 @@ import ( cmtrpctypes "github.com/cometbft/cometbft/rpc/core/types" - rpctypes "github.com/cosmos/evm/rpc/types" + "github.com/cosmos/evm/rpc/types" evmtypes "github.com/cosmos/evm/x/vm/types" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" @@ -46,7 +46,7 @@ func (b *Backend) BlockNumber() (hexutil.Uint64, error) { // GetBlockByNumber returns the JSON-RPC compatible Ethereum block identified by // block number. Depending on fullTx it either returns the full transaction // objects or if false only the hashes of the transactions. -func (b *Backend) GetBlockByNumber(blockNum rpctypes.BlockNumber, fullTx bool) (map[string]interface{}, error) { +func (b *Backend) GetBlockByNumber(blockNum types.BlockNumber, fullTx bool) (map[string]interface{}, error) { resBlock, err := b.CometBlockByNumber(blockNum) if err != nil { return nil, nil @@ -119,7 +119,7 @@ func (b *Backend) GetBlockTransactionCountByHash(hash common.Hash) *hexutil.Uint // GetBlockTransactionCountByNumber returns the number of Ethereum transactions // in the block identified by number. -func (b *Backend) GetBlockTransactionCountByNumber(blockNum rpctypes.BlockNumber) *hexutil.Uint { +func (b *Backend) GetBlockTransactionCountByNumber(blockNum types.BlockNumber) *hexutil.Uint { block, err := b.CometBlockByNumber(blockNum) if err != nil { b.Logger.Debug("block not found", "height", blockNum.Int64(), "error", err.Error()) @@ -148,7 +148,7 @@ func (b *Backend) getBlockTransactionCount(block *cmtrpctypes.ResultBlock) *hexu } // EthBlockByNumber returns the Ethereum Block identified by number. -func (b *Backend) EthBlockByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Block, error) { +func (b *Backend) EthBlockByNumber(blockNum types.BlockNumber) (*ethtypes.Block, error) { resBlock, err := b.CometBlockByNumber(blockNum) if err != nil { return nil, err @@ -174,7 +174,7 @@ func (b *Backend) EthBlockByNumber(blockNum rpctypes.BlockNumber) (*ethtypes.Blo // GetBlockReceipts returns the receipts for a given block number or hash. func (b *Backend) GetBlockReceipts( - blockNrOrHash rpctypes.BlockNumberOrHash, + blockNrOrHash types.BlockNumberOrHash, ) ([]map[string]interface{}, error) { blockNum, err := b.BlockNumberFromComet(blockNrOrHash) if err != nil { @@ -216,7 +216,7 @@ func (b *Backend) GetBlockReceipts( return nil, fmt.Errorf("failed to get sender: %w", err) } - result[i], err = rpctypes.RPCMarshalReceipt(receipts[i], tx, from) + result[i], err = types.RPCMarshalReceipt(receipts[i], tx, from) if err != nil { return nil, fmt.Errorf("failed to marshal receipt") } diff --git a/rpc/backend/tx_info.go b/rpc/backend/tx_info.go index 9cf22c65b..fbbd13a1e 100644 --- a/rpc/backend/tx_info.go +++ b/rpc/backend/tx_info.go @@ -20,7 +20,7 @@ import ( "github.com/cosmos/evm/mempool/txpool" rpctypes "github.com/cosmos/evm/rpc/types" - types2 "github.com/cosmos/evm/server/types" + servertypes "github.com/cosmos/evm/server/types" "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -132,7 +132,7 @@ func (b *Backend) GetTransactionByHashPending(txHash common.Hash) (*rpctypes.RPC } // GetGasUsed returns gasUsed from transaction -func (b *Backend) GetGasUsed(res *types2.TxResult, price *big.Int, gas uint64) uint64 { +func (b *Backend) GetGasUsed(res *servertypes.TxResult, price *big.Int, gas uint64) uint64 { return res.GasUsed } @@ -145,7 +145,7 @@ func (b *Backend) GetTransactionReceipt(hash common.Hash) (map[string]interface{ maxRetries := 10 baseDelay := 50 * time.Millisecond - var res *types2.TxResult + var res *servertypes.TxResult var err error for attempt := 0; attempt <= maxRetries; attempt++ { @@ -294,7 +294,7 @@ func (b *Backend) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNum // GetTxByEthHash uses `/tx_query` to find transaction by ethereum tx hash // TODO: Don't need to convert once hashing is fixed on CometBFT // https://github.com/cometbft/cometbft/issues/6539 -func (b *Backend) GetTxByEthHash(hash common.Hash) (*types2.TxResult, error) { +func (b *Backend) GetTxByEthHash(hash common.Hash) (*servertypes.TxResult, error) { if b.Indexer != nil { return b.Indexer.GetByTxHash(hash) } @@ -311,7 +311,7 @@ func (b *Backend) GetTxByEthHash(hash common.Hash) (*types2.TxResult, error) { } // GetTxByTxIndex uses `/tx_query` to find transaction by tx index of valid ethereum txs -func (b *Backend) GetTxByTxIndex(height int64, index uint) (*types2.TxResult, error) { +func (b *Backend) GetTxByTxIndex(height int64, index uint) (*servertypes.TxResult, error) { int32Index := int32(index) //#nosec G115 -- checked for int overflow already if b.Indexer != nil { return b.Indexer.GetByBlockAndIndex(height, int32Index) @@ -332,7 +332,7 @@ func (b *Backend) GetTxByTxIndex(height int64, index uint) (*types2.TxResult, er } // QueryCometTxIndexer query tx in CometBFT tx indexer -func (b *Backend) QueryCometTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*types2.TxResult, error) { +func (b *Backend) QueryCometTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*servertypes.TxResult, error) { resTxs, err := b.ClientCtx.Client.TxSearch(b.Ctx, query, false, nil, nil, "") if err != nil { return nil, err diff --git a/rpc/stream/rpc.go b/rpc/stream/rpc.go index 07c56537b..49b8b611b 100644 --- a/rpc/stream/rpc.go +++ b/rpc/stream/rpc.go @@ -14,7 +14,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/utils" + "github.com/cosmos/evm/utils" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" @@ -184,7 +184,7 @@ func (s *RPCStream) start( s.logger.Error("event data type mismatch", "type", fmt.Sprintf("%T", ev.Data)) continue } - height, err := cosmosevmtypes.SafeUint64(dataTx.Height) + height, err := utils.SafeUint64(dataTx.Height) if err != nil { continue } diff --git a/rpc/types/utils.go b/rpc/types/utils.go index 4efaa37fc..aa7494073 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -17,7 +17,7 @@ import ( cmtrpcclient "github.com/cometbft/cometbft/rpc/client" cmttypes "github.com/cometbft/cometbft/types" - types2 "github.com/cosmos/evm/x/feemarket/types" + feemarkettypes "github.com/cosmos/evm/x/feemarket/types" evmtypes "github.com/cosmos/evm/x/vm/types" errorsmod "cosmossdk.io/errors" @@ -356,7 +356,7 @@ func TxSucessOrExpectedFailure(res *abci.ExecTxResult) bool { } // CalcBaseFee calculates the basefee of the header. -func CalcBaseFee(config *ethparams.ChainConfig, parent *ethtypes.Header, p types2.Params) (*big.Int, error) { +func CalcBaseFee(config *ethparams.ChainConfig, parent *ethtypes.Header, p feemarkettypes.Params) (*big.Int, error) { // If the current block is the first EIP-1559 block, return the InitialBaseFee. if !config.IsLondon(parent.Number) { return new(big.Int).SetUint64(ethparams.InitialBaseFee), nil @@ -368,7 +368,7 @@ func CalcBaseFee(config *ethparams.ChainConfig, parent *ethtypes.Header, p types factor := evmtypes.GetEVMCoinDecimals().ConversionFactor() minGasPrice := p.MinGasPrice.Mul(sdkmath.LegacyNewDecFromInt(factor)) - return types2.CalcGasBaseFee( + return feemarkettypes.CalcGasBaseFee( parent.GasUsed, parentGasTarget, uint64(p.BaseFeeChangeDenominator), sdkmath.LegacyNewDecFromBigInt(parent.BaseFee), sdkmath.LegacyOneDec(), minGasPrice, ).TruncateInt().BigInt(), nil diff --git a/server/indexer_service.go b/server/indexer_service.go index 8693c001d..ecd797e70 100644 --- a/server/indexer_service.go +++ b/server/indexer_service.go @@ -9,7 +9,7 @@ import ( coretypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/cometbft/cometbft/types" - types2 "github.com/cosmos/evm/server/types" + servertypes "github.com/cosmos/evm/server/types" ) const ( @@ -22,13 +22,13 @@ const ( type EVMIndexerService struct { service.BaseService - txIdxr types2.EVMTxIndexer + txIdxr servertypes.EVMTxIndexer client rpcclient.Client } // NewEVMIndexerService returns a new service instance. func NewEVMIndexerService( - txIdxr types2.EVMTxIndexer, + txIdxr servertypes.EVMTxIndexer, client rpcclient.Client, ) *EVMIndexerService { is := &EVMIndexerService{txIdxr: txIdxr, client: client} diff --git a/server/start.go b/server/start.go index af4812bc9..edbd9a8b1 100644 --- a/server/start.go +++ b/server/start.go @@ -33,7 +33,7 @@ import ( ethdebug "github.com/cosmos/evm/rpc/namespaces/ethereum/debug" cosmosevmserverconfig "github.com/cosmos/evm/server/config" srvflags "github.com/cosmos/evm/server/flags" - types2 "github.com/cosmos/evm/server/types" + servertypes "github.com/cosmos/evm/server/types" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" @@ -467,7 +467,7 @@ func startInProcess(svrCtx *server.Context, clientCtx client.Context, opts Start ethmetricsexp.Setup(config.JSONRPC.MetricsAddress) } - var idxer types2.EVMTxIndexer + var idxer servertypes.EVMTxIndexer if config.JSONRPC.EnableIndexer { idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(svrCtx.Viper)) if err != nil { diff --git a/x/erc20/client/cli/tx.go b/x/erc20/client/cli/tx.go index a139c8fa4..34b1b8e7a 100644 --- a/x/erc20/client/cli/tx.go +++ b/x/erc20/client/cli/tx.go @@ -6,7 +6,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/spf13/cobra" - cosmosevmtypes "github.com/cosmos/evm/utils" + "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/erc20/types" "cosmossdk.io/math" @@ -48,7 +48,7 @@ func NewConvertERC20Cmd() *cobra.Command { } contract := args[0] - if err := cosmosevmtypes.ValidateAddress(contract); err != nil { + if err := utils.ValidateAddress(contract); err != nil { return fmt.Errorf("invalid ERC20 contract address %w", err) } @@ -104,7 +104,7 @@ func NewConvertCoinCmd() *cobra.Command { if len(args) == 2 { receiver = args[1] - if err := cosmosevmtypes.ValidateAddress(receiver); err != nil { + if err := utils.ValidateAddress(receiver); err != nil { return fmt.Errorf("invalid receiver hex address %w", err) } } else { @@ -141,7 +141,7 @@ func NewMsgRegisterERC20Cmd() *cobra.Command { } for _, contract := range args { - if err := cosmosevmtypes.ValidateAddress(contract); err != nil { + if err := utils.ValidateAddress(contract); err != nil { return fmt.Errorf("invalid ERC20 contract address %w", err) } } diff --git a/x/erc20/keeper/grpc_query.go b/x/erc20/keeper/grpc_query.go index bfefaf314..8ca7191df 100644 --- a/x/erc20/keeper/grpc_query.go +++ b/x/erc20/keeper/grpc_query.go @@ -6,7 +6,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - cosmosevmtypes "github.com/cosmos/evm/utils" + "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/erc20/types" "cosmossdk.io/store/prefix" @@ -55,7 +55,7 @@ func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) ( // check if the token is a hex address, if not, check if it is a valid SDK // denom - if err := cosmosevmtypes.ValidateAddress(req.Token); err != nil { + if err := utils.ValidateAddress(req.Token); err != nil { if err := sdk.ValidateDenom(req.Token); err != nil { return nil, status.Errorf( codes.InvalidArgument, diff --git a/x/erc20/types/proposal.go b/x/erc20/types/proposal.go index 78d1a4b26..7f3f97a88 100644 --- a/x/erc20/types/proposal.go +++ b/x/erc20/types/proposal.go @@ -5,7 +5,7 @@ import ( "fmt" "strings" - cosmosevmtypes "github.com/cosmos/evm/utils" + "github.com/cosmos/evm/utils" errorsmod "cosmossdk.io/errors" @@ -53,7 +53,7 @@ func ValidateErc20Denom(denom string) error { if len(trimmed) == 0 { return fmt.Errorf("invalid denom (given: %s): missing address after prefix %s", denom, Erc20NativeCoinDenomPrefix) } - return cosmosevmtypes.ValidateAddress(trimmed) + return utils.ValidateAddress(trimmed) } return fmt.Errorf("invalid denom (given: %s): denomination should be prefixed with %s", denom, Erc20NativeCoinDenomPrefix) @@ -79,7 +79,7 @@ func (*RegisterERC20Proposal) ProposalType() string { // ValidateBasic performs a stateless check of the proposal fields func (rtbp *RegisterERC20Proposal) ValidateBasic() error { for _, address := range rtbp.Erc20Addresses { - if err := cosmosevmtypes.ValidateAddress(address); err != nil { + if err := utils.ValidateAddress(address); err != nil { return errorsmod.Wrap(err, "ERC20 address") } } @@ -108,7 +108,7 @@ func (*ToggleTokenConversionProposal) ProposalType() string { func (ttcp *ToggleTokenConversionProposal) ValidateBasic() error { // check if the token is a hex address, if not, check if it is a valid SDK // denom - if err := cosmosevmtypes.ValidateAddress(ttcp.Token); err != nil { + if err := utils.ValidateAddress(ttcp.Token); err != nil { if err := sdk.ValidateDenom(ttcp.Token); err != nil { return err } diff --git a/x/ibc/callbacks/keeper/keeper.go b/x/ibc/callbacks/keeper/keeper.go index a501e4d1d..a19f45e3f 100644 --- a/x/ibc/callbacks/keeper/keeper.go +++ b/x/ibc/callbacks/keeper/keeper.go @@ -12,7 +12,7 @@ import ( erc20types "github.com/cosmos/evm/x/erc20/types" "github.com/cosmos/evm/x/ibc/callbacks/types" evmante "github.com/cosmos/evm/x/vm/ante" - types2 "github.com/cosmos/evm/x/vm/types" + evmtypes "github.com/cosmos/evm/x/vm/types" callbacktypes "github.com/cosmos/ibc-go/v10/modules/apps/callbacks/types" transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" @@ -128,7 +128,7 @@ func (k ContractKeeper) IBCReceivePacketCallback( // with the gas retrieved from the EVM message result. cachedCtx, writeFn := ctx.CacheContext() cachedCtx = evmante.BuildEvmExecutionCtx(cachedCtx). - WithGasMeter(types2.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit)) + WithGasMeter(evmtypes.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit)) // receiver := sdk.MustAccAddressFromBech32(data.Receiver) receiver, err := sdk.AccAddressFromBech32(data.Receiver) @@ -297,7 +297,7 @@ func (k ContractKeeper) IBCOnAcknowledgementPacketCallback( // with the gas retrieved from the EVM message result. cachedCtx, writeFn := ctx.CacheContext() cachedCtx = evmante.BuildEvmExecutionCtx(cachedCtx). - WithGasMeter(types2.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit)) + WithGasMeter(evmtypes.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit)) if len(cbData.Calldata) != 0 { return errorsmod.Wrap(types.ErrInvalidCalldata, "acknowledgement callback data should not contain calldata") @@ -398,7 +398,7 @@ func (k ContractKeeper) IBCOnTimeoutPacketCallback( // with the gas retrieved from the EVM message result. cachedCtx, writeFn := ctx.CacheContext() cachedCtx = evmante.BuildEvmExecutionCtx(cachedCtx). - WithGasMeter(types2.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit)) + WithGasMeter(evmtypes.NewInfiniteGasMeterWithLimit(cbData.CommitGasLimit)) if len(cbData.Calldata) != 0 { return errorsmod.Wrap(types.ErrInvalidCalldata, "timeout callback data should not contain calldata") diff --git a/x/vm/keeper/grpc_query.go b/x/vm/keeper/grpc_query.go index ef9b99dd1..f1a7be3b6 100644 --- a/x/vm/keeper/grpc_query.go +++ b/x/vm/keeper/grpc_query.go @@ -22,7 +22,7 @@ import ( tmproto "github.com/cometbft/cometbft/proto/tendermint/types" rpctypes "github.com/cosmos/evm/rpc/types" - cosmosevmtypes "github.com/cosmos/evm/utils" + "github.com/cosmos/evm/utils" evmante "github.com/cosmos/evm/x/vm/ante" "github.com/cosmos/evm/x/vm/statedb" "github.com/cosmos/evm/x/vm/types" @@ -51,7 +51,7 @@ func (k Keeper) Account(c context.Context, req *types.QueryAccountRequest) (*typ return nil, status.Error(codes.InvalidArgument, "empty request") } - if err := cosmosevmtypes.ValidateAddress(req.Address); err != nil { + if err := utils.ValidateAddress(req.Address); err != nil { return nil, status.Error( codes.InvalidArgument, err.Error(), ) @@ -74,7 +74,7 @@ func (k Keeper) CosmosAccount(c context.Context, req *types.QueryCosmosAccountRe return nil, status.Error(codes.InvalidArgument, "empty request") } - if err := cosmosevmtypes.ValidateAddress(req.Address); err != nil { + if err := utils.ValidateAddress(req.Address); err != nil { return nil, status.Error( codes.InvalidArgument, err.Error(), ) @@ -144,7 +144,7 @@ func (k Keeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*typ return nil, status.Error(codes.InvalidArgument, "empty request") } - if err := cosmosevmtypes.ValidateAddress(req.Address); err != nil { + if err := utils.ValidateAddress(req.Address); err != nil { return nil, status.Error( codes.InvalidArgument, types.ErrZeroAddress.Error(), @@ -166,7 +166,7 @@ func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*typ return nil, status.Error(codes.InvalidArgument, "empty request") } - if err := cosmosevmtypes.ValidateAddress(req.Address); err != nil { + if err := utils.ValidateAddress(req.Address); err != nil { return nil, status.Error( codes.InvalidArgument, types.ErrZeroAddress.Error(), @@ -192,7 +192,7 @@ func (k Keeper) Code(c context.Context, req *types.QueryCodeRequest) (*types.Que return nil, status.Error(codes.InvalidArgument, "empty request") } - if err := cosmosevmtypes.ValidateAddress(req.Address); err != nil { + if err := utils.ValidateAddress(req.Address); err != nil { return nil, status.Error( codes.InvalidArgument, types.ErrZeroAddress.Error(), diff --git a/x/vm/keeper/state_transition.go b/x/vm/keeper/state_transition.go index 6921d129a..eb8975cf2 100644 --- a/x/vm/keeper/state_transition.go +++ b/x/vm/keeper/state_transition.go @@ -14,7 +14,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" - types2 "github.com/cosmos/evm/ante/types" + antetypes "github.com/cosmos/evm/ante/types" rpctypes "github.com/cosmos/evm/rpc/types" "github.com/cosmos/evm/utils" "github.com/cosmos/evm/x/vm/statedb" @@ -47,7 +47,7 @@ func (k *Keeper) NewEVMWithOverridePrecompiles( Transfer: core.Transfer, GetHash: k.GetHashFn(ctx), Coinbase: cfg.CoinBase, - GasLimit: types2.BlockGasLimit(ctx), + GasLimit: antetypes.BlockGasLimit(ctx), BlockNumber: big.NewInt(ctx.BlockHeight()), Time: uint64(ctx.BlockHeader().Time.Unix()), //#nosec G115 -- int overflow is not a concern here Difficulty: big.NewInt(0), // unused. Only required in PoW context diff --git a/x/vm/types/logs.go b/x/vm/types/logs.go index 50073bf0b..7d14f1a4f 100644 --- a/x/vm/types/logs.go +++ b/x/vm/types/logs.go @@ -7,7 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" - cosmosevmtypes "github.com/cosmos/evm/utils" + "github.com/cosmos/evm/utils" ) // NewTransactionLogs creates a new NewTransactionLogs instance. @@ -28,7 +28,7 @@ func NewTransactionLogsFromEth(hash common.Hash, ethlogs []*ethtypes.Log) Transa // Validate performs a basic validation of a GenesisAccount fields. func (tx TransactionLogs) Validate() error { - if cosmosevmtypes.IsEmptyHash(tx.Hash) { + if utils.IsEmptyHash(tx.Hash) { return fmt.Errorf("hash cannot be the empty %s", tx.Hash) } @@ -53,16 +53,16 @@ func (tx TransactionLogs) EthLogs() []*ethtypes.Log { // Validate performs a basic validation of an ethereum Log fields. func (log *Log) Validate() error { - if err := cosmosevmtypes.ValidateAddress(log.Address); err != nil { + if err := utils.ValidateAddress(log.Address); err != nil { return fmt.Errorf("invalid log address %w", err) } - if cosmosevmtypes.IsEmptyHash(log.BlockHash) { + if utils.IsEmptyHash(log.BlockHash) { return fmt.Errorf("block hash cannot be the empty %s", log.BlockHash) } if log.BlockNumber == 0 { return errors.New("block number cannot be zero") } - if cosmosevmtypes.IsEmptyHash(log.TxHash) { + if utils.IsEmptyHash(log.TxHash) { return fmt.Errorf("tx hash cannot be the empty %s", log.TxHash) } return nil From b9b964000f799f60bd9c0860aa6f7523de48a82b Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 13:22:34 -0400 Subject: [PATCH 14/17] Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76b6b6b66..f7524dfb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ - [\#609](https://github.com/cosmos/evm/pull/609) Make `erc20Keeper` optional in the EVM keeper - [\#624](https://github.com/cosmos/evm/pull/624) Cleanup unnecessary `fix-revert-gas-refund-height`. - [\#635](https://github.com/cosmos/evm/pull/635) Move DefaultStaticPrecompiles to /evm and allow projects to set it by default alongside the keeper. +- [\#639](https://github.com/cosmos/evm/pull/639) Remove `/types` and move types into respective folders. - [\#630](https://github.com/cosmos/evm/pull/630) Reduce feemarket parameter loading to minimize memory allocations. - [\#577](https://github.com/cosmos/evm/pull/577) Cleanup precompiles boilerplate code. - [\#648](https://github.com/cosmos/evm/pull/648) Move all `ante` logic such as `NewAnteHandler` from the `evmd` package to `evm/ante` so it can be used as library functions. From a474794951e04b310ea9c6507c5de1ea6f51e146 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 13:25:43 -0400 Subject: [PATCH 15/17] add relevant import changes to migration guide --- .../migrations/v0.4.0_to_v0.5.0_UNRELEASED.md | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md b/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md index 0b4d42ca6..7bb1a791b 100644 --- a/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md +++ b/docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md @@ -24,10 +24,52 @@ go mod tidy For a complete list of changes, refer to [this PR](https://github.com/cosmos/evm/pull/639). The following list includes references within `evmd` that have been moved. -- `Bip44CoinType`, `BIP44HDPath` was moved to `"github.com/cosmos/evm/crypto/hd"` -- `HasDynamicFeeExtensionOption` was moved `"github.com/cosmos/evm/ante/types"` -- `GenesisState` was removed as a duplicate object can be found in the `evmd` folder and a testing version is in `"github.com/cosmos/evm/testutil"` -- `AttoPowerReduction` was moved to `"github.com/cosmos/evm/utils"` +### Summary of import changes in `evmd`: + +**Removed import:** +```diff +- cosmosevmtypes "github.com/cosmos/evm/types" +``` + +**Added imports:** +```diff ++ antetypes "github.com/cosmos/evm/ante/types" ++ evmaddress "github.com/cosmos/evm/encoding/address" ++ "github.com/cosmos/evm/utils" +``` + +### Detailed mapping of moved items: + +- **`AttoPowerReduction`** โ†’ moved to `"github.com/cosmos/evm/utils"` + ```diff + - sdk.DefaultPowerReduction = cosmosevmtypes.AttoPowerReduction + + sdk.DefaultPowerReduction = utils.AttoPowerReduction + ``` + +- **`HasDynamicFeeExtensionOption`** โ†’ moved to `"github.com/cosmos/evm/ante/types"` + ```diff + - ExtensionOptionChecker: cosmosevmtypes.HasDynamicFeeExtensionOption, + + ExtensionOptionChecker: antetypes.HasDynamicFeeExtensionOption, + ``` + +- **Address Codec functions** โ†’ new package `"github.com/cosmos/evm/encoding/address"` + + Use `evmaddress.NewEvmCodec()` for address codec initialization: + ```go + app.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, + runtime.NewKVStoreService(keys[authtypes.StoreKey]), + authtypes.ProtoBaseAccount, + evmconfig.GetMaccPerms(), + evmaddress.NewEvmCodec(sdk.GetConfig().GetBech32AccountAddrPrefix()), + sdk.GetConfig().GetBech32AccountAddrPrefix(), + authAddr, + ) + ``` + +- **`Bip44CoinType`, `BIP44HDPath`** โ†’ moved to `"github.com/cosmos/evm/crypto/hd"` + +- **`GenesisState`** โ†’ removed as a duplicate object can be found in the `evmd` folder and a testing version is in `"github.com/cosmos/evm/testutil"` --- From ea7798fa068abfa509d06f4dee915aa8acc15e8a Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 14:43:04 -0400 Subject: [PATCH 16/17] proto changes --- ante/types/dynamic_fee.pb.go | 45 ++-- .../{types => ante}/v1/dynamic_fee.pulsar.go | 158 +++++------ .../evm/{types => eip712}/v1/web3.pulsar.go | 199 +++++++------- .../{types => server}/v1/indexer.pulsar.go | 254 +++++++++--------- ethereum/eip712/web3.pb.go | 50 ++-- .../evm/{types => ante}/v1/dynamic_fee.proto | 2 +- .../evm/{types => eip712}/v1/web3.proto | 2 +- .../evm/{types => server}/v1/indexer.proto | 2 +- server/types/indexer.pb.go | 50 ++-- 9 files changed, 382 insertions(+), 380 deletions(-) rename api/cosmos/evm/{types => ante}/v1/dynamic_fee.pulsar.go (73%) rename api/cosmos/evm/{types => eip712}/v1/web3.pulsar.go (73%) rename api/cosmos/evm/{types => server}/v1/indexer.pulsar.go (74%) rename proto/cosmos/evm/{types => ante}/v1/dynamic_fee.proto (94%) rename proto/cosmos/evm/{types => eip712}/v1/web3.proto (97%) rename proto/cosmos/evm/{types => server}/v1/indexer.proto (97%) diff --git a/ante/types/dynamic_fee.pb.go b/ante/types/dynamic_fee.pb.go index 479792fef..f1c499c06 100644 --- a/ante/types/dynamic_fee.pb.go +++ b/ante/types/dynamic_fee.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/types/v1/dynamic_fee.proto +// source: cosmos/evm/ante/v1/dynamic_fee.proto package types @@ -37,7 +37,7 @@ func (m *ExtensionOptionDynamicFeeTx) Reset() { *m = ExtensionOptionDyna func (m *ExtensionOptionDynamicFeeTx) String() string { return proto.CompactTextString(m) } func (*ExtensionOptionDynamicFeeTx) ProtoMessage() {} func (*ExtensionOptionDynamicFeeTx) Descriptor() ([]byte, []int) { - return fileDescriptor_3385bb4614fa656c, []int{0} + return fileDescriptor_057a31d9192a8080, []int{0} } func (m *ExtensionOptionDynamicFeeTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -67,32 +67,31 @@ func (m *ExtensionOptionDynamicFeeTx) XXX_DiscardUnknown() { var xxx_messageInfo_ExtensionOptionDynamicFeeTx proto.InternalMessageInfo func init() { - proto.RegisterType((*ExtensionOptionDynamicFeeTx)(nil), "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx") + proto.RegisterType((*ExtensionOptionDynamicFeeTx)(nil), "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx") } func init() { - proto.RegisterFile("cosmos/evm/types/v1/dynamic_fee.proto", fileDescriptor_3385bb4614fa656c) + proto.RegisterFile("cosmos/evm/ante/v1/dynamic_fee.proto", fileDescriptor_057a31d9192a8080) } -var fileDescriptor_3385bb4614fa656c = []byte{ - // 259 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x33, 0xd4, - 0x4f, 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x8e, 0x4f, 0x4b, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x12, 0x86, 0x28, 0xd3, 0x4b, 0x2d, 0xcb, 0xd5, 0x03, 0x2b, 0xd3, 0x2b, 0x33, 0x94, - 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x75, 0x52, 0x22, 0xe9, 0xf9, 0xe9, - 0xf9, 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0x2a, 0xe5, 0x92, 0x76, 0xad, 0x28, 0x49, 0xcd, - 0x2b, 0xce, 0xcc, 0xcf, 0xf3, 0x2f, 0x28, 0xc9, 0xcc, 0xcf, 0x73, 0x81, 0xd8, 0xe0, 0x96, 0x9a, - 0x1a, 0x52, 0x21, 0x14, 0xc6, 0x25, 0x94, 0x9b, 0x58, 0x11, 0x5f, 0x50, 0x94, 0x99, 0x5f, 0x94, - 0x59, 0x52, 0x09, 0x62, 0x24, 0xa7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x69, 0x9c, 0xb8, - 0x27, 0xcf, 0x70, 0xeb, 0x9e, 0xbc, 0x34, 0xc4, 0x01, 0xc5, 0x29, 0xd9, 0x7a, 0x99, 0xf9, 0xfa, - 0xb9, 0x89, 0x25, 0x19, 0x7a, 0x3e, 0xa9, 0xe9, 0x89, 0xc9, 0x95, 0x2e, 0xa9, 0xc9, 0x2b, 0x9e, - 0x6f, 0xd0, 0x62, 0x0c, 0x12, 0xc8, 0x4d, 0xac, 0x08, 0x80, 0x1a, 0x11, 0x00, 0x32, 0xc1, 0xc9, - 0xea, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, - 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x14, 0xd2, 0x33, 0x4b, 0x32, - 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x91, 0x02, 0x20, 0x31, 0xaf, 0x24, 0x15, 0x12, 0x0a, - 0x49, 0x6c, 0x60, 0x97, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x7a, 0xae, 0x40, 0x20, - 0x01, 0x00, 0x00, +var fileDescriptor_057a31d9192a8080 = []byte{ + // 256 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0xd5, 0x4f, 0xcc, 0x2b, 0x49, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, + 0xa9, 0xcc, 0x4b, 0xcc, 0xcd, 0x4c, 0x8e, 0x4f, 0x4b, 0x4d, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0x82, 0xa8, 0xd2, 0x4b, 0x2d, 0xcb, 0xd5, 0x03, 0xa9, 0xd2, 0x2b, 0x33, 0x94, 0x12, + 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, 0x65, 0x52, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, + 0x60, 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0x2a, 0xe5, 0x92, 0x76, 0xad, 0x28, 0x49, 0xcd, 0x2b, + 0xce, 0xcc, 0xcf, 0xf3, 0x2f, 0x28, 0xc9, 0xcc, 0xcf, 0x73, 0x81, 0x58, 0xe0, 0x96, 0x9a, 0x1a, + 0x52, 0x21, 0x14, 0xc6, 0x25, 0x94, 0x9b, 0x58, 0x11, 0x5f, 0x50, 0x94, 0x99, 0x5f, 0x94, 0x59, + 0x52, 0x09, 0x62, 0x24, 0xa7, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0x69, 0x9c, 0xb8, 0x27, + 0xcf, 0x70, 0xeb, 0x9e, 0xbc, 0x34, 0xc4, 0xfe, 0xe2, 0x94, 0x6c, 0xbd, 0xcc, 0x7c, 0xfd, 0xdc, + 0xc4, 0x92, 0x0c, 0x3d, 0x9f, 0xd4, 0xf4, 0xc4, 0xe4, 0x4a, 0x97, 0xd4, 0xe4, 0x15, 0xcf, 0x37, + 0x68, 0x31, 0x06, 0x09, 0xe4, 0x26, 0x56, 0x04, 0x40, 0x8d, 0x08, 0x00, 0x99, 0xe0, 0x64, 0x75, + 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, + 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x0a, 0xe9, 0x99, 0x25, 0x19, 0xa5, + 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe8, 0xde, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, + 0xbb, 0xdc, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xac, 0x66, 0x4c, 0xd0, 0x1e, 0x01, 0x00, 0x00, } func (m *ExtensionOptionDynamicFeeTx) Marshal() (dAtA []byte, err error) { diff --git a/api/cosmos/evm/types/v1/dynamic_fee.pulsar.go b/api/cosmos/evm/ante/v1/dynamic_fee.pulsar.go similarity index 73% rename from api/cosmos/evm/types/v1/dynamic_fee.pulsar.go rename to api/cosmos/evm/ante/v1/dynamic_fee.pulsar.go index e4408114e..8a4eb6eb8 100644 --- a/api/cosmos/evm/types/v1/dynamic_fee.pulsar.go +++ b/api/cosmos/evm/ante/v1/dynamic_fee.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package typesv1 +package antev1 import ( _ "cosmossdk.io/api/amino" @@ -20,8 +20,8 @@ var ( ) func init() { - file_cosmos_evm_types_v1_dynamic_fee_proto_init() - md_ExtensionOptionDynamicFeeTx = File_cosmos_evm_types_v1_dynamic_fee_proto.Messages().ByName("ExtensionOptionDynamicFeeTx") + file_cosmos_evm_ante_v1_dynamic_fee_proto_init() + md_ExtensionOptionDynamicFeeTx = File_cosmos_evm_ante_v1_dynamic_fee_proto.Messages().ByName("ExtensionOptionDynamicFeeTx") fd_ExtensionOptionDynamicFeeTx_max_priority_price = md_ExtensionOptionDynamicFeeTx.Fields().ByName("max_priority_price") } @@ -34,7 +34,7 @@ func (x *ExtensionOptionDynamicFeeTx) ProtoReflect() protoreflect.Message { } func (x *ExtensionOptionDynamicFeeTx) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_types_v1_dynamic_fee_proto_msgTypes[0] + mi := &file_cosmos_evm_ante_v1_dynamic_fee_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -111,13 +111,13 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) Range(f func(protoreflect.F // a repeated field is populated if it is non-empty. func (x *fastReflection_ExtensionOptionDynamicFeeTx) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + case "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx.max_priority_price": return x.MaxPriorityPrice != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) } } @@ -129,13 +129,13 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) Has(fd protoreflect.FieldDe // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_ExtensionOptionDynamicFeeTx) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + case "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx.max_priority_price": x.MaxPriorityPrice = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) } } @@ -147,14 +147,14 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) Clear(fd protoreflect.Field // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_ExtensionOptionDynamicFeeTx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + case "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx.max_priority_price": value := x.MaxPriorityPrice return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx does not contain field %s", descriptor.FullName())) } } @@ -170,13 +170,13 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) Get(descriptor protoreflect // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_ExtensionOptionDynamicFeeTx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + case "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx.max_priority_price": x.MaxPriorityPrice = value.Interface().(string) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) } } @@ -192,13 +192,13 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) Set(fd protoreflect.FieldDe // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_ExtensionOptionDynamicFeeTx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": - panic(fmt.Errorf("field max_priority_price of message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx is not mutable")) + case "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + panic(fmt.Errorf("field max_priority_price of message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) } } @@ -207,13 +207,13 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) Mutable(fd protoreflect.Fie // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_ExtensionOptionDynamicFeeTx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx.max_priority_price": + case "cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx.max_priority_price": return protoreflect.ValueOfString("") default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx does not contain field %s", fd.FullName())) } } @@ -223,7 +223,7 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) NewField(fd protoreflect.Fi func (x *fastReflection_ExtensionOptionDynamicFeeTx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx", d.FullName())) } panic("unreachable") } @@ -438,7 +438,7 @@ func (x *fastReflection_ExtensionOptionDynamicFeeTx) ProtoMethods() *protoiface. // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/evm/types/v1/dynamic_fee.proto +// source: cosmos/evm/ante/v1/dynamic_fee.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -462,7 +462,7 @@ type ExtensionOptionDynamicFeeTx struct { func (x *ExtensionOptionDynamicFeeTx) Reset() { *x = ExtensionOptionDynamicFeeTx{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_types_v1_dynamic_fee_proto_msgTypes[0] + mi := &file_cosmos_evm_ante_v1_dynamic_fee_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -476,7 +476,7 @@ func (*ExtensionOptionDynamicFeeTx) ProtoMessage() {} // Deprecated: Use ExtensionOptionDynamicFeeTx.ProtoReflect.Descriptor instead. func (*ExtensionOptionDynamicFeeTx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescGZIP(), []int{0} + return file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescGZIP(), []int{0} } func (x *ExtensionOptionDynamicFeeTx) GetMaxPriorityPrice() string { @@ -486,55 +486,55 @@ func (x *ExtensionOptionDynamicFeeTx) GetMaxPriorityPrice() string { return "" } -var File_cosmos_evm_types_v1_dynamic_fee_proto protoreflect.FileDescriptor - -var file_cosmos_evm_types_v1_dynamic_fee_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x66, 0x65, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x65, 0x76, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x75, 0x0a, 0x1b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, - 0x65, 0x65, 0x54, 0x78, 0x12, 0x56, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x6f, - 0x72, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x28, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x50, - 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0xc7, 0x01, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, - 0x63, 0x46, 0x65, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, - 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x54, 0xaa, - 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, - 0x76, 0x6d, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_evm_ante_v1_dynamic_fee_proto protoreflect.FileDescriptor + +var file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDesc = []byte{ + 0x0a, 0x24, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x61, 0x6e, 0x74, + 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x5f, 0x66, 0x65, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, + 0x76, 0x6d, 0x2e, 0x61, 0x6e, 0x74, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, + 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, + 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x75, 0x0a, 0x1b, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x65, 0x65, + 0x54, 0x78, 0x12, 0x56, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, + 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, + 0x44, 0x65, 0x63, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x50, 0x72, 0x69, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0xc0, 0x01, 0x0a, 0x16, 0x63, + 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x61, 0x6e, + 0x74, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x46, 0x65, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x61, 0x6e, 0x74, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x6e, + 0x74, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x41, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x41, 0x6e, 0x74, 0x65, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x41, 0x6e, 0x74, + 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, + 0x6d, 0x5c, 0x41, 0x6e, 0x74, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x41, 0x6e, 0x74, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescOnce sync.Once - file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescData = file_cosmos_evm_types_v1_dynamic_fee_proto_rawDesc + file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescOnce sync.Once + file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescData = file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDesc ) -func file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescGZIP() []byte { - file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescOnce.Do(func() { - file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescData) +func file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescGZIP() []byte { + file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescOnce.Do(func() { + file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescData) }) - return file_cosmos_evm_types_v1_dynamic_fee_proto_rawDescData + return file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDescData } -var file_cosmos_evm_types_v1_dynamic_fee_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_evm_types_v1_dynamic_fee_proto_goTypes = []interface{}{ - (*ExtensionOptionDynamicFeeTx)(nil), // 0: cosmos.evm.types.v1.ExtensionOptionDynamicFeeTx +var file_cosmos_evm_ante_v1_dynamic_fee_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_evm_ante_v1_dynamic_fee_proto_goTypes = []interface{}{ + (*ExtensionOptionDynamicFeeTx)(nil), // 0: cosmos.evm.ante.v1.ExtensionOptionDynamicFeeTx } -var file_cosmos_evm_types_v1_dynamic_fee_proto_depIdxs = []int32{ +var file_cosmos_evm_ante_v1_dynamic_fee_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -542,13 +542,13 @@ var file_cosmos_evm_types_v1_dynamic_fee_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_cosmos_evm_types_v1_dynamic_fee_proto_init() } -func file_cosmos_evm_types_v1_dynamic_fee_proto_init() { - if File_cosmos_evm_types_v1_dynamic_fee_proto != nil { +func init() { file_cosmos_evm_ante_v1_dynamic_fee_proto_init() } +func file_cosmos_evm_ante_v1_dynamic_fee_proto_init() { + if File_cosmos_evm_ante_v1_dynamic_fee_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_evm_types_v1_dynamic_fee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_ante_v1_dynamic_fee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionOptionDynamicFeeTx); i { case 0: return &v.state @@ -565,18 +565,18 @@ func file_cosmos_evm_types_v1_dynamic_fee_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_evm_types_v1_dynamic_fee_proto_rawDesc, + RawDescriptor: file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_evm_types_v1_dynamic_fee_proto_goTypes, - DependencyIndexes: file_cosmos_evm_types_v1_dynamic_fee_proto_depIdxs, - MessageInfos: file_cosmos_evm_types_v1_dynamic_fee_proto_msgTypes, + GoTypes: file_cosmos_evm_ante_v1_dynamic_fee_proto_goTypes, + DependencyIndexes: file_cosmos_evm_ante_v1_dynamic_fee_proto_depIdxs, + MessageInfos: file_cosmos_evm_ante_v1_dynamic_fee_proto_msgTypes, }.Build() - File_cosmos_evm_types_v1_dynamic_fee_proto = out.File - file_cosmos_evm_types_v1_dynamic_fee_proto_rawDesc = nil - file_cosmos_evm_types_v1_dynamic_fee_proto_goTypes = nil - file_cosmos_evm_types_v1_dynamic_fee_proto_depIdxs = nil + File_cosmos_evm_ante_v1_dynamic_fee_proto = out.File + file_cosmos_evm_ante_v1_dynamic_fee_proto_rawDesc = nil + file_cosmos_evm_ante_v1_dynamic_fee_proto_goTypes = nil + file_cosmos_evm_ante_v1_dynamic_fee_proto_depIdxs = nil } diff --git a/api/cosmos/evm/types/v1/web3.pulsar.go b/api/cosmos/evm/eip712/v1/web3.pulsar.go similarity index 73% rename from api/cosmos/evm/types/v1/web3.pulsar.go rename to api/cosmos/evm/eip712/v1/web3.pulsar.go index c56141069..2c0ef3604 100644 --- a/api/cosmos/evm/types/v1/web3.pulsar.go +++ b/api/cosmos/evm/eip712/v1/web3.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package typesv1 +package eip712v1 import ( fmt "fmt" @@ -21,8 +21,8 @@ var ( ) func init() { - file_cosmos_evm_types_v1_web3_proto_init() - md_ExtensionOptionsWeb3Tx = File_cosmos_evm_types_v1_web3_proto.Messages().ByName("ExtensionOptionsWeb3Tx") + file_cosmos_evm_eip712_v1_web3_proto_init() + md_ExtensionOptionsWeb3Tx = File_cosmos_evm_eip712_v1_web3_proto.Messages().ByName("ExtensionOptionsWeb3Tx") fd_ExtensionOptionsWeb3Tx_typed_data_chain_id = md_ExtensionOptionsWeb3Tx.Fields().ByName("typed_data_chain_id") fd_ExtensionOptionsWeb3Tx_fee_payer = md_ExtensionOptionsWeb3Tx.Fields().ByName("fee_payer") fd_ExtensionOptionsWeb3Tx_fee_payer_sig = md_ExtensionOptionsWeb3Tx.Fields().ByName("fee_payer_sig") @@ -37,7 +37,7 @@ func (x *ExtensionOptionsWeb3Tx) ProtoReflect() protoreflect.Message { } func (x *ExtensionOptionsWeb3Tx) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_types_v1_web3_proto_msgTypes[0] + mi := &file_cosmos_evm_eip712_v1_web3_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -126,17 +126,17 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) Range(f func(protoreflect.FieldD // a repeated field is populated if it is non-empty. func (x *fastReflection_ExtensionOptionsWeb3Tx) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": return x.TypedDataChainId != uint64(0) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer": return x.FeePayer != "" - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": return len(x.FeePayerSig) != 0 default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) } } @@ -148,17 +148,17 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) Has(fd protoreflect.FieldDescrip // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_ExtensionOptionsWeb3Tx) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": x.TypedDataChainId = uint64(0) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer": x.FeePayer = "" - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": x.FeePayerSig = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) } } @@ -170,20 +170,20 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) Clear(fd protoreflect.FieldDescr // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_ExtensionOptionsWeb3Tx) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": value := x.TypedDataChainId return protoreflect.ValueOfUint64(value) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer": value := x.FeePayer return protoreflect.ValueOfString(value) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": value := x.FeePayerSig return protoreflect.ValueOfBytes(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx does not contain field %s", descriptor.FullName())) } } @@ -199,17 +199,17 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) Get(descriptor protoreflect.Fiel // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_ExtensionOptionsWeb3Tx) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": x.TypedDataChainId = value.Uint() - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer": x.FeePayer = value.Interface().(string) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": x.FeePayerSig = value.Bytes() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) } } @@ -225,17 +225,17 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) Set(fd protoreflect.FieldDescrip // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_ExtensionOptionsWeb3Tx) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": - panic(fmt.Errorf("field typed_data_chain_id of message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx is not mutable")) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer": - panic(fmt.Errorf("field fee_payer of message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx is not mutable")) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": - panic(fmt.Errorf("field fee_payer_sig of message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx is not mutable")) + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + panic(fmt.Errorf("field typed_data_chain_id of message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx is not mutable")) + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer": + panic(fmt.Errorf("field fee_payer of message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx is not mutable")) + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + panic(fmt.Errorf("field fee_payer_sig of message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) } } @@ -244,17 +244,17 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) Mutable(fd protoreflect.FieldDes // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_ExtensionOptionsWeb3Tx) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.typed_data_chain_id": return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer": return protoreflect.ValueOfString("") - case "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": + case "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx.fee_payer_sig": return protoreflect.ValueOfBytes(nil) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx does not contain field %s", fd.FullName())) } } @@ -264,7 +264,7 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) NewField(fd protoreflect.FieldDe func (x *fastReflection_ExtensionOptionsWeb3Tx) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.types.v1.ExtensionOptionsWeb3Tx", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx", d.FullName())) } panic("unreachable") } @@ -551,7 +551,7 @@ func (x *fastReflection_ExtensionOptionsWeb3Tx) ProtoMethods() *protoiface.Metho // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/evm/types/v1/web3.proto +// source: cosmos/evm/eip712/v1/web3.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -581,7 +581,7 @@ type ExtensionOptionsWeb3Tx struct { func (x *ExtensionOptionsWeb3Tx) Reset() { *x = ExtensionOptionsWeb3Tx{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_types_v1_web3_proto_msgTypes[0] + mi := &file_cosmos_evm_eip712_v1_web3_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -595,7 +595,7 @@ func (*ExtensionOptionsWeb3Tx) ProtoMessage() {} // Deprecated: Use ExtensionOptionsWeb3Tx.ProtoReflect.Descriptor instead. func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int) { - return file_cosmos_evm_types_v1_web3_proto_rawDescGZIP(), []int{0} + return file_cosmos_evm_eip712_v1_web3_proto_rawDescGZIP(), []int{0} } func (x *ExtensionOptionsWeb3Tx) GetTypedDataChainId() uint64 { @@ -619,61 +619,62 @@ func (x *ExtensionOptionsWeb3Tx) GetFeePayerSig() []byte { return nil } -var File_cosmos_evm_types_v1_web3_proto protoreflect.FileDescriptor - -var file_cosmos_evm_types_v1_web3_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x65, 0x62, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x01, 0x0a, 0x16, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x57, 0x65, 0x62, 0x33, 0x54, 0x78, 0x12, 0x61, 0x0a, 0x13, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x42, 0x32, 0xe2, 0xde, 0x1f, 0x10, 0x54, 0x79, 0x70, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x1a, 0x74, 0x79, 0x70, - 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x2c, 0x6f, 0x6d, - 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x10, 0x74, 0x79, 0x70, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x09, 0x66, 0x65, 0x65, - 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, 0xea, 0xde, - 0x1f, 0x12, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, - 0x6d, 0x70, 0x74, 0x79, 0x52, 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x12, 0x3d, - 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x19, 0xea, 0xde, 0x1f, 0x15, 0x66, 0x65, 0x65, 0x50, 0x61, - 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, - 0x52, 0x0b, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x3a, 0x04, 0x88, - 0xa0, 0x1f, 0x00, 0x42, 0xc1, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x42, - 0x09, 0x57, 0x65, 0x62, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, - 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x54, - 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x45, 0x76, 0x6d, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_evm_eip712_v1_web3_proto protoreflect.FileDescriptor + +var file_cosmos_evm_eip712_v1_web3_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x65, 0x69, 0x70, + 0x37, 0x31, 0x32, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x65, 0x62, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x65, 0x69, + 0x70, 0x37, 0x31, 0x32, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x01, + 0x0a, 0x16, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x57, 0x65, 0x62, 0x33, 0x54, 0x78, 0x12, 0x61, 0x0a, 0x13, 0x74, 0x79, 0x70, 0x65, + 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x32, 0xe2, 0xde, 0x1f, 0x10, 0x54, 0x79, 0x70, 0x65, 0x64, + 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0xea, 0xde, 0x1f, 0x1a, 0x74, + 0x79, 0x70, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x44, 0x2c, + 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x10, 0x74, 0x79, 0x70, 0x65, 0x64, + 0x44, 0x61, 0x74, 0x61, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x09, 0x66, + 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x16, + 0xea, 0xde, 0x1f, 0x12, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x2c, 0x6f, 0x6d, 0x69, + 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x08, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, + 0x12, 0x3d, 0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x65, 0x72, 0x5f, 0x73, 0x69, + 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x19, 0xea, 0xde, 0x1f, 0x15, 0x66, 0x65, 0x65, + 0x50, 0x61, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x0b, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x65, 0x72, 0x53, 0x69, 0x67, 0x3a, + 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0xc8, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x65, 0x69, 0x70, 0x37, 0x31, 0x32, 0x2e, + 0x76, 0x31, 0x42, 0x09, 0x57, 0x65, 0x62, 0x33, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x65, 0x69, 0x70, + 0x37, 0x31, 0x32, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x69, 0x70, 0x37, 0x31, 0x32, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x43, 0x45, 0x45, 0xaa, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, + 0x76, 0x6d, 0x2e, 0x45, 0x69, 0x70, 0x37, 0x31, 0x32, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x14, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x45, 0x69, 0x70, 0x37, 0x31, 0x32, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, + 0x5c, 0x45, 0x69, 0x70, 0x37, 0x31, 0x32, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, + 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x45, 0x69, 0x70, 0x37, 0x31, 0x32, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_cosmos_evm_types_v1_web3_proto_rawDescOnce sync.Once - file_cosmos_evm_types_v1_web3_proto_rawDescData = file_cosmos_evm_types_v1_web3_proto_rawDesc + file_cosmos_evm_eip712_v1_web3_proto_rawDescOnce sync.Once + file_cosmos_evm_eip712_v1_web3_proto_rawDescData = file_cosmos_evm_eip712_v1_web3_proto_rawDesc ) -func file_cosmos_evm_types_v1_web3_proto_rawDescGZIP() []byte { - file_cosmos_evm_types_v1_web3_proto_rawDescOnce.Do(func() { - file_cosmos_evm_types_v1_web3_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_types_v1_web3_proto_rawDescData) +func file_cosmos_evm_eip712_v1_web3_proto_rawDescGZIP() []byte { + file_cosmos_evm_eip712_v1_web3_proto_rawDescOnce.Do(func() { + file_cosmos_evm_eip712_v1_web3_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_eip712_v1_web3_proto_rawDescData) }) - return file_cosmos_evm_types_v1_web3_proto_rawDescData + return file_cosmos_evm_eip712_v1_web3_proto_rawDescData } -var file_cosmos_evm_types_v1_web3_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_evm_types_v1_web3_proto_goTypes = []interface{}{ - (*ExtensionOptionsWeb3Tx)(nil), // 0: cosmos.evm.types.v1.ExtensionOptionsWeb3Tx +var file_cosmos_evm_eip712_v1_web3_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_evm_eip712_v1_web3_proto_goTypes = []interface{}{ + (*ExtensionOptionsWeb3Tx)(nil), // 0: cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx } -var file_cosmos_evm_types_v1_web3_proto_depIdxs = []int32{ +var file_cosmos_evm_eip712_v1_web3_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -681,13 +682,13 @@ var file_cosmos_evm_types_v1_web3_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_cosmos_evm_types_v1_web3_proto_init() } -func file_cosmos_evm_types_v1_web3_proto_init() { - if File_cosmos_evm_types_v1_web3_proto != nil { +func init() { file_cosmos_evm_eip712_v1_web3_proto_init() } +func file_cosmos_evm_eip712_v1_web3_proto_init() { + if File_cosmos_evm_eip712_v1_web3_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_evm_types_v1_web3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_eip712_v1_web3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExtensionOptionsWeb3Tx); i { case 0: return &v.state @@ -704,18 +705,18 @@ func file_cosmos_evm_types_v1_web3_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_evm_types_v1_web3_proto_rawDesc, + RawDescriptor: file_cosmos_evm_eip712_v1_web3_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_evm_types_v1_web3_proto_goTypes, - DependencyIndexes: file_cosmos_evm_types_v1_web3_proto_depIdxs, - MessageInfos: file_cosmos_evm_types_v1_web3_proto_msgTypes, + GoTypes: file_cosmos_evm_eip712_v1_web3_proto_goTypes, + DependencyIndexes: file_cosmos_evm_eip712_v1_web3_proto_depIdxs, + MessageInfos: file_cosmos_evm_eip712_v1_web3_proto_msgTypes, }.Build() - File_cosmos_evm_types_v1_web3_proto = out.File - file_cosmos_evm_types_v1_web3_proto_rawDesc = nil - file_cosmos_evm_types_v1_web3_proto_goTypes = nil - file_cosmos_evm_types_v1_web3_proto_depIdxs = nil + File_cosmos_evm_eip712_v1_web3_proto = out.File + file_cosmos_evm_eip712_v1_web3_proto_rawDesc = nil + file_cosmos_evm_eip712_v1_web3_proto_goTypes = nil + file_cosmos_evm_eip712_v1_web3_proto_depIdxs = nil } diff --git a/api/cosmos/evm/types/v1/indexer.pulsar.go b/api/cosmos/evm/server/v1/indexer.pulsar.go similarity index 74% rename from api/cosmos/evm/types/v1/indexer.pulsar.go rename to api/cosmos/evm/server/v1/indexer.pulsar.go index 8a9fe8c83..90362349a 100644 --- a/api/cosmos/evm/types/v1/indexer.pulsar.go +++ b/api/cosmos/evm/server/v1/indexer.pulsar.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-pulsar. DO NOT EDIT. -package typesv1 +package serverv1 import ( fmt "fmt" @@ -25,8 +25,8 @@ var ( ) func init() { - file_cosmos_evm_types_v1_indexer_proto_init() - md_TxResult = File_cosmos_evm_types_v1_indexer_proto.Messages().ByName("TxResult") + file_cosmos_evm_server_v1_indexer_proto_init() + md_TxResult = File_cosmos_evm_server_v1_indexer_proto.Messages().ByName("TxResult") fd_TxResult_height = md_TxResult.Fields().ByName("height") fd_TxResult_tx_index = md_TxResult.Fields().ByName("tx_index") fd_TxResult_msg_index = md_TxResult.Fields().ByName("msg_index") @@ -45,7 +45,7 @@ func (x *TxResult) ProtoReflect() protoreflect.Message { } func (x *TxResult) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_types_v1_indexer_proto_msgTypes[0] + mi := &file_cosmos_evm_server_v1_indexer_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -158,25 +158,25 @@ func (x *fastReflection_TxResult) Range(f func(protoreflect.FieldDescriptor, pro // a repeated field is populated if it is non-empty. func (x *fastReflection_TxResult) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.evm.types.v1.TxResult.height": + case "cosmos.evm.server.v1.TxResult.height": return x.Height != int64(0) - case "cosmos.evm.types.v1.TxResult.tx_index": + case "cosmos.evm.server.v1.TxResult.tx_index": return x.TxIndex != uint32(0) - case "cosmos.evm.types.v1.TxResult.msg_index": + case "cosmos.evm.server.v1.TxResult.msg_index": return x.MsgIndex != uint32(0) - case "cosmos.evm.types.v1.TxResult.eth_tx_index": + case "cosmos.evm.server.v1.TxResult.eth_tx_index": return x.EthTxIndex != int32(0) - case "cosmos.evm.types.v1.TxResult.failed": + case "cosmos.evm.server.v1.TxResult.failed": return x.Failed != false - case "cosmos.evm.types.v1.TxResult.gas_used": + case "cosmos.evm.server.v1.TxResult.gas_used": return x.GasUsed != uint64(0) - case "cosmos.evm.types.v1.TxResult.cumulative_gas_used": + case "cosmos.evm.server.v1.TxResult.cumulative_gas_used": return x.CumulativeGasUsed != uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.TxResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.server.v1.TxResult")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.TxResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.server.v1.TxResult does not contain field %s", fd.FullName())) } } @@ -188,25 +188,25 @@ func (x *fastReflection_TxResult) Has(fd protoreflect.FieldDescriptor) bool { // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TxResult) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.evm.types.v1.TxResult.height": + case "cosmos.evm.server.v1.TxResult.height": x.Height = int64(0) - case "cosmos.evm.types.v1.TxResult.tx_index": + case "cosmos.evm.server.v1.TxResult.tx_index": x.TxIndex = uint32(0) - case "cosmos.evm.types.v1.TxResult.msg_index": + case "cosmos.evm.server.v1.TxResult.msg_index": x.MsgIndex = uint32(0) - case "cosmos.evm.types.v1.TxResult.eth_tx_index": + case "cosmos.evm.server.v1.TxResult.eth_tx_index": x.EthTxIndex = int32(0) - case "cosmos.evm.types.v1.TxResult.failed": + case "cosmos.evm.server.v1.TxResult.failed": x.Failed = false - case "cosmos.evm.types.v1.TxResult.gas_used": + case "cosmos.evm.server.v1.TxResult.gas_used": x.GasUsed = uint64(0) - case "cosmos.evm.types.v1.TxResult.cumulative_gas_used": + case "cosmos.evm.server.v1.TxResult.cumulative_gas_used": x.CumulativeGasUsed = uint64(0) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.TxResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.server.v1.TxResult")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.TxResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.server.v1.TxResult does not contain field %s", fd.FullName())) } } @@ -218,32 +218,32 @@ func (x *fastReflection_TxResult) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_TxResult) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.evm.types.v1.TxResult.height": + case "cosmos.evm.server.v1.TxResult.height": value := x.Height return protoreflect.ValueOfInt64(value) - case "cosmos.evm.types.v1.TxResult.tx_index": + case "cosmos.evm.server.v1.TxResult.tx_index": value := x.TxIndex return protoreflect.ValueOfUint32(value) - case "cosmos.evm.types.v1.TxResult.msg_index": + case "cosmos.evm.server.v1.TxResult.msg_index": value := x.MsgIndex return protoreflect.ValueOfUint32(value) - case "cosmos.evm.types.v1.TxResult.eth_tx_index": + case "cosmos.evm.server.v1.TxResult.eth_tx_index": value := x.EthTxIndex return protoreflect.ValueOfInt32(value) - case "cosmos.evm.types.v1.TxResult.failed": + case "cosmos.evm.server.v1.TxResult.failed": value := x.Failed return protoreflect.ValueOfBool(value) - case "cosmos.evm.types.v1.TxResult.gas_used": + case "cosmos.evm.server.v1.TxResult.gas_used": value := x.GasUsed return protoreflect.ValueOfUint64(value) - case "cosmos.evm.types.v1.TxResult.cumulative_gas_used": + case "cosmos.evm.server.v1.TxResult.cumulative_gas_used": value := x.CumulativeGasUsed return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.TxResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.server.v1.TxResult")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.TxResult does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message cosmos.evm.server.v1.TxResult does not contain field %s", descriptor.FullName())) } } @@ -259,25 +259,25 @@ func (x *fastReflection_TxResult) Get(descriptor protoreflect.FieldDescriptor) p // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TxResult) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.evm.types.v1.TxResult.height": + case "cosmos.evm.server.v1.TxResult.height": x.Height = value.Int() - case "cosmos.evm.types.v1.TxResult.tx_index": + case "cosmos.evm.server.v1.TxResult.tx_index": x.TxIndex = uint32(value.Uint()) - case "cosmos.evm.types.v1.TxResult.msg_index": + case "cosmos.evm.server.v1.TxResult.msg_index": x.MsgIndex = uint32(value.Uint()) - case "cosmos.evm.types.v1.TxResult.eth_tx_index": + case "cosmos.evm.server.v1.TxResult.eth_tx_index": x.EthTxIndex = int32(value.Int()) - case "cosmos.evm.types.v1.TxResult.failed": + case "cosmos.evm.server.v1.TxResult.failed": x.Failed = value.Bool() - case "cosmos.evm.types.v1.TxResult.gas_used": + case "cosmos.evm.server.v1.TxResult.gas_used": x.GasUsed = value.Uint() - case "cosmos.evm.types.v1.TxResult.cumulative_gas_used": + case "cosmos.evm.server.v1.TxResult.cumulative_gas_used": x.CumulativeGasUsed = value.Uint() default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.TxResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.server.v1.TxResult")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.TxResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.server.v1.TxResult does not contain field %s", fd.FullName())) } } @@ -293,25 +293,25 @@ func (x *fastReflection_TxResult) Set(fd protoreflect.FieldDescriptor, value pro // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_TxResult) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.types.v1.TxResult.height": - panic(fmt.Errorf("field height of message cosmos.evm.types.v1.TxResult is not mutable")) - case "cosmos.evm.types.v1.TxResult.tx_index": - panic(fmt.Errorf("field tx_index of message cosmos.evm.types.v1.TxResult is not mutable")) - case "cosmos.evm.types.v1.TxResult.msg_index": - panic(fmt.Errorf("field msg_index of message cosmos.evm.types.v1.TxResult is not mutable")) - case "cosmos.evm.types.v1.TxResult.eth_tx_index": - panic(fmt.Errorf("field eth_tx_index of message cosmos.evm.types.v1.TxResult is not mutable")) - case "cosmos.evm.types.v1.TxResult.failed": - panic(fmt.Errorf("field failed of message cosmos.evm.types.v1.TxResult is not mutable")) - case "cosmos.evm.types.v1.TxResult.gas_used": - panic(fmt.Errorf("field gas_used of message cosmos.evm.types.v1.TxResult is not mutable")) - case "cosmos.evm.types.v1.TxResult.cumulative_gas_used": - panic(fmt.Errorf("field cumulative_gas_used of message cosmos.evm.types.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.height": + panic(fmt.Errorf("field height of message cosmos.evm.server.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.tx_index": + panic(fmt.Errorf("field tx_index of message cosmos.evm.server.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.msg_index": + panic(fmt.Errorf("field msg_index of message cosmos.evm.server.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.eth_tx_index": + panic(fmt.Errorf("field eth_tx_index of message cosmos.evm.server.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.failed": + panic(fmt.Errorf("field failed of message cosmos.evm.server.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.gas_used": + panic(fmt.Errorf("field gas_used of message cosmos.evm.server.v1.TxResult is not mutable")) + case "cosmos.evm.server.v1.TxResult.cumulative_gas_used": + panic(fmt.Errorf("field cumulative_gas_used of message cosmos.evm.server.v1.TxResult is not mutable")) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.TxResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.server.v1.TxResult")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.TxResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.server.v1.TxResult does not contain field %s", fd.FullName())) } } @@ -320,25 +320,25 @@ func (x *fastReflection_TxResult) Mutable(fd protoreflect.FieldDescriptor) proto // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_TxResult) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.evm.types.v1.TxResult.height": + case "cosmos.evm.server.v1.TxResult.height": return protoreflect.ValueOfInt64(int64(0)) - case "cosmos.evm.types.v1.TxResult.tx_index": + case "cosmos.evm.server.v1.TxResult.tx_index": return protoreflect.ValueOfUint32(uint32(0)) - case "cosmos.evm.types.v1.TxResult.msg_index": + case "cosmos.evm.server.v1.TxResult.msg_index": return protoreflect.ValueOfUint32(uint32(0)) - case "cosmos.evm.types.v1.TxResult.eth_tx_index": + case "cosmos.evm.server.v1.TxResult.eth_tx_index": return protoreflect.ValueOfInt32(int32(0)) - case "cosmos.evm.types.v1.TxResult.failed": + case "cosmos.evm.server.v1.TxResult.failed": return protoreflect.ValueOfBool(false) - case "cosmos.evm.types.v1.TxResult.gas_used": + case "cosmos.evm.server.v1.TxResult.gas_used": return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.evm.types.v1.TxResult.cumulative_gas_used": + case "cosmos.evm.server.v1.TxResult.cumulative_gas_used": return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.types.v1.TxResult")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.server.v1.TxResult")) } - panic(fmt.Errorf("message cosmos.evm.types.v1.TxResult does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message cosmos.evm.server.v1.TxResult does not contain field %s", fd.FullName())) } } @@ -348,7 +348,7 @@ func (x *fastReflection_TxResult) NewField(fd protoreflect.FieldDescriptor) prot func (x *fastReflection_TxResult) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.types.v1.TxResult", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.server.v1.TxResult", d.FullName())) } panic("unreachable") } @@ -715,7 +715,7 @@ func (x *fastReflection_TxResult) ProtoMethods() *protoiface.Methods { // versions: // protoc-gen-go v1.27.0 // protoc (unknown) -// source: cosmos/evm/types/v1/indexer.proto +// source: cosmos/evm/server/v1/indexer.proto const ( // Verify that this generated code is sufficiently up-to-date. @@ -752,7 +752,7 @@ type TxResult struct { func (x *TxResult) Reset() { *x = TxResult{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_types_v1_indexer_proto_msgTypes[0] + mi := &file_cosmos_evm_server_v1_indexer_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -766,7 +766,7 @@ func (*TxResult) ProtoMessage() {} // Deprecated: Use TxResult.ProtoReflect.Descriptor instead. func (*TxResult) Descriptor() ([]byte, []int) { - return file_cosmos_evm_types_v1_indexer_proto_rawDescGZIP(), []int{0} + return file_cosmos_evm_server_v1_indexer_proto_rawDescGZIP(), []int{0} } func (x *TxResult) GetHeight() int64 { @@ -818,61 +818,61 @@ func (x *TxResult) GetCumulativeGasUsed() uint64 { return 0 } -var File_cosmos_evm_types_v1_indexer_proto protoreflect.FileDescriptor - -var file_cosmos_evm_types_v1_indexer_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x72, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, - 0x01, 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, 0x65, 0x69, - 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, - 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0c, 0x65, - 0x74, 0x68, 0x5f, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x54, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, - 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, - 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, - 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, - 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x63, - 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, - 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0xc4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x76, 0x31, 0x42, 0x0c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x45, 0x54, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x45, 0x76, 0x6d, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, - 0x54, 0x79, 0x70, 0x65, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, - 0x76, 0x6d, 0x3a, 0x3a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_cosmos_evm_server_v1_indexer_proto protoreflect.FileDescriptor + +var file_cosmos_evm_server_v1_indexer_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x72, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xe5, 0x01, 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6d, 0x73, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x20, 0x0a, + 0x0c, 0x65, 0x74, 0x68, 0x5f, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x65, 0x74, 0x68, 0x54, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, + 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x11, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x73, 0x55, 0x73, + 0x65, 0x64, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x42, 0xcb, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, + 0x76, 0x6d, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x53, 0xaa, 0x02, 0x14, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x20, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x17, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x53, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_cosmos_evm_types_v1_indexer_proto_rawDescOnce sync.Once - file_cosmos_evm_types_v1_indexer_proto_rawDescData = file_cosmos_evm_types_v1_indexer_proto_rawDesc + file_cosmos_evm_server_v1_indexer_proto_rawDescOnce sync.Once + file_cosmos_evm_server_v1_indexer_proto_rawDescData = file_cosmos_evm_server_v1_indexer_proto_rawDesc ) -func file_cosmos_evm_types_v1_indexer_proto_rawDescGZIP() []byte { - file_cosmos_evm_types_v1_indexer_proto_rawDescOnce.Do(func() { - file_cosmos_evm_types_v1_indexer_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_types_v1_indexer_proto_rawDescData) +func file_cosmos_evm_server_v1_indexer_proto_rawDescGZIP() []byte { + file_cosmos_evm_server_v1_indexer_proto_rawDescOnce.Do(func() { + file_cosmos_evm_server_v1_indexer_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_evm_server_v1_indexer_proto_rawDescData) }) - return file_cosmos_evm_types_v1_indexer_proto_rawDescData + return file_cosmos_evm_server_v1_indexer_proto_rawDescData } -var file_cosmos_evm_types_v1_indexer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_cosmos_evm_types_v1_indexer_proto_goTypes = []interface{}{ - (*TxResult)(nil), // 0: cosmos.evm.types.v1.TxResult +var file_cosmos_evm_server_v1_indexer_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cosmos_evm_server_v1_indexer_proto_goTypes = []interface{}{ + (*TxResult)(nil), // 0: cosmos.evm.server.v1.TxResult } -var file_cosmos_evm_types_v1_indexer_proto_depIdxs = []int32{ +var file_cosmos_evm_server_v1_indexer_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name @@ -880,13 +880,13 @@ var file_cosmos_evm_types_v1_indexer_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_cosmos_evm_types_v1_indexer_proto_init() } -func file_cosmos_evm_types_v1_indexer_proto_init() { - if File_cosmos_evm_types_v1_indexer_proto != nil { +func init() { file_cosmos_evm_server_v1_indexer_proto_init() } +func file_cosmos_evm_server_v1_indexer_proto_init() { + if File_cosmos_evm_server_v1_indexer_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_cosmos_evm_types_v1_indexer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_cosmos_evm_server_v1_indexer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TxResult); i { case 0: return &v.state @@ -903,18 +903,18 @@ func file_cosmos_evm_types_v1_indexer_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_cosmos_evm_types_v1_indexer_proto_rawDesc, + RawDescriptor: file_cosmos_evm_server_v1_indexer_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_cosmos_evm_types_v1_indexer_proto_goTypes, - DependencyIndexes: file_cosmos_evm_types_v1_indexer_proto_depIdxs, - MessageInfos: file_cosmos_evm_types_v1_indexer_proto_msgTypes, + GoTypes: file_cosmos_evm_server_v1_indexer_proto_goTypes, + DependencyIndexes: file_cosmos_evm_server_v1_indexer_proto_depIdxs, + MessageInfos: file_cosmos_evm_server_v1_indexer_proto_msgTypes, }.Build() - File_cosmos_evm_types_v1_indexer_proto = out.File - file_cosmos_evm_types_v1_indexer_proto_rawDesc = nil - file_cosmos_evm_types_v1_indexer_proto_goTypes = nil - file_cosmos_evm_types_v1_indexer_proto_depIdxs = nil + File_cosmos_evm_server_v1_indexer_proto = out.File + file_cosmos_evm_server_v1_indexer_proto_rawDesc = nil + file_cosmos_evm_server_v1_indexer_proto_goTypes = nil + file_cosmos_evm_server_v1_indexer_proto_depIdxs = nil } diff --git a/ethereum/eip712/web3.pb.go b/ethereum/eip712/web3.pb.go index 225ae6a4f..1388fe9ee 100644 --- a/ethereum/eip712/web3.pb.go +++ b/ethereum/eip712/web3.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/types/v1/web3.proto +// source: cosmos/evm/eip712/v1/web3.proto package eip712 @@ -41,7 +41,7 @@ func (m *ExtensionOptionsWeb3Tx) Reset() { *m = ExtensionOptionsWeb3Tx{} func (m *ExtensionOptionsWeb3Tx) String() string { return proto.CompactTextString(m) } func (*ExtensionOptionsWeb3Tx) ProtoMessage() {} func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int) { - return fileDescriptor_8a9cacdd2daddb96, []int{0} + return fileDescriptor_1743a56ebcab8cbd, []int{0} } func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -71,33 +71,33 @@ func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown() { var xxx_messageInfo_ExtensionOptionsWeb3Tx proto.InternalMessageInfo func init() { - proto.RegisterType((*ExtensionOptionsWeb3Tx)(nil), "cosmos.evm.types.v1.ExtensionOptionsWeb3Tx") + proto.RegisterType((*ExtensionOptionsWeb3Tx)(nil), "cosmos.evm.eip712.v1.ExtensionOptionsWeb3Tx") } -func init() { proto.RegisterFile("cosmos/evm/types/v1/web3.proto", fileDescriptor_8a9cacdd2daddb96) } +func init() { proto.RegisterFile("cosmos/evm/eip712/v1/web3.proto", fileDescriptor_1743a56ebcab8cbd) } -var fileDescriptor_8a9cacdd2daddb96 = []byte{ - // 313 bytes of a gzipped FileDescriptorProto +var fileDescriptor_1743a56ebcab8cbd = []byte{ + // 311 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0x86, 0x73, 0x5a, 0xc4, 0x46, 0x85, 0x92, 0x6a, 0xa9, 0x1d, 0x2e, 0x45, 0x10, 0x3a, 0x48, - 0x8e, 0x36, 0x83, 0x20, 0x88, 0x10, 0xeb, 0xe0, 0xa4, 0x68, 0x41, 0x70, 0x09, 0x97, 0xe6, 0x6b, - 0x7a, 0xc3, 0xe5, 0x8e, 0xde, 0x35, 0xb6, 0xff, 0xc0, 0xd1, 0x9f, 0xe0, 0xcf, 0x71, 0xec, 0xe8, - 0x14, 0x24, 0xdd, 0xba, 0xbb, 0x4b, 0x52, 0x2a, 0xa1, 0xdb, 0xc7, 0xf3, 0x7c, 0xcf, 0xf2, 0x9a, - 0x78, 0x28, 0x14, 0x17, 0x8a, 0x40, 0xc2, 0x89, 0x9e, 0x4b, 0x50, 0x24, 0xe9, 0x92, 0x37, 0x08, - 0x5c, 0x47, 0x4e, 0x84, 0x16, 0x56, 0x7d, 0xed, 0x1d, 0x48, 0xb8, 0x53, 0x78, 0x27, 0xe9, 0xb6, - 0x8e, 0x23, 0x11, 0x89, 0xc2, 0x93, 0xfc, 0x5a, 0xbf, 0x9e, 0xfd, 0x22, 0xb3, 0x71, 0x37, 0xd3, - 0x10, 0x2b, 0x26, 0xe2, 0x07, 0xa9, 0x99, 0x88, 0xd5, 0x0b, 0x04, 0xee, 0x60, 0x66, 0x51, 0xb3, - 0x9e, 0xc7, 0xa1, 0x1f, 0x52, 0x4d, 0xfd, 0xe1, 0x98, 0xb2, 0xd8, 0x67, 0x61, 0x13, 0xb5, 0x51, - 0xa7, 0xe2, 0xf5, 0xb2, 0xd4, 0xae, 0x0d, 0x72, 0xdd, 0xa7, 0x9a, 0xde, 0xe6, 0xf2, 0xbe, 0xbf, - 0x4a, 0xed, 0x96, 0xde, 0x62, 0x17, 0x82, 0x33, 0x0d, 0x5c, 0xea, 0xf9, 0x53, 0x6d, 0xcb, 0x85, - 0x96, 0x6b, 0x56, 0x47, 0x00, 0xbe, 0xa4, 0x73, 0x98, 0x34, 0x77, 0xda, 0xa8, 0x53, 0xf5, 0x1a, - 0xab, 0xd4, 0xb6, 0x46, 0x00, 0x8f, 0x39, 0x2b, 0xc5, 0xfb, 0x1b, 0x66, 0x5d, 0x9b, 0x47, 0xff, - 0x91, 0xaf, 0x58, 0xd4, 0xdc, 0x6d, 0xa3, 0xce, 0xa1, 0x77, 0xba, 0x4a, 0xed, 0x93, 0xcd, 0xd3, - 0x33, 0x8b, 0x4a, 0xed, 0x41, 0x09, 0x5f, 0x55, 0xde, 0x3f, 0x6d, 0xc3, 0xbb, 0xf9, 0xca, 0x30, - 0x5a, 0x64, 0x18, 0xfd, 0x64, 0x18, 0x7d, 0x2c, 0xb1, 0xb1, 0x58, 0x62, 0xe3, 0x7b, 0x89, 0x8d, - 0xd7, 0xf3, 0x88, 0xe9, 0xf1, 0x34, 0x70, 0x86, 0x82, 0x93, 0xd2, 0xce, 0xa0, 0xc7, 0x30, 0x81, - 0x29, 0x27, 0xc0, 0xe4, 0x65, 0xb7, 0x17, 0xec, 0x15, 0xfb, 0xb9, 0x7f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x6f, 0x5f, 0x74, 0x4e, 0x8c, 0x01, 0x00, 0x00, + 0x1c, 0xc5, 0x73, 0x5a, 0xc4, 0x46, 0x85, 0x12, 0x6b, 0xa9, 0x1d, 0xee, 0x8a, 0x20, 0x74, 0x90, + 0x1c, 0x6d, 0x06, 0x41, 0x10, 0x21, 0xd6, 0xc1, 0x49, 0xd1, 0x82, 0xe0, 0x12, 0x2e, 0xcd, 0xbf, + 0xe9, 0x0d, 0x97, 0x3b, 0x9a, 0x6b, 0x6c, 0xbf, 0x81, 0xa3, 0x1f, 0xc1, 0x8f, 0xe3, 0xd8, 0xd1, + 0x29, 0x48, 0xba, 0x75, 0x77, 0x97, 0xb4, 0x44, 0x42, 0xb7, 0xc7, 0xef, 0xfd, 0xde, 0xf2, 0x4c, + 0x32, 0x94, 0xb1, 0x90, 0x31, 0x85, 0x44, 0x50, 0xe0, 0xea, 0xb2, 0xdb, 0xa3, 0x49, 0x97, 0xbe, + 0x81, 0xef, 0xd8, 0x6a, 0x22, 0xb5, 0xb4, 0xea, 0x1b, 0xc1, 0x86, 0x44, 0xd8, 0x1b, 0xc1, 0x4e, + 0xba, 0xad, 0x7a, 0x28, 0x43, 0xb9, 0x16, 0x68, 0x9e, 0x36, 0xee, 0xd9, 0x2f, 0x32, 0x1b, 0x77, + 0x33, 0x0d, 0x51, 0xcc, 0x65, 0xf4, 0xa0, 0x34, 0x97, 0x51, 0xfc, 0x02, 0xbe, 0x33, 0x98, 0x59, + 0xcc, 0x3c, 0xd6, 0x73, 0x05, 0x81, 0x17, 0x30, 0xcd, 0xbc, 0xe1, 0x98, 0xf1, 0xc8, 0xe3, 0x41, + 0x13, 0xb5, 0x51, 0xa7, 0xe2, 0xf6, 0xb2, 0x94, 0xd4, 0x06, 0x79, 0xdd, 0x67, 0x9a, 0xdd, 0xe6, + 0xe5, 0x7d, 0x7f, 0x95, 0x92, 0x96, 0xde, 0x62, 0x17, 0x52, 0x70, 0x0d, 0x42, 0xe9, 0xf9, 0x53, + 0x6d, 0xab, 0x0b, 0x2c, 0xc7, 0xac, 0x8e, 0x00, 0x3c, 0xc5, 0xe6, 0x30, 0x69, 0xee, 0xb4, 0x51, + 0xa7, 0xea, 0x36, 0x56, 0x29, 0xb1, 0x46, 0x00, 0x8f, 0x39, 0x2b, 0x8d, 0xf7, 0x0b, 0x66, 0x5d, + 0x9b, 0x47, 0xff, 0x23, 0x2f, 0xe6, 0x61, 0x73, 0xb7, 0x8d, 0x3a, 0x87, 0xee, 0xe9, 0x2a, 0x25, + 0x27, 0x85, 0xf4, 0xcc, 0xc3, 0xd2, 0xf6, 0xa0, 0x84, 0xaf, 0x2a, 0xef, 0x9f, 0xc4, 0x70, 0x6f, + 0xbe, 0x32, 0x8c, 0x16, 0x19, 0x46, 0x3f, 0x19, 0x46, 0x1f, 0x4b, 0x6c, 0x2c, 0x96, 0xd8, 0xf8, + 0x5e, 0x62, 0xe3, 0xf5, 0x3c, 0xe4, 0x7a, 0x3c, 0xf5, 0xed, 0xa1, 0x14, 0xb4, 0xfc, 0xb4, 0x1e, + 0xc3, 0x04, 0xa6, 0xc5, 0xe5, 0xfe, 0xde, 0xfa, 0x3f, 0xe7, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x81, + 0x8f, 0x55, 0x3f, 0x8e, 0x01, 0x00, 0x00, } func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error) { diff --git a/proto/cosmos/evm/types/v1/dynamic_fee.proto b/proto/cosmos/evm/ante/v1/dynamic_fee.proto similarity index 94% rename from proto/cosmos/evm/types/v1/dynamic_fee.proto rename to proto/cosmos/evm/ante/v1/dynamic_fee.proto index e4ce481c2..8ed4eeb44 100644 --- a/proto/cosmos/evm/types/v1/dynamic_fee.proto +++ b/proto/cosmos/evm/ante/v1/dynamic_fee.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package cosmos.evm.types.v1; +package cosmos.evm.ante.v1; import "amino/amino.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/cosmos/evm/types/v1/web3.proto b/proto/cosmos/evm/eip712/v1/web3.proto similarity index 97% rename from proto/cosmos/evm/types/v1/web3.proto rename to proto/cosmos/evm/eip712/v1/web3.proto index 98fd97dd8..1636af468 100644 --- a/proto/cosmos/evm/types/v1/web3.proto +++ b/proto/cosmos/evm/eip712/v1/web3.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package cosmos.evm.types.v1; +package cosmos.evm.eip712.v1; import "gogoproto/gogo.proto"; diff --git a/proto/cosmos/evm/types/v1/indexer.proto b/proto/cosmos/evm/server/v1/indexer.proto similarity index 97% rename from proto/cosmos/evm/types/v1/indexer.proto rename to proto/cosmos/evm/server/v1/indexer.proto index 00a657dcf..cb6115be4 100644 --- a/proto/cosmos/evm/types/v1/indexer.proto +++ b/proto/cosmos/evm/server/v1/indexer.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package cosmos.evm.types.v1; +package cosmos.evm.server.v1; import "gogoproto/gogo.proto"; diff --git a/server/types/indexer.pb.go b/server/types/indexer.pb.go index 3a36a31c6..b8f42d0b2 100644 --- a/server/types/indexer.pb.go +++ b/server/types/indexer.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/evm/types/v1/indexer.proto +// source: cosmos/evm/server/v1/indexer.proto package types @@ -48,7 +48,7 @@ func (m *TxResult) Reset() { *m = TxResult{} } func (m *TxResult) String() string { return proto.CompactTextString(m) } func (*TxResult) ProtoMessage() {} func (*TxResult) Descriptor() ([]byte, []int) { - return fileDescriptor_b69626dfe9e578b6, []int{0} + return fileDescriptor_4195a4d4cee0e673, []int{0} } func (m *TxResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,32 +78,34 @@ func (m *TxResult) XXX_DiscardUnknown() { var xxx_messageInfo_TxResult proto.InternalMessageInfo func init() { - proto.RegisterType((*TxResult)(nil), "cosmos.evm.types.v1.TxResult") + proto.RegisterType((*TxResult)(nil), "cosmos.evm.server.v1.TxResult") } -func init() { proto.RegisterFile("cosmos/evm/types/v1/indexer.proto", fileDescriptor_b69626dfe9e578b6) } +func init() { + proto.RegisterFile("cosmos/evm/server/v1/indexer.proto", fileDescriptor_4195a4d4cee0e673) +} -var fileDescriptor_b69626dfe9e578b6 = []byte{ +var fileDescriptor_4195a4d4cee0e673 = []byte{ // 301 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x90, 0xb1, 0x4e, 0xc3, 0x30, - 0x14, 0x45, 0x63, 0xda, 0xa6, 0xc1, 0x82, 0x81, 0x14, 0x55, 0x01, 0xa4, 0x60, 0x3a, 0x65, 0xb2, - 0x55, 0xb1, 0x21, 0x26, 0x16, 0xc4, 0x6a, 0x95, 0x85, 0x25, 0x4a, 0x9b, 0x87, 0x13, 0xa9, 0xc6, - 0x55, 0xec, 0x58, 0xe1, 0x0f, 0x18, 0xf9, 0x04, 0x3e, 0x87, 0xb1, 0x23, 0x23, 0x6a, 0xc5, 0x7f, - 0xa0, 0x3a, 0x51, 0x61, 0x7b, 0x57, 0xe7, 0x3c, 0x5d, 0xe9, 0xe2, 0xab, 0x85, 0xd2, 0x52, 0x69, - 0x06, 0x56, 0x32, 0xf3, 0xba, 0x02, 0xcd, 0xec, 0x94, 0x95, 0x2f, 0x39, 0x34, 0x50, 0xd1, 0x55, - 0xa5, 0x8c, 0x0a, 0x47, 0xad, 0x42, 0xc1, 0x4a, 0xea, 0x14, 0x6a, 0xa7, 0xe7, 0xa7, 0x42, 0x09, - 0xe5, 0x38, 0xdb, 0x5d, 0xad, 0x3a, 0xf9, 0x41, 0x38, 0x98, 0x35, 0x1c, 0x74, 0xbd, 0x34, 0xe1, - 0x18, 0xfb, 0x05, 0x94, 0xa2, 0x30, 0x11, 0x22, 0x28, 0xe9, 0xf1, 0x2e, 0x85, 0x67, 0x38, 0x30, - 0x4d, 0xea, 0x3a, 0xa2, 0x03, 0x82, 0x92, 0x63, 0x3e, 0x34, 0xcd, 0xc3, 0x2e, 0x86, 0x17, 0xf8, - 0x50, 0x6a, 0xd1, 0xb1, 0x9e, 0x63, 0x81, 0xd4, 0xa2, 0x85, 0x04, 0x1f, 0x81, 0x29, 0xd2, 0xfd, - 0x6f, 0x9f, 0xa0, 0x64, 0xc0, 0x31, 0x98, 0x62, 0xd6, 0xbd, 0x8f, 0xb1, 0xff, 0x9c, 0x95, 0x4b, - 0xc8, 0xa3, 0x01, 0x41, 0x49, 0xc0, 0xbb, 0xb4, 0x6b, 0x14, 0x99, 0x4e, 0x6b, 0x0d, 0x79, 0xe4, - 0x13, 0x94, 0xf4, 0xf9, 0x50, 0x64, 0xfa, 0x51, 0x43, 0x1e, 0x52, 0x3c, 0x5a, 0xd4, 0xb2, 0x5e, - 0x66, 0xa6, 0xb4, 0x90, 0xee, 0xad, 0xa1, 0xb3, 0x4e, 0xfe, 0xd0, 0x7d, 0xeb, 0xdf, 0xf4, 0xdf, - 0x3e, 0x2e, 0xbd, 0xbb, 0xdb, 0xcf, 0x4d, 0x8c, 0xd6, 0x9b, 0x18, 0x7d, 0x6f, 0x62, 0xf4, 0xbe, - 0x8d, 0xbd, 0xf5, 0x36, 0xf6, 0xbe, 0xb6, 0xb1, 0xf7, 0x34, 0x11, 0xa5, 0x29, 0xea, 0x39, 0x5d, - 0x28, 0xc9, 0xfe, 0x4d, 0xab, 0xa1, 0xb2, 0x50, 0xb5, 0x0b, 0xcf, 0x7d, 0x37, 0xd6, 0xf5, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x15, 0x69, 0x03, 0x7c, 0x01, 0x00, 0x00, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0xbf, 0x4e, 0xf3, 0x30, + 0x14, 0xc5, 0xe3, 0xaf, 0x6d, 0x9a, 0xcf, 0x82, 0x81, 0x50, 0x55, 0x01, 0x24, 0x63, 0x75, 0xca, + 0x64, 0xab, 0x62, 0x43, 0x4c, 0x2c, 0x88, 0xd5, 0x2a, 0x0b, 0x4b, 0x94, 0x36, 0x17, 0x27, 0x52, + 0x8d, 0xab, 0xd8, 0xb1, 0xc2, 0x1b, 0x30, 0xf2, 0x08, 0x3c, 0x0e, 0x63, 0x47, 0x46, 0xd4, 0x8a, + 0xf7, 0x40, 0xf9, 0xa3, 0x32, 0xb0, 0xdd, 0xa3, 0xdf, 0xef, 0xea, 0x48, 0x07, 0xcf, 0x56, 0xda, + 0x28, 0x6d, 0x38, 0x38, 0xc5, 0x0d, 0x94, 0x0e, 0x4a, 0xee, 0xe6, 0xbc, 0x78, 0xce, 0xa0, 0x86, + 0x92, 0x6d, 0x4a, 0x6d, 0x75, 0x38, 0xe9, 0x1c, 0x06, 0x4e, 0xb1, 0xce, 0x61, 0x6e, 0x7e, 0x3e, + 0x91, 0x5a, 0xea, 0x56, 0xe0, 0xcd, 0xd5, 0xb9, 0xb3, 0x6f, 0x84, 0x83, 0x45, 0x2d, 0xc0, 0x54, + 0x6b, 0x1b, 0x4e, 0xb1, 0x9f, 0x43, 0x21, 0x73, 0x1b, 0x21, 0x8a, 0xe2, 0x81, 0xe8, 0x53, 0x78, + 0x86, 0x03, 0x5b, 0x27, 0x6d, 0x49, 0xf4, 0x8f, 0xa2, 0xf8, 0x58, 0x8c, 0x6d, 0x7d, 0xdf, 0xc4, + 0xf0, 0x02, 0xff, 0x57, 0x46, 0xf6, 0x6c, 0xd0, 0xb2, 0x40, 0x19, 0xd9, 0x41, 0x8a, 0x8f, 0xc0, + 0xe6, 0xc9, 0xe1, 0x77, 0x48, 0x51, 0x3c, 0x12, 0x18, 0x6c, 0xbe, 0xe8, 0xdf, 0xa7, 0xd8, 0x7f, + 0x4a, 0x8b, 0x35, 0x64, 0xd1, 0x88, 0xa2, 0x38, 0x10, 0x7d, 0x6a, 0x1a, 0x65, 0x6a, 0x92, 0xca, + 0x40, 0x16, 0xf9, 0x14, 0xc5, 0x43, 0x31, 0x96, 0xa9, 0x79, 0x30, 0x90, 0x85, 0x0c, 0x9f, 0xae, + 0x2a, 0x55, 0xad, 0x53, 0x5b, 0x38, 0x48, 0x0e, 0xd6, 0xb8, 0xb5, 0x4e, 0x7e, 0xd1, 0x5d, 0xe7, + 0x5f, 0x0f, 0x5f, 0xdf, 0x2f, 0xbd, 0xdb, 0x9b, 0x8f, 0x1d, 0x41, 0xdb, 0x1d, 0x41, 0x5f, 0x3b, + 0x82, 0xde, 0xf6, 0xc4, 0xdb, 0xee, 0x89, 0xf7, 0xb9, 0x27, 0xde, 0xe3, 0x4c, 0x16, 0x36, 0xaf, + 0x96, 0x6c, 0xa5, 0x15, 0xff, 0x3b, 0xae, 0x7d, 0xd9, 0x80, 0x59, 0xfa, 0xed, 0x58, 0x57, 0x3f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x6a, 0x21, 0x97, 0x7e, 0x01, 0x00, 0x00, } func (m *TxResult) Marshal() (dAtA []byte, err error) { From e924dea0b30d13b5bd606835eeb92b950191686f Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 15:25:17 -0400 Subject: [PATCH 17/17] fix comments --- Makefile | 26 +++++++++++++------------- evmd/testutil/eth_setup.go | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 5bd994ea3..96ebe8242 100644 --- a/Makefile +++ b/Makefile @@ -147,15 +147,15 @@ test-race: run-tests test-evmd: ARGS=-timeout=15m test-evmd: - @cd evmd && go test -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(PACKAGES_EVMD) + @cd evmd && go test -race -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(PACKAGES_EVMD) test-unit-cover: ARGS=-timeout=15m -coverprofile=coverage.txt -covermode=atomic test-unit-cover: TEST_PACKAGES=$(PACKAGES_UNIT) test-unit-cover: run-tests @echo "๐Ÿ” Running evm (root) coverage..." - @go test -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage.txt ./... + @go test -race -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage.txt ./... @echo "๐Ÿ” Running evmd coverage..." - @cd evmd && go test -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage_evmd.txt ./... + @cd evmd && go test -race -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage_evmd.txt ./... @echo "๐Ÿ”€ Merging evmd coverage into root coverage..." @tail -n +2 evmd/coverage_evmd.txt >> coverage.txt && rm evmd/coverage_evmd.txt @echo "๐Ÿงน Filtering ignored files from coverage.txt..." @@ -167,15 +167,15 @@ test: test-unit test-all: @echo "๐Ÿ” Running evm module tests..." - @go test -tags=test -mod=readonly -timeout=15m $(PACKAGES_NOSIMULATION) + @go test -race -tags=test -mod=readonly -timeout=15m $(PACKAGES_NOSIMULATION) @echo "๐Ÿ” Running evmd module tests..." - @cd evmd && go test -tags=test -mod=readonly -timeout=15m $(PACKAGES_EVMD) + @cd evmd && go test -race -tags=test -mod=readonly -timeout=15m $(PACKAGES_EVMD) run-tests: ifneq (,$(shell which tparse 2>/dev/null)) - go test -tags=test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse + go test -race -tags=test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse else - go test -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) + go test -race -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) endif # Use the old Apple linker to workaround broken xcode - https://github.com/golang/go/issues/65169 @@ -184,11 +184,11 @@ ifeq ($(OS_FAMILY),Darwin) endif test-fuzz: - go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzMintCoins ./x/precisebank/keeper - go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzBurnCoins ./x/precisebank/keeper - go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzSendCoins ./x/precisebank/keeper - go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_NonZeroRemainder ./x/precisebank/types - go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_ZeroRemainder ./x/precisebank/types + go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzMintCoins ./x/precisebank/keeper + go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzBurnCoins ./x/precisebank/keeper + go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzSendCoins ./x/precisebank/keeper + go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_NonZeroRemainder ./x/precisebank/types + go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_ZeroRemainder ./x/precisebank/types test-scripts: @echo "Running scripts tests" @@ -201,7 +201,7 @@ test-solidity: .PHONY: run-tests test test-all $(TEST_TARGETS) benchmark: - @go test -tags=test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) + @go test -race -tags=test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) .PHONY: benchmark diff --git a/evmd/testutil/eth_setup.go b/evmd/testutil/eth_setup.go index 0c7f66984..52a7ed1ab 100644 --- a/evmd/testutil/eth_setup.go +++ b/evmd/testutil/eth_setup.go @@ -1,12 +1,12 @@ package testutil import ( - "github.com/cosmos/evm/testutil" "time" cmtypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm" + "github.com/cosmos/evm/testutil" "cosmossdk.io/math"