From ac47fa42b9850cae27962e0e9532ea19ea6e25a6 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Sep 2025 17:10:14 -0400 Subject: [PATCH 01/45] move tests to remove circular dependency --- evmd/tests/integration/ante/ante_test.go | 9 +++++++++ go.mod | 5 ----- go.sum | 19 ------------------- .../ante/test_evm_antehandler_benchmark.go | 18 ++++++------------ .../ante/test_validate_handler_options.go | 7 +------ 5 files changed, 16 insertions(+), 42 deletions(-) rename ante/evm_antehandler_benchmark_test.go => tests/integration/ante/test_evm_antehandler_benchmark.go (90%) rename ante/validate_handler_options_test.go => tests/integration/ante/test_validate_handler_options.go (96%) diff --git a/evmd/tests/integration/ante/ante_test.go b/evmd/tests/integration/ante/ante_test.go index 1744da4d8..19a5aa7e8 100644 --- a/evmd/tests/integration/ante/ante_test.go +++ b/evmd/tests/integration/ante/ante_test.go @@ -10,3 +10,12 @@ import ( func TestAnte_Integration(t *testing.T) { ante.TestIntegrationAnteHandler(t, integration.CreateEvmd) } + +func BenchmarkAnteHandler(b *testing.B) { + // Run the benchmark with a mock EVM app + ante.RunBenchmarkAnteHandler(b, integration.CreateEvmd) +} + +func TestValidateHandlerOptions(t *testing.T) { + ante.RunValidateHandlerOptionsTest(t, integration.CreateEvmd) +} diff --git a/go.mod b/go.mod index 6361a5ebf..2e66b7626 100644 --- a/go.mod +++ b/go.mod @@ -67,7 +67,6 @@ require ( cloud.google.com/go/iam v1.2.2 // indirect cloud.google.com/go/monitoring v1.21.2 // indirect cloud.google.com/go/storage v1.49.0 // indirect - cosmossdk.io/client/v2 v2.0.0-beta.7 // indirect cosmossdk.io/collections v1.2.1 // indirect cosmossdk.io/depinject v1.2.1 // indirect cosmossdk.io/schema v1.1.0 // indirect @@ -106,7 +105,6 @@ require ( github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/consensys/gnark-crypto v0.18.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/evm/evmd v0.0.0-20250922212313-159ba69b2cf9 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.2.2 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect @@ -120,8 +118,6 @@ require ( github.com/desertbit/timer v1.0.1 // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dlclark/regexp2 v1.7.0 // indirect - github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/dot v1.6.2 // indirect @@ -141,7 +137,6 @@ require ( github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-viper/mapstructure/v2 v2.2.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect diff --git a/go.sum b/go.sum index cc50d7160..b3f7089a2 100644 --- a/go.sum +++ b/go.sum @@ -616,8 +616,6 @@ cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= cosmossdk.io/api v0.9.2 h1:9i9ptOBdmoIEVEVWLtYYHjxZonlF/aOVODLFaxpmNtg= cosmossdk.io/api v0.9.2/go.mod h1:CWt31nVohvoPMTlPv+mMNCtC0a7BqRdESjCsstHcTkU= -cosmossdk.io/client/v2 v2.0.0-beta.7 h1:O0PfZL5kC3Sp54wZASLNihQ612Gd6duMp11aM9wawNg= -cosmossdk.io/client/v2 v2.0.0-beta.7/go.mod h1:TzwwrzeK+AfSVSESVEIOYO/9xuCh1fPv0HgeocmfVnM= cosmossdk.io/collections v1.2.1 h1:mAlNMs5vJwkda4TA+k5q/43p24RVAQ/qyDrjANu3BXE= cosmossdk.io/collections v1.2.1/go.mod h1:PSsEJ/fqny0VPsHLFT6gXDj/2C1tBOTS9eByK0+PBFU= cosmossdk.io/core v0.11.3 h1:mei+MVDJOwIjIniaKelE3jPDqShCc/F4LkNNHh+4yfo= @@ -786,15 +784,12 @@ github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXH github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= @@ -857,8 +852,6 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+R github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/cosmos-sdk v0.53.4 h1:kPF6vY68+/xi1/VebSZGpoxQqA52qkhUzqkrgeBn3Mg= github.com/cosmos/cosmos-sdk v0.53.4/go.mod h1:7U3+WHZtI44dEOnU46+lDzBb2tFh1QlMvi8Z5JugopI= -github.com/cosmos/evm/evmd v0.0.0-20250922212313-159ba69b2cf9 h1:026h8xxYYpz/qH97X8mW/Cn1p7cvFVQyiA1hh8T7qaU= -github.com/cosmos/evm/evmd v0.0.0-20250922212313-159ba69b2cf9/go.mod h1:B9yQ4LV0aGn4W+9TlcOHr5aD49fwHyhtmRB15VewVBE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/go-ethereum v1.16.2-cosmos-1 h1:QIaIS6HIdPSBdTvpFhxswhMLUJgcr4irbd2o9ZKldAI= @@ -922,19 +915,11 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo= -github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3 h1:+3HCtB74++ClLy8GgjUQYeC8R4ILzVcIe8+5edAJJnE= -github.com/dop251/goja v0.0.0-20230605162241-28ee0ee714f3/go.mod h1:QMWlm50DNe14hD7t24KEqZuUdC9sOTy8W6XbCU1mlw4= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= -github.com/dop251/goja_nodejs v0.0.0-20211022123610-8dd9abb0616d/go.mod h1:DngW8aVqWbuLRMHItjPUyqdj+HWPvnQe8V8y1nDpIbM= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= @@ -1044,8 +1029,6 @@ github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvSc github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyLFfuisuzeidWPMPWmECqU= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= @@ -1176,7 +1159,6 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -1305,7 +1287,6 @@ github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSAS github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= diff --git a/ante/evm_antehandler_benchmark_test.go b/tests/integration/ante/test_evm_antehandler_benchmark.go similarity index 90% rename from ante/evm_antehandler_benchmark_test.go rename to tests/integration/ante/test_evm_antehandler_benchmark.go index b46ac9932..35f816c9f 100644 --- a/ante/evm_antehandler_benchmark_test.go +++ b/tests/integration/ante/test_evm_antehandler_benchmark.go @@ -1,13 +1,12 @@ -package ante_test +package ante import ( "fmt" + ante2 "github.com/cosmos/evm/ante" "math/big" "testing" - "github.com/cosmos/evm/ante" ethante "github.com/cosmos/evm/ante/evm" - "github.com/cosmos/evm/evmd/tests/integration" basefactory "github.com/cosmos/evm/testutil/integration/base/factory" "github.com/cosmos/evm/testutil/integration/evm/factory" "github.com/cosmos/evm/testutil/integration/evm/grpc" @@ -81,7 +80,7 @@ func RunBenchmarkAnteHandler(b *testing.B, create network.CreateEvmApp, options } handlerOptions := suite.generateHandlerOptions() - ante := ante.NewAnteHandler(handlerOptions) + ante := ante2.NewAnteHandler(handlerOptions) b.StartTimer() b.Run(fmt.Sprintf("tx_type_%v", v.name), func(b *testing.B) { @@ -141,9 +140,9 @@ func (s *benchmarkSuite) generateTxType(txType string) (sdktypes.Tx, error) { } } -func (s *benchmarkSuite) generateHandlerOptions() ante.HandlerOptions { +func (s *benchmarkSuite) generateHandlerOptions() ante2.HandlerOptions { encCfg := s.network.GetEncodingConfig() - return ante.HandlerOptions{ + return ante2.HandlerOptions{ Cdc: s.network.App.AppCodec(), AccountKeeper: s.network.App.GetAccountKeeper(), BankKeeper: s.network.App.GetBankKeeper(), @@ -153,13 +152,8 @@ func (s *benchmarkSuite) generateHandlerOptions() ante.HandlerOptions { IBCKeeper: s.network.App.GetIBCKeeper(), FeeMarketKeeper: s.network.App.GetFeeMarketKeeper(), SignModeHandler: encCfg.TxConfig.SignModeHandler(), - SigGasConsumer: ante.SigVerificationGasConsumer, + SigGasConsumer: ante2.SigVerificationGasConsumer, MaxTxGasWanted: 1_000_000_000, TxFeeChecker: ethante.NewDynamicFeeChecker(s.network.App.GetFeeMarketKeeper()), } } - -func BenchmarkAnteHandler(b *testing.B) { - // Run the benchmark with a mock EVM app - RunBenchmarkAnteHandler(b, integration.CreateEvmd) -} diff --git a/ante/validate_handler_options_test.go b/tests/integration/ante/test_validate_handler_options.go similarity index 96% rename from ante/validate_handler_options_test.go rename to tests/integration/ante/test_validate_handler_options.go index 881f14a8a..2d8cd599a 100644 --- a/ante/validate_handler_options_test.go +++ b/tests/integration/ante/test_validate_handler_options.go @@ -1,4 +1,4 @@ -package ante_test +package ante import ( "testing" @@ -8,7 +8,6 @@ import ( "github.com/cosmos/evm/ante" 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" ) @@ -167,7 +166,3 @@ func RunValidateHandlerOptionsTest(t *testing.T, create network.CreateEvmApp, op } } } - -func TestValidateHandlerOptions(t *testing.T) { - RunValidateHandlerOptionsTest(t, integration.CreateEvmd) -} From 463ad287e4c5c8141a113406b348fe6e12da6076 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Sep 2025 17:15:31 -0400 Subject: [PATCH 02/45] remove ante2 --- .../ante/test_evm_antehandler_benchmark.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/integration/ante/test_evm_antehandler_benchmark.go b/tests/integration/ante/test_evm_antehandler_benchmark.go index 35f816c9f..5a78ec491 100644 --- a/tests/integration/ante/test_evm_antehandler_benchmark.go +++ b/tests/integration/ante/test_evm_antehandler_benchmark.go @@ -2,11 +2,11 @@ package ante import ( "fmt" - ante2 "github.com/cosmos/evm/ante" + ante "github.com/cosmos/evm/ante" "math/big" "testing" - ethante "github.com/cosmos/evm/ante/evm" + evmante "github.com/cosmos/evm/ante/evm" basefactory "github.com/cosmos/evm/testutil/integration/base/factory" "github.com/cosmos/evm/testutil/integration/evm/factory" "github.com/cosmos/evm/testutil/integration/evm/grpc" @@ -80,7 +80,7 @@ func RunBenchmarkAnteHandler(b *testing.B, create network.CreateEvmApp, options } handlerOptions := suite.generateHandlerOptions() - ante := ante2.NewAnteHandler(handlerOptions) + anteHandler := ante.NewAnteHandler(handlerOptions) b.StartTimer() b.Run(fmt.Sprintf("tx_type_%v", v.name), func(b *testing.B) { @@ -101,9 +101,9 @@ func RunBenchmarkAnteHandler(b *testing.B, create network.CreateEvmApp, options b.StartTimer() // Run benchmark - _, err = ante(ctx, tx, v.simulate) + _, err = anteHandler(ctx, tx, v.simulate) if err != nil { - b.Fatal(errors.Wrap(err, "failed to run ante handler")) + b.Fatal(errors.Wrap(err, "failed to run anteHandler")) } } }) @@ -140,9 +140,9 @@ func (s *benchmarkSuite) generateTxType(txType string) (sdktypes.Tx, error) { } } -func (s *benchmarkSuite) generateHandlerOptions() ante2.HandlerOptions { +func (s *benchmarkSuite) generateHandlerOptions() ante.HandlerOptions { encCfg := s.network.GetEncodingConfig() - return ante2.HandlerOptions{ + return ante.HandlerOptions{ Cdc: s.network.App.AppCodec(), AccountKeeper: s.network.App.GetAccountKeeper(), BankKeeper: s.network.App.GetBankKeeper(), @@ -152,8 +152,8 @@ func (s *benchmarkSuite) generateHandlerOptions() ante2.HandlerOptions { IBCKeeper: s.network.App.GetIBCKeeper(), FeeMarketKeeper: s.network.App.GetFeeMarketKeeper(), SignModeHandler: encCfg.TxConfig.SignModeHandler(), - SigGasConsumer: ante2.SigVerificationGasConsumer, + SigGasConsumer: ante.SigVerificationGasConsumer, MaxTxGasWanted: 1_000_000_000, - TxFeeChecker: ethante.NewDynamicFeeChecker(s.network.App.GetFeeMarketKeeper()), + TxFeeChecker: evmante.NewDynamicFeeChecker(s.network.App.GetFeeMarketKeeper()), } } From c3dc99e13b78781a0792de85e140b68be1b9352c Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Sep 2025 17:22:45 -0400 Subject: [PATCH 03/45] wip: move all config files out of evmd --- ante/evm/fee_checker_test.go | 3 ++- ante/evm/mono_decorator_test.go | 3 ++- .../cmd/evmd/config => config}/activators.go | 3 +-- {evmd/cmd/evmd/config => config}/chain_id.go | 0 {evmd/cmd/evmd/config => config}/config.go | 0 {evmd/cmd/evmd/config => config}/constants.go | 0 config/evm_app_options.go | 6 +++++ .../cmd/evmd/config => config}/evmd_config.go | 0 {evmd/eips => eips}/README.md | 0 {evmd/eips => eips}/eips.go | 0 {evmd/eips => eips}/testdata/Counter.json | 0 {evmd/eips => eips}/testdata/Counter.sol | 0 .../testdata/CounterFactory.json | 0 .../eips => eips}/testdata/CounterFactory.sol | 0 {evmd/eips => eips}/testdata/contracts.go | 0 evmd/app.go | 8 +++---- evmd/cmd/evmd/cmd/creator.go | 10 ++++----- evmd/cmd/evmd/cmd/root.go | 22 +++++++++---------- evmd/cmd/evmd/cmd/testnet.go | 16 +++++++------- evmd/cmd/evmd/config/config_testing.go | 15 ------------- evmd/cmd/evmd/config/evm_app_options.go | 14 ------------ evmd/cmd/evmd/main.go | 9 ++++---- evmd/genesis.go | 2 +- evmd/go.mod | 1 - evmd/test_helpers.go | 7 +++--- evmd/tests/integration/create_app.go | 7 +++--- evmd/{eips => tests/integration}/eips_test.go | 6 ++--- evmd/tests/network/network.go | 9 ++++---- go.mod | 1 + go.sum | 2 ++ .../ante/test_evm_antehandler_benchmark.go | 4 ++-- testutil/config/config_testing.go | 7 ------ testutil/config/evm_app_options.go | 10 --------- testutil/ibc/coordinator.go | 4 ++-- x/precisebank/keeper/keeper_test.go | 4 ++-- x/vm/types/msg_test.go | 4 ++-- 36 files changed, 67 insertions(+), 110 deletions(-) rename {evmd/cmd/evmd/config => config}/activators.go (89%) rename {evmd/cmd/evmd/config => config}/chain_id.go (100%) rename {evmd/cmd/evmd/config => config}/config.go (100%) rename {evmd/cmd/evmd/config => config}/constants.go (100%) rename {evmd/cmd/evmd/config => config}/evmd_config.go (100%) rename {evmd/eips => eips}/README.md (100%) rename {evmd/eips => eips}/eips.go (100%) rename {evmd/eips => eips}/testdata/Counter.json (100%) rename {evmd/eips => eips}/testdata/Counter.sol (100%) rename {evmd/eips => eips}/testdata/CounterFactory.json (100%) rename {evmd/eips => eips}/testdata/CounterFactory.sol (100%) rename {evmd/eips => eips}/testdata/contracts.go (100%) delete mode 100644 evmd/cmd/evmd/config/config_testing.go delete mode 100644 evmd/cmd/evmd/config/evm_app_options.go rename evmd/{eips => tests/integration}/eips_test.go (99%) diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index a5cbc3734..deaa1c341 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -1,6 +1,7 @@ package evm_test import ( + evmconfig "github.com/cosmos/evm/config" "math/big" "testing" @@ -59,7 +60,7 @@ func TestSDKTxFeeChecker(t *testing.T) { // london hardfork enableness chainID := uint64(config.EighteenDecimalsChainID) encodingConfig := encoding.MakeConfig(chainID) - err := config.EvmAppOptions(chainID) + err := evmconfig.EvmAppOptions(chainID) require.NoError(t, err) evmDenom := evmtypes.GetEVMCoinDenom() diff --git a/ante/evm/mono_decorator_test.go b/ante/evm/mono_decorator_test.go index 295415734..664da1b62 100644 --- a/ante/evm/mono_decorator_test.go +++ b/ante/evm/mono_decorator_test.go @@ -2,6 +2,7 @@ package evm_test import ( "context" + evmconfig "github.com/cosmos/evm/config" "math/big" "testing" "time" @@ -145,7 +146,7 @@ func toMsgSlice(msgs []*evmsdktypes.MsgEthereumTx) []sdk.Msg { func TestMonoDecorator(t *testing.T) { chainID := uint64(config.EighteenDecimalsChainID) - require.NoError(t, config.EvmAppOptions(chainID)) + require.NoError(t, evmconfig.EvmAppOptions(chainID)) cfg := encoding.MakeConfig(chainID) testCases := []struct { diff --git a/evmd/cmd/evmd/config/activators.go b/config/activators.go similarity index 89% rename from evmd/cmd/evmd/config/activators.go rename to config/activators.go index 136f1f2b8..d528febd8 100644 --- a/evmd/cmd/evmd/config/activators.go +++ b/config/activators.go @@ -1,9 +1,8 @@ package config import ( + "github.com/cosmos/evm/eips" "github.com/ethereum/go-ethereum/core/vm" - - "github.com/cosmos/evm/evmd/eips" ) // cosmosEVMActivators defines a map of opcode modifiers associated diff --git a/evmd/cmd/evmd/config/chain_id.go b/config/chain_id.go similarity index 100% rename from evmd/cmd/evmd/config/chain_id.go rename to config/chain_id.go diff --git a/evmd/cmd/evmd/config/config.go b/config/config.go similarity index 100% rename from evmd/cmd/evmd/config/config.go rename to config/config.go diff --git a/evmd/cmd/evmd/config/constants.go b/config/constants.go similarity index 100% rename from evmd/cmd/evmd/config/constants.go rename to config/constants.go diff --git a/config/evm_app_options.go b/config/evm_app_options.go index 63b06dbc6..504007d35 100644 --- a/config/evm_app_options.go +++ b/config/evm_app_options.go @@ -89,3 +89,9 @@ func setBaseDenom(ci evmtypes.EvmCoinInfo) (err error) { // new setBaseDenom() units are lower than the current base denom's units. return sdk.RegisterDenom(ci.Denom, math.LegacyNewDecWithPrec(1, int64(ci.Decimals))) } + +// EvmAppOptions allows to setup the global configuration +// for the Cosmos EVM chain. +func EvmAppOptions(chainID uint64) error { + return EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, cosmosEVMActivators) +} diff --git a/evmd/cmd/evmd/config/evmd_config.go b/config/evmd_config.go similarity index 100% rename from evmd/cmd/evmd/config/evmd_config.go rename to config/evmd_config.go diff --git a/evmd/eips/README.md b/eips/README.md similarity index 100% rename from evmd/eips/README.md rename to eips/README.md diff --git a/evmd/eips/eips.go b/eips/eips.go similarity index 100% rename from evmd/eips/eips.go rename to eips/eips.go diff --git a/evmd/eips/testdata/Counter.json b/eips/testdata/Counter.json similarity index 100% rename from evmd/eips/testdata/Counter.json rename to eips/testdata/Counter.json diff --git a/evmd/eips/testdata/Counter.sol b/eips/testdata/Counter.sol similarity index 100% rename from evmd/eips/testdata/Counter.sol rename to eips/testdata/Counter.sol diff --git a/evmd/eips/testdata/CounterFactory.json b/eips/testdata/CounterFactory.json similarity index 100% rename from evmd/eips/testdata/CounterFactory.json rename to eips/testdata/CounterFactory.json diff --git a/evmd/eips/testdata/CounterFactory.sol b/eips/testdata/CounterFactory.sol similarity index 100% rename from evmd/eips/testdata/CounterFactory.sol rename to eips/testdata/CounterFactory.sol diff --git a/evmd/eips/testdata/contracts.go b/eips/testdata/contracts.go similarity index 100% rename from evmd/eips/testdata/contracts.go rename to eips/testdata/contracts.go diff --git a/evmd/app.go b/evmd/app.go index c2be992f6..f6ef3be3f 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -36,8 +36,6 @@ import ( feemarkettypes "github.com/cosmos/evm/x/feemarket/types" ibccallbackskeeper "github.com/cosmos/evm/x/ibc/callbacks/keeper" - // NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens - evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" "github.com/cosmos/evm/x/ibc/transfer" transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper" transferv2 "github.com/cosmos/evm/x/ibc/transfer/v2" @@ -138,7 +136,7 @@ func init() { // manually update the power reduction by replacing micro (u) -> atto (a) evmos sdk.DefaultPowerReduction = cosmosevmtypes.AttoPowerReduction - defaultNodeHome = evmdconfig.MustGetDefaultNodeHome() + defaultNodeHome = evmconfig.MustGetDefaultNodeHome() } const appName = "evmd" @@ -319,7 +317,7 @@ func NewExampleApp( // add keepers app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]), - authtypes.ProtoBaseAccount, evmdconfig.GetMaccPerms(), + authtypes.ProtoBaseAccount, evmconfig.GetMaccPerms(), authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()), sdk.GetConfig().GetBech32AccountAddrPrefix(), authAddr, @@ -329,7 +327,7 @@ func NewExampleApp( appCodec, runtime.NewKVStoreService(keys[banktypes.StoreKey]), app.AccountKeeper, - evmdconfig.BlockedAddresses(), + evmconfig.BlockedAddresses(), authAddr, logger, ) diff --git a/evmd/cmd/evmd/cmd/creator.go b/evmd/cmd/evmd/cmd/creator.go index c6238998d..dd94a09c9 100644 --- a/evmd/cmd/evmd/cmd/creator.go +++ b/evmd/cmd/evmd/cmd/creator.go @@ -2,6 +2,7 @@ package cmd import ( "errors" + "github.com/cosmos/evm/config" "io" "path/filepath" @@ -13,7 +14,6 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/evm/evmd" - evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" "github.com/spf13/cast" "github.com/spf13/viper" @@ -94,8 +94,8 @@ func (a appCreator) newApp( traceStore, true, simtestutil.EmptyAppOptions{}, - evmdconfig.EVMChainID, - evmdconfig.EvmAppOptions, + config.EVMChainID, + config.EvmAppOptions, baseappOptions..., ) } @@ -137,8 +137,8 @@ func (a appCreator) appExport( traceStore, loadLatest, appOpts, - evmdconfig.EVMChainID, - evmdconfig.EvmAppOptions, + config.EVMChainID, + config.EvmAppOptions, ) if height != -1 { diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index 8a540cf0a..81321b8ef 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -2,6 +2,7 @@ package cmd import ( "errors" + "github.com/cosmos/evm/config" "io" "os" @@ -17,7 +18,6 @@ import ( cosmosevmcmd "github.com/cosmos/evm/client" cosmosevmkeyring "github.com/cosmos/evm/crypto/keyring" "github.com/cosmos/evm/evmd" - evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" cosmosevmserver "github.com/cosmos/evm/server" srvflags "github.com/cosmos/evm/server/flags" @@ -63,7 +63,7 @@ func NewRootCmd() *cobra.Command { nil, true, simtestutil.EmptyAppOptions{}, - evmdconfig.EVMChainID, + config.EVMChainID, noOpEvmAppOptions, ) @@ -81,7 +81,7 @@ func NewRootCmd() *cobra.Command { WithInput(os.Stdin). WithAccountRetriever(authtypes.AccountRetriever{}). WithBroadcastMode(flags.FlagBroadcastMode). - WithHomeDir(evmdconfig.MustGetDefaultNodeHome()). + WithHomeDir(config.MustGetDefaultNodeHome()). WithViper(""). // In simapp, we don't use any prefix for env variables. // Cosmos EVM specific setup WithKeyringOptions(cosmosevmkeyring.Option()). @@ -130,7 +130,7 @@ func NewRootCmd() *cobra.Command { return err } - customAppTemplate, customAppConfig := evmdconfig.InitAppConfig(evmdconfig.BaseDenom, evmdconfig.EVMChainID) + customAppTemplate, customAppConfig := config.InitAppConfig(config.BaseDenom, config.EVMChainID) customTMConfig := initCometConfig() return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) @@ -148,7 +148,7 @@ func NewRootCmd() *cobra.Command { } if initClientCtx.ChainID != "" { - if err := evmdconfig.EvmAppOptions(evmdconfig.EVMChainID); err != nil { + if err := config.EvmAppOptions(config.EVMChainID); err != nil { panic(err) } } @@ -172,7 +172,7 @@ func initRootCmd(rootCmd *cobra.Command, evmApp *evmd.EVMD) { cfg := sdk.GetConfig() cfg.Seal() - defaultNodeHome := evmdconfig.MustGetDefaultNodeHome() + defaultNodeHome := config.MustGetDefaultNodeHome() sdkAppCreator := func(l log.Logger, d dbm.DB, w io.Writer, ao servertypes.AppOptions) servertypes.Application { return newApp(l, d, w, ao) } @@ -319,8 +319,8 @@ func newApp( return evmd.NewExampleApp( logger, db, traceStore, true, appOpts, - evmdconfig.EVMChainID, - evmdconfig.EvmAppOptions, + config.EVMChainID, + config.EvmAppOptions, baseappOptions..., ) } @@ -361,13 +361,13 @@ func appExport( } if height != -1 { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, evmdconfig.EVMChainID, evmdconfig.EvmAppOptions, baseapp.SetChainID(chainID)) + exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) if err := exampleApp.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } } else { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, evmdconfig.EVMChainID, evmdconfig.EvmAppOptions, baseapp.SetChainID(chainID)) + exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) } return exampleApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) @@ -382,7 +382,7 @@ func getChainIDFromOpts(appOpts servertypes.AppOptions) (chainID string, err err if chainID == "" { // If not available load from home homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) - chainID, err = evmdconfig.GetChainIDFromHome(homeDir) + chainID, err = config.GetChainIDFromHome(homeDir) if err != nil { return "", err } diff --git a/evmd/cmd/evmd/cmd/testnet.go b/evmd/cmd/evmd/cmd/testnet.go index a98dfc052..6a6d1361b 100644 --- a/evmd/cmd/evmd/cmd/testnet.go +++ b/evmd/cmd/evmd/cmd/testnet.go @@ -4,6 +4,7 @@ import ( "bufio" "encoding/json" "fmt" + "github.com/cosmos/evm/config" "net" "os" "path/filepath" @@ -12,7 +13,6 @@ import ( cosmosevmhd "github.com/cosmos/evm/crypto/hd" cosmosevmkeyring "github.com/cosmos/evm/crypto/keyring" "github.com/cosmos/evm/evmd" - evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" cosmosevmserverconfig "github.com/cosmos/evm/server/config" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -268,8 +268,8 @@ func initTestnetFiles( appConfig.Telemetry.EnableHostnameLabel = false appConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", args.chainID}} evm := cosmosevmserverconfig.DefaultEVMConfig() - evm.EVMChainID = evmdconfig.EVMChainID - evmCfg := evmdconfig.EVMAppConfig{ + evm.EVMChainID = config.EVMChainID + evmCfg := config.EVMAppConfig{ Config: *appConfig, EVM: *evm, JSONRPC: *cosmosevmserverconfig.DefaultJSONRPCConfig(), @@ -443,7 +443,7 @@ func initTestnetFiles( return err } - srvconfig.SetConfigTemplate(evmdconfig.EVMAppTemplate) + srvconfig.SetConfigTemplate(config.EVMAppTemplate) srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config", "app.toml"), evmCfg) } @@ -685,8 +685,8 @@ func NewTestNetworkFixture() network.TestFixture { nil, true, simtestutil.EmptyAppOptions{}, - evmdconfig.EVMChainID, - evmdconfig.EvmAppOptions, + config.EVMChainID, + config.EvmAppOptions, ) appCtr := func(val network.ValidatorI) servertypes.Application { @@ -696,8 +696,8 @@ func NewTestNetworkFixture() network.TestFixture { nil, true, simtestutil.EmptyAppOptions{}, - evmdconfig.EVMChainID, - evmdconfig.EvmAppOptions, + config.EVMChainID, + config.EvmAppOptions, ) } diff --git a/evmd/cmd/evmd/config/config_testing.go b/evmd/cmd/evmd/config/config_testing.go deleted file mode 100644 index 504d57427..000000000 --- a/evmd/cmd/evmd/config/config_testing.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build test -// +build test - -package config - -import ( - evmconfig "github.com/cosmos/evm/config" - testconfig "github.com/cosmos/evm/testutil/config" -) - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return evmconfig.EvmAppOptionsWithConfigWithReset(chainID, testconfig.TestChainsCoinInfo, cosmosEVMActivators, true) -} diff --git a/evmd/cmd/evmd/config/evm_app_options.go b/evmd/cmd/evmd/config/evm_app_options.go deleted file mode 100644 index 07e73107d..000000000 --- a/evmd/cmd/evmd/config/evm_app_options.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build !test -// +build !test - -package config - -import ( - evmconfig "github.com/cosmos/evm/config" -) - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return evmconfig.EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, cosmosEVMActivators) -} diff --git a/evmd/cmd/evmd/main.go b/evmd/cmd/evmd/main.go index 0669a5891..fea2301b4 100644 --- a/evmd/cmd/evmd/main.go +++ b/evmd/cmd/evmd/main.go @@ -2,20 +2,19 @@ package main import ( "fmt" + config2 "github.com/cosmos/evm/config" "os" - "github.com/cosmos/evm/evmd/cmd/evmd/cmd" - evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/evm/evmd/cmd/evmd/cmd" ) func main() { setupSDKConfig() rootCmd := cmd.NewRootCmd() - if err := svrcmd.Execute(rootCmd, "evmd", evmdconfig.MustGetDefaultNodeHome()); err != nil { + if err := svrcmd.Execute(rootCmd, "evmd", config2.MustGetDefaultNodeHome()); err != nil { fmt.Fprintln(rootCmd.OutOrStderr(), err) os.Exit(1) } @@ -23,6 +22,6 @@ func main() { func setupSDKConfig() { config := sdk.GetConfig() - evmdconfig.SetBech32Prefixes(config) + config2.SetBech32Prefixes(config) config.Seal() } diff --git a/evmd/genesis.go b/evmd/genesis.go index 7d656730b..68def66f4 100644 --- a/evmd/genesis.go +++ b/evmd/genesis.go @@ -2,8 +2,8 @@ package evmd import ( "encoding/json" + "github.com/cosmos/evm/testutil/config" - "github.com/cosmos/evm/evmd/cmd/evmd/config" 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/evmd/go.mod b/evmd/go.mod index 321acf200..03d564fed 100644 --- a/evmd/go.mod +++ b/evmd/go.mod @@ -275,7 +275,6 @@ replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 github.com/cosmos/evm => ../ - github.com/cosmos/evm/evmd => ./evmd // use Cosmos geth fork github.com/ethereum/go-ethereum => github.com/cosmos/go-ethereum v0.0.0-20250806193535-2fc7571efa91 // Security Advisory https://github.com/advisories/GHSA-h395-qcrw-5vmq diff --git a/evmd/test_helpers.go b/evmd/test_helpers.go index b7e77d9b3..173818910 100644 --- a/evmd/test_helpers.go +++ b/evmd/test_helpers.go @@ -3,10 +3,9 @@ package evmd import ( "encoding/json" "fmt" + "github.com/cosmos/evm/config" "testing" - "github.com/cosmos/evm/evmd/cmd/evmd/config" - testconfig "github.com/cosmos/evm/testutil/config" "github.com/stretchr/testify/require" abci "github.com/cometbft/cometbft/abci/types" @@ -55,7 +54,7 @@ func setup(withGenesis bool, invCheckPeriod uint, chainID string, evmChainID uin appOptions[flags.FlagHome] = defaultNodeHome appOptions[server.FlagInvCheckPeriod] = invCheckPeriod - app := NewExampleApp(log.NewNopLogger(), db, nil, true, appOptions, evmChainID, testconfig.EvmAppOptions, baseapp.SetChainID(chainID)) + app := NewExampleApp(log.NewNopLogger(), db, nil, true, appOptions, evmChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) if withGenesis { return app, app.DefaultGenesis() } @@ -132,7 +131,7 @@ func SetupTestingApp(chainID string, evmChainID uint64) func() (ibctesting.Testi db, nil, true, simtestutil.NewAppOptionsWithFlagHome(defaultNodeHome), evmChainID, - testconfig.EvmAppOptions, + config.EvmAppOptions, baseapp.SetChainID(chainID), ) return app, app.DefaultGenesis() diff --git a/evmd/tests/integration/create_app.go b/evmd/tests/integration/create_app.go index fd05c278f..ef7c00195 100644 --- a/evmd/tests/integration/create_app.go +++ b/evmd/tests/integration/create_app.go @@ -2,12 +2,11 @@ package integration import ( "encoding/json" + "github.com/cosmos/evm/config" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/evm" "github.com/cosmos/evm/evmd" - "github.com/cosmos/evm/evmd/cmd/evmd/config" - testconfig "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/constants" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" ibctesting "github.com/cosmos/ibc-go/v10/testing" @@ -43,7 +42,7 @@ func CreateEvmd(chainID string, evmChainID uint64, customBaseAppOptions ...func( loadLatest, appOptions, evmChainID, - testconfig.EvmAppOptions, + config.EvmAppOptions, baseAppOptions..., ) } @@ -58,7 +57,7 @@ func SetupEvmd() (ibctesting.TestingApp, map[string]json.RawMessage) { true, simutils.EmptyAppOptions{}, constants.ExampleEIP155ChainID, - testconfig.EvmAppOptions, + config.EvmAppOptions, ) // disable base fee for testing genesisState := app.DefaultGenesis() diff --git a/evmd/eips/eips_test.go b/evmd/tests/integration/eips_test.go similarity index 99% rename from evmd/eips/eips_test.go rename to evmd/tests/integration/eips_test.go index 512881342..23d9523ae 100644 --- a/evmd/eips/eips_test.go +++ b/evmd/tests/integration/eips_test.go @@ -1,7 +1,9 @@ -package eips_test +package integration_test import ( "fmt" + "github.com/cosmos/evm/eips/testdata" + "github.com/cosmos/evm/evmd/tests/integration" "math/big" "testing" @@ -13,8 +15,6 @@ import ( //nolint:revive // dot imports are fine for Ginkgo . "github.com/onsi/gomega" - "github.com/cosmos/evm/evmd/eips/testdata" - "github.com/cosmos/evm/evmd/tests/integration" testconfig "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/integration/evm/factory" "github.com/cosmos/evm/testutil/integration/evm/grpc" diff --git a/evmd/tests/network/network.go b/evmd/tests/network/network.go index 51fb9133f..54dcb3feb 100644 --- a/evmd/tests/network/network.go +++ b/evmd/tests/network/network.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + evmconfig "github.com/cosmos/evm/config" "net/http" "net/url" "os" @@ -29,9 +30,7 @@ import ( dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/evm/crypto/hd" "github.com/cosmos/evm/evmd" - evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config" "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" @@ -110,7 +109,7 @@ func DefaultConfig() Config { panic(fmt.Sprintf("failed creating temporary directory: %v", err)) } defer os.RemoveAll(dir) - tempApp := evmd.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), evmChainID, testconfig.EvmAppOptions, baseapp.SetChainID(chainID)) + tempApp := evmd.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), evmChainID, evmconfig.EvmAppOptions, baseapp.SetChainID(chainID)) cfg := Config{ Codec: tempApp.AppCodec(), @@ -144,7 +143,7 @@ func NewAppConstructor(chainID string, evmChainID uint64) AppConstructor { val.Ctx.Logger, dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir), evmChainID, - testconfig.EvmAppOptions, + evmconfig.EvmAppOptions, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), baseapp.SetChainID(chainID), @@ -476,7 +475,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) { return nil, err } - customAppTemplate, _ := evmdconfig.InitAppConfig(testconstants.ExampleAttoDenom, testconstants.ExampleEIP155ChainID) + customAppTemplate, _ := evmconfig.InitAppConfig(testconstants.ExampleAttoDenom, testconstants.ExampleEIP155ChainID) srvconfig.SetConfigTemplate(customAppTemplate) srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appCfg) diff --git a/go.mod b/go.mod index 2e66b7626..e3ea8d9b5 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.23.8 require ( cosmossdk.io/api v0.9.2 + cosmossdk.io/client/v2 v2.0.0-beta.7 cosmossdk.io/core v0.11.3 cosmossdk.io/errors v1.0.2 cosmossdk.io/log v1.6.1 diff --git a/go.sum b/go.sum index b3f7089a2..fb1913581 100644 --- a/go.sum +++ b/go.sum @@ -616,6 +616,8 @@ cloud.google.com/go/workflows v1.9.0/go.mod h1:ZGkj1aFIOd9c8Gerkjjq7OW7I5+l6cSvT cloud.google.com/go/workflows v1.10.0/go.mod h1:fZ8LmRmZQWacon9UCX1r/g/DfAXx5VcPALq2CxzdePw= cosmossdk.io/api v0.9.2 h1:9i9ptOBdmoIEVEVWLtYYHjxZonlF/aOVODLFaxpmNtg= cosmossdk.io/api v0.9.2/go.mod h1:CWt31nVohvoPMTlPv+mMNCtC0a7BqRdESjCsstHcTkU= +cosmossdk.io/client/v2 v2.0.0-beta.7 h1:O0PfZL5kC3Sp54wZASLNihQ612Gd6duMp11aM9wawNg= +cosmossdk.io/client/v2 v2.0.0-beta.7/go.mod h1:TzwwrzeK+AfSVSESVEIOYO/9xuCh1fPv0HgeocmfVnM= cosmossdk.io/collections v1.2.1 h1:mAlNMs5vJwkda4TA+k5q/43p24RVAQ/qyDrjANu3BXE= cosmossdk.io/collections v1.2.1/go.mod h1:PSsEJ/fqny0VPsHLFT6gXDj/2C1tBOTS9eByK0+PBFU= cosmossdk.io/core v0.11.3 h1:mei+MVDJOwIjIniaKelE3jPDqShCc/F4LkNNHh+4yfo= diff --git a/tests/integration/ante/test_evm_antehandler_benchmark.go b/tests/integration/ante/test_evm_antehandler_benchmark.go index 5a78ec491..1be209904 100644 --- a/tests/integration/ante/test_evm_antehandler_benchmark.go +++ b/tests/integration/ante/test_evm_antehandler_benchmark.go @@ -2,11 +2,11 @@ package ante import ( "fmt" - ante "github.com/cosmos/evm/ante" + evmante "github.com/cosmos/evm/ante/evm" "math/big" "testing" - evmante "github.com/cosmos/evm/ante/evm" + "github.com/cosmos/evm/ante" basefactory "github.com/cosmos/evm/testutil/integration/base/factory" "github.com/cosmos/evm/testutil/integration/evm/factory" "github.com/cosmos/evm/testutil/integration/evm/grpc" diff --git a/testutil/config/config_testing.go b/testutil/config/config_testing.go index e37568c2b..d2712f938 100644 --- a/testutil/config/config_testing.go +++ b/testutil/config/config_testing.go @@ -4,7 +4,6 @@ package config import ( - evmconfig "github.com/cosmos/evm/config" evmtypes "github.com/cosmos/evm/x/vm/types" ) @@ -55,9 +54,3 @@ var TestChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ Decimals: evmtypes.EighteenDecimals, }, } - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return evmconfig.EvmAppOptionsWithConfigWithReset(chainID, TestChainsCoinInfo, cosmosEVMActivators, true) -} diff --git a/testutil/config/evm_app_options.go b/testutil/config/evm_app_options.go index 07e73107d..9b3702a61 100644 --- a/testutil/config/evm_app_options.go +++ b/testutil/config/evm_app_options.go @@ -2,13 +2,3 @@ // +build !test package config - -import ( - evmconfig "github.com/cosmos/evm/config" -) - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return evmconfig.EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, cosmosEVMActivators) -} diff --git a/testutil/ibc/coordinator.go b/testutil/ibc/coordinator.go index c4823df48..6de2ad024 100644 --- a/testutil/ibc/coordinator.go +++ b/testutil/ibc/coordinator.go @@ -2,13 +2,13 @@ package ibctesting import ( "fmt" + evmconfig "github.com/cosmos/evm/config" "strconv" "testing" "time" "github.com/stretchr/testify/require" - "github.com/cosmos/evm/testutil/config" ibctesting "github.com/cosmos/ibc-go/v10/testing" ) @@ -42,7 +42,7 @@ func NewCoordinator(t *testing.T, nEVMChains, mCosmosChains int, evmAppCreator i chainID := GetChainID(i) evmChainID, err := strconv.ParseUint(GetEvmChainID(i), 10, 64) require.NoError(t, err) - require.NoError(t, config.EvmAppOptions(evmChainID)) + require.NoError(t, evmconfig.EvmAppOptions(evmChainID)) // setup EVM chains chains[strconv.FormatUint(evmChainID, 10)] = NewTestChain(t, true, coord, chainID) } diff --git a/x/precisebank/keeper/keeper_test.go b/x/precisebank/keeper/keeper_test.go index 75a4656ef..9ad6864d9 100644 --- a/x/precisebank/keeper/keeper_test.go +++ b/x/precisebank/keeper/keeper_test.go @@ -1,10 +1,10 @@ package keeper_test import ( + evmconfig "github.com/cosmos/evm/config" "testing" evmosencoding "github.com/cosmos/evm/encoding" - "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" "github.com/cosmos/evm/x/precisebank/keeper" "github.com/cosmos/evm/x/precisebank/types" @@ -44,7 +44,7 @@ func newMockedTestData(t *testing.T) testData { cfg := evmosencoding.MakeConfig(chainID) cdc := cfg.Codec k := keeper.NewKeeper(cdc, storeKey, bk, ak) - err := config.EvmAppOptions(chainID) + err := evmconfig.EvmAppOptions(chainID) if err != nil { return testData{} } diff --git a/x/vm/types/msg_test.go b/x/vm/types/msg_test.go index 2692b3edb..f34d8fd3c 100644 --- a/x/vm/types/msg_test.go +++ b/x/vm/types/msg_test.go @@ -2,6 +2,7 @@ package types_test import ( "fmt" + evmconfig "github.com/cosmos/evm/config" "math" "math/big" "reflect" @@ -14,7 +15,6 @@ import ( "github.com/stretchr/testify/suite" "github.com/cosmos/evm/encoding" - "github.com/cosmos/evm/testutil/config" testconstants "github.com/cosmos/evm/testutil/constants" utiltx "github.com/cosmos/evm/testutil/tx" "github.com/cosmos/evm/x/vm/types" @@ -54,7 +54,7 @@ func (suite *MsgsTestSuite) SetupTest() { encodingConfig := encoding.MakeConfig(suite.chainID.Uint64()) suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) - err := config.EvmAppOptions(9001) + err := evmconfig.EvmAppOptions(9001) suite.Require().NoError(err) } From 9b9dd66e6972ab9a25c4c5147e71227502da7866 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Sep 2025 17:29:49 -0400 Subject: [PATCH 04/45] wip: add todos --- config/config.go | 2 +- config/constants.go | 2 +- config/evm_app_options.go | 2 +- evmd/app.go | 35 +++++-------------------------- evmd/cmd/evmd/cmd/root.go | 12 +++++------ testutil/config/config.go | 2 +- testutil/config/config_testing.go | 2 +- testutil/config/constants.go | 2 +- x/vm/types/chain_config.go | 6 +++--- 9 files changed, 20 insertions(+), 45 deletions(-) diff --git a/config/config.go b/config/config.go index 2699ca0b6..14d6779f4 100644 --- a/config/config.go +++ b/config/config.go @@ -10,7 +10,7 @@ import ( // ChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo // that allows initializing the app with different coin info based on the // chain id -var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ +var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this EighteenDecimalsChainID: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, diff --git a/config/constants.go b/config/constants.go index fb9bdbe4b..5c47914b6 100644 --- a/config/constants.go +++ b/config/constants.go @@ -1,6 +1,6 @@ package config -const ( +const ( // TODO:VLAD - Clean this up // ExampleChainDenom is the denomination of the Cosmos EVM example chain's base coin. ExampleChainDenom = "aatom" diff --git a/config/evm_app_options.go b/config/evm_app_options.go index 504007d35..8c35ef84e 100644 --- a/config/evm_app_options.go +++ b/config/evm_app_options.go @@ -19,7 +19,7 @@ type EVMOptionsFn func(uint64) error var sealed = false -func EvmAppOptionsWithConfig( +func EvmAppOptionsWithConfig( // TODO:VLAD - This should all be set within the VM module chainID uint64, chainsCoinInfo map[uint64]evmtypes.EvmCoinInfo, cosmosEVMActivators map[int]func(*vm.JumpTable), diff --git a/evmd/app.go b/evmd/app.go index f6ef3be3f..ae424a26e 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -211,43 +211,17 @@ func NewExampleApp( traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, - evmChainID uint64, - evmAppOptions evmconfig.EVMOptionsFn, + evmChainID uint64, // TODO:VLAD - Remove this + evmAppOptions evmconfig.EVMOptionsFn, // TODO:VLAD - Remove this baseAppOptions ...func(*baseapp.BaseApp), ) *EVMD { - encodingConfig := evmosencoding.MakeConfig(evmChainID) + encodingConfig := evmosencoding.MakeConfig(evmChainID) // TODO:VLAD - Remove chain id from this appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry txConfig := encodingConfig.TxConfig - // Below we could construct and set an application specific mempool and - // ABCI 1.0 PrepareProposal and ProcessProposal handlers. These defaults are - // already set in the SDK's BaseApp, this shows an example of how to override - // them. - // - // Example: - // - // bApp := baseapp.NewBaseApp(...) - // nonceMempool := evmmempool.NewSenderNonceMempool() - // abciPropHandler := NewDefaultProposalHandler(nonceMempool, bApp) - // - // bApp.SetMempool(nonceMempool) - // bApp.SetPrepareProposal(abciPropHandler.PrepareProposalHandler()) - // bApp.SetProcessProposal(abciPropHandler.ProcessProposalHandler()) - // - // Alternatively, you can construct BaseApp options, append those to - // baseAppOptions and pass them to NewBaseApp. - // - // Example: - // - // prepareOpt = func(app *baseapp.BaseApp) { - // abciPropHandler := baseapp.NewDefaultProposalHandler(nonceMempool, app) - // app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler()) - // } - // baseAppOptions = append(baseAppOptions, prepareOpt) - bApp := baseapp.NewBaseApp( appName, logger, @@ -262,6 +236,7 @@ func NewExampleApp( bApp.SetTxEncoder(txConfig.TxEncoder()) // initialize the Cosmos EVM application configuration + // TODO:VLAD - Remove this if err := evmAppOptions(evmChainID); err != nil { panic(err) } @@ -1122,7 +1097,7 @@ func (app *EVMD) GetTxConfig() client.TxConfig { return app.txConfig } -func (app *EVMD) SetClientCtx(clientCtx client.Context) { +func (app *EVMD) SetClientCtx(clientCtx client.Context) { // TODO:VLAD - Remove this if possible app.clientCtx = clientCtx } diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index 81321b8ef..8438cf07e 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -130,7 +130,7 @@ func NewRootCmd() *cobra.Command { return err } - customAppTemplate, customAppConfig := config.InitAppConfig(config.BaseDenom, config.EVMChainID) + customAppTemplate, customAppConfig := config.InitAppConfig(config.BaseDenom, config.EVMChainID) // TODO:VLAD - Remove this customTMConfig := initCometConfig() return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) @@ -147,7 +147,7 @@ func NewRootCmd() *cobra.Command { panic(err) } - if initClientCtx.ChainID != "" { + if initClientCtx.ChainID != "" { // TODO:VLAD - Remove this if err := config.EvmAppOptions(config.EVMChainID); err != nil { panic(err) } @@ -319,8 +319,8 @@ func newApp( return evmd.NewExampleApp( logger, db, traceStore, true, appOpts, - config.EVMChainID, - config.EvmAppOptions, + config.EVMChainID, // TODO:VLAD - Remove this + config.EvmAppOptions, // TODO:VLAD - Remove this baseappOptions..., ) } @@ -361,13 +361,13 @@ func appExport( } if height != -1 { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) + exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove appoptions and evmchainid if err := exampleApp.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } } else { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) + exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid } return exampleApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) diff --git a/testutil/config/config.go b/testutil/config/config.go index 7ea385bdb..beff48a06 100644 --- a/testutil/config/config.go +++ b/testutil/config/config.go @@ -10,7 +10,7 @@ import ( // ChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo // that allows initializing the app with different coin info based on the // chain id -var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ +var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this EighteenDecimalsChainID: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, diff --git a/testutil/config/config_testing.go b/testutil/config/config_testing.go index d2712f938..220b85919 100644 --- a/testutil/config/config_testing.go +++ b/testutil/config/config_testing.go @@ -10,7 +10,7 @@ import ( // TestChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo // that allows initializing the app with different coin info based on the // chain id -var TestChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ +var TestChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this EighteenDecimalsChainID: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, diff --git a/testutil/config/constants.go b/testutil/config/constants.go index fb9bdbe4b..5c47914b6 100644 --- a/testutil/config/constants.go +++ b/testutil/config/constants.go @@ -1,6 +1,6 @@ package config -const ( +const ( // TODO:VLAD - Clean this up // ExampleChainDenom is the denomination of the Cosmos EVM example chain's base coin. ExampleChainDenom = "aatom" diff --git a/x/vm/types/chain_config.go b/x/vm/types/chain_config.go index 6a9877340..d22fd6547 100644 --- a/x/vm/types/chain_config.go +++ b/x/vm/types/chain_config.go @@ -11,7 +11,7 @@ import ( ) // testChainID represents the ChainID used for the purpose of testing. -const testChainID uint64 = 262144 +const testChainID uint64 = 262144 // TODO:VLAD - Consolidate into a single object across the entire repo // chainConfig is the chain configuration used in the EVM to defined which // opcodes are active based on Ethereum upgrades. @@ -84,8 +84,8 @@ func DefaultChainConfig(evmChainID uint64) *ChainConfig { cfg := &ChainConfig{ ChainId: evmChainID, - Denom: DefaultEVMDenom, - Decimals: DefaultEVMDecimals, + Denom: DefaultEVMDenom, // TODO:VLAD - Remove this + Decimals: DefaultEVMDecimals, // TODO:VLAD - Remove this HomesteadBlock: &homesteadBlock, DAOForkBlock: &daoForkBlock, DAOForkSupport: true, From dc32dbb312b036c9d4ab57923dd693dac991dcda Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Sep 2025 17:37:38 -0400 Subject: [PATCH 05/45] reset config to fix test --- x/vm/types/msg_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/vm/types/msg_test.go b/x/vm/types/msg_test.go index f34d8fd3c..ae2f347cf 100644 --- a/x/vm/types/msg_test.go +++ b/x/vm/types/msg_test.go @@ -54,6 +54,8 @@ func (suite *MsgsTestSuite) SetupTest() { encodingConfig := encoding.MakeConfig(suite.chainID.Uint64()) suite.clientCtx = client.Context{}.WithTxConfig(encodingConfig.TxConfig) + configurator := types.NewEVMConfigurator() + configurator.ResetTestConfig() err := evmconfig.EvmAppOptions(9001) suite.Require().NoError(err) } From 019f3d8eb5b25996127cba5df5cc595fae7cdbcd Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 23 Sep 2025 18:08:38 -0400 Subject: [PATCH 06/45] fix evmd tests by adding resets to the evmappoptions --- config/config.go | 24 ++++++++++++++++++++++++ config/evm_app_options.go | 6 ------ config/evm_app_options_prod.go | 10 ++++++++++ config/evm_app_options_testing.go | 10 ++++++++++ 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 config/evm_app_options_prod.go create mode 100644 config/evm_app_options_testing.go diff --git a/config/config.go b/config/config.go index 14d6779f4..5283d0df2 100644 --- a/config/config.go +++ b/config/config.go @@ -31,6 +31,30 @@ var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this DisplayDenom: "test", Decimals: evmtypes.EighteenDecimals, }, + TwelveDecimalsChainID: { + Denom: "ptest2", + ExtendedDenom: "atest2", + DisplayDenom: "test2", + Decimals: evmtypes.TwelveDecimals, + }, + TwoDecimalsChainID: { + Denom: "ctest3", + ExtendedDenom: "atest3", + DisplayDenom: "test3", + Decimals: evmtypes.TwoDecimals, + }, + TestChainID1: { + Denom: ExampleChainDenom, + ExtendedDenom: ExampleChainDenom, + DisplayDenom: ExampleChainDenom, + Decimals: evmtypes.EighteenDecimals, + }, + TestChainID2: { + Denom: ExampleChainDenom, + ExtendedDenom: ExampleChainDenom, + DisplayDenom: ExampleChainDenom, + Decimals: evmtypes.EighteenDecimals, + }, } const ( diff --git a/config/evm_app_options.go b/config/evm_app_options.go index 8c35ef84e..4de22faf5 100644 --- a/config/evm_app_options.go +++ b/config/evm_app_options.go @@ -89,9 +89,3 @@ func setBaseDenom(ci evmtypes.EvmCoinInfo) (err error) { // new setBaseDenom() units are lower than the current base denom's units. return sdk.RegisterDenom(ci.Denom, math.LegacyNewDecWithPrec(1, int64(ci.Decimals))) } - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, cosmosEVMActivators) -} diff --git a/config/evm_app_options_prod.go b/config/evm_app_options_prod.go new file mode 100644 index 000000000..6b523ebdf --- /dev/null +++ b/config/evm_app_options_prod.go @@ -0,0 +1,10 @@ +//go:build !test +// +build !test + +package config + +// EvmAppOptions allows to setup the global configuration +// for the Cosmos EVM chain. +func EvmAppOptions(chainID uint64) error { + return EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, cosmosEVMActivators) +} diff --git a/config/evm_app_options_testing.go b/config/evm_app_options_testing.go new file mode 100644 index 000000000..0f30dcaa4 --- /dev/null +++ b/config/evm_app_options_testing.go @@ -0,0 +1,10 @@ +//go:build test +// +build test + +package config + +// EvmAppOptions allows to setup the global configuration +// for the Cosmos EVM chain. +func EvmAppOptions(chainID uint64) error { + return EvmAppOptionsWithConfigWithReset(chainID, ChainsCoinInfo, cosmosEVMActivators, true) +} From 3aff36be3a22add84acb3dd1c642e21fcceb3ccf Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 10:17:57 -0400 Subject: [PATCH 07/45] remove testutil/config constants consolidates these constants into one file in /config --- ante/evm/fee_checker_test.go | 5 ++-- ante/evm/mono_decorator_test.go | 5 ++-- config/constants.go | 2 -- evmd/genesis.go | 3 +-- testutil/config/config.go | 15 +++++------ testutil/config/config_testing.go | 37 ++++++++++++++-------------- testutil/config/constants.go | 31 ----------------------- testutil/config/evm_app_options.go | 4 --- testutil/config/genesis.go | 3 ++- testutil/constants/constants_test.go | 2 +- testutil/ibc/chain.go | 2 +- 11 files changed, 36 insertions(+), 73 deletions(-) delete mode 100644 testutil/config/constants.go delete mode 100644 testutil/config/evm_app_options.go diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index deaa1c341..cf3d95e8c 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -1,7 +1,7 @@ package evm_test import ( - evmconfig "github.com/cosmos/evm/config" + "github.com/cosmos/evm/config" "math/big" "testing" @@ -12,7 +12,6 @@ import ( "github.com/cosmos/evm/ante/evm" anteinterfaces "github.com/cosmos/evm/ante/interfaces" "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" @@ -60,7 +59,7 @@ func TestSDKTxFeeChecker(t *testing.T) { // london hardfork enableness chainID := uint64(config.EighteenDecimalsChainID) encodingConfig := encoding.MakeConfig(chainID) - err := evmconfig.EvmAppOptions(chainID) + err := config.EvmAppOptions(chainID) require.NoError(t, err) evmDenom := evmtypes.GetEVMCoinDenom() diff --git a/ante/evm/mono_decorator_test.go b/ante/evm/mono_decorator_test.go index 664da1b62..2f3fa6ea2 100644 --- a/ante/evm/mono_decorator_test.go +++ b/ante/evm/mono_decorator_test.go @@ -2,7 +2,7 @@ package evm_test import ( "context" - evmconfig "github.com/cosmos/evm/config" + "github.com/cosmos/evm/config" "math/big" "testing" "time" @@ -20,7 +20,6 @@ import ( "github.com/cosmos/evm/ante/evm" "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/encoding" - "github.com/cosmos/evm/testutil/config" utiltx "github.com/cosmos/evm/testutil/tx" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" "github.com/cosmos/evm/x/vm/statedb" @@ -146,7 +145,7 @@ func toMsgSlice(msgs []*evmsdktypes.MsgEthereumTx) []sdk.Msg { func TestMonoDecorator(t *testing.T) { chainID := uint64(config.EighteenDecimalsChainID) - require.NoError(t, evmconfig.EvmAppOptions(chainID)) + require.NoError(t, config.EvmAppOptions(chainID)) cfg := encoding.MakeConfig(chainID) testCases := []struct { diff --git a/config/constants.go b/config/constants.go index 5c47914b6..e7180db42 100644 --- a/config/constants.go +++ b/config/constants.go @@ -19,8 +19,6 @@ const ( // TODO:VLAD - Clean this up // TwoDecimalsChainID is the chain ID for the 2 decimals chain. TwoDecimalsChainID = 9004 - CosmosChainID = 262144 - // TestChainID1 is test chain IDs for IBC E2E test TestChainID1 = 9005 // TestChainID2 is test chain IDs for IBC E2E test diff --git a/evmd/genesis.go b/evmd/genesis.go index 68def66f4..27f7727c9 100644 --- a/evmd/genesis.go +++ b/evmd/genesis.go @@ -2,8 +2,7 @@ package evmd import ( "encoding/json" - "github.com/cosmos/evm/testutil/config" - + "github.com/cosmos/evm/config" 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/config/config.go b/testutil/config/config.go index beff48a06..4148ef6df 100644 --- a/testutil/config/config.go +++ b/testutil/config/config.go @@ -1,6 +1,7 @@ package config import ( + "github.com/cosmos/evm/config" "github.com/cosmos/evm/types" evmtypes "github.com/cosmos/evm/x/vm/types" @@ -11,16 +12,16 @@ import ( // that allows initializing the app with different coin info based on the // chain id var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this - EighteenDecimalsChainID: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleDisplayDenom, + config.EighteenDecimalsChainID: { + Denom: config.ExampleChainDenom, + ExtendedDenom: config.ExampleChainDenom, + DisplayDenom: config.ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, EVMChainID: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleDisplayDenom, + Denom: config.ExampleChainDenom, + ExtendedDenom: config.ExampleChainDenom, + DisplayDenom: config.ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, } diff --git a/testutil/config/config_testing.go b/testutil/config/config_testing.go index 220b85919..d682f95ab 100644 --- a/testutil/config/config_testing.go +++ b/testutil/config/config_testing.go @@ -4,6 +4,7 @@ package config import ( + "github.com/cosmos/evm/config" evmtypes "github.com/cosmos/evm/x/vm/types" ) @@ -11,46 +12,46 @@ import ( // that allows initializing the app with different coin info based on the // chain id var TestChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this - EighteenDecimalsChainID: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleDisplayDenom, + config.EighteenDecimalsChainID: { + Denom: config.ExampleChainDenom, + ExtendedDenom: config.ExampleChainDenom, + DisplayDenom: config.ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, - SixDecimalsChainID: { + config.SixDecimalsChainID: { Denom: "utest", ExtendedDenom: "atest", DisplayDenom: "test", Decimals: evmtypes.SixDecimals, }, - TwelveDecimalsChainID: { + config.TwelveDecimalsChainID: { Denom: "ptest2", ExtendedDenom: "atest2", DisplayDenom: "test2", Decimals: evmtypes.TwelveDecimals, }, - TwoDecimalsChainID: { + config.TwoDecimalsChainID: { Denom: "ctest3", ExtendedDenom: "atest3", DisplayDenom: "test3", Decimals: evmtypes.TwoDecimals, }, - TestChainID1: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleChainDenom, + config.TestChainID1: { + Denom: config.ExampleChainDenom, + ExtendedDenom: config.ExampleChainDenom, + DisplayDenom: config.ExampleChainDenom, Decimals: evmtypes.EighteenDecimals, }, - TestChainID2: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleChainDenom, + config.TestChainID2: { + Denom: config.ExampleChainDenom, + ExtendedDenom: config.ExampleChainDenom, + DisplayDenom: config.ExampleChainDenom, Decimals: evmtypes.EighteenDecimals, }, EVMChainID: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleDisplayDenom, + Denom: config.ExampleChainDenom, + ExtendedDenom: config.ExampleChainDenom, + DisplayDenom: config.ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, } diff --git a/testutil/config/constants.go b/testutil/config/constants.go deleted file mode 100644 index 5c47914b6..000000000 --- a/testutil/config/constants.go +++ /dev/null @@ -1,31 +0,0 @@ -package config - -const ( // TODO:VLAD - Clean this up - // ExampleChainDenom is the denomination of the Cosmos EVM example chain's base coin. - ExampleChainDenom = "aatom" - - // ExampleDisplayDenom is the display denomination of the Cosmos EVM example chain's base coin. - ExampleDisplayDenom = "atom" - - // EighteenDecimalsChainID is the chain ID for the 18 decimals chain. - EighteenDecimalsChainID = 9001 - - // SixDecimalsChainID is the chain ID for the 6 decimals chain. - SixDecimalsChainID = 9002 - - // TwelveDecimalsChainID is the chain ID for the 12 decimals chain. - TwelveDecimalsChainID = 9003 - - // TwoDecimalsChainID is the chain ID for the 2 decimals chain. - TwoDecimalsChainID = 9004 - - CosmosChainID = 262144 - - // TestChainID1 is test chain IDs for IBC E2E test - TestChainID1 = 9005 - // TestChainID2 is test chain IDs for IBC E2E test - TestChainID2 = 9006 - - // WEVMOSContractMainnet is the WEVMOS contract address for mainnet - WEVMOSContractMainnet = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517" -) diff --git a/testutil/config/evm_app_options.go b/testutil/config/evm_app_options.go deleted file mode 100644 index 9b3702a61..000000000 --- a/testutil/config/evm_app_options.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build !test -// +build !test - -package config diff --git a/testutil/config/genesis.go b/testutil/config/genesis.go index 4dc55d415..2da76292a 100644 --- a/testutil/config/genesis.go +++ b/testutil/config/genesis.go @@ -2,6 +2,7 @@ package config import ( "encoding/json" + "github.com/cosmos/evm/config" testconstants "github.com/cosmos/evm/testutil/constants" erc20types "github.com/cosmos/evm/x/erc20/types" @@ -48,7 +49,7 @@ func NewErc20GenesisState() *erc20types.GenesisState { // NOTE: for the example chain implementation we are also adding a default minter. func NewMintGenesisState() *minttypes.GenesisState { mintGenState := minttypes.DefaultGenesisState() - mintGenState.Params.MintDenom = ExampleChainDenom + mintGenState.Params.MintDenom = config.ExampleChainDenom return mintGenState } diff --git a/testutil/constants/constants_test.go b/testutil/constants/constants_test.go index 30c951cd4..9b3a70328 100644 --- a/testutil/constants/constants_test.go +++ b/testutil/constants/constants_test.go @@ -1,11 +1,11 @@ package constants_test import ( + "github.com/cosmos/evm/config" "testing" "github.com/stretchr/testify/require" - "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/constants" ) diff --git a/testutil/ibc/chain.go b/testutil/ibc/chain.go index e78c82c4b..a1ff2589d 100644 --- a/testutil/ibc/chain.go +++ b/testutil/ibc/chain.go @@ -3,6 +3,7 @@ package ibctesting import ( "fmt" + "github.com/cosmos/evm/config" "math/big" "testing" "time" @@ -19,7 +20,6 @@ import ( "github.com/cosmos/evm" "github.com/cosmos/evm/crypto/ethsecp256k1" - "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/tx" "github.com/cosmos/evm/x/vm/types" clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types" From 567764f959e366e7bb18d123fdb97df325e6a81d Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 10:54:24 -0400 Subject: [PATCH 08/45] fix eips test the test was using a duplicate eips multiplier value instead of the global one moved to config --- evmd/tests/integration/eips/eips_test.go | 13 + .../integration/eips/eips.go | 229 +++++++++--------- 2 files changed, 122 insertions(+), 120 deletions(-) create mode 100644 evmd/tests/integration/eips/eips_test.go rename evmd/tests/integration/eips_test.go => tests/integration/eips/eips.go (58%) diff --git a/evmd/tests/integration/eips/eips_test.go b/evmd/tests/integration/eips/eips_test.go new file mode 100644 index 000000000..1b283a8a4 --- /dev/null +++ b/evmd/tests/integration/eips/eips_test.go @@ -0,0 +1,13 @@ +package eips_test + +import ( + "github.com/cosmos/evm/evmd/tests/integration" + "github.com/cosmos/evm/tests/integration/eips" + "testing" + //nolint:revive // dot imports are fine for Ginkgo + //nolint:revive // dot imports are fine for Ginkgo +) + +func TestEIPs(t *testing.T) { + eips.RunTests(t, integration.CreateEvmd) +} diff --git a/evmd/tests/integration/eips_test.go b/tests/integration/eips/eips.go similarity index 58% rename from evmd/tests/integration/eips_test.go rename to tests/integration/eips/eips.go index 23d9523ae..b6720dcd1 100644 --- a/evmd/tests/integration/eips_test.go +++ b/tests/integration/eips/eips.go @@ -1,41 +1,34 @@ -package integration_test +package eips import ( "fmt" + "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/evm/eips" "github.com/cosmos/evm/eips/testdata" - "github.com/cosmos/evm/evmd/tests/integration" - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/params" - - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/ginkgo/v2" - //nolint:revive // dot imports are fine for Ginkgo - . "github.com/onsi/gomega" - - testconfig "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/integration/evm/factory" "github.com/cosmos/evm/testutil/integration/evm/grpc" "github.com/cosmos/evm/testutil/integration/evm/network" "github.com/cosmos/evm/testutil/integration/evm/utils" "github.com/cosmos/evm/testutil/keyring" - testutiltypes "github.com/cosmos/evm/testutil/types" - evmtypes "github.com/cosmos/evm/x/vm/types" - - "github.com/cosmos/cosmos-sdk/crypto/types" + types2 "github.com/cosmos/evm/testutil/types" + types3 "github.com/cosmos/evm/x/vm/types" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/params" + "github.com/onsi/ginkgo/v2" + "github.com/onsi/gomega" + "math/big" + "testing" ) +// RunTests // Below tests are divided in 3 steps: // 1. Deploy and interact with contracts to compute the gas used BEFORE enabling // the EIP. // 2. Activate the EIP under test. // 3. Deploy and interact with contracts to compute the gas used AFTER enabling // the EIP. - func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.ConfigOption) { - _ = Describe("EIP-0000 - ", Ordered, func() { + _ = ginkgo.Describe("EIP-0000 - ", ginkgo.Ordered, func() { var ( in network.Network tf factory.TxFactory @@ -56,14 +49,14 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf // The factory counter is used because it will create a new instance of // the counter contract, allowing to test the CREATE opcode. counterFactoryContract, err := testdata.LoadCounterFactoryContract() - Expect(err).ToNot(HaveOccurred(), "failed to load Counter Factory contract") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to load Counter Factory contract") - deploymentData := testutiltypes.ContractDeploymentData{ + deploymentData := types2.ContractDeploymentData{ Contract: counterFactoryContract, ConstructorArgs: []interface{}{}, } - BeforeAll(func() { + ginkgo.BeforeAll(func() { k = keyring.New(2) opts := []network.ConfigOption{ network.WithPreFundedAccounts(k.GetAllAccAddrs()...), @@ -82,7 +75,7 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf senderAddr2 = k.GetAddr(1) // Set extra EIPs to empty to allow testing a single modifier. - defaultParams := evmtypes.DefaultParams() + defaultParams := types3.DefaultParams() defaultParams.ExtraEIPs = []int64{} err := utils.UpdateEvmParams( @@ -93,25 +86,25 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf Params: defaultParams, }, ) - Expect(err).To(BeNil(), "failed during update of evm params") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(err).To(gomega.BeNil(), "failed during update of evm params") + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) }) - It("should deploy the contract before enabling the EIP", func() { - deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr2, evmtypes.EvmTxArgs{}, deploymentData) - Expect(err).To(BeNil(), "failed to create deployment tx args") + ginkgo.It("should deploy the contract before enabling the EIP", func() { + deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr2, types3.EvmTxArgs{}, deploymentData) + gomega.Expect(err).To(gomega.BeNil(), "failed to create deployment tx args") res, err := tf.ExecuteEthTx(senderPriv2, deploymentTxArgs) - Expect(err).To(BeNil(), "failed during contract deployment") + gomega.Expect(err).To(gomega.BeNil(), "failed during contract deployment") gasUsedPre = res.GasUsed }) - It("should enable the new EIP", func() { - testconfig.Multiplier = eipMultiplier + ginkgo.It("should enable the new EIP", func() { + eips.Multiplier = eipMultiplier newEIP := 0o000 qRes, err := gh.GetEvmParams() - Expect(err).To(BeNil(), "failed during query to evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during query to evm params") qRes.Params.ExtraEIPs = append(qRes.Params.ExtraEIPs, int64(newEIP)) err = utils.UpdateEvmParams( utils.UpdateParamsInput{ @@ -121,27 +114,27 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf Params: qRes.Params, }, ) - Expect(err).To(BeNil(), "failed during update of evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during update of evm params") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) qRes, err = gh.GetEvmParams() - Expect(err).To(BeNil(), "failed during query to evm params") - Expect(qRes.Params.ExtraEIPs).To(ContainElement(int64(newEIP)), "expected to have EIP 0000 in evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during query to evm params") + gomega.Expect(qRes.Params.ExtraEIPs).To(gomega.ContainElement(int64(newEIP)), "expected to have EIP 0000 in evm params") }) - It("should change CREATE opcode constant gas after enabling EIP", func() { + ginkgo.It("should change CREATE opcode constant gas after enabling EIP", func() { qRes, err := gh.GetEvmParams() _ = qRes.Params gasCostPre := params.CreateGas - deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr2, evmtypes.EvmTxArgs{}, deploymentData) - Expect(err).To(BeNil(), "failed to create deployment tx args") + deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr2, types3.EvmTxArgs{}, deploymentData) + gomega.Expect(err).To(gomega.BeNil(), "failed to create deployment tx args") res, err := tf.ExecuteEthTx(senderPriv2, deploymentTxArgs) - Expect(err).To(BeNil(), "failed during contract deployment") + gomega.Expect(err).To(gomega.BeNil(), "failed during contract deployment") // commit block to update sender nonce - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) gasUsedPost := res.GasUsed @@ -149,11 +142,11 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf // opcode before enabling the new eip. gasUsedDiff := eipMultiplier*gasCostPre - gasCostPre expectedGas := gasUsedPre + int64(gasUsedDiff) //#nosec G115 -- int overflow is not a concern here - Expect(gasUsedPost).To(Equal(expectedGas)) + gomega.Expect(gasUsedPost).To(gomega.Equal(expectedGas)) }) }) - _ = Describe("EIP0001 - ", Ordered, func() { + _ = ginkgo.Describe("EIP0001 - ", ginkgo.Ordered, func() { var ( in network.Network tf factory.TxFactory @@ -176,9 +169,9 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf // The counter factory contract is used to deploy a counter contract and // perform state transition using the CALL opcode. counterFactoryContract, err := testdata.LoadCounterFactoryContract() - Expect(err).ToNot(HaveOccurred(), "failed to load Counter Factory contract") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to load Counter Factory contract") - BeforeAll(func() { + ginkgo.BeforeAll(func() { k = keyring.New(1) opts := []network.ConfigOption{ network.WithPreFundedAccounts(k.GetAllAccAddrs()...), @@ -191,7 +184,7 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf senderPriv = k.GetPrivKey(0) // Set extra EIPs to empty to allow testing a single modifier. - defaultParams := evmtypes.DefaultParams() + defaultParams := types3.DefaultParams() defaultParams.ExtraEIPs = []int64{} err = utils.UpdateEvmParams( utils.UpdateParamsInput{ @@ -201,69 +194,69 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf Params: defaultParams, }, ) - Expect(err).To(BeNil(), "failed during update of evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during update of evm params") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) }) - It("should deploy the contract before enabling the EIP", func() { + ginkgo.It("should deploy the contract before enabling the EIP", func() { counterFactoryAddr, err = tf.DeployContract( senderPriv, - evmtypes.EvmTxArgs{}, - testutiltypes.ContractDeploymentData{ + types3.EvmTxArgs{}, + types2.ContractDeploymentData{ Contract: counterFactoryContract, ConstructorArgs: []interface{}{}, }, ) - Expect(err).ToNot(HaveOccurred(), "failed to deploy counter factory contract") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to deploy counter factory contract") + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) res, err := tf.ExecuteContractCall( senderPriv, - evmtypes.EvmTxArgs{To: &counterFactoryAddr}, - testutiltypes.CallArgs{ + types3.EvmTxArgs{To: &counterFactoryAddr}, + types2.CallArgs{ ContractABI: counterFactoryContract.ABI, MethodName: "incrementCounter", Args: []interface{}{}, }, ) - Expect(err).ToNot(HaveOccurred(), "failed to increment counter value") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to increment counter value") gasUsedPre = res.GasUsed - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) // Query the counter value to check proper state transition later. res, err = tf.ExecuteContractCall( senderPriv, - evmtypes.EvmTxArgs{To: &counterFactoryAddr}, - testutiltypes.CallArgs{ + types3.EvmTxArgs{To: &counterFactoryAddr}, + types2.CallArgs{ ContractABI: counterFactoryContract.ABI, MethodName: "getCounterValue", Args: []interface{}{}, }, ) - Expect(err).ToNot(HaveOccurred(), "failed to get counter value") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to get counter value") + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) - ethRes, err := evmtypes.DecodeTxResponse(res.Data) - Expect(err).ToNot(HaveOccurred(), "failed to decode tx response") + ethRes, err := types3.DecodeTxResponse(res.Data) + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to decode tx response") unpacked, err := counterFactoryContract.ABI.Unpack( "getCounterValue", ethRes.Ret, ) - Expect(err).ToNot(HaveOccurred(), "failed to unpack counter value") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to unpack counter value") counter, ok := unpacked[0].(*big.Int) - Expect(ok).To(BeTrue(), "failed to convert counter to big.Int") - Expect(counter.String()).To(Equal(fmt.Sprintf("%d", initialCounterValue+1)), "counter is not correct") + gomega.Expect(ok).To(gomega.BeTrue(), "failed to convert counter to big.Int") + gomega.Expect(counter.String()).To(gomega.Equal(fmt.Sprintf("%d", initialCounterValue+1)), "counter is not correct") }) - It("should enable the new EIP", func() { - testconfig.Multiplier = eipMultiplier + ginkgo.It("should enable the new EIP", func() { + eips.Multiplier = eipMultiplier newEIP := 0o001 qRes, err := gh.GetEvmParams() - Expect(err).To(BeNil(), "failed during query to evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during query to evm params") qRes.Params.ExtraEIPs = append(qRes.Params.ExtraEIPs, int64(newEIP)) err = utils.UpdateEvmParams( @@ -274,65 +267,65 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf Params: qRes.Params, }, ) - Expect(err).To(BeNil(), "failed during update of evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during update of evm params") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) qRes, err = gh.GetEvmParams() - Expect(err).To(BeNil(), "failed during query to evm params") - Expect(qRes.Params.ExtraEIPs).To(ContainElement(int64(newEIP)), "expected to have eip 0001 in evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during query to evm params") + gomega.Expect(qRes.Params.ExtraEIPs).To(gomega.ContainElement(int64(newEIP)), "expected to have eip 0001 in evm params") }) - It("should change CALL opcode constant gas after enabling EIP", func() { + ginkgo.It("should change CALL opcode constant gas after enabling EIP", func() { // Constant gas cost used before enabling the new EIP. gasCostPre := params.WarmStorageReadCostEIP2929 res, err := tf.ExecuteContractCall( senderPriv, - evmtypes.EvmTxArgs{To: &counterFactoryAddr}, - testutiltypes.CallArgs{ + types3.EvmTxArgs{To: &counterFactoryAddr}, + types2.CallArgs{ ContractABI: counterFactoryContract.ABI, MethodName: "incrementCounter", Args: []interface{}{}, }, ) - Expect(err).ToNot(HaveOccurred(), "failed to increment counter value") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to increment counter value") gasUsedPost := res.GasUsed - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) res, err = tf.ExecuteContractCall( senderPriv, - evmtypes.EvmTxArgs{To: &counterFactoryAddr}, - testutiltypes.CallArgs{ + types3.EvmTxArgs{To: &counterFactoryAddr}, + types2.CallArgs{ ContractABI: counterFactoryContract.ABI, MethodName: "getCounterValue", Args: []interface{}{}, }, ) - Expect(err).ToNot(HaveOccurred(), "failed to get counter value") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to get counter value") + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) - ethRes, err := evmtypes.DecodeTxResponse(res.Data) - Expect(err).ToNot(HaveOccurred(), "failed to decode tx response") + ethRes, err := types3.DecodeTxResponse(res.Data) + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to decode tx response") unpacked, err := counterFactoryContract.ABI.Unpack( "getCounterValue", ethRes.Ret, ) - Expect(err).ToNot(HaveOccurred(), "failed to unpack counter value") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to unpack counter value") counter, ok := unpacked[0].(*big.Int) - Expect(ok).To(BeTrue(), "failed to convert counter to big.Int") - Expect(counter.String()).To(Equal(fmt.Sprintf("%d", initialCounterValue+2)), "counter is not updated correctly") + gomega.Expect(ok).To(gomega.BeTrue(), "failed to convert counter to big.Int") + gomega.Expect(counter.String()).To(gomega.Equal(fmt.Sprintf("%d", initialCounterValue+2)), "counter is not updated correctly") // The difference in gas is the new cost of the opcode, minus the cost of the // opcode before enabling the new eip. gasUsedDiff := eipMultiplier*gasCostPre - gasCostPre expectedGas := gasUsedPre + int64(gasUsedDiff) //#nosec G115 -- int overflow is not a concern here - Expect(gasUsedPost).To(Equal(expectedGas)) + gomega.Expect(gasUsedPost).To(gomega.Equal(expectedGas)) }) }) - _ = Describe("EIP0002 - ", Ordered, func() { + _ = ginkgo.Describe("EIP0002 - ", ginkgo.Ordered, func() { var ( in network.Network tf factory.TxFactory @@ -349,13 +342,13 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf constantGas := uint64(500) counterContract, err := testdata.LoadCounterContract() - Expect(err).ToNot(HaveOccurred(), "failed to load Counter contract") + gomega.Expect(err).ToNot(gomega.HaveOccurred(), "failed to load Counter contract") - deploymentData := testutiltypes.ContractDeploymentData{ + deploymentData := types2.ContractDeploymentData{ Contract: counterContract, ConstructorArgs: []interface{}{}, } - BeforeAll(func() { + ginkgo.BeforeAll(func() { k = keyring.New(2) opts := []network.ConfigOption{ network.WithPreFundedAccounts(k.GetAllAccAddrs()...), @@ -375,7 +368,7 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf senderAddr2 = k.GetAddr(0) // Set extra EIPs to empty to allow testing a single modifier. - defaultParams := evmtypes.DefaultParams() + defaultParams := types3.DefaultParams() defaultParams.ExtraEIPs = []int64{} err = utils.UpdateEvmParams( @@ -386,28 +379,28 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf Params: defaultParams, }, ) - Expect(err).To(BeNil(), "failed during update of evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during update of evm params") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) }) - It("should deploy the contract before enabling the EIP", func() { - deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr, evmtypes.EvmTxArgs{}, deploymentData) - Expect(err).To(BeNil(), "failed to create deployment tx args") + ginkgo.It("should deploy the contract before enabling the EIP", func() { + deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr, types3.EvmTxArgs{}, deploymentData) + gomega.Expect(err).To(gomega.BeNil(), "failed to create deployment tx args") res, err := tf.ExecuteEthTx(senderPriv, deploymentTxArgs) - Expect(err).To(BeNil(), "failed during contract deployment") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(err).To(gomega.BeNil(), "failed during contract deployment") + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) gasUsedPre = res.GasUsed }) - It("should enable the new EIP", func() { - testconfig.SstoreConstantGas = constantGas + ginkgo.It("should enable the new EIP", func() { + eips.SstoreConstantGas = constantGas newEIP := 0o002 qRes, err := gh.GetEvmParams() - Expect(err).To(BeNil(), "failed during query to evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during query to evm params") qRes.Params.ExtraEIPs = append(qRes.Params.ExtraEIPs, int64(newEIP)) err = utils.UpdateEvmParams( utils.UpdateParamsInput{ @@ -417,36 +410,32 @@ func RunTests(t *testing.T, create network.CreateEvmApp, options ...network.Conf Params: qRes.Params, }, ) - Expect(err).To(BeNil(), "failed during update of evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during update of evm params") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) qRes, err = gh.GetEvmParams() - Expect(err).To(BeNil(), "failed during query to evm params") - Expect(qRes.Params.ExtraEIPs).To(ContainElement(int64(newEIP)), "expected to have eip 0002 in evm params") + gomega.Expect(err).To(gomega.BeNil(), "failed during query to evm params") + gomega.Expect(qRes.Params.ExtraEIPs).To(gomega.ContainElement(int64(newEIP)), "expected to have eip 0002 in evm params") }) - It("should change SSTORE opcode constant gas after enabling EIP", func() { - deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr2, evmtypes.EvmTxArgs{}, deploymentData) - Expect(err).To(BeNil(), "failed to create deployment tx args") + ginkgo.It("should change SSTORE opcode constant gas after enabling EIP", func() { + deploymentTxArgs, err := tf.GenerateDeployContractArgs(senderAddr2, types3.EvmTxArgs{}, deploymentData) + gomega.Expect(err).To(gomega.BeNil(), "failed to create deployment tx args") res, err := tf.ExecuteEthTx(senderPriv2, deploymentTxArgs) - Expect(err).To(BeNil(), "failed during contract deployment") - Expect(in.NextBlock()).To(BeNil()) + gomega.Expect(err).To(gomega.BeNil(), "failed during contract deployment") + gomega.Expect(in.NextBlock()).To(gomega.BeNil()) gasUsedPost := res.GasUsed // The expected gas is previous gas plus the constant gas because // previous this eip, SSTORE was using only the dynamic gas. expectedGas := gasUsedPre + int64(constantGas) //#nosec G115 -- int overflow is not a concern here - Expect(gasUsedPost).To(Equal(expectedGas)) + gomega.Expect(gasUsedPost).To(gomega.Equal(expectedGas)) }) }) - RegisterFailHandler(Fail) - RunSpecs(t, "EIPs Suite") -} - -func TestEIPs(t *testing.T) { - RunTests(t, integration.CreateEvmd) + gomega.RegisterFailHandler(ginkgo.Fail) + ginkgo.RunSpecs(t, "EIPs Suite") } From 91d432c457dfe14129b3496d77626f1ccad0124a Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 11:00:25 -0400 Subject: [PATCH 09/45] remove all configs except for genesis from testutil/config and consolidate into /config --- tests/integration/eip712/test_eip712.go | 2 +- .../precompiles/bech32/test_bech32.go | 2 +- .../precompiles/bech32/test_methods.go | 2 +- .../precompiles/distribution/test_event.go | 2 +- testutil/config/activators.go | 13 ---- testutil/config/config.go | 66 ------------------- testutil/config/config_testing.go | 57 ---------------- testutil/config/eips.go | 33 ---------- testutil/ibc/helpers.go | 3 +- 9 files changed, 5 insertions(+), 175 deletions(-) delete mode 100644 testutil/config/activators.go delete mode 100644 testutil/config/config.go delete mode 100644 testutil/config/config_testing.go delete mode 100644 testutil/config/eips.go diff --git a/tests/integration/eip712/test_eip712.go b/tests/integration/eip712/test_eip712.go index 92b498139..4884a9d85 100644 --- a/tests/integration/eip712/test_eip712.go +++ b/tests/integration/eip712/test_eip712.go @@ -3,6 +3,7 @@ package eip712 import ( "bytes" "fmt" + "github.com/cosmos/evm/config" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/signer/core/apitypes" @@ -12,7 +13,6 @@ import ( "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/ethereum/eip712" - "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/constants" "github.com/cosmos/evm/testutil/integration/evm/network" evmtypes "github.com/cosmos/evm/x/vm/types" diff --git a/tests/integration/precompiles/bech32/test_bech32.go b/tests/integration/precompiles/bech32/test_bech32.go index ef6f258b9..668a78af1 100644 --- a/tests/integration/precompiles/bech32/test_bech32.go +++ b/tests/integration/precompiles/bech32/test_bech32.go @@ -1,12 +1,12 @@ package bech32 import ( + "github.com/cosmos/evm/config" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/vm" "github.com/holiman/uint256" "github.com/cosmos/evm/precompiles/bech32" - "github.com/cosmos/evm/testutil/config" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/tests/integration/precompiles/bech32/test_methods.go b/tests/integration/precompiles/bech32/test_methods.go index 592554cd6..c4e7acff5 100644 --- a/tests/integration/precompiles/bech32/test_methods.go +++ b/tests/integration/precompiles/bech32/test_methods.go @@ -2,12 +2,12 @@ package bech32 import ( "fmt" + "github.com/cosmos/evm/config" "github.com/ethereum/go-ethereum/common" "github.com/cosmos/evm/precompiles/bech32" cmn "github.com/cosmos/evm/precompiles/common" - "github.com/cosmos/evm/testutil/config" sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/tests/integration/precompiles/distribution/test_event.go b/tests/integration/precompiles/distribution/test_event.go index c83178113..05be91f6e 100644 --- a/tests/integration/precompiles/distribution/test_event.go +++ b/tests/integration/precompiles/distribution/test_event.go @@ -1,6 +1,7 @@ package distribution import ( + "github.com/cosmos/evm/config" "math/big" "github.com/ethereum/go-ethereum/common" @@ -11,7 +12,6 @@ import ( cmn "github.com/cosmos/evm/precompiles/common" "github.com/cosmos/evm/precompiles/distribution" "github.com/cosmos/evm/precompiles/testutil" - "github.com/cosmos/evm/testutil/config" "github.com/cosmos/evm/testutil/constants" "github.com/cosmos/evm/x/vm/statedb" diff --git a/testutil/config/activators.go b/testutil/config/activators.go deleted file mode 100644 index a88b99e69..000000000 --- a/testutil/config/activators.go +++ /dev/null @@ -1,13 +0,0 @@ -package config - -import ( - "github.com/ethereum/go-ethereum/core/vm" -) - -// cosmosEVMActivators defines a map of opcode modifiers associated -// with a key defining the corresponding EIP. -var cosmosEVMActivators = map[int]func(*vm.JumpTable){ - 0o000: Enable0000, - 0o001: Enable0001, - 0o002: Enable0002, -} diff --git a/testutil/config/config.go b/testutil/config/config.go deleted file mode 100644 index 4148ef6df..000000000 --- a/testutil/config/config.go +++ /dev/null @@ -1,66 +0,0 @@ -package config - -import ( - "github.com/cosmos/evm/config" - "github.com/cosmos/evm/types" - evmtypes "github.com/cosmos/evm/x/vm/types" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// ChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo -// that allows initializing the app with different coin info based on the -// chain id -var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this - config.EighteenDecimalsChainID: { - Denom: config.ExampleChainDenom, - ExtendedDenom: config.ExampleChainDenom, - DisplayDenom: config.ExampleDisplayDenom, - Decimals: evmtypes.EighteenDecimals, - }, - EVMChainID: { - Denom: config.ExampleChainDenom, - ExtendedDenom: config.ExampleChainDenom, - DisplayDenom: config.ExampleDisplayDenom, - Decimals: evmtypes.EighteenDecimals, - }, -} - -const ( - // Bech32Prefix defines the Bech32 prefix used for accounts on the exemplary Cosmos EVM blockchain. - Bech32Prefix = "cosmos" - // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address. - Bech32PrefixAccAddr = Bech32Prefix - // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key. - Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic - // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address. - Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator - // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key. - Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic - // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address. - Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus - // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key. - Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic - // DisplayDenom defines the denomination displayed to users in client applications. - DisplayDenom = "atom" - // BaseDenom defines to the default denomination used in the Cosmos EVM example chain. - BaseDenom = "aatom" - // BaseDenomUnit defines the precision of the base denomination. - BaseDenomUnit = 18 - // EVMChainID defines the EIP-155 replay-protection chain id for the current ethereum chain config. - EVMChainID = 262144 -) - -// SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings. -func SetBech32Prefixes(config *sdk.Config) { - config.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub) - config.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub) - config.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub) -} - -// 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 -} diff --git a/testutil/config/config_testing.go b/testutil/config/config_testing.go deleted file mode 100644 index d682f95ab..000000000 --- a/testutil/config/config_testing.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build test -// +build test - -package config - -import ( - "github.com/cosmos/evm/config" - evmtypes "github.com/cosmos/evm/x/vm/types" -) - -// TestChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo -// that allows initializing the app with different coin info based on the -// chain id -var TestChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this - config.EighteenDecimalsChainID: { - Denom: config.ExampleChainDenom, - ExtendedDenom: config.ExampleChainDenom, - DisplayDenom: config.ExampleDisplayDenom, - Decimals: evmtypes.EighteenDecimals, - }, - config.SixDecimalsChainID: { - Denom: "utest", - ExtendedDenom: "atest", - DisplayDenom: "test", - Decimals: evmtypes.SixDecimals, - }, - config.TwelveDecimalsChainID: { - Denom: "ptest2", - ExtendedDenom: "atest2", - DisplayDenom: "test2", - Decimals: evmtypes.TwelveDecimals, - }, - config.TwoDecimalsChainID: { - Denom: "ctest3", - ExtendedDenom: "atest3", - DisplayDenom: "test3", - Decimals: evmtypes.TwoDecimals, - }, - config.TestChainID1: { - Denom: config.ExampleChainDenom, - ExtendedDenom: config.ExampleChainDenom, - DisplayDenom: config.ExampleChainDenom, - Decimals: evmtypes.EighteenDecimals, - }, - config.TestChainID2: { - Denom: config.ExampleChainDenom, - ExtendedDenom: config.ExampleChainDenom, - DisplayDenom: config.ExampleChainDenom, - Decimals: evmtypes.EighteenDecimals, - }, - EVMChainID: { - Denom: config.ExampleChainDenom, - ExtendedDenom: config.ExampleChainDenom, - DisplayDenom: config.ExampleDisplayDenom, - Decimals: evmtypes.EighteenDecimals, - }, -} diff --git a/testutil/config/eips.go b/testutil/config/eips.go deleted file mode 100644 index a1157805e..000000000 --- a/testutil/config/eips.go +++ /dev/null @@ -1,33 +0,0 @@ -package config - -import ( - "github.com/ethereum/go-ethereum/core/vm" -) - -var ( - Multiplier = uint64(10) - SstoreConstantGas = uint64(500) -) - -// enable0000 contains the logic to modify the CREATE and CREATE2 opcodes -// constant gas value. -func Enable0000(jt *vm.JumpTable) { - currentValCreate := jt[vm.CREATE].GetConstantGas() - jt[vm.CREATE].SetConstantGas(currentValCreate * Multiplier) - - currentValCreate2 := jt[vm.CREATE2].GetConstantGas() - jt[vm.CREATE2].SetConstantGas(currentValCreate2 * Multiplier) -} - -// enable0001 contains the logic to modify the CALL opcode -// constant gas value. -func Enable0001(jt *vm.JumpTable) { - currentVal := jt[vm.CALL].GetConstantGas() - jt[vm.CALL].SetConstantGas(currentVal * Multiplier) -} - -// enable0002 contains the logic to modify the SSTORE opcode -// constant gas value. -func Enable0002(jt *vm.JumpTable) { - jt[vm.SSTORE].SetConstantGas(SstoreConstantGas) -} diff --git a/testutil/ibc/helpers.go b/testutil/ibc/helpers.go index 85f749944..7cf9ea65f 100644 --- a/testutil/ibc/helpers.go +++ b/testutil/ibc/helpers.go @@ -1,6 +1,7 @@ package ibctesting import ( + "github.com/cosmos/evm/config" "math/big" "math/rand" "testing" @@ -10,8 +11,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/evm/testutil/config" - bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" From dda4aacc3b2bfd9d2191e09ed89a5fd9a1a2c2ec Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 11:31:46 -0400 Subject: [PATCH 10/45] changelogchangelogchangelogchangelogchangelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d6bf69e..998477579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ - [\#635](https://github.com/cosmos/evm/pull/635) Move DefaultStaticPrecompiles to /evm and allow projects to set it by default alongside the keeper. - [\#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. +- [\#659](https://github.com/cosmos/evm/pull/659) Move configs out of EVMD and deduplicate configs ### FEATURES From 94fc72a248bd10da957ea9bc7181e0c3740f7705 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 12:14:57 -0400 Subject: [PATCH 11/45] lints --- evmd/cmd/evmd/main.go | 10 +++++----- evmd/tests/integration/create_app.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/evmd/cmd/evmd/main.go b/evmd/cmd/evmd/main.go index fea2301b4..1ede2c86e 100644 --- a/evmd/cmd/evmd/main.go +++ b/evmd/cmd/evmd/main.go @@ -2,11 +2,11 @@ package main import ( "fmt" - config2 "github.com/cosmos/evm/config" "os" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/evm/config" "github.com/cosmos/evm/evmd/cmd/evmd/cmd" ) @@ -14,14 +14,14 @@ func main() { setupSDKConfig() rootCmd := cmd.NewRootCmd() - if err := svrcmd.Execute(rootCmd, "evmd", config2.MustGetDefaultNodeHome()); err != nil { + if err := svrcmd.Execute(rootCmd, "evmd", config.MustGetDefaultNodeHome()); err != nil { fmt.Fprintln(rootCmd.OutOrStderr(), err) os.Exit(1) } } func setupSDKConfig() { - config := sdk.GetConfig() - config2.SetBech32Prefixes(config) - config.Seal() + cfg := sdk.GetConfig() + config.SetBech32Prefixes(cfg) + cfg.Seal() } diff --git a/evmd/tests/integration/create_app.go b/evmd/tests/integration/create_app.go index ef7c00195..fc1ac26ad 100644 --- a/evmd/tests/integration/create_app.go +++ b/evmd/tests/integration/create_app.go @@ -2,10 +2,10 @@ package integration import ( "encoding/json" - "github.com/cosmos/evm/config" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/evm" + "github.com/cosmos/evm/config" "github.com/cosmos/evm/evmd" "github.com/cosmos/evm/testutil/constants" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" From fde47c064255265cddaa0cb063cc5d3751f28e46 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 16:31:23 -0400 Subject: [PATCH 12/45] wip: removing app options (tests failing) app options is removed from new app creation. however, we're getting a recovered panic on *restarting* the chain due to prepareproposal running before preblocker: +0x120\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).PrepareProposal.func1()\n\tgithub.com/cosmos/cosmos-sdk@v0.53.4/baseapp/abci.go:433 +0x38\npanic({0x1061c8160?, 0x10912faa0?})\n\truntime/panic.go:783 +0x120\ngithub.com/cosmos/evm/x/vm/types.GetEVMCoinDecimals(...)\n\tgithub.com/cosmos/evm@v0.2.0/x/vm/types/denom_config.go:61\ngithub.com/cosmos/evm/x/vm/types.ConvertAmountTo18DecimalsLegacy(...)\n\tgithub.com/cosmos/evm@v0.2.0/x/vm/types/scaling.go:17\ngithub.com/cosmos/evm/x/vm/wrappers.FeeMarketWrapper.GetBaseFee({{_, _}}, {{0x10698a810, 0x109225540}, {0x1069b51c0, 0x14001f4c200}, {{0x0, 0x0}, {0x16dc0f689, 0x4}, ...}, ...})\n\tgithub.com/cosmos/evm@v0.2.0/x/vm/wrappers/feemarket.go:38 +0x68\ngithub.com/cosmos/evm/x/vm/keeper.Keeper.GetBaseFee({{0x1069b4890, 0x14001eddeb0}, {0x10695e0b0, 0x14003560450}, {0x10695e240, 0x14003560490}, 0x140035637a0, {0x1400189d3e0, 0x14, 0x20}, ...}, ...)\n\tgithub.com/cosmos/evm@v0.2.0/x/vm/keeper/keeper.go:355 +0xe4\ngithub.com/cosmos/evm/mempool.(*ExperimentalEVMMempool).getIterators(0x14003cbd180, {0x10698a848?, 0x14002c39c08?}, {0x109225540, 0x0, 0x0})\n\tgithub.com/cosmos/evm@v0.2.0/mempool/mempool.go:439 +0x20c\ngithub.com/cosmos/evm/mempool.(*ExperimentalEVMMempool).SelectBy(0x14003cbd180, {0x10698a848?, 0x14002c39c08?}, {0x109225540?, 0x14000085ce8?, 0x104cce034?}, 0x140044cd540)\n\tgithub.com/cosmos/evm@v0.2.0/mempool/mempool.go:370 +0xe0\ngithub.com/cosmos/cosmos-sdk/types/mempool.SelectBy({0x10698a848?, 0x14002c39c08?}, {0x10698b108?, 0x14003cbd180?}, {0x109225540?, 0x0?, 0x0?}, 0x140044cd540)\n\tgithub.com/cosmos/cosmos-sdk@v0.53.4/types/mempool/mempool.go:58 +0xa0\ngithub.com/cosmos/evm/evmd.NewExampleApp.(*DefaultProposalHandler).PrepareProposalHandler.func3({{0x10698a810, 0x109225540}, {0x1069b51c0, 0x14001f4c200}, {{0x0, 0x0}, {0x16dc0f689, 0x4}, 0xd, {0x3507e5b0, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/cosmos-sdk@v0.53.4/baseapp/abci_utils.go:294 +0x250\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).PrepareProposal(0x14002d32488, 0x140015f42c0)\n\tgithub.com/cosmos/cosmos-sdk@v0.53.4/baseapp/abci.go:439 --- $CHAINDIR/config/client.toml | 19 + api/cosmos/evm/vm/v1/evm.pulsar.go | 1302 +++++++++++++++++------- config/evm_app_options.go | 6 +- config/evm_app_options_prod.go | 4 +- config/evm_app_options_testing.go | 4 +- evmd/$CHAINDIR/config/client.toml | 19 + evmd/app.go | 12 +- evmd/cmd/evmd/cmd/creator.go | 2 - evmd/cmd/evmd/cmd/root.go | 17 +- evmd/cmd/evmd/cmd/testnet.go | 2 - evmd/test_helpers.go | 3 +- evmd/tests/integration/create_app.go | 2 - evmd/tests/network/network.go | 3 +- local_node.sh | 4 +- mempool/mempool.go | 14 +- proto/cosmos/evm/vm/v1/evm.proto | 5 + tests/integration/x/vm/test_genesis.go | 5 + x/precisebank/module.go | 2 +- x/vm/genesis.go | 7 + x/vm/keeper/keeper.go | 7 + x/vm/module.go | 96 +- {config => x/vm/types}/activators.go | 6 +- x/vm/types/chain_config.go | 11 +- x/vm/types/config.go | 4 - x/vm/types/evm.pb.go | 527 +++++++--- x/vm/types/interfaces.go | 1 + x/vm/types/key.go | 10 +- x/vm/types/params.go | 2 +- x/vm/types/scaling.go | 2 +- 29 files changed, 1506 insertions(+), 592 deletions(-) create mode 100644 $CHAINDIR/config/client.toml create mode 100644 evmd/$CHAINDIR/config/client.toml rename {config => x/vm/types}/activators.go (58%) diff --git a/$CHAINDIR/config/client.toml b/$CHAINDIR/config/client.toml new file mode 100644 index 000000000..27f74c5d5 --- /dev/null +++ b/$CHAINDIR/config/client.toml @@ -0,0 +1,19 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# Default key name, if set, defines the default key to use for signing transaction when the --from flag is not specified +keyring-default-keyname = "" +# CLI output format (text|json) +output = "text" +# : to CometBFT RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" diff --git a/api/cosmos/evm/vm/v1/evm.pulsar.go b/api/cosmos/evm/vm/v1/evm.pulsar.go index 7980ded78..ab96fe217 100644 --- a/api/cosmos/evm/vm/v1/evm.pulsar.go +++ b/api/cosmos/evm/vm/v1/evm.pulsar.go @@ -160,6 +160,7 @@ var ( fd_Params_access_control protoreflect.FieldDescriptor fd_Params_active_static_precompiles protoreflect.FieldDescriptor fd_Params_history_serve_window protoreflect.FieldDescriptor + fd_Params_extended_denom_options protoreflect.FieldDescriptor ) func init() { @@ -171,6 +172,7 @@ func init() { fd_Params_access_control = md_Params.Fields().ByName("access_control") fd_Params_active_static_precompiles = md_Params.Fields().ByName("active_static_precompiles") fd_Params_history_serve_window = md_Params.Fields().ByName("history_serve_window") + fd_Params_extended_denom_options = md_Params.Fields().ByName("extended_denom_options") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -274,6 +276,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ExtendedDenomOptions != nil { + value := protoreflect.ValueOfMessage(x.ExtendedDenomOptions.ProtoReflect()) + if !f(fd_Params_extended_denom_options, value) { + return + } + } } // Has reports whether a field is populated. @@ -301,6 +309,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return len(x.ActiveStaticPrecompiles) != 0 case "cosmos.evm.vm.v1.Params.history_serve_window": return x.HistoryServeWindow != uint64(0) + case "cosmos.evm.vm.v1.Params.extended_denom_options": + return x.ExtendedDenomOptions != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.Params")) @@ -329,6 +339,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.ActiveStaticPrecompiles = nil case "cosmos.evm.vm.v1.Params.history_serve_window": x.HistoryServeWindow = uint64(0) + case "cosmos.evm.vm.v1.Params.extended_denom_options": + x.ExtendedDenomOptions = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.Params")) @@ -372,6 +384,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.evm.vm.v1.Params.history_serve_window": value := x.HistoryServeWindow return protoreflect.ValueOfUint64(value) + case "cosmos.evm.vm.v1.Params.extended_denom_options": + value := x.ExtendedDenomOptions + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.Params")) @@ -410,6 +425,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.ActiveStaticPrecompiles = *clv.list case "cosmos.evm.vm.v1.Params.history_serve_window": x.HistoryServeWindow = value.Uint() + case "cosmos.evm.vm.v1.Params.extended_denom_options": + x.ExtendedDenomOptions = value.Message().Interface().(*ExtendedDenomOptions) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.Params")) @@ -453,6 +470,11 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Params_9_list{list: &x.ActiveStaticPrecompiles} return protoreflect.ValueOfList(value) + case "cosmos.evm.vm.v1.Params.extended_denom_options": + if x.ExtendedDenomOptions == nil { + x.ExtendedDenomOptions = new(ExtendedDenomOptions) + } + return protoreflect.ValueOfMessage(x.ExtendedDenomOptions.ProtoReflect()) case "cosmos.evm.vm.v1.Params.evm_denom": panic(fmt.Errorf("field evm_denom of message cosmos.evm.vm.v1.Params is not mutable")) case "cosmos.evm.vm.v1.Params.history_serve_window": @@ -486,6 +508,9 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfList(&_Params_9_list{list: &list}) case "cosmos.evm.vm.v1.Params.history_serve_window": return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.evm.vm.v1.Params.extended_denom_options": + m := new(ExtendedDenomOptions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.Params")) @@ -585,6 +610,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.HistoryServeWindow != 0 { n += 1 + runtime.Sov(uint64(x.HistoryServeWindow)) } + if x.ExtendedDenomOptions != nil { + l = options.Size(x.ExtendedDenomOptions) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -614,6 +643,20 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ExtendedDenomOptions != nil { + encoded, err := options.Marshal(x.ExtendedDenomOptions) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x5a + } if x.HistoryServeWindow != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.HistoryServeWindow)) i-- @@ -894,19 +937,494 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - if postIndex > l { + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.AccessControl == nil { + x.AccessControl = &AccessControl{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AccessControl); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActiveStaticPrecompiles", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ActiveStaticPrecompiles = append(x.ActiveStaticPrecompiles, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HistoryServeWindow", wireType) + } + x.HistoryServeWindow = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.HistoryServeWindow |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 11: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExtendedDenomOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.ExtendedDenomOptions == nil { + x.ExtendedDenomOptions = &ExtendedDenomOptions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ExtendedDenomOptions); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ExtendedDenomOptions protoreflect.MessageDescriptor + fd_ExtendedDenomOptions_extended_denom protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_evm_vm_v1_evm_proto_init() + md_ExtendedDenomOptions = File_cosmos_evm_vm_v1_evm_proto.Messages().ByName("ExtendedDenomOptions") + fd_ExtendedDenomOptions_extended_denom = md_ExtendedDenomOptions.Fields().ByName("extended_denom") +} + +var _ protoreflect.Message = (*fastReflection_ExtendedDenomOptions)(nil) + +type fastReflection_ExtendedDenomOptions ExtendedDenomOptions + +func (x *ExtendedDenomOptions) ProtoReflect() protoreflect.Message { + return (*fastReflection_ExtendedDenomOptions)(x) +} + +func (x *ExtendedDenomOptions) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ExtendedDenomOptions_messageType fastReflection_ExtendedDenomOptions_messageType +var _ protoreflect.MessageType = fastReflection_ExtendedDenomOptions_messageType{} + +type fastReflection_ExtendedDenomOptions_messageType struct{} + +func (x fastReflection_ExtendedDenomOptions_messageType) Zero() protoreflect.Message { + return (*fastReflection_ExtendedDenomOptions)(nil) +} +func (x fastReflection_ExtendedDenomOptions_messageType) New() protoreflect.Message { + return new(fastReflection_ExtendedDenomOptions) +} +func (x fastReflection_ExtendedDenomOptions_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ExtendedDenomOptions +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ExtendedDenomOptions) Descriptor() protoreflect.MessageDescriptor { + return md_ExtendedDenomOptions +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ExtendedDenomOptions) Type() protoreflect.MessageType { + return _fastReflection_ExtendedDenomOptions_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ExtendedDenomOptions) New() protoreflect.Message { + return new(fastReflection_ExtendedDenomOptions) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ExtendedDenomOptions) Interface() protoreflect.ProtoMessage { + return (*ExtendedDenomOptions)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ExtendedDenomOptions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ExtendedDenom != "" { + value := protoreflect.ValueOfString(x.ExtendedDenom) + if !f(fd_ExtendedDenomOptions_extended_denom, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ExtendedDenomOptions) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.evm.vm.v1.ExtendedDenomOptions.extended_denom": + return x.ExtendedDenom != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtendedDenomOptions")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtendedDenomOptions does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtendedDenomOptions) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.evm.vm.v1.ExtendedDenomOptions.extended_denom": + x.ExtendedDenom = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtendedDenomOptions")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtendedDenomOptions does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ExtendedDenomOptions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.evm.vm.v1.ExtendedDenomOptions.extended_denom": + value := x.ExtendedDenom + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtendedDenomOptions")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtendedDenomOptions does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtendedDenomOptions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.evm.vm.v1.ExtendedDenomOptions.extended_denom": + x.ExtendedDenom = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtendedDenomOptions")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtendedDenomOptions does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtendedDenomOptions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.vm.v1.ExtendedDenomOptions.extended_denom": + panic(fmt.Errorf("field extended_denom of message cosmos.evm.vm.v1.ExtendedDenomOptions is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtendedDenomOptions")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtendedDenomOptions does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ExtendedDenomOptions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.vm.v1.ExtendedDenomOptions.extended_denom": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.ExtendedDenomOptions")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.ExtendedDenomOptions does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ExtendedDenomOptions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.ExtendedDenomOptions", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ExtendedDenomOptions) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ExtendedDenomOptions) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ExtendedDenomOptions) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ExtendedDenomOptions) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ExtendedDenomOptions) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.ExtendedDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ExtendedDenomOptions) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ExtendedDenom) > 0 { + i -= len(x.ExtendedDenom) + copy(dAtA[i:], x.ExtendedDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ExtendedDenom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ExtendedDenomOptions) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.AccessControl == nil { - x.AccessControl = &AccessControl{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AccessControl); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex - case 9: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtendedDenomOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ExtendedDenomOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ActiveStaticPrecompiles", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExtendedDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -934,27 +1452,8 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.ActiveStaticPrecompiles = append(x.ActiveStaticPrecompiles, string(dAtA[iNdEx:postIndex])) + x.ExtendedDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field HistoryServeWindow", wireType) - } - x.HistoryServeWindow = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.HistoryServeWindow |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1012,7 +1511,7 @@ func (x *AccessControl) ProtoReflect() protoreflect.Message { } func (x *AccessControl) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[1] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1572,7 +2071,7 @@ func (x *AccessControlType) ProtoReflect() protoreflect.Message { } func (x *AccessControlType) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[2] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2098,7 +2597,7 @@ func (x *ChainConfig) ProtoReflect() protoreflect.Message { } func (x *ChainConfig) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[3] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3928,7 +4427,7 @@ func (x *State) ProtoReflect() protoreflect.Message { } func (x *State) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[4] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4463,7 +4962,7 @@ func (x *TransactionLogs) ProtoReflect() protoreflect.Message { } func (x *TransactionLogs) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[5] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5032,7 +5531,7 @@ func (x *Log) ProtoReflect() protoreflect.Message { } func (x *Log) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[6] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5962,7 +6461,7 @@ func (x *TxResult) ProtoReflect() protoreflect.Message { } func (x *TxResult) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[7] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6733,7 +7232,7 @@ func (x *AccessTuple) ProtoReflect() protoreflect.Message { } func (x *AccessTuple) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[8] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7249,7 +7748,7 @@ func (x *TraceConfig) ProtoReflect() protoreflect.Message { } func (x *TraceConfig) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[9] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8226,7 +8725,7 @@ func (x *Preinstall) ProtoReflect() protoreflect.Message { } func (x *Preinstall) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[10] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8833,8 +9332,9 @@ type Params struct { AccessControl *AccessControl `protobuf:"bytes,8,opt,name=access_control,json=accessControl,proto3" json:"access_control,omitempty"` // active_static_precompiles defines the slice of hex addresses of the // precompiled contracts that are active - ActiveStaticPrecompiles []string `protobuf:"bytes,9,rep,name=active_static_precompiles,json=activeStaticPrecompiles,proto3" json:"active_static_precompiles,omitempty"` - HistoryServeWindow uint64 `protobuf:"varint,10,opt,name=history_serve_window,json=historyServeWindow,proto3" json:"history_serve_window,omitempty"` + ActiveStaticPrecompiles []string `protobuf:"bytes,9,rep,name=active_static_precompiles,json=activeStaticPrecompiles,proto3" json:"active_static_precompiles,omitempty"` + HistoryServeWindow uint64 `protobuf:"varint,10,opt,name=history_serve_window,json=historyServeWindow,proto3" json:"history_serve_window,omitempty"` + ExtendedDenomOptions *ExtendedDenomOptions `protobuf:"bytes,11,opt,name=extended_denom_options,json=extendedDenomOptions,proto3" json:"extended_denom_options,omitempty"` } func (x *Params) Reset() { @@ -8899,6 +9399,48 @@ func (x *Params) GetHistoryServeWindow() uint64 { return 0 } +func (x *Params) GetExtendedDenomOptions() *ExtendedDenomOptions { + if x != nil { + return x.ExtendedDenomOptions + } + return nil +} + +type ExtendedDenomOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ExtendedDenom string `protobuf:"bytes,1,opt,name=extended_denom,json=extendedDenom,proto3" json:"extended_denom,omitempty"` +} + +func (x *ExtendedDenomOptions) Reset() { + *x = ExtendedDenomOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExtendedDenomOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExtendedDenomOptions) ProtoMessage() {} + +// Deprecated: Use ExtendedDenomOptions.ProtoReflect.Descriptor instead. +func (*ExtendedDenomOptions) Descriptor() ([]byte, []int) { + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{1} +} + +func (x *ExtendedDenomOptions) GetExtendedDenom() string { + if x != nil { + return x.ExtendedDenom + } + return "" +} + // AccessControl defines the permission policy of the EVM // for creating and calling contracts type AccessControl struct { @@ -8915,7 +9457,7 @@ type AccessControl struct { func (x *AccessControl) Reset() { *x = AccessControl{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[1] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8929,7 +9471,7 @@ func (*AccessControl) ProtoMessage() {} // Deprecated: Use AccessControl.ProtoReflect.Descriptor instead. func (*AccessControl) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{1} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{2} } func (x *AccessControl) GetCreate() *AccessControlType { @@ -8967,7 +9509,7 @@ type AccessControlType struct { func (x *AccessControlType) Reset() { *x = AccessControlType{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[2] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8981,7 +9523,7 @@ func (*AccessControlType) ProtoMessage() {} // Deprecated: Use AccessControlType.ProtoReflect.Descriptor instead. func (*AccessControlType) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{2} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{3} } func (x *AccessControlType) GetAccessType() AccessType { @@ -9068,7 +9610,7 @@ type ChainConfig struct { func (x *ChainConfig) Reset() { *x = ChainConfig{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[3] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9082,7 +9624,7 @@ func (*ChainConfig) ProtoMessage() {} // Deprecated: Use ChainConfig.ProtoReflect.Descriptor instead. func (*ChainConfig) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{3} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{4} } func (x *ChainConfig) GetHomesteadBlock() string { @@ -9268,7 +9810,7 @@ type State struct { func (x *State) Reset() { *x = State{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[4] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9282,7 +9824,7 @@ func (*State) ProtoMessage() {} // Deprecated: Use State.ProtoReflect.Descriptor instead. func (*State) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{4} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{5} } func (x *State) GetKey() string { @@ -9316,7 +9858,7 @@ type TransactionLogs struct { func (x *TransactionLogs) Reset() { *x = TransactionLogs{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[5] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9330,7 +9872,7 @@ func (*TransactionLogs) ProtoMessage() {} // Deprecated: Use TransactionLogs.ProtoReflect.Descriptor instead. func (*TransactionLogs) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{5} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{6} } func (x *TransactionLogs) GetHash() string { @@ -9385,7 +9927,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[6] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9399,7 +9941,7 @@ func (*Log) ProtoMessage() {} // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{6} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{7} } func (x *Log) GetAddress() string { @@ -9498,7 +10040,7 @@ type TxResult struct { func (x *TxResult) Reset() { *x = TxResult{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[7] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9512,7 +10054,7 @@ func (*TxResult) ProtoMessage() {} // Deprecated: Use TxResult.ProtoReflect.Descriptor instead. func (*TxResult) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{7} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{8} } func (x *TxResult) GetContractAddress() string { @@ -9572,7 +10114,7 @@ type AccessTuple struct { func (x *AccessTuple) Reset() { *x = AccessTuple{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[8] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9586,7 +10128,7 @@ func (*AccessTuple) ProtoMessage() {} // Deprecated: Use AccessTuple.ProtoReflect.Descriptor instead. func (*AccessTuple) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{8} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{9} } func (x *AccessTuple) GetAddress() string { @@ -9637,7 +10179,7 @@ type TraceConfig struct { func (x *TraceConfig) Reset() { *x = TraceConfig{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[9] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9651,7 +10193,7 @@ func (*TraceConfig) ProtoMessage() {} // Deprecated: Use TraceConfig.ProtoReflect.Descriptor instead. func (*TraceConfig) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{9} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{10} } func (x *TraceConfig) GetTracer() string { @@ -9749,7 +10291,7 @@ type Preinstall struct { func (x *Preinstall) Reset() { *x = Preinstall{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[10] + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9763,7 +10305,7 @@ func (*Preinstall) ProtoMessage() {} // Deprecated: Use Preinstall.ProtoReflect.Descriptor instead. func (*Preinstall) Descriptor() ([]byte, []int) { - return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{10} + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{11} } func (x *Preinstall) GetName() string { @@ -9795,7 +10337,7 @@ var file_cosmos_evm_vm_v1_evm_proto_rawDesc = []byte{ 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 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, 0xb4, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x04, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x31, 0x0a, 0x09, 0x65, 0x76, 0x6d, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xf2, 0xde, 0x1f, 0x10, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x76, 0x6d, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x52, 0x08, 0x65, 0x76, 0x6d, @@ -9819,283 +10361,293 @@ var file_cosmos_evm_vm_v1_evm_proto_rawDesc = []byte{ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3a, 0x1b, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x78, 0x2f, 0x76, 0x6d, 0x2f, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, - 0x10, 0x04, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0x91, - 0x01, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, - 0x12, 0x41, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x63, 0x61, - 0x6c, 0x6c, 0x22, 0xdd, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x63, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, + 0x72, 0x76, 0x65, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x12, 0x5c, 0x0a, 0x16, 0x65, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, + 0x65, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x14, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x1b, 0x8a, 0xe7, 0xb0, 0x2a, 0x16, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x65, 0x76, 0x6d, 0x2f, 0x78, 0x2f, 0x76, 0x6d, 0x2f, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, + 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0x3d, 0x0a, 0x14, + 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, + 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x22, 0x91, 0x01, 0x0a, 0x0d, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x41, 0x0a, + 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x24, 0xe2, 0xde, 0x1f, - 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0xf2, 0xde, 0x1f, 0x12, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x22, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x63, 0x0a, - 0x13, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, - 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x33, 0xe2, 0xde, 0x1f, 0x11, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4c, 0x69, 0x73, - 0x74, 0xf2, 0xde, 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x52, - 0x11, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4c, 0x69, - 0x73, 0x74, 0x22, 0xa8, 0x10, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x5c, 0x0a, 0x0f, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, - 0x52, 0x0e, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x12, 0x68, 0x0a, 0x0e, 0x64, 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x54, 0x79, + 0x70, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x12, 0x3d, 0x0a, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x54, + 0x79, 0x70, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x22, + 0xdd, 0x01, 0x0a, 0x11, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x63, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x42, 0x24, 0xe2, 0xde, 0x1f, 0x0a, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x52, 0x0a, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x63, 0x0a, 0x13, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x33, 0xe2, 0xde, 0x1f, 0x11, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0xf2, 0xde, + 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x52, 0x11, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x4c, 0x69, 0x73, 0x74, 0x22, + 0xa8, 0x10, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x5c, 0x0a, 0x0f, 0x68, 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0c, 0x44, 0x41, 0x4f, 0x46, 0x6f, 0x72, 0x6b, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x61, 0x6f, - 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0c, 0x64, 0x61, - 0x6f, 0x46, 0x6f, 0x72, 0x6b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x57, 0x0a, 0x10, 0x64, 0x61, - 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x42, 0x2d, 0xe2, 0xde, 0x1f, 0x0e, 0x44, 0x41, 0x4f, 0x46, 0x6f, 0x72, - 0x6b, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x64, 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, - 0x72, 0x74, 0x22, 0x52, 0x0e, 0x64, 0x61, 0x6f, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x75, 0x70, 0x70, - 0x6f, 0x72, 0x74, 0x12, 0x62, 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, - 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, 0x35, 0x30, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, 0x70, - 0x31, 0x35, 0x30, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, 0x31, - 0x35, 0x30, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x62, 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, - 0x35, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, - 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, - 0x35, 0x35, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, - 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, - 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x62, 0x0a, 0x0c, 0x65, - 0x69, 0x70, 0x31, 0x35, 0x38, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0b, - 0x45, 0x49, 0x50, 0x31, 0x35, 0x38, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, 0x13, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x38, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x38, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x5c, 0x0a, 0x0f, 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x68, 0x6f, 0x6d, + 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0e, 0x68, + 0x6f, 0x6d, 0x65, 0x73, 0x74, 0x65, 0x61, 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x68, 0x0a, + 0x0e, 0x64, 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x42, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xe2, 0xde, 0x1f, 0x0c, 0x44, 0x41, 0x4f, 0x46, 0x6f, 0x72, 0x6b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0xf2, 0xde, 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, 0x61, 0x6f, 0x5f, 0x66, 0x6f, + 0x72, 0x6b, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0c, 0x64, 0x61, 0x6f, 0x46, 0x6f, + 0x72, 0x6b, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x57, 0x0a, 0x10, 0x64, 0x61, 0x6f, 0x5f, 0x66, + 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x2d, 0xe2, 0xde, 0x1f, 0x0e, 0x44, 0x41, 0x4f, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x75, + 0x70, 0x70, 0x6f, 0x72, 0x74, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x64, + 0x61, 0x6f, 0x5f, 0x66, 0x6f, 0x72, 0x6b, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x22, + 0x52, 0x0e, 0x64, 0x61, 0x6f, 0x46, 0x6f, 0x72, 0x6b, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x62, 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, + 0x74, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, 0x35, 0x30, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x30, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x62, 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, 0x35, 0x35, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, 0x31, 0x35, 0x35, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x65, 0x69, + 0x70, 0x31, 0x35, 0x35, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x65, 0x69, 0x70, + 0x31, 0x35, 0x35, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x62, 0x0a, 0x0c, 0x65, 0x69, 0x70, 0x31, + 0x35, 0x38, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x3f, + 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xe2, 0xde, 0x1f, 0x0b, 0x45, 0x49, 0x50, + 0x31, 0x35, 0x38, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x65, 0x69, 0x70, 0x31, 0x35, 0x38, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, + 0x0b, 0x65, 0x69, 0x70, 0x31, 0x35, 0x38, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5c, 0x0a, 0x0f, + 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, + 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x79, 0x7a, 0x61, 0x6e, 0x74, + 0x69, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0e, 0x62, 0x79, 0x7a, 0x61, + 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6b, 0x0a, 0x14, 0x63, 0x6f, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, - 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x16, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x79, 0x7a, - 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0e, 0x62, - 0x79, 0x7a, 0x61, 0x6e, 0x74, 0x69, 0x75, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6b, 0x0a, - 0x14, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x38, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1b, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, - 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5f, 0x0a, 0x10, 0x70, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1b, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x70, 0x6c, 0x65, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x22, 0x52, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x6f, 0x70, + 0x6c, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x5f, 0x0a, 0x10, 0x70, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x62, 0x75, 0x72, 0x67, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x34, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x17, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0f, 0x70, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, + 0x75, 0x72, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x0e, 0x69, 0x73, 0x74, 0x61, + 0x6e, 0x62, 0x75, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x32, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x15, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x5f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0d, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x12, 0x6d, 0x75, 0x69, 0x72, 0x5f, 0x67, 0x6c, 0x61, 0x63, + 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x36, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x75, 0x69, 0x72, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x10, 0x6d, 0x75, 0x69, 0x72, 0x47, 0x6c, 0x61, + 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, 0x62, 0x65, 0x72, + 0x6c, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x30, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, + 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x22, 0x52, 0x0b, 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x53, + 0x0a, 0x0c, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, - 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, 0x65, 0x74, 0x65, 0x72, 0x73, 0x62, - 0x75, 0x72, 0x67, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0f, 0x70, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x62, 0x75, 0x72, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x59, 0x0a, 0x0e, 0x69, - 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x32, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, - 0x1f, 0x15, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, 0x6c, - 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0d, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x62, 0x75, - 0x6c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x12, 0x6d, 0x75, 0x69, 0x72, 0x5f, 0x67, - 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x36, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, - 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x75, 0x69, 0x72, 0x5f, 0x67, 0x6c, 0x61, 0x63, - 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x10, 0x6d, 0x75, 0x69, 0x72, - 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x53, 0x0a, 0x0c, - 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x30, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, - 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x5f, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x62, 0x65, 0x72, 0x6c, 0x69, 0x6e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x53, 0x0a, 0x0c, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x42, 0x30, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, - 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6c, 0x6f, 0x6e, 0x64, - 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x67, 0x0a, 0x13, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x5f, - 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x12, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x37, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, - 0x1f, 0x1a, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x67, 0x6c, - 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x11, 0x61, 0x72, - 0x72, 0x6f, 0x77, 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, - 0x64, 0x0a, 0x12, 0x67, 0x72, 0x61, 0x79, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, + 0xde, 0x1f, 0x13, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x0b, 0x6c, 0x6f, 0x6e, 0x64, 0x6f, 0x6e, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x12, 0x67, 0x0a, 0x13, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x67, 0x6c, 0x61, + 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x37, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1a, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x72, 0x72, 0x6f, 0x77, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, + 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x11, 0x61, 0x72, 0x72, 0x6f, 0x77, + 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x12, 0x67, 0x72, 0x61, 0x79, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x22, 0x52, 0x10, 0x67, 0x72, 0x61, 0x79, 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x6a, 0x0a, 0x14, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6e, - 0x65, 0x74, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x15, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x38, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, - 0x1f, 0x1b, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6e, 0x65, - 0x74, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x12, 0x6d, - 0x65, 0x72, 0x67, 0x65, 0x4e, 0x65, 0x74, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x18, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, - 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x1a, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x56, - 0x0a, 0x0d, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x1b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x31, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, - 0xf2, 0xde, 0x1f, 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, - 0x61, 0x69, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, - 0x61, 0x69, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x63, 0x61, 0x6e, 0x63, 0x75, 0x6e, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, - 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, - 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, - 0x63, 0x61, 0x6e, 0x63, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x63, 0x61, - 0x6e, 0x63, 0x75, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x70, 0x72, 0x61, 0x67, - 0x75, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, + 0x63, 0x6b, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x42, 0x36, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x19, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x67, 0x72, 0x61, + 0x79, 0x5f, 0x67, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, + 0x52, 0x10, 0x67, 0x72, 0x61, 0x79, 0x47, 0x6c, 0x61, 0x63, 0x69, 0x65, 0x72, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x6a, 0x0a, 0x14, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6e, 0x65, 0x74, 0x73, + 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x38, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, + 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x1b, 0x79, + 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x5f, 0x6e, 0x65, 0x74, 0x73, 0x70, + 0x6c, 0x69, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x52, 0x12, 0x6d, 0x65, 0x72, 0x67, + 0x65, 0x4e, 0x65, 0x74, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x19, + 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, + 0x6f, 0x6d, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, + 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x56, 0x0a, 0x0d, 0x73, + 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1b, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x31, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, + 0x14, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0c, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x68, 0x61, 0x69, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x63, 0x61, 0x6e, 0x63, 0x75, 0x6e, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, + 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x61, 0x6e, + 0x63, 0x75, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x63, 0x61, 0x6e, 0x63, 0x75, + 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x70, 0x72, 0x61, 0x67, 0x75, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, 0x1f, 0x15, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, + 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x70, + 0x72, 0x61, 0x67, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x70, 0x72, 0x61, + 0x67, 0x75, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x76, 0x65, 0x72, 0x6b, 0x6c, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2f, 0xda, 0xde, + 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, + 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, 0x3a, + 0x22, 0x76, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x76, + 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x0a, 0x6f, 0x73, 0x61, + 0x6b, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2e, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, - 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, 0x6d, 0x6c, - 0x3a, 0x22, 0x70, 0x72, 0x61, 0x67, 0x75, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x0a, - 0x70, 0x72, 0x61, 0x67, 0x75, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0b, 0x76, 0x65, - 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x2f, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x12, 0x79, 0x61, - 0x6d, 0x6c, 0x3a, 0x22, 0x76, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, - 0x52, 0x0a, 0x76, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x0a, - 0x6f, 0x73, 0x61, 0x6b, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x2e, 0xda, 0xde, 0x1f, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x11, 0x79, - 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x6f, 0x73, 0x61, 0x6b, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, - 0x52, 0x09, 0x6f, 0x73, 0x61, 0x6b, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, - 0x06, 0x4a, 0x04, 0x08, 0x16, 0x10, 0x17, 0x4a, 0x04, 0x08, 0x17, 0x10, 0x18, 0x22, 0x2f, 0x0a, - 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x50, - 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, - 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x29, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, - 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, - 0x22, 0x87, 0x03, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, - 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x2f, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x2c, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x48, 0x61, 0x73, 0x68, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, - 0x22, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, - 0xea, 0xde, 0x1f, 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x3b, 0x0a, - 0x0f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x0e, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x90, 0x02, 0x0a, 0x08, 0x54, - 0x78, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x1b, 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x57, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0x1b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, - 0xde, 0x1f, 0x0e, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x73, - 0x22, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x74, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x65, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 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, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x61, 0x0a, - 0x0b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0f, 0xea, 0xde, - 0x1f, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x0b, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, - 0x22, 0xa0, 0x04, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x16, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x65, 0x78, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x72, 0x65, 0x65, 0x78, 0x65, 0x63, 0x12, 0x35, 0x0a, 0x0d, 0x64, 0x69, - 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x10, 0xea, 0xde, 0x1f, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, - 0x61, 0x63, 0x6b, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x63, - 0x6b, 0x12, 0x3b, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x0e, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x0e, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x64, 0x65, 0x62, 0x75, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, - 0x65, 0x62, 0x75, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x6f, 0x76, - 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x6f, 0x76, - 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x10, - 0xea, 0xde, 0x1f, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, - 0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x42, - 0x0a, 0x12, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x10, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x10, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x3e, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x6a, 0x73, 0x6f, - 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, - 0xea, 0xde, 0x1f, 0x0c, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x4a, 0x73, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x52, 0x0e, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x13, - 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x4e, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x2a, 0xc0, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x3c, 0x0a, 0x1a, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x4c, 0x45, 0x53, 0x53, - 0x10, 0x00, 0x1a, 0x1c, 0x8a, 0x9d, 0x20, 0x18, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, - 0x70, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x6c, 0x65, 0x73, 0x73, - 0x12, 0x34, 0x0a, 0x16, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x52, 0x45, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x18, 0x8a, 0x9d, - 0x20, 0x14, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, - 0x72, 0x69, 0x63, 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, - 0x45, 0x44, 0x10, 0x02, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x79, 0x70, 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, - 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x42, 0xab, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, - 0x08, 0x45, 0x76, 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 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, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x76, - 0x6d, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x45, 0x56, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x1c, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x6d, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0xf2, 0xde, 0x1f, 0x11, 0x79, 0x61, 0x6d, 0x6c, + 0x3a, 0x22, 0x6f, 0x73, 0x61, 0x6b, 0x61, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x52, 0x09, 0x6f, + 0x73, 0x61, 0x6b, 0x61, 0x54, 0x69, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, + 0x08, 0x16, 0x10, 0x17, 0x4a, 0x04, 0x08, 0x17, 0x10, 0x18, 0x22, 0x2f, 0x0a, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x50, 0x0a, 0x0f, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, + 0x73, 0x68, 0x12, 0x29, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0x87, 0x03, + 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x0c, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x2c, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x13, 0xea, 0xde, 0x1f, 0x0f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x48, 0x61, 0x73, 0x68, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2f, 0x0a, + 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x42, + 0x14, 0xea, 0xde, 0x1f, 0x10, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, + 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0d, 0xea, 0xde, 0x1f, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, + 0x68, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x05, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0c, 0xea, 0xde, 0x1f, + 0x08, 0x6c, 0x6f, 0x67, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x0f, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x0e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x90, 0x02, 0x0a, 0x08, 0x54, 0x78, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1b, + 0xf2, 0xde, 0x1f, 0x17, 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x52, 0x0f, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x6c, 0x6f, + 0x6f, 0x6d, 0x12, 0x57, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, + 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x6f, 0x67, 0x73, 0x42, 0x1b, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xde, 0x1f, 0x0e, + 0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x78, 0x5f, 0x6c, 0x6f, 0x67, 0x73, 0x22, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x74, 0x78, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x72, + 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x65, 0x74, 0x12, 0x1a, 0x0a, + 0x08, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x08, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 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, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0x61, 0x0a, 0x0b, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x54, 0x75, 0x70, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x32, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x0f, 0xea, 0xde, 0x1f, 0x0b, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x3a, 0x04, 0x88, 0xa0, 0x1f, 0x00, 0x22, 0xa0, 0x04, + 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, + 0x06, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x65, 0x78, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x72, 0x65, 0x65, 0x78, 0x65, 0x63, 0x12, 0x35, 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x10, + 0xea, 0xde, 0x1f, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x63, 0x6b, + 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x3b, + 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x12, 0xea, 0xde, 0x1f, 0x0e, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, + 0x65, 0x62, 0x75, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x64, 0x65, 0x62, 0x75, + 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, + 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x6f, 0x76, 0x65, 0x72, 0x72, + 0x69, 0x64, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, + 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x10, 0xea, 0xde, 0x1f, + 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x42, 0x0a, 0x12, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x14, 0xea, 0xde, 0x1f, 0x10, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x3e, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x10, 0xea, 0xde, 0x1f, + 0x0c, 0x74, 0x72, 0x61, 0x63, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x74, + 0x72, 0x61, 0x63, 0x65, 0x72, 0x4a, 0x73, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, + 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x52, 0x13, 0x64, 0x69, 0x73, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x4e, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x2a, 0xc0, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x3c, 0x0a, 0x1a, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, + 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x00, 0x1a, + 0x1c, 0x8a, 0x9d, 0x20, 0x18, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x12, 0x34, 0x0a, + 0x16, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, + 0x54, 0x52, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x18, 0x8a, 0x9d, 0x20, 0x14, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, + 0x02, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, + 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x1a, 0x04, 0x88, + 0xa3, 0x1e, 0x00, 0x42, 0xab, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x45, 0x76, + 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 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, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x6d, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x45, 0x56, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x6d, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -10111,34 +10663,36 @@ func file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP() []byte { } var file_cosmos_evm_vm_v1_evm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cosmos_evm_vm_v1_evm_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_cosmos_evm_vm_v1_evm_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_cosmos_evm_vm_v1_evm_proto_goTypes = []interface{}{ - (AccessType)(0), // 0: cosmos.evm.vm.v1.AccessType - (*Params)(nil), // 1: cosmos.evm.vm.v1.Params - (*AccessControl)(nil), // 2: cosmos.evm.vm.v1.AccessControl - (*AccessControlType)(nil), // 3: cosmos.evm.vm.v1.AccessControlType - (*ChainConfig)(nil), // 4: cosmos.evm.vm.v1.ChainConfig - (*State)(nil), // 5: cosmos.evm.vm.v1.State - (*TransactionLogs)(nil), // 6: cosmos.evm.vm.v1.TransactionLogs - (*Log)(nil), // 7: cosmos.evm.vm.v1.Log - (*TxResult)(nil), // 8: cosmos.evm.vm.v1.TxResult - (*AccessTuple)(nil), // 9: cosmos.evm.vm.v1.AccessTuple - (*TraceConfig)(nil), // 10: cosmos.evm.vm.v1.TraceConfig - (*Preinstall)(nil), // 11: cosmos.evm.vm.v1.Preinstall + (AccessType)(0), // 0: cosmos.evm.vm.v1.AccessType + (*Params)(nil), // 1: cosmos.evm.vm.v1.Params + (*ExtendedDenomOptions)(nil), // 2: cosmos.evm.vm.v1.ExtendedDenomOptions + (*AccessControl)(nil), // 3: cosmos.evm.vm.v1.AccessControl + (*AccessControlType)(nil), // 4: cosmos.evm.vm.v1.AccessControlType + (*ChainConfig)(nil), // 5: cosmos.evm.vm.v1.ChainConfig + (*State)(nil), // 6: cosmos.evm.vm.v1.State + (*TransactionLogs)(nil), // 7: cosmos.evm.vm.v1.TransactionLogs + (*Log)(nil), // 8: cosmos.evm.vm.v1.Log + (*TxResult)(nil), // 9: cosmos.evm.vm.v1.TxResult + (*AccessTuple)(nil), // 10: cosmos.evm.vm.v1.AccessTuple + (*TraceConfig)(nil), // 11: cosmos.evm.vm.v1.TraceConfig + (*Preinstall)(nil), // 12: cosmos.evm.vm.v1.Preinstall } var file_cosmos_evm_vm_v1_evm_proto_depIdxs = []int32{ - 2, // 0: cosmos.evm.vm.v1.Params.access_control:type_name -> cosmos.evm.vm.v1.AccessControl - 3, // 1: cosmos.evm.vm.v1.AccessControl.create:type_name -> cosmos.evm.vm.v1.AccessControlType - 3, // 2: cosmos.evm.vm.v1.AccessControl.call:type_name -> cosmos.evm.vm.v1.AccessControlType - 0, // 3: cosmos.evm.vm.v1.AccessControlType.access_type:type_name -> cosmos.evm.vm.v1.AccessType - 7, // 4: cosmos.evm.vm.v1.TransactionLogs.logs:type_name -> cosmos.evm.vm.v1.Log - 6, // 5: cosmos.evm.vm.v1.TxResult.tx_logs:type_name -> cosmos.evm.vm.v1.TransactionLogs - 4, // 6: cosmos.evm.vm.v1.TraceConfig.overrides:type_name -> cosmos.evm.vm.v1.ChainConfig - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 3, // 0: cosmos.evm.vm.v1.Params.access_control:type_name -> cosmos.evm.vm.v1.AccessControl + 2, // 1: cosmos.evm.vm.v1.Params.extended_denom_options:type_name -> cosmos.evm.vm.v1.ExtendedDenomOptions + 4, // 2: cosmos.evm.vm.v1.AccessControl.create:type_name -> cosmos.evm.vm.v1.AccessControlType + 4, // 3: cosmos.evm.vm.v1.AccessControl.call:type_name -> cosmos.evm.vm.v1.AccessControlType + 0, // 4: cosmos.evm.vm.v1.AccessControlType.access_type:type_name -> cosmos.evm.vm.v1.AccessType + 8, // 5: cosmos.evm.vm.v1.TransactionLogs.logs:type_name -> cosmos.evm.vm.v1.Log + 7, // 6: cosmos.evm.vm.v1.TxResult.tx_logs:type_name -> cosmos.evm.vm.v1.TransactionLogs + 5, // 7: cosmos.evm.vm.v1.TraceConfig.overrides:type_name -> cosmos.evm.vm.v1.ChainConfig + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name } func init() { file_cosmos_evm_vm_v1_evm_proto_init() } @@ -10160,7 +10714,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccessControl); i { + switch v := v.(*ExtendedDenomOptions); i { case 0: return &v.state case 1: @@ -10172,7 +10726,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccessControlType); i { + switch v := v.(*AccessControl); i { case 0: return &v.state case 1: @@ -10184,7 +10738,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChainConfig); i { + switch v := v.(*AccessControlType); i { case 0: return &v.state case 1: @@ -10196,7 +10750,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*State); i { + switch v := v.(*ChainConfig); i { case 0: return &v.state case 1: @@ -10208,7 +10762,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionLogs); i { + switch v := v.(*State); i { case 0: return &v.state case 1: @@ -10220,7 +10774,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Log); i { + switch v := v.(*TransactionLogs); i { case 0: return &v.state case 1: @@ -10232,7 +10786,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TxResult); i { + switch v := v.(*Log); i { case 0: return &v.state case 1: @@ -10244,7 +10798,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccessTuple); i { + switch v := v.(*TxResult); i { case 0: return &v.state case 1: @@ -10256,7 +10810,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TraceConfig); i { + switch v := v.(*AccessTuple); i { case 0: return &v.state case 1: @@ -10268,6 +10822,18 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { } } file_cosmos_evm_vm_v1_evm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TraceConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_evm_vm_v1_evm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Preinstall); i { case 0: return &v.state @@ -10286,7 +10852,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_evm_vm_v1_evm_proto_rawDesc, NumEnums: 1, - NumMessages: 11, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/config/evm_app_options.go b/config/evm_app_options.go index 4de22faf5..305169687 100644 --- a/config/evm_app_options.go +++ b/config/evm_app_options.go @@ -1,15 +1,13 @@ package config import ( + "cosmossdk.io/math" "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ethereum/go-ethereum/core/vm" evmtypes "github.com/cosmos/evm/x/vm/types" - - "cosmossdk.io/math" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // EVMOptionsFn defines a function type for setting app options specifically for diff --git a/config/evm_app_options_prod.go b/config/evm_app_options_prod.go index 6b523ebdf..8846dae12 100644 --- a/config/evm_app_options_prod.go +++ b/config/evm_app_options_prod.go @@ -3,8 +3,10 @@ package config +import "github.com/cosmos/evm/x/vm/types" + // EvmAppOptions allows to setup the global configuration // for the Cosmos EVM chain. func EvmAppOptions(chainID uint64) error { - return EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, cosmosEVMActivators) + return EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, types.DefaultCosmosEVMActivators) } diff --git a/config/evm_app_options_testing.go b/config/evm_app_options_testing.go index 0f30dcaa4..c5a6bb0b4 100644 --- a/config/evm_app_options_testing.go +++ b/config/evm_app_options_testing.go @@ -3,8 +3,10 @@ package config +import "github.com/cosmos/evm/x/vm/types" + // EvmAppOptions allows to setup the global configuration // for the Cosmos EVM chain. func EvmAppOptions(chainID uint64) error { - return EvmAppOptionsWithConfigWithReset(chainID, ChainsCoinInfo, cosmosEVMActivators, true) + return EvmAppOptionsWithConfigWithReset(chainID, ChainsCoinInfo, types.DefaultCosmosEVMActivators, true) } diff --git a/evmd/$CHAINDIR/config/client.toml b/evmd/$CHAINDIR/config/client.toml new file mode 100644 index 000000000..27f74c5d5 --- /dev/null +++ b/evmd/$CHAINDIR/config/client.toml @@ -0,0 +1,19 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +############################################################################### +### Client Configuration ### +############################################################################### + +# The network chain ID +chain-id = "" +# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) +keyring-backend = "os" +# Default key name, if set, defines the default key to use for signing transaction when the --from flag is not specified +keyring-default-keyname = "" +# CLI output format (text|json) +output = "text" +# : to CometBFT RPC interface for this chain +node = "tcp://localhost:26657" +# Transaction broadcasting mode (sync|async) +broadcast-mode = "sync" diff --git a/evmd/app.go b/evmd/app.go index ae424a26e..76125e238 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -212,7 +212,6 @@ func NewExampleApp( loadLatest bool, appOpts servertypes.AppOptions, evmChainID uint64, // TODO:VLAD - Remove this - evmAppOptions evmconfig.EVMOptionsFn, // TODO:VLAD - Remove this baseAppOptions ...func(*baseapp.BaseApp), ) *EVMD { encodingConfig := evmosencoding.MakeConfig(evmChainID) // TODO:VLAD - Remove chain id from this @@ -235,12 +234,6 @@ func NewExampleApp( bApp.SetInterfaceRegistry(interfaceRegistry) bApp.SetTxEncoder(txConfig.TxEncoder()) - // initialize the Cosmos EVM application configuration - // TODO:VLAD - Remove this - if err := evmAppOptions(evmChainID); err != nil { - panic(err) - } - keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, @@ -447,6 +440,7 @@ func NewExampleApp( // Set up EVM keeper tracer := cast.ToString(appOpts.Get(srvflags.EVMTracer)) + evmChainId := cast.ToUint64(appOpts.Get(srvflags.EVMChainID)) // NOTE: it's required to set up the EVM keeper before the ERC-20 keeper, because it is used in its instantiation. app.EVMKeeper = evmkeeper.NewKeeper( @@ -459,6 +453,7 @@ func NewExampleApp( app.FeeMarketKeeper, &app.ConsensusParamsKeeper, &app.Erc20Keeper, + evmChainId, tracer, ).WithStaticPrecompiles( precompiletypes.DefaultStaticPrecompiles( @@ -574,7 +569,7 @@ func NewExampleApp( ibctm.NewAppModule(tmLightClientModule), transferModule, // Cosmos EVM modules - vm.NewAppModule(app.EVMKeeper, app.AccountKeeper, app.AccountKeeper.AddressCodec()), + vm.NewAppModule(app.EVMKeeper, app.AccountKeeper, app.BankKeeper, app.AccountKeeper.AddressCodec()), feemarket.NewAppModule(app.FeeMarketKeeper), erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper), precisebank.NewAppModule(app.PreciseBankKeeper, app.BankKeeper, app.AccountKeeper), @@ -600,6 +595,7 @@ func NewExampleApp( app.ModuleManager.SetOrderPreBlockers( upgradetypes.ModuleName, authtypes.ModuleName, + evmtypes.ModuleName, ) // During begin block slashing happens after distr.BeginBlocker so that diff --git a/evmd/cmd/evmd/cmd/creator.go b/evmd/cmd/evmd/cmd/creator.go index dd94a09c9..861892f1c 100644 --- a/evmd/cmd/evmd/cmd/creator.go +++ b/evmd/cmd/evmd/cmd/creator.go @@ -95,7 +95,6 @@ func (a appCreator) newApp( true, simtestutil.EmptyAppOptions{}, config.EVMChainID, - config.EvmAppOptions, baseappOptions..., ) } @@ -138,7 +137,6 @@ func (a appCreator) appExport( loadLatest, appOpts, config.EVMChainID, - config.EvmAppOptions, ) if height != -1 { diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index 8438cf07e..b5df3eeb5 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -54,9 +54,6 @@ func NewRootCmd() *cobra.Command { // we "pre"-instantiate the application for getting the injected/configured encoding configuration // and the CLI options for the modules // add keyring to autocli opts - noOpEvmAppOptions := func(_ uint64) error { - return nil - } tempApp := evmd.NewExampleApp( log.NewNopLogger(), dbm.NewMemDB(), @@ -64,7 +61,6 @@ func NewRootCmd() *cobra.Command { true, simtestutil.EmptyAppOptions{}, config.EVMChainID, - noOpEvmAppOptions, ) encodingConfig := sdktestutil.TestEncodingConfig{ @@ -147,12 +143,6 @@ func NewRootCmd() *cobra.Command { panic(err) } - if initClientCtx.ChainID != "" { // TODO:VLAD - Remove this - if err := config.EvmAppOptions(config.EVMChainID); err != nil { - panic(err) - } - } - return rootCmd } @@ -319,8 +309,7 @@ func newApp( return evmd.NewExampleApp( logger, db, traceStore, true, appOpts, - config.EVMChainID, // TODO:VLAD - Remove this - config.EvmAppOptions, // TODO:VLAD - Remove this + config.EVMChainID, // TODO:VLAD - Remove this baseappOptions..., ) } @@ -361,13 +350,13 @@ func appExport( } if height != -1 { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove appoptions and evmchainid + exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove appoptions and evmchainid if err := exampleApp.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } } else { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid + exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid } return exampleApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) diff --git a/evmd/cmd/evmd/cmd/testnet.go b/evmd/cmd/evmd/cmd/testnet.go index 6a6d1361b..9677fb146 100644 --- a/evmd/cmd/evmd/cmd/testnet.go +++ b/evmd/cmd/evmd/cmd/testnet.go @@ -686,7 +686,6 @@ func NewTestNetworkFixture() network.TestFixture { true, simtestutil.EmptyAppOptions{}, config.EVMChainID, - config.EvmAppOptions, ) appCtr := func(val network.ValidatorI) servertypes.Application { @@ -697,7 +696,6 @@ func NewTestNetworkFixture() network.TestFixture { true, simtestutil.EmptyAppOptions{}, config.EVMChainID, - config.EvmAppOptions, ) } diff --git a/evmd/test_helpers.go b/evmd/test_helpers.go index 173818910..05aad5dc3 100644 --- a/evmd/test_helpers.go +++ b/evmd/test_helpers.go @@ -54,7 +54,7 @@ func setup(withGenesis bool, invCheckPeriod uint, chainID string, evmChainID uin appOptions[flags.FlagHome] = defaultNodeHome appOptions[server.FlagInvCheckPeriod] = invCheckPeriod - app := NewExampleApp(log.NewNopLogger(), db, nil, true, appOptions, evmChainID, config.EvmAppOptions, baseapp.SetChainID(chainID)) + app := NewExampleApp(log.NewNopLogger(), db, nil, true, appOptions, evmChainID, baseapp.SetChainID(chainID)) if withGenesis { return app, app.DefaultGenesis() } @@ -131,7 +131,6 @@ func SetupTestingApp(chainID string, evmChainID uint64) func() (ibctesting.Testi db, nil, true, simtestutil.NewAppOptionsWithFlagHome(defaultNodeHome), evmChainID, - config.EvmAppOptions, baseapp.SetChainID(chainID), ) return app, app.DefaultGenesis() diff --git a/evmd/tests/integration/create_app.go b/evmd/tests/integration/create_app.go index fc1ac26ad..dff6ce513 100644 --- a/evmd/tests/integration/create_app.go +++ b/evmd/tests/integration/create_app.go @@ -42,7 +42,6 @@ func CreateEvmd(chainID string, evmChainID uint64, customBaseAppOptions ...func( loadLatest, appOptions, evmChainID, - config.EvmAppOptions, baseAppOptions..., ) } @@ -57,7 +56,6 @@ func SetupEvmd() (ibctesting.TestingApp, map[string]json.RawMessage) { true, simutils.EmptyAppOptions{}, constants.ExampleEIP155ChainID, - config.EvmAppOptions, ) // disable base fee for testing genesisState := app.DefaultGenesis() diff --git a/evmd/tests/network/network.go b/evmd/tests/network/network.go index 54dcb3feb..a1516cc96 100644 --- a/evmd/tests/network/network.go +++ b/evmd/tests/network/network.go @@ -109,7 +109,7 @@ func DefaultConfig() Config { panic(fmt.Sprintf("failed creating temporary directory: %v", err)) } defer os.RemoveAll(dir) - tempApp := evmd.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), evmChainID, evmconfig.EvmAppOptions, baseapp.SetChainID(chainID)) + tempApp := evmd.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), evmChainID, baseapp.SetChainID(chainID)) cfg := Config{ Codec: tempApp.AppCodec(), @@ -143,7 +143,6 @@ func NewAppConstructor(chainID string, evmChainID uint64) AppConstructor { val.Ctx.Logger, dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir), evmChainID, - evmconfig.EvmAppOptions, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), baseapp.SetChainID(chainID), diff --git a/local_node.sh b/local_node.sh index a7e410825..7ca691319 100755 --- a/local_node.sh +++ b/local_node.sh @@ -340,9 +340,9 @@ fi # Start the node evmd start "$TRACE" \ --pruning nothing \ - --log_level $LOGLEVEL \ + --log_level "info" \ --minimum-gas-prices=0atest \ --evm.min-tip=0 \ - --home "$CHAINDIR" \ + --home "/Users/vlad/.evmd/" \ --json-rpc.api eth,txpool,personal,net,debug,web3 \ --chain-id "$CHAINID" diff --git a/mempool/mempool.go b/mempool/mempool.go index a3a7aa62c..1222d432b 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/evm/mempool/txpool" "github.com/cosmos/evm/mempool/txpool/legacypool" "github.com/cosmos/evm/rpc/stream" - "github.com/cosmos/evm/x/precisebank/types" evmtypes "github.com/cosmos/evm/x/vm/types" "cosmossdk.io/log" @@ -54,8 +53,6 @@ type ( logger log.Logger txConfig client.TxConfig blockchain *Blockchain - bondDenom string - evmDenom string blockGasLimit uint64 // Block gas limit from consensus parameters minTip *uint256.Int @@ -91,9 +88,6 @@ func NewExperimentalEVMMempool(getCtxCallback func(height int64, prove bool) (sd blockchain *Blockchain ) - bondDenom := evmtypes.GetEVMCoinDenom() - evmDenom := types.ExtendedCoinDenom() - // add the mempool name to the logger logger = logger.With(log.ModuleKey, "ExperimentalEVMMempool") @@ -154,7 +148,7 @@ func NewExperimentalEVMMempool(getCtxCallback func(height int64, prove bool) (sd if !ok { return math.ZeroInt() } - found, coin := cosmosTxFee.GetFee().Find(bondDenom) + found, coin := cosmosTxFee.GetFee().Find(evmtypes.GetEVMCoinDenom()) if !found { return math.ZeroInt() } @@ -181,8 +175,6 @@ func NewExperimentalEVMMempool(getCtxCallback func(height int64, prove bool) (sd logger: logger, txConfig: txConfig, blockchain: blockchain, - bondDenom: bondDenom, - evmDenom: evmDenom, blockGasLimit: config.BlockGasLimit, minTip: config.MinTip, anteHandler: config.AnteHandler, @@ -284,7 +276,7 @@ func (m *ExperimentalEVMMempool) Select(goCtx context.Context, i [][]byte) sdkme evmIterator, cosmosIterator := m.getIterators(goCtx, i) - combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.bondDenom, m.blockchain.Config().ChainID, m.blockchain) + combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, evmtypes.GetEVMCoinDenom(), m.blockchain.Config().ChainID, m.blockchain) return combinedIterator } @@ -377,7 +369,7 @@ func (m *ExperimentalEVMMempool) SelectBy(goCtx context.Context, i [][]byte, f f evmIterator, cosmosIterator := m.getIterators(goCtx, i) - combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.bondDenom, m.blockchain.Config().ChainID, m.blockchain) + combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, evmtypes.GetEVMCoinDenom(), m.blockchain.Config().ChainID, m.blockchain) for combinedIterator != nil && f(combinedIterator.Tx()) { combinedIterator = combinedIterator.Next() diff --git a/proto/cosmos/evm/vm/v1/evm.proto b/proto/cosmos/evm/vm/v1/evm.proto index dda6eade0..0deb92c89 100644 --- a/proto/cosmos/evm/vm/v1/evm.proto +++ b/proto/cosmos/evm/vm/v1/evm.proto @@ -36,6 +36,11 @@ message Params { // precompiled contracts that are active repeated string active_static_precompiles = 9; uint64 history_serve_window = 10; + ExtendedDenomOptions extended_denom_options = 11; +} + +message ExtendedDenomOptions { + string extended_denom = 1; } // AccessControl defines the permission policy of the EVM diff --git a/tests/integration/x/vm/test_genesis.go b/tests/integration/x/vm/test_genesis.go index 10e5f407c..38947cc0e 100644 --- a/tests/integration/x/vm/test_genesis.go +++ b/tests/integration/x/vm/test_genesis.go @@ -1,6 +1,7 @@ package vm import ( + "sync" "testing" "github.com/ethereum/go-ethereum/common" @@ -131,7 +132,9 @@ func (s *GenesisTestSuite) TestInitGenesis() { s.network.GetContext(), s.network.App.GetEVMKeeper(), s.network.App.GetAccountKeeper(), + s.network.App.GetBankKeeper(), *tc.genState, + &sync.Once{}, ) }) } else { @@ -140,7 +143,9 @@ func (s *GenesisTestSuite) TestInitGenesis() { ctx, s.network.App.GetEVMKeeper(), s.network.App.GetAccountKeeper(), + s.network.App.GetBankKeeper(), *tc.genState, + &sync.Once{}, ) }) // verify state for each account diff --git a/x/precisebank/module.go b/x/precisebank/module.go index 3008920e3..5da71ceb7 100644 --- a/x/precisebank/module.go +++ b/x/precisebank/module.go @@ -78,7 +78,7 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod if err != nil { return err } - return gs.Validate() + return nil } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for precisebank module. diff --git a/x/vm/genesis.go b/x/vm/genesis.go index 987214423..f6c411607 100644 --- a/x/vm/genesis.go +++ b/x/vm/genesis.go @@ -2,6 +2,7 @@ package vm import ( "fmt" + "sync" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" @@ -19,7 +20,9 @@ func InitGenesis( ctx sdk.Context, k *keeper.Keeper, accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, data types.GenesisState, + initializer *sync.Once, ) []abci.ValidatorUpdate { err := k.SetParams(ctx, data.Params) if err != nil { @@ -57,6 +60,10 @@ func InitGenesis( } } + initializer.Do(func() { + SetGlobalConfigVariables(ctx, k, bankKeeper, data.Params) + }) + if err := k.AddPreinstalls(ctx, data.Preinstalls); err != nil { panic(fmt.Errorf("error adding preinstalls: %s", err)) } diff --git a/x/vm/keeper/keeper.go b/x/vm/keeper/keeper.go index 301c0f8be..4fc0fc082 100644 --- a/x/vm/keeper/keeper.go +++ b/x/vm/keeper/keeper.go @@ -95,6 +95,7 @@ func NewKeeper( fmk types.FeeMarketKeeper, consensusKeeper types.ConsensusParamsKeeper, erc20Keeper types.Erc20Keeper, + evmChainId uint64, tracer string, ) *Keeper { // ensure evm module account is set @@ -110,6 +111,12 @@ func NewKeeper( bankWrapper := wrappers.NewBankWrapper(bankKeeper) feeMarketWrapper := wrappers.NewFeeMarketWrapper(fmk) + // set global chain config + ethCfg := types.DefaultChainConfig(evmChainId) //TODO:VLAD make this configurable + if err := types.SetChainConfig(ethCfg); err != nil { + panic(err) + } + // NOTE: we pass in the parameter space to the CommitStateDB in order to use custom denominations for the EVM operations return &Keeper{ cdc: cdc, diff --git a/x/vm/module.go b/x/vm/module.go index 9c51ae43a..cd1c505b0 100644 --- a/x/vm/module.go +++ b/x/vm/module.go @@ -2,12 +2,13 @@ package vm import ( "context" + "cosmossdk.io/math" "encoding/json" "fmt" - "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "sync" abci "github.com/cometbft/cometbft/abci/types" @@ -35,6 +36,7 @@ var ( _ appmodule.HasBeginBlocker = AppModule{} _ appmodule.HasEndBlocker = AppModule{} + _ appmodule.HasPreBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the evm module. @@ -104,16 +106,20 @@ func (AppModuleBasic) GetQueryCmd() *cobra.Command { // AppModule implements an application module for the evm module. type AppModule struct { AppModuleBasic - keeper *keeper.Keeper - ak types.AccountKeeper + keeper *keeper.Keeper + ak types.AccountKeeper + bankKeeper types.BankKeeper + initializer *sync.Once } // NewAppModule creates a new AppModule object -func NewAppModule(k *keeper.Keeper, ak types.AccountKeeper, ac address.Codec) AppModule { +func NewAppModule(k *keeper.Keeper, ak types.AccountKeeper, bankKeeper types.BankKeeper, ac address.Codec) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{ac: ac}, keeper: k, ak: ak, + bankKeeper: bankKeeper, + initializer: &sync.Once{}, } } @@ -129,6 +135,15 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } +func (am AppModule) PreBlock(goCtx context.Context) (appmodule.ResponsePreBlock, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + params := am.keeper.GetParams(ctx) + am.initializer.Do(func() { + SetGlobalConfigVariables(ctx, am.keeper, am.bankKeeper, params) + }) + return &sdk.ResponsePreBlock{ConsensusParamsChanged: false}, nil +} + // BeginBlock returns the begin blocker for the evm module. func (am AppModule) BeginBlock(ctx context.Context) error { c := sdk.UnwrapSDKContext(ctx) @@ -147,7 +162,7 @@ func (am AppModule) EndBlock(ctx context.Context) error { func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - InitGenesis(ctx, am.keeper, am.ak, genesisState) + InitGenesis(ctx, am.keeper, am.ak, am.bankKeeper, genesisState, am.initializer) return []abci.ValidatorUpdate{} } @@ -176,3 +191,74 @@ func (am AppModule) IsAppModule() {} // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (am AppModule) IsOnePerModuleType() {} + +// setBaseDenom registers the display denom and base denom and sets the +// base denom for the chain. The function registered different values based on +// the EvmCoinInfo to allow different configurations in mainnet and testnet. +func setBaseDenom(ci types.EvmCoinInfo) (err error) { + // Defer setting the base denom, and capture any potential error from it. + // So when failing because the denom was already registered, we ignore it and set + // the corresponding denom to be base denom + defer func() { + err = sdk.SetBaseDenom(ci.Denom) + }() + if err := sdk.RegisterDenom(ci.DisplayDenom, math.LegacyOneDec()); err != nil { + return err + } + + // sdk.RegisterDenom will automatically overwrite the base denom when the + // new setBaseDenom() units are lower than the current base denom's units. + return sdk.RegisterDenom(ci.Denom, math.LegacyNewDecWithPrec(1, int64(ci.Decimals))) +} + +func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeeper types.BankKeeper, params types.Params) { + var decimals types.Decimals + + evmDenomMetadata, found := bankKeeper.GetDenomMetaData(ctx, params.EvmDenom) + if !found { + panic("denom metadata could not be found") + } + + for _, denomUnit := range evmDenomMetadata.DenomUnits { + if denomUnit.Denom == evmDenomMetadata.Display { + decimals = types.Decimals(denomUnit.Exponent) + } + } + + var extendedDenom string + if decimals == 18 { + extendedDenom = params.EvmDenom + } else { + if params.ExtendedDenomOptions == nil { + panic(fmt.Errorf("extended denom options cannot be nil for non-18-decimal chains")) + } + extendedDenom = params.ExtendedDenomOptions.ExtendedDenom + } + + coinInfo := types.EvmCoinInfo{ + Denom: params.EvmDenom, + ExtendedDenom: extendedDenom, + DisplayDenom: evmDenomMetadata.Display, + Decimals: decimals, + } + + // set the denom info for the chain + if err := setBaseDenom(coinInfo); err != nil { + panic(err) + } + + configurator := types.NewEVMConfigurator() + //if withReset { + // // reset configuration to set the new one + // configurator.ResetTestConfig() + //} + err := configurator. + WithExtendedEips(types.DefaultCosmosEVMActivators). + WithChainConfig(types.GetChainConfig()). + // NOTE: we're using the 18 decimals default for the example chain + WithEVMCoinInfo(coinInfo). + Configure() + if err != nil { + panic(err) + } +} diff --git a/config/activators.go b/x/vm/types/activators.go similarity index 58% rename from config/activators.go rename to x/vm/types/activators.go index 197526d7c..734712429 100644 --- a/config/activators.go +++ b/x/vm/types/activators.go @@ -1,4 +1,4 @@ -package config +package types import ( "github.com/ethereum/go-ethereum/core/vm" @@ -6,9 +6,9 @@ import ( "github.com/cosmos/evm/eips" ) -// cosmosEVMActivators defines a map of opcode modifiers associated +// DefaultCosmosEVMActivators defines a map of opcode modifiers associated // with a key defining the corresponding EIP. -var cosmosEVMActivators = map[int]func(*vm.JumpTable){ +var DefaultCosmosEVMActivators = map[int]func(*vm.JumpTable){ 0o000: eips.Enable0000, 0o001: eips.Enable0001, 0o002: eips.Enable0002, diff --git a/x/vm/types/chain_config.go b/x/vm/types/chain_config.go index d22fd6547..ea92d97c8 100644 --- a/x/vm/types/chain_config.go +++ b/x/vm/types/chain_config.go @@ -10,9 +10,6 @@ import ( sdkmath "cosmossdk.io/math" ) -// testChainID represents the ChainID used for the purpose of testing. -const testChainID uint64 = 262144 // TODO:VLAD - Consolidate into a single object across the entire repo - // chainConfig is the chain configuration used in the EVM to defined which // opcodes are active based on Ethereum upgrades. var chainConfig *ChainConfig @@ -60,7 +57,7 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *gethparams.ChainConfig { func DefaultChainConfig(evmChainID uint64) *ChainConfig { if evmChainID == 0 { - evmChainID = testChainID + evmChainID = DefaultEVMChainID } homesteadBlock := sdkmath.ZeroInt() @@ -111,11 +108,11 @@ func DefaultChainConfig(evmChainID uint64) *ChainConfig { return cfg } -// setChainConfig allows to set the `chainConfig` variable modifying the +// SetChainConfig allows to set the `chainConfig` variable modifying the // default values. The method is private because it should only be called once // in the EVMConfigurator. -func setChainConfig(cc *ChainConfig) error { - if chainConfig != nil { +func SetChainConfig(cc *ChainConfig) error { + if chainConfig != nil && chainConfig.ChainId != DefaultEVMChainID { return errors.New("chainConfig already set. Cannot set again the chainConfig") } config := DefaultChainConfig(0) diff --git a/x/vm/types/config.go b/x/vm/types/config.go index 34f87ffef..44fa6f31f 100644 --- a/x/vm/types/config.go +++ b/x/vm/types/config.go @@ -22,10 +22,6 @@ func (ec *EVMConfigurator) Configure() error { return fmt.Errorf("error configuring EVMConfigurator: already sealed and cannot be modified") } - if err := setChainConfig(ec.chainConfig); err != nil { - return err - } - if err := setEVMCoinInfo(ec.evmCoinInfo); err != nil { return err } diff --git a/x/vm/types/evm.pb.go b/x/vm/types/evm.pb.go index e472085c9..ea68bafcb 100644 --- a/x/vm/types/evm.pb.go +++ b/x/vm/types/evm.pb.go @@ -70,8 +70,9 @@ type Params struct { AccessControl AccessControl `protobuf:"bytes,8,opt,name=access_control,json=accessControl,proto3" json:"access_control"` // active_static_precompiles defines the slice of hex addresses of the // precompiled contracts that are active - ActiveStaticPrecompiles []string `protobuf:"bytes,9,rep,name=active_static_precompiles,json=activeStaticPrecompiles,proto3" json:"active_static_precompiles,omitempty"` - HistoryServeWindow uint64 `protobuf:"varint,10,opt,name=history_serve_window,json=historyServeWindow,proto3" json:"history_serve_window,omitempty"` + ActiveStaticPrecompiles []string `protobuf:"bytes,9,rep,name=active_static_precompiles,json=activeStaticPrecompiles,proto3" json:"active_static_precompiles,omitempty"` + HistoryServeWindow uint64 `protobuf:"varint,10,opt,name=history_serve_window,json=historyServeWindow,proto3" json:"history_serve_window,omitempty"` + ExtendedDenomOptions *ExtendedDenomOptions `protobuf:"bytes,11,opt,name=extended_denom_options,json=extendedDenomOptions,proto3" json:"extended_denom_options,omitempty"` } func (m *Params) Reset() { *m = Params{} } @@ -149,6 +150,57 @@ func (m *Params) GetHistoryServeWindow() uint64 { return 0 } +func (m *Params) GetExtendedDenomOptions() *ExtendedDenomOptions { + if m != nil { + return m.ExtendedDenomOptions + } + return nil +} + +type ExtendedDenomOptions struct { + ExtendedDenom string `protobuf:"bytes,1,opt,name=extended_denom,json=extendedDenom,proto3" json:"extended_denom,omitempty"` +} + +func (m *ExtendedDenomOptions) Reset() { *m = ExtendedDenomOptions{} } +func (m *ExtendedDenomOptions) String() string { return proto.CompactTextString(m) } +func (*ExtendedDenomOptions) ProtoMessage() {} +func (*ExtendedDenomOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_d1129b8db63d55c7, []int{1} +} +func (m *ExtendedDenomOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExtendedDenomOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExtendedDenomOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExtendedDenomOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExtendedDenomOptions.Merge(m, src) +} +func (m *ExtendedDenomOptions) XXX_Size() int { + return m.Size() +} +func (m *ExtendedDenomOptions) XXX_DiscardUnknown() { + xxx_messageInfo_ExtendedDenomOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_ExtendedDenomOptions proto.InternalMessageInfo + +func (m *ExtendedDenomOptions) GetExtendedDenom() string { + if m != nil { + return m.ExtendedDenom + } + return "" +} + // AccessControl defines the permission policy of the EVM // for creating and calling contracts type AccessControl struct { @@ -162,7 +214,7 @@ func (m *AccessControl) Reset() { *m = AccessControl{} } func (m *AccessControl) String() string { return proto.CompactTextString(m) } func (*AccessControl) ProtoMessage() {} func (*AccessControl) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{1} + return fileDescriptor_d1129b8db63d55c7, []int{2} } func (m *AccessControl) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -223,7 +275,7 @@ func (m *AccessControlType) Reset() { *m = AccessControlType{} } func (m *AccessControlType) String() string { return proto.CompactTextString(m) } func (*AccessControlType) ProtoMessage() {} func (*AccessControlType) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{2} + return fileDescriptor_d1129b8db63d55c7, []int{3} } func (m *AccessControlType) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -333,7 +385,7 @@ func (m *ChainConfig) Reset() { *m = ChainConfig{} } func (m *ChainConfig) String() string { return proto.CompactTextString(m) } func (*ChainConfig) ProtoMessage() {} func (*ChainConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{3} + return fileDescriptor_d1129b8db63d55c7, []int{4} } func (m *ChainConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -402,7 +454,7 @@ func (m *State) Reset() { *m = State{} } func (m *State) String() string { return proto.CompactTextString(m) } func (*State) ProtoMessage() {} func (*State) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{4} + return fileDescriptor_d1129b8db63d55c7, []int{5} } func (m *State) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -459,7 +511,7 @@ func (m *TransactionLogs) Reset() { *m = TransactionLogs{} } func (m *TransactionLogs) String() string { return proto.CompactTextString(m) } func (*TransactionLogs) ProtoMessage() {} func (*TransactionLogs) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{5} + return fileDescriptor_d1129b8db63d55c7, []int{6} } func (m *TransactionLogs) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -537,7 +589,7 @@ func (m *Log) Reset() { *m = Log{} } func (m *Log) String() string { return proto.CompactTextString(m) } func (*Log) ProtoMessage() {} func (*Log) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{6} + return fileDescriptor_d1129b8db63d55c7, []int{7} } func (m *Log) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -659,7 +711,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_d1129b8db63d55c7, []int{7} + return fileDescriptor_d1129b8db63d55c7, []int{8} } func (m *TxResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -700,7 +752,7 @@ func (m *AccessTuple) Reset() { *m = AccessTuple{} } func (m *AccessTuple) String() string { return proto.CompactTextString(m) } func (*AccessTuple) ProtoMessage() {} func (*AccessTuple) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{8} + return fileDescriptor_d1129b8db63d55c7, []int{9} } func (m *AccessTuple) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -760,7 +812,7 @@ func (m *TraceConfig) Reset() { *m = TraceConfig{} } func (m *TraceConfig) String() string { return proto.CompactTextString(m) } func (*TraceConfig) ProtoMessage() {} func (*TraceConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{9} + return fileDescriptor_d1129b8db63d55c7, []int{10} } func (m *TraceConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -881,7 +933,7 @@ func (m *Preinstall) Reset() { *m = Preinstall{} } func (m *Preinstall) String() string { return proto.CompactTextString(m) } func (*Preinstall) ProtoMessage() {} func (*Preinstall) Descriptor() ([]byte, []int) { - return fileDescriptor_d1129b8db63d55c7, []int{10} + return fileDescriptor_d1129b8db63d55c7, []int{11} } func (m *Preinstall) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -934,6 +986,7 @@ func (m *Preinstall) GetCode() string { func init() { proto.RegisterEnum("cosmos.evm.vm.v1.AccessType", AccessType_name, AccessType_value) proto.RegisterType((*Params)(nil), "cosmos.evm.vm.v1.Params") + proto.RegisterType((*ExtendedDenomOptions)(nil), "cosmos.evm.vm.v1.ExtendedDenomOptions") proto.RegisterType((*AccessControl)(nil), "cosmos.evm.vm.v1.AccessControl") proto.RegisterType((*AccessControlType)(nil), "cosmos.evm.vm.v1.AccessControlType") proto.RegisterType((*ChainConfig)(nil), "cosmos.evm.vm.v1.ChainConfig") @@ -949,133 +1002,136 @@ func init() { func init() { proto.RegisterFile("cosmos/evm/vm/v1/evm.proto", fileDescriptor_d1129b8db63d55c7) } var fileDescriptor_d1129b8db63d55c7 = []byte{ - // 2007 bytes of a gzipped FileDescriptorProto + // 2061 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0x4d, 0x6f, 0x1b, 0xc7, - 0x19, 0x16, 0xc5, 0x95, 0xb4, 0x1c, 0x52, 0xd2, 0x7a, 0x44, 0xcb, 0x34, 0xed, 0x68, 0xd5, 0x6d, - 0x0f, 0xaa, 0x91, 0x4a, 0x96, 0x1c, 0xb5, 0x86, 0xd3, 0x0f, 0x88, 0x32, 0xd3, 0x4a, 0xb5, 0x1d, - 0x61, 0xa8, 0xc6, 0x48, 0xd1, 0x62, 0x31, 0xdc, 0x1d, 0x2f, 0x37, 0xda, 0xdd, 0x21, 0x66, 0x96, - 0xb4, 0xd8, 0x3f, 0xd0, 0xc0, 0xa7, 0xf4, 0x07, 0x18, 0x08, 0xd0, 0x4b, 0x8e, 0x39, 0xf4, 0x07, - 0xf4, 0x98, 0x63, 0x8e, 0x45, 0x81, 0x2e, 0x0a, 0xfa, 0x10, 0x40, 0x47, 0xfd, 0x82, 0x62, 0x3e, - 0xf8, 0x29, 0x85, 0x55, 0x00, 0xc1, 0x9e, 0xe7, 0xfd, 0x78, 0x9e, 0xf9, 0x78, 0x77, 0xe7, 0x5d, - 0x82, 0xaa, 0x47, 0x79, 0x4c, 0xf9, 0x0e, 0xe9, 0xc6, 0x3b, 0xe2, 0x6f, 0x57, 0x8c, 0xb6, 0xdb, - 0x8c, 0xa6, 0x14, 0x5a, 0xca, 0xb7, 0x2d, 0x2c, 0xe2, 0x6f, 0xb7, 0x7a, 0x0b, 0xc7, 0x61, 0x42, - 0x77, 0xe4, 0xbf, 0x2a, 0xa8, 0x5a, 0x0e, 0x68, 0x40, 0xe5, 0x70, 0x47, 0x8c, 0x94, 0xd5, 0xf9, -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xaf, 0x93, 0x28, 0xd6, 0xfb, 0x92, 0x75, 0x67, 0x16, 0xab, 0xbe, 0x8a, 0xc7, 0xb2, - 0x1c, 0x04, 0x14, 0x1a, 0x30, 0xb6, 0x19, 0x0e, 0x3a, 0x44, 0x31, 0xbe, 0x77, 0x63, 0xc6, 0xb1, - 0x2c, 0x07, 0x01, 0x85, 0x06, 0x8c, 0x5d, 0xc2, 0xce, 0x22, 0xcd, 0xb8, 0x71, 0x63, 0xc6, 0xb1, - 0x2c, 0x07, 0x01, 0x85, 0x24, 0xe3, 0x73, 0x00, 0x28, 0xc7, 0x67, 0x58, 0x11, 0xda, 0x92, 0x70, - 0x7b, 0x16, 0xa1, 0x6e, 0x61, 0x47, 0x49, 0x0e, 0x2a, 0x48, 0x20, 0xe8, 0x86, 0x8d, 0xd9, 0xba, - 0x75, 0xe7, 0xd8, 0x30, 0xef, 0x58, 0x15, 0x67, 0x07, 0x2c, 0x88, 0xd6, 0x90, 0x40, 0x0b, 0xe4, - 0xcf, 0x48, 0x4f, 0xf5, 0x05, 0x48, 0x0c, 0xc5, 0xd9, 0x77, 0x71, 0xd4, 0x21, 0xea, 0x3a, 0x47, - 0x0a, 0x38, 0x27, 0x60, 0xf5, 0x94, 0xe1, 0x84, 0x8b, 0xb6, 0x92, 0x26, 0xcf, 0x68, 0xc0, 0x21, - 0x04, 0x46, 0x0b, 0xf3, 0x96, 0xce, 0x95, 0x63, 0xf8, 0x53, 0x60, 0x44, 0x34, 0xe0, 0xb2, 0xb1, - 0x29, 0xee, 0xdd, 0xbe, 0xda, 0x45, 0x3d, 0xa3, 0x01, 0x92, 0x21, 0xce, 0x5f, 0xf3, 0x20, 0xff, - 0x8c, 0x06, 0xb0, 0x02, 0x96, 0xb0, 0xef, 0x33, 0xc2, 0xb9, 0x66, 0x1a, 0x40, 0xb8, 0x0e, 0x16, - 0x53, 0xda, 0x0e, 0x3d, 0x45, 0x57, 0x40, 0x1a, 0x09, 0x61, 0x1f, 0xa7, 0x58,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0x74, 0x84, 0x83, 0x56, 0x07, 0xa6, 0x03, 0x7d, 0x78, 0x65, 0xb0, 0xd0, 0x8c, - 0x28, 0x8d, 0x65, 0x19, 0x95, 0x90, 0x02, 0xf0, 0xa5, 0xdc, 0x72, 0x59, 0x22, 0x79, 0xd9, 0xc4, - 0xff, 0xe8, 0x6a, 0x89, 0x4c, 0xd5, 0x59, 0xed, 0x9e, 0x68, 0xe1, 0x2f, 0x33, 0x7b, 0x45, 0x69, - 0xeb, 0x7c, 0xe7, 0xab, 0xef, 0xbe, 0x7e, 0x90, 0x13, 0xa7, 0x23, 0x8b, 0xd1, 0x02, 0x79, 0x46, - 0x52, 0x79, 0xec, 0x25, 0x24, 0x86, 0xe2, 0x6d, 0xc5, 0x48, 0x97, 0xb0, 0x94, 0xf8, 0xf2, 0x78, - 0x4d, 0x34, 0xc4, 0xe2, 0xd5, 0x17, 0x60, 0xee, 0x76, 0x38, 0xf1, 0xd5, 0x59, 0xa2, 0xa5, 0x00, - 0xf3, 0x3f, 0x70, 0xe2, 0x3f, 0x31, 0x3e, 0xff, 0xd2, 0x9e, 0x73, 0x30, 0x28, 0xea, 0xfe, 0xbe, - 0xd3, 0x8e, 0xc8, 0x8c, 0x1a, 0xdd, 0x03, 0x25, 0xf1, 0xc1, 0x84, 0x03, 0xe2, 0x9e, 0x91, 0x9e, - 0xae, 0x54, 0x55, 0x77, 0xda, 0xfe, 0x7b, 0xd2, 0xe3, 0x68, 0x1c, 0x68, 0x89, 0x2f, 0x0d, 0x50, - 0x3c, 0x65, 0xd8, 0x23, 0xba, 0x5b, 0x17, 0xd5, 0x2e, 0x20, 0xd3, 0x12, 0x1a, 0x09, 0x6d, 0x71, - 0xa8, 0xb4, 0x93, 0xea, 0x27, 0x72, 0x00, 0x45, 0x06, 0x23, 0xe4, 0x9c, 0x78, 0x72, 0x2f, 0x0d, - 0xa4, 0x11, 0xdc, 0x07, 0xcb, 0x7e, 0xc8, 0x71, 0x33, 0x92, 0xdf, 0x87, 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b, 0xf3, 0xd5, 0xdc, 0xbf, 0xcf, 0x57, 0x73, 0x5f, 0xbe, 0x5b, 0x9d, 0xf9, 0xee, + 0xdd, 0xea, 0xcc, 0x3f, 0xde, 0xad, 0xce, 0xfc, 0x61, 0x2d, 0x08, 0x79, 0xbb, 0xdb, 0xda, 0xf0, + 0x68, 0xbc, 0x39, 0xf9, 0x5b, 0x87, 0xf8, 0x20, 0x67, 0xad, 0x79, 0xf9, 0x73, 0xd7, 0xa3, 0xff, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x29, 0x83, 0x0d, 0x47, 0x13, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -1098,6 +1154,18 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ExtendedDenomOptions != nil { + { + size, err := m.ExtendedDenomOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvm(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } if m.HistoryServeWindow != 0 { i = encodeVarintEvm(dAtA, i, uint64(m.HistoryServeWindow)) i-- @@ -1132,21 +1200,21 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { } } if len(m.ExtraEIPs) > 0 { - dAtA3 := make([]byte, len(m.ExtraEIPs)*10) - var j2 int + dAtA4 := make([]byte, len(m.ExtraEIPs)*10) + var j3 int for _, num1 := range m.ExtraEIPs { num := uint64(num1) for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) + dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j2++ + j3++ } - dAtA3[j2] = uint8(num) - j2++ + dAtA4[j3] = uint8(num) + j3++ } - i -= j2 - copy(dAtA[i:], dAtA3[:j2]) - i = encodeVarintEvm(dAtA, i, uint64(j2)) + i -= j3 + copy(dAtA[i:], dAtA4[:j3]) + i = encodeVarintEvm(dAtA, i, uint64(j3)) i-- dAtA[i] = 0x22 } @@ -1160,6 +1228,36 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ExtendedDenomOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExtendedDenomOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExtendedDenomOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ExtendedDenom) > 0 { + i -= len(m.ExtendedDenom) + copy(dAtA[i:], m.ExtendedDenom) + i = encodeVarintEvm(dAtA, i, uint64(len(m.ExtendedDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *AccessControl) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2038,6 +2136,23 @@ func (m *Params) Size() (n int) { if m.HistoryServeWindow != 0 { n += 1 + sovEvm(uint64(m.HistoryServeWindow)) } + if m.ExtendedDenomOptions != nil { + l = m.ExtendedDenomOptions.Size() + n += 1 + l + sovEvm(uint64(l)) + } + return n +} + +func (m *ExtendedDenomOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ExtendedDenom) + if l > 0 { + n += 1 + l + sovEvm(uint64(l)) + } return n } @@ -2630,6 +2745,124 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedDenomOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvm + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ExtendedDenomOptions == nil { + m.ExtendedDenomOptions = &ExtendedDenomOptions{} + } + if err := m.ExtendedDenomOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvm(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvm + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExtendedDenomOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExtendedDenomOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExtendedDenomOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtendedDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvm(dAtA[iNdEx:]) diff --git a/x/vm/types/interfaces.go b/x/vm/types/interfaces.go index 3823f9de8..75d358673 100644 --- a/x/vm/types/interfaces.go +++ b/x/vm/types/interfaces.go @@ -58,6 +58,7 @@ type StakingKeeper interface { GetHistoricalInfo(ctx context.Context, height int64) (stakingtypes.HistoricalInfo, error) GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (stakingtypes.Validator, error) ValidatorAddressCodec() address.Codec + BondDenom(ctx context.Context) (string, error) } // FeeMarketKeeper defines the expected interfaces needed for the feemarket diff --git a/x/vm/types/key.go b/x/vm/types/key.go index 0b7eaa6b5..45226c8d5 100644 --- a/x/vm/types/key.go +++ b/x/vm/types/key.go @@ -27,6 +27,7 @@ const ( prefixStorage prefixParams prefixCodeHash + prefixEvmCoinInfo ) // prefix bytes for the EVM transient store @@ -39,10 +40,11 @@ const ( // KVStore key prefixes var ( - KeyPrefixCode = []byte{prefixCode} - KeyPrefixStorage = []byte{prefixStorage} - KeyPrefixParams = []byte{prefixParams} - KeyPrefixCodeHash = []byte{prefixCodeHash} + KeyPrefixCode = []byte{prefixCode} + KeyPrefixStorage = []byte{prefixStorage} + KeyPrefixParams = []byte{prefixParams} + KeyPrefixCodeHash = []byte{prefixCodeHash} + KeyPrefixEvmCoinInfo = []byte{prefixEvmCoinInfo} ) // Transient Store key prefixes diff --git a/x/vm/types/params.go b/x/vm/types/params.go index 5b3e8d400..9294839f4 100644 --- a/x/vm/types/params.go +++ b/x/vm/types/params.go @@ -20,7 +20,7 @@ var ( // DefaultEVMDenom is the default value for the evm denom DefaultEVMDenom = "atest" // DefaultEVMChainID is the default value for the evm chain ID - DefaultEVMChainID = "cosmos_262144-1" + DefaultEVMChainID uint64 = 262144 // DefaultEVMDecimals is the default value for the evm denom decimal precision DefaultEVMDecimals uint64 = 18 // DefaultStaticPrecompiles defines the default active precompiles. diff --git a/x/vm/types/scaling.go b/x/vm/types/scaling.go index ee7dde6c6..ec59ae288 100644 --- a/x/vm/types/scaling.go +++ b/x/vm/types/scaling.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// ConvertAmountToLegacy18Decimals convert the given amount into a 18 decimals +// ConvertAmountTo18DecimalsLegacy convert the given amount into a 18 decimals // representation. func ConvertAmountTo18DecimalsLegacy(amt sdkmath.LegacyDec) sdkmath.LegacyDec { evmCoinDecimal := GetEVMCoinDecimals() From 7e8c25f4ae35017ddf9626059ce76d298de68c4d Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 17:13:45 -0400 Subject: [PATCH 13/45] begin storing coin info in the vm keeper storage the mempool needed the global variable, but that wasn't set, so we set it in the vm keeper storage and use it from there in the mempool everything else still uses the global variable, but we now have a foundation to move it over to the state storage --- api/cosmos/evm/vm/v1/evm.pulsar.go | 729 ++++++++++++++++++++++++++++- config/config.go | 14 +- mempool/interface.go | 1 + mempool/mempool.go | 9 +- proto/cosmos/evm/vm/v1/evm.proto | 7 + testutil/constants/constants.go | 8 +- x/vm/keeper/coin_info.go | 29 ++ x/vm/keeper/keeper.go | 3 +- x/vm/module.go | 6 +- x/vm/types/denom.go | 13 +- x/vm/types/denom_config.go | 8 +- x/vm/types/evm.pb.go | 568 +++++++++++++++++----- x/vm/wrappers/feemarket.go | 5 +- x/vm/wrappers/feemarket_test.go | 2 +- 14 files changed, 1213 insertions(+), 189 deletions(-) create mode 100644 x/vm/keeper/coin_info.go diff --git a/api/cosmos/evm/vm/v1/evm.pulsar.go b/api/cosmos/evm/vm/v1/evm.pulsar.go index ab96fe217..7e5c9a62b 100644 --- a/api/cosmos/evm/vm/v1/evm.pulsar.go +++ b/api/cosmos/evm/vm/v1/evm.pulsar.go @@ -9249,6 +9249,602 @@ func (x *fastReflection_Preinstall) ProtoMethods() *protoiface.Methods { } } +var ( + md_EvmCoinInfo protoreflect.MessageDescriptor + fd_EvmCoinInfo_denom protoreflect.FieldDescriptor + fd_EvmCoinInfo_extended_denom protoreflect.FieldDescriptor + fd_EvmCoinInfo_display_denom protoreflect.FieldDescriptor + fd_EvmCoinInfo_decimals protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_evm_vm_v1_evm_proto_init() + md_EvmCoinInfo = File_cosmos_evm_vm_v1_evm_proto.Messages().ByName("EvmCoinInfo") + fd_EvmCoinInfo_denom = md_EvmCoinInfo.Fields().ByName("denom") + fd_EvmCoinInfo_extended_denom = md_EvmCoinInfo.Fields().ByName("extended_denom") + fd_EvmCoinInfo_display_denom = md_EvmCoinInfo.Fields().ByName("display_denom") + fd_EvmCoinInfo_decimals = md_EvmCoinInfo.Fields().ByName("decimals") +} + +var _ protoreflect.Message = (*fastReflection_EvmCoinInfo)(nil) + +type fastReflection_EvmCoinInfo EvmCoinInfo + +func (x *EvmCoinInfo) ProtoReflect() protoreflect.Message { + return (*fastReflection_EvmCoinInfo)(x) +} + +func (x *EvmCoinInfo) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_EvmCoinInfo_messageType fastReflection_EvmCoinInfo_messageType +var _ protoreflect.MessageType = fastReflection_EvmCoinInfo_messageType{} + +type fastReflection_EvmCoinInfo_messageType struct{} + +func (x fastReflection_EvmCoinInfo_messageType) Zero() protoreflect.Message { + return (*fastReflection_EvmCoinInfo)(nil) +} +func (x fastReflection_EvmCoinInfo_messageType) New() protoreflect.Message { + return new(fastReflection_EvmCoinInfo) +} +func (x fastReflection_EvmCoinInfo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_EvmCoinInfo +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_EvmCoinInfo) Descriptor() protoreflect.MessageDescriptor { + return md_EvmCoinInfo +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_EvmCoinInfo) Type() protoreflect.MessageType { + return _fastReflection_EvmCoinInfo_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_EvmCoinInfo) New() protoreflect.Message { + return new(fastReflection_EvmCoinInfo) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_EvmCoinInfo) Interface() protoreflect.ProtoMessage { + return (*EvmCoinInfo)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_EvmCoinInfo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Denom != "" { + value := protoreflect.ValueOfString(x.Denom) + if !f(fd_EvmCoinInfo_denom, value) { + return + } + } + if x.ExtendedDenom != "" { + value := protoreflect.ValueOfString(x.ExtendedDenom) + if !f(fd_EvmCoinInfo_extended_denom, value) { + return + } + } + if x.DisplayDenom != "" { + value := protoreflect.ValueOfString(x.DisplayDenom) + if !f(fd_EvmCoinInfo_display_denom, value) { + return + } + } + if x.Decimals != uint32(0) { + value := protoreflect.ValueOfUint32(x.Decimals) + if !f(fd_EvmCoinInfo_decimals, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_EvmCoinInfo) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.evm.vm.v1.EvmCoinInfo.denom": + return x.Denom != "" + case "cosmos.evm.vm.v1.EvmCoinInfo.extended_denom": + return x.ExtendedDenom != "" + case "cosmos.evm.vm.v1.EvmCoinInfo.display_denom": + return x.DisplayDenom != "" + case "cosmos.evm.vm.v1.EvmCoinInfo.decimals": + return x.Decimals != uint32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.EvmCoinInfo")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.EvmCoinInfo does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvmCoinInfo) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.evm.vm.v1.EvmCoinInfo.denom": + x.Denom = "" + case "cosmos.evm.vm.v1.EvmCoinInfo.extended_denom": + x.ExtendedDenom = "" + case "cosmos.evm.vm.v1.EvmCoinInfo.display_denom": + x.DisplayDenom = "" + case "cosmos.evm.vm.v1.EvmCoinInfo.decimals": + x.Decimals = uint32(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.EvmCoinInfo")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.EvmCoinInfo does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_EvmCoinInfo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.evm.vm.v1.EvmCoinInfo.denom": + value := x.Denom + return protoreflect.ValueOfString(value) + case "cosmos.evm.vm.v1.EvmCoinInfo.extended_denom": + value := x.ExtendedDenom + return protoreflect.ValueOfString(value) + case "cosmos.evm.vm.v1.EvmCoinInfo.display_denom": + value := x.DisplayDenom + return protoreflect.ValueOfString(value) + case "cosmos.evm.vm.v1.EvmCoinInfo.decimals": + value := x.Decimals + return protoreflect.ValueOfUint32(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.EvmCoinInfo")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.EvmCoinInfo does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvmCoinInfo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.evm.vm.v1.EvmCoinInfo.denom": + x.Denom = value.Interface().(string) + case "cosmos.evm.vm.v1.EvmCoinInfo.extended_denom": + x.ExtendedDenom = value.Interface().(string) + case "cosmos.evm.vm.v1.EvmCoinInfo.display_denom": + x.DisplayDenom = value.Interface().(string) + case "cosmos.evm.vm.v1.EvmCoinInfo.decimals": + x.Decimals = uint32(value.Uint()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.EvmCoinInfo")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.EvmCoinInfo does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvmCoinInfo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.vm.v1.EvmCoinInfo.denom": + panic(fmt.Errorf("field denom of message cosmos.evm.vm.v1.EvmCoinInfo is not mutable")) + case "cosmos.evm.vm.v1.EvmCoinInfo.extended_denom": + panic(fmt.Errorf("field extended_denom of message cosmos.evm.vm.v1.EvmCoinInfo is not mutable")) + case "cosmos.evm.vm.v1.EvmCoinInfo.display_denom": + panic(fmt.Errorf("field display_denom of message cosmos.evm.vm.v1.EvmCoinInfo is not mutable")) + case "cosmos.evm.vm.v1.EvmCoinInfo.decimals": + panic(fmt.Errorf("field decimals of message cosmos.evm.vm.v1.EvmCoinInfo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.EvmCoinInfo")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.EvmCoinInfo does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_EvmCoinInfo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.evm.vm.v1.EvmCoinInfo.denom": + return protoreflect.ValueOfString("") + case "cosmos.evm.vm.v1.EvmCoinInfo.extended_denom": + return protoreflect.ValueOfString("") + case "cosmos.evm.vm.v1.EvmCoinInfo.display_denom": + return protoreflect.ValueOfString("") + case "cosmos.evm.vm.v1.EvmCoinInfo.decimals": + return protoreflect.ValueOfUint32(uint32(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.evm.vm.v1.EvmCoinInfo")) + } + panic(fmt.Errorf("message cosmos.evm.vm.v1.EvmCoinInfo does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_EvmCoinInfo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.evm.vm.v1.EvmCoinInfo", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_EvmCoinInfo) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_EvmCoinInfo) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_EvmCoinInfo) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_EvmCoinInfo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*EvmCoinInfo) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Denom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ExtendedDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.DisplayDenom) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Decimals != 0 { + n += 1 + runtime.Sov(uint64(x.Decimals)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*EvmCoinInfo) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Decimals != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Decimals)) + i-- + dAtA[i] = 0x20 + } + if len(x.DisplayDenom) > 0 { + i -= len(x.DisplayDenom) + copy(dAtA[i:], x.DisplayDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.DisplayDenom))) + i-- + dAtA[i] = 0x1a + } + if len(x.ExtendedDenom) > 0 { + i -= len(x.ExtendedDenom) + copy(dAtA[i:], x.ExtendedDenom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ExtendedDenom))) + i-- + dAtA[i] = 0x12 + } + if len(x.Denom) > 0 { + i -= len(x.Denom) + copy(dAtA[i:], x.Denom) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Denom))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*EvmCoinInfo) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EvmCoinInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: EvmCoinInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExtendedDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ExtendedDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DisplayDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.DisplayDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + x.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -10329,6 +10925,65 @@ func (x *Preinstall) GetCode() string { return "" } +type EvmCoinInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + ExtendedDenom string `protobuf:"bytes,2,opt,name=extended_denom,json=extendedDenom,proto3" json:"extended_denom,omitempty"` + DisplayDenom string `protobuf:"bytes,3,opt,name=display_denom,json=displayDenom,proto3" json:"display_denom,omitempty"` + Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` +} + +func (x *EvmCoinInfo) Reset() { + *x = EvmCoinInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_evm_vm_v1_evm_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EvmCoinInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EvmCoinInfo) ProtoMessage() {} + +// Deprecated: Use EvmCoinInfo.ProtoReflect.Descriptor instead. +func (*EvmCoinInfo) Descriptor() ([]byte, []int) { + return file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP(), []int{12} +} + +func (x *EvmCoinInfo) GetDenom() string { + if x != nil { + return x.Denom + } + return "" +} + +func (x *EvmCoinInfo) GetExtendedDenom() string { + if x != nil { + return x.ExtendedDenom + } + return "" +} + +func (x *EvmCoinInfo) GetDisplayDenom() string { + if x != nil { + return x.DisplayDenom + } + return "" +} + +func (x *EvmCoinInfo) GetDecimals() uint32 { + if x != nil { + return x.Decimals + } + return 0 +} + var File_cosmos_evm_vm_v1_evm_proto protoreflect.FileDescriptor var file_cosmos_evm_vm_v1_evm_proto_rawDesc = []byte{ @@ -10624,30 +11279,39 @@ var file_cosmos_evm_vm_v1_evm_proto_rawDesc = []byte{ 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x2a, 0xc0, 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x3c, 0x0a, 0x1a, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, - 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x00, 0x1a, - 0x1c, 0x8a, 0x9d, 0x20, 0x18, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x50, - 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x12, 0x34, 0x0a, - 0x16, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, - 0x54, 0x52, 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x18, 0x8a, 0x9d, 0x20, 0x14, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, - 0x74, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x18, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, - 0x02, 0x1a, 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, - 0x65, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x1a, 0x04, 0x88, - 0xa3, 0x1e, 0x00, 0x42, 0xab, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x45, 0x76, - 0x6d, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 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, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x6d, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x45, 0x56, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x45, 0x76, 0x6d, 0x2e, 0x56, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x6d, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x8b, 0x01, 0x0a, 0x0b, 0x45, 0x76, 0x6d, 0x43, 0x6f, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x64, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x44, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x23, 0x0a, + 0x0d, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x44, 0x65, 0x6e, + 0x6f, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x2a, 0xc0, + 0x01, 0x0a, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x3c, 0x0a, + 0x1a, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, + 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x4c, 0x45, 0x53, 0x53, 0x10, 0x00, 0x1a, 0x1c, 0x8a, + 0x9d, 0x20, 0x18, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x50, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x6c, 0x65, 0x73, 0x73, 0x12, 0x34, 0x0a, 0x16, 0x41, + 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x53, 0x54, 0x52, + 0x49, 0x43, 0x54, 0x45, 0x44, 0x10, 0x01, 0x1a, 0x18, 0x8a, 0x9d, 0x20, 0x14, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x52, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x65, + 0x64, 0x12, 0x38, 0x0a, 0x18, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x02, 0x1a, + 0x1a, 0x8a, 0x9d, 0x20, 0x16, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x1a, 0x04, 0x88, 0xa3, 0x1e, + 0x00, 0x42, 0xab, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x65, 0x76, 0x6d, 0x2e, 0x76, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x45, 0x76, 0x6d, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 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, 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x6d, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x43, 0x45, 0x56, 0xaa, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x45, 0x76, + 0x6d, 0x2e, 0x56, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x10, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x45, 0x76, 0x6d, 0x5c, 0x56, 0x6d, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x45, 0x76, 0x6d, 0x3a, 0x3a, 0x56, 0x6d, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -10663,7 +11327,7 @@ func file_cosmos_evm_vm_v1_evm_proto_rawDescGZIP() []byte { } var file_cosmos_evm_vm_v1_evm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cosmos_evm_vm_v1_evm_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_cosmos_evm_vm_v1_evm_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_cosmos_evm_vm_v1_evm_proto_goTypes = []interface{}{ (AccessType)(0), // 0: cosmos.evm.vm.v1.AccessType (*Params)(nil), // 1: cosmos.evm.vm.v1.Params @@ -10678,6 +11342,7 @@ var file_cosmos_evm_vm_v1_evm_proto_goTypes = []interface{}{ (*AccessTuple)(nil), // 10: cosmos.evm.vm.v1.AccessTuple (*TraceConfig)(nil), // 11: cosmos.evm.vm.v1.TraceConfig (*Preinstall)(nil), // 12: cosmos.evm.vm.v1.Preinstall + (*EvmCoinInfo)(nil), // 13: cosmos.evm.vm.v1.EvmCoinInfo } var file_cosmos_evm_vm_v1_evm_proto_depIdxs = []int32{ 3, // 0: cosmos.evm.vm.v1.Params.access_control:type_name -> cosmos.evm.vm.v1.AccessControl @@ -10845,6 +11510,18 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { return nil } } + file_cosmos_evm_vm_v1_evm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EvmCoinInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -10852,7 +11529,7 @@ func file_cosmos_evm_vm_v1_evm_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_evm_vm_v1_evm_proto_rawDesc, NumEnums: 1, - NumMessages: 12, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/config/config.go b/config/config.go index 5283d0df2..a9fd92cf9 100644 --- a/config/config.go +++ b/config/config.go @@ -15,45 +15,45 @@ var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, DisplayDenom: ExampleDisplayDenom, - Decimals: evmtypes.EighteenDecimals, + Decimals: evmtypes.EighteenDecimals.Uint32(), }, // SixDecimalsChainID provides a chain ID which is being set up with 6 decimals SixDecimalsChainID: { Denom: "utest", ExtendedDenom: "atest", DisplayDenom: "test", - Decimals: evmtypes.SixDecimals, + Decimals: evmtypes.SixDecimals.Uint32(), }, // EVMChainID provides a chain ID used for internal testing EVMChainID: { Denom: "atest", ExtendedDenom: "atest", DisplayDenom: "test", - Decimals: evmtypes.EighteenDecimals, + Decimals: evmtypes.EighteenDecimals.Uint32(), }, TwelveDecimalsChainID: { Denom: "ptest2", ExtendedDenom: "atest2", DisplayDenom: "test2", - Decimals: evmtypes.TwelveDecimals, + Decimals: evmtypes.TwelveDecimals.Uint32(), }, TwoDecimalsChainID: { Denom: "ctest3", ExtendedDenom: "atest3", DisplayDenom: "test3", - Decimals: evmtypes.TwoDecimals, + Decimals: evmtypes.TwoDecimals.Uint32(), }, TestChainID1: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, DisplayDenom: ExampleChainDenom, - Decimals: evmtypes.EighteenDecimals, + Decimals: evmtypes.EighteenDecimals.Uint32(), }, TestChainID2: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, DisplayDenom: ExampleChainDenom, - Decimals: evmtypes.EighteenDecimals, + Decimals: evmtypes.EighteenDecimals.Uint32(), }, } diff --git a/mempool/interface.go b/mempool/interface.go index bfbf291ce..b09841989 100644 --- a/mempool/interface.go +++ b/mempool/interface.go @@ -16,6 +16,7 @@ import ( type VMKeeperI interface { GetBaseFee(ctx sdk.Context) *big.Int GetParams(ctx sdk.Context) (params vmtypes.Params) + GetEvmCoinInfo(ctx sdk.Context) (coinInfo vmtypes.EvmCoinInfo) GetAccount(ctx sdk.Context, addr common.Address) *statedb.Account GetState(ctx sdk.Context, addr common.Address, key common.Hash) common.Hash GetCode(ctx sdk.Context, codeHash common.Hash) []byte diff --git a/mempool/mempool.go b/mempool/mempool.go index 1222d432b..6526da325 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -144,11 +144,12 @@ func NewExperimentalEVMMempool(getCtxCallback func(height int64, prove bool) (sd defaultConfig := sdkmempool.PriorityNonceMempoolConfig[math.Int]{} defaultConfig.TxPriority = sdkmempool.TxPriority[math.Int]{ GetTxPriority: func(goCtx context.Context, tx sdk.Tx) math.Int { + ctx := sdk.UnwrapSDKContext(goCtx) cosmosTxFee, ok := tx.(sdk.FeeTx) if !ok { return math.ZeroInt() } - found, coin := cosmosTxFee.GetFee().Find(evmtypes.GetEVMCoinDenom()) + found, coin := cosmosTxFee.GetFee().Find(vmKeeper.GetEvmCoinInfo(ctx).Denom) if !found { return math.ZeroInt() } @@ -273,10 +274,11 @@ func (m *ExperimentalEVMMempool) InsertInvalidNonce(txBytes []byte) error { func (m *ExperimentalEVMMempool) Select(goCtx context.Context, i [][]byte) sdkmempool.Iterator { m.mtx.Lock() defer m.mtx.Unlock() + ctx := sdk.UnwrapSDKContext(goCtx) evmIterator, cosmosIterator := m.getIterators(goCtx, i) - combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, evmtypes.GetEVMCoinDenom(), m.blockchain.Config().ChainID, m.blockchain) + combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.vmKeeper.GetEvmCoinInfo(ctx).Denom, m.blockchain.Config().ChainID, m.blockchain) return combinedIterator } @@ -366,10 +368,11 @@ func (m *ExperimentalEVMMempool) shouldRemoveFromEVMPool(tx sdk.Tx) bool { func (m *ExperimentalEVMMempool) SelectBy(goCtx context.Context, i [][]byte, f func(sdk.Tx) bool) { m.mtx.Lock() defer m.mtx.Unlock() + ctx := sdk.UnwrapSDKContext(goCtx) evmIterator, cosmosIterator := m.getIterators(goCtx, i) - combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, evmtypes.GetEVMCoinDenom(), m.blockchain.Config().ChainID, m.blockchain) + combinedIterator := NewEVMMempoolIterator(evmIterator, cosmosIterator, m.logger, m.txConfig, m.vmKeeper.GetEvmCoinInfo(ctx).Denom, m.blockchain.Config().ChainID, m.blockchain) for combinedIterator != nil && f(combinedIterator.Tx()) { combinedIterator = combinedIterator.Next() diff --git a/proto/cosmos/evm/vm/v1/evm.proto b/proto/cosmos/evm/vm/v1/evm.proto index 0deb92c89..ea22da1f0 100644 --- a/proto/cosmos/evm/vm/v1/evm.proto +++ b/proto/cosmos/evm/vm/v1/evm.proto @@ -353,3 +353,10 @@ message Preinstall { // code in hex format for the preinstall contract string code = 3; } + +message EvmCoinInfo { + string denom = 1; + string extended_denom = 2; + string display_denom = 3; + uint32 decimals = 4; +} \ No newline at end of file diff --git a/testutil/constants/constants.go b/testutil/constants/constants.go index 1b2cf732a..317171f31 100644 --- a/testutil/constants/constants.go +++ b/testutil/constants/constants.go @@ -79,25 +79,25 @@ var ( Denom: ExampleAttoDenom, ExtendedDenom: ExampleAttoDenom, DisplayDenom: ExampleDisplayDenom, - Decimals: evmtypes.EighteenDecimals, + Decimals: evmtypes.EighteenDecimals.Uint32(), }, SixDecimalsChainID: { Denom: "utest", ExtendedDenom: "atest", DisplayDenom: "test", - Decimals: evmtypes.SixDecimals, + Decimals: evmtypes.SixDecimals.Uint32(), }, TwelveDecimalsChainID: { Denom: "ptest2", ExtendedDenom: "atest2", DisplayDenom: "test2", - Decimals: evmtypes.TwelveDecimals, + Decimals: evmtypes.TwelveDecimals.Uint32(), }, TwoDecimalsChainID: { Denom: "ctest3", ExtendedDenom: "atest3", DisplayDenom: "test3", - Decimals: evmtypes.TwoDecimals, + Decimals: evmtypes.TwoDecimals.Uint32(), }, } diff --git a/x/vm/keeper/coin_info.go b/x/vm/keeper/coin_info.go new file mode 100644 index 000000000..713a66e4a --- /dev/null +++ b/x/vm/keeper/coin_info.go @@ -0,0 +1,29 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/evm/x/vm/types" +) + +// GetEvmCoinInfo returns the EVM Coin Info stored in the module +func (k Keeper) GetEvmCoinInfo(ctx sdk.Context) (coinInfo types.EvmCoinInfo) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.KeyPrefixEvmCoinInfo) + if bz == nil { + return coinInfo + } + k.cdc.MustUnmarshal(bz, &coinInfo) + return +} + +// SetEvmCoinInfo sets the EVM Coin Info stored in the module +func (k Keeper) SetEvmCoinInfo(ctx sdk.Context, coinInfo types.EvmCoinInfo) error { + store := ctx.KVStore(k.storeKey) + bz, err := k.cdc.Marshal(&coinInfo) + if err != nil { + return err + } + + store.Set(types.KeyPrefixEvmCoinInfo, bz) + return nil +} diff --git a/x/vm/keeper/keeper.go b/x/vm/keeper/keeper.go index 4fc0fc082..fc1599bf0 100644 --- a/x/vm/keeper/keeper.go +++ b/x/vm/keeper/keeper.go @@ -352,7 +352,8 @@ func (k Keeper) GetBaseFee(ctx sdk.Context) *big.Int { if !types.IsLondon(ethCfg, ctx.BlockHeight()) { return nil } - baseFee := k.feeMarketWrapper.GetBaseFee(ctx) + coinInfo := k.GetEvmCoinInfo(ctx) + baseFee := k.feeMarketWrapper.GetBaseFee(ctx, types.Decimals(coinInfo.Decimals)) if baseFee == nil { // return 0 if feemarket not enabled. baseFee = big.NewInt(0) diff --git a/x/vm/module.go b/x/vm/module.go index cd1c505b0..b05ea091f 100644 --- a/x/vm/module.go +++ b/x/vm/module.go @@ -239,7 +239,7 @@ func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeep Denom: params.EvmDenom, ExtendedDenom: extendedDenom, DisplayDenom: evmDenomMetadata.Display, - Decimals: decimals, + Decimals: decimals.Uint32(), } // set the denom info for the chain @@ -247,6 +247,10 @@ func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeep panic(err) } + if err := vmKeeper.SetEvmCoinInfo(ctx, coinInfo); err != nil { + panic(err) + } + configurator := types.NewEVMConfigurator() //if withReset { // // reset configuration to set the new one diff --git a/x/vm/types/denom.go b/x/vm/types/denom.go index b4d5d68dc..aacfa2f89 100644 --- a/x/vm/types/denom.go +++ b/x/vm/types/denom.go @@ -54,7 +54,7 @@ var ConversionFactor = map[Decimals]math.Int{ } // Decimals represents the decimal representation of a Cosmos coin. -type Decimals uint8 +type Decimals uint32 // Validate checks if the Decimals instance represent a supported decimals value // or not. @@ -77,13 +77,4 @@ func (d Decimals) ConversionFactor() math.Int { return ConversionFactor[d] } -// EvmCoinInfo struct holds the name and decimals of the EVM denom. The EVM denom -// is the token used to pay fees in the EVM. -// -// TODO: move to own file? at least rename file because it's unclear to use "denom" -type EvmCoinInfo struct { - Denom string - ExtendedDenom string - DisplayDenom string - Decimals Decimals -} +func (d Decimals) Uint32() uint32 { return uint32(d) } diff --git a/x/vm/types/denom_config.go b/x/vm/types/denom_config.go index 04ff3fe8b..ca731fc3a 100644 --- a/x/vm/types/denom_config.go +++ b/x/vm/types/denom_config.go @@ -25,7 +25,7 @@ func setEVMCoinDecimals(d Decimals) error { return fmt.Errorf("setting EVM coin decimals: %w", err) } - evmCoinInfo.Decimals = d + evmCoinInfo.Decimals = d.Uint32() return nil } @@ -58,7 +58,7 @@ func setDisplayDenom(displayDenom string) error { // GetEVMCoinDecimals returns the decimals used in the representation of the EVM // coin. func GetEVMCoinDecimals() Decimals { - return evmCoinInfo.Decimals + return Decimals(evmCoinInfo.Decimals) } // GetEVMCoinDenom returns the denom used for the EVM coin. @@ -82,7 +82,7 @@ func setEVMCoinInfo(eci EvmCoinInfo) error { return errors.New("EVM coin info already set") } - if eci.Decimals == EighteenDecimals { + if Decimals(eci.Decimals) == EighteenDecimals { if eci.Denom != eci.ExtendedDenom { return errors.New("EVM coin denom and extended denom must be the same for 18 decimals") } @@ -99,5 +99,5 @@ func setEVMCoinInfo(eci EvmCoinInfo) error { if err := setDisplayDenom(eci.DisplayDenom); err != nil { return err } - return setEVMCoinDecimals(eci.Decimals) + return setEVMCoinDecimals(Decimals(eci.Decimals)) } diff --git a/x/vm/types/evm.pb.go b/x/vm/types/evm.pb.go index ea68bafcb..28450b4f2 100644 --- a/x/vm/types/evm.pb.go +++ b/x/vm/types/evm.pb.go @@ -983,6 +983,74 @@ func (m *Preinstall) GetCode() string { return "" } +type EvmCoinInfo struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + ExtendedDenom string `protobuf:"bytes,2,opt,name=extended_denom,json=extendedDenom,proto3" json:"extended_denom,omitempty"` + DisplayDenom string `protobuf:"bytes,3,opt,name=display_denom,json=displayDenom,proto3" json:"display_denom,omitempty"` + Decimals uint32 `protobuf:"varint,4,opt,name=decimals,proto3" json:"decimals,omitempty"` +} + +func (m *EvmCoinInfo) Reset() { *m = EvmCoinInfo{} } +func (m *EvmCoinInfo) String() string { return proto.CompactTextString(m) } +func (*EvmCoinInfo) ProtoMessage() {} +func (*EvmCoinInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_d1129b8db63d55c7, []int{12} +} +func (m *EvmCoinInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EvmCoinInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EvmCoinInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EvmCoinInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EvmCoinInfo.Merge(m, src) +} +func (m *EvmCoinInfo) XXX_Size() int { + return m.Size() +} +func (m *EvmCoinInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EvmCoinInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_EvmCoinInfo proto.InternalMessageInfo + +func (m *EvmCoinInfo) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *EvmCoinInfo) GetExtendedDenom() string { + if m != nil { + return m.ExtendedDenom + } + return "" +} + +func (m *EvmCoinInfo) GetDisplayDenom() string { + if m != nil { + return m.DisplayDenom + } + return "" +} + +func (m *EvmCoinInfo) GetDecimals() uint32 { + if m != nil { + return m.Decimals + } + return 0 +} + func init() { proto.RegisterEnum("cosmos.evm.vm.v1.AccessType", AccessType_name, AccessType_value) proto.RegisterType((*Params)(nil), "cosmos.evm.vm.v1.Params") @@ -997,141 +1065,145 @@ func init() { proto.RegisterType((*AccessTuple)(nil), "cosmos.evm.vm.v1.AccessTuple") proto.RegisterType((*TraceConfig)(nil), "cosmos.evm.vm.v1.TraceConfig") proto.RegisterType((*Preinstall)(nil), "cosmos.evm.vm.v1.Preinstall") + proto.RegisterType((*EvmCoinInfo)(nil), "cosmos.evm.vm.v1.EvmCoinInfo") } func init() { proto.RegisterFile("cosmos/evm/vm/v1/evm.proto", fileDescriptor_d1129b8db63d55c7) } var fileDescriptor_d1129b8db63d55c7 = []byte{ - // 2061 bytes of a gzipped FileDescriptorProto + // 2111 bytes of a gzipped FileDescriptorProto 0x1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x29, 0x36, 0x4e, + 0x64, 0xa1, 0x82, 0x8b, 0xe9, 0x20, 0x0c, 0xbe, 0x00, 0xc6, 0x20, 0x80, 0xb5, 0x5b, 0x2d, 0x1a, + 0x27, 0xe5, 0xec, 0x46, 0x66, 0x53, 0xaf, 0xfe, 0xbc, 0x97, 0x9a, 0x45, 0x45, 0x59, 0x97, 0x9e, + 0xab, 0xd4, 0xbc, 0x33, 0x41, 0xaa, 0x72, 0x2c, 0x54, 0x54, 0xb4, 0x2a, 0x14, 0x36, 0x40, 0x81, + 0xf8, 0xad, 0x9d, 0xbd, 0x87, 0x6a, 0x01, 0x9a, 0x58, 0xc0, 0x6f, 0x66, 0x2d, 0x20, 0x5f, 0x3b, + 0x3a, 0xdd, 0xd9, 0x7b, 0xd8, 0x9f, 0xff, 0xaa, 0x7a, 0xaf, 0x8d, 0xb0, 0x58, 0x28, 0x2f, 0xa1, + 0x9c, 0x7c, 0x5f, 0x63, 0x4f, 0x69, 0x2c, 0xde, 0x54, 0x63, 0xef, 0x3a, 0x8d, 0xbd, 0x71, 0x8d, + 0xbd, 0x71, 0x8d, 0xc7, 0x4a, 0x63, 0xe9, 0xa6, 0x1a, 0x8f, 0xaf, 0xd3, 0x78, 0x3c, 0xae, 0x21, + 0x63, 0x78, 0x31, 0x35, 0xba, 0x7f, 0xc6, 0x51, 0xe2, 0xb7, 0x43, 0x25, 0xa3, 0xdf, 0xb8, 0x98, + 0x26, 0x32, 0x2d, 0x54, 0x1c, 0x58, 0x24, 0xfb, 0x39, 0x28, 0x39, 0x34, 0x62, 0x09, 0xb7, 0x45, + 0xb4, 0x15, 0x10, 0x25, 0x91, 0x13, 0x12, 0x8f, 0x67, 0x49, 0xdc, 0x93, 0x12, 0xd7, 0xa5, 0x5b, + 0x68, 0x75, 0xdc, 0x2c, 0xc5, 0x6c, 0x60, 0xb4, 0x48, 0x42, 0x62, 0xd6, 0x68, 0xc7, 0x9e, 0x12, + 0x02, 0x42, 0xe8, 0xfd, 0x59, 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 0x9d, 0x23, 0x09, 0xac, 0x53, 0xb0, 0x72, 0x16, 0xe3, 0x88, 0xf1, 0x9e, 0x97, 0x46, + 0x27, 0xd4, 0x63, 0x10, 0x02, 0xad, 0x89, 0x59, 0x53, 0xe5, 0x8a, 0x31, 0xfc, 0x19, 0xd0, 0x02, + 0xea, 0x31, 0xd1, 0xd8, 0xe4, 0x77, 0x6f, 0x4f, 0x77, 0x51, 0x27, 0xd4, 0x43, 0x22, 0xc4, 0xfa, + 0x4b, 0x16, 0x64, 0x4f, 0xa8, 0x07, 0xcb, 0x60, 0x09, 0xbb, 0x6e, 0x4c, 0x18, 0x53, 0x4c, 0x7d, + 0x08, 0xd7, 0xc0, 0x62, 0x42, 0x5b, 0xbe, 0x23, 0xe9, 0x72, 0x48, 0x21, 0x2e, 0xec, 0xe2, 0x04, + 0x8b, 0x1e, 0xa0, 0x80, 0xc4, 0x98, 0x7f, 0x42, 0x88, 0x52, 0xb7, 0xa3, 0x76, 0xd8, 0x20, 0xb1, + 0xb8, 0xca, 0xb5, 0xea, 0xca, 0x65, 0x6a, 0xe6, 0x85, 0xfd, 0x99, 0x30, 0xa3, 0x51, 0x00, 0xdf, + 0x03, 0x4b, 0xc9, 0x85, 0x2d, 0xd6, 0xb0, 0x20, 0xb6, 0x78, 0xf5, 0x32, 0x35, 0x57, 0x92, 0xe1, + 0x32, 0x7f, 0x87, 0x59, 0x13, 0x2d, 0x26, 0x17, 0xfc, 0x7f, 0xb8, 0x0d, 0xf4, 0xe4, 0xc2, 0xf6, + 0x23, 0x97, 0x5c, 0x88, 0x4b, 0x5c, 0xab, 0x96, 0x2e, 0x53, 0xd3, 0x18, 0x09, 0x3f, 0xe2, 0x3e, + 0xb4, 0x94, 0x5c, 0x88, 0x01, 0x7c, 0x0f, 0x00, 0x39, 0x25, 0xa1, 0x20, 0xef, 0xe4, 0xe5, 0xcb, + 0xd4, 0xcc, 0x09, 0xab, 0xe0, 0x1e, 0x0e, 0xa1, 0x05, 0x16, 0x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0x76, 0x52, + 0xab, 0xd7, 0x8d, 0xb9, 0xca, 0xfd, 0xd7, 0x6f, 0x36, 0xca, 0xc3, 0xf8, 0x53, 0x12, 0x87, 0x3e, + 0x63, 0x3e, 0x8d, 0x02, 0xbe, 0xdc, 0xf7, 0xc1, 0xda, 0x68, 0x36, 0xaa, 0xd5, 0xcf, 0xd0, 0xd1, + 0xc1, 0x59, 0xed, 0xd0, 0xc8, 0x54, 0xca, 0xaf, 0xdf, 0x6c, 0x94, 0x86, 0x99, 0x88, 0xb0, 0x24, + 0xf6, 0x1d, 0xfe, 0x1e, 0x78, 0x0c, 0xca, 0xd7, 0x6b, 0xd6, 0x0e, 0x8d, 0xf9, 0x4a, 0xe5, 0xf5, + 0x9b, 0x8d, 0xb5, 0xeb, 0x14, 0x89, 0x5b, 0xd1, 0x3e, 0xff, 0xc7, 0xfa, 0x5c, 0xf5, 0xc9, 0x37, + 0xbd, 0xf5, 0xcc, 0xb7, 0xbd, 0xf5, 0xcc, 0x7f, 0x7b, 0xeb, 0x99, 0x2f, 0xde, 0xae, 0xcf, 0x7d, + 0xfb, 0x76, 0x7d, 0xee, 0x5f, 0x6f, 0xd7, 0xe7, 0xfe, 0xb8, 0xe1, 0xf9, 0x49, 0xb3, 0xdd, 0xd8, + 0x72, 0x68, 0xb8, 0x3d, 0xf9, 0xcb, 0x4b, 0xd2, 0x6d, 0x11, 0xd6, 0x58, 0x14, 0x3f, 0xbe, 0x3d, + 0xfa, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0x59, 0x0f, 0x70, 0xd5, 0x13, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -2091,6 +2163,55 @@ func (m *Preinstall) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EvmCoinInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EvmCoinInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EvmCoinInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Decimals != 0 { + i = encodeVarintEvm(dAtA, i, uint64(m.Decimals)) + i-- + dAtA[i] = 0x20 + } + if len(m.DisplayDenom) > 0 { + i -= len(m.DisplayDenom) + copy(dAtA[i:], m.DisplayDenom) + i = encodeVarintEvm(dAtA, i, uint64(len(m.DisplayDenom))) + i-- + dAtA[i] = 0x1a + } + if len(m.ExtendedDenom) > 0 { + i -= len(m.ExtendedDenom) + copy(dAtA[i:], m.ExtendedDenom) + i = encodeVarintEvm(dAtA, i, uint64(len(m.ExtendedDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintEvm(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvm(dAtA []byte, offset int, v uint64) int { offset -= sovEvm(v) base := offset @@ -2486,6 +2607,30 @@ func (m *Preinstall) Size() (n int) { return n } +func (m *EvmCoinInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovEvm(uint64(l)) + } + l = len(m.ExtendedDenom) + if l > 0 { + n += 1 + l + sovEvm(uint64(l)) + } + l = len(m.DisplayDenom) + if l > 0 { + n += 1 + l + sovEvm(uint64(l)) + } + if m.Decimals != 0 { + n += 1 + sovEvm(uint64(m.Decimals)) + } + return n +} + func sovEvm(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5301,6 +5446,171 @@ func (m *Preinstall) Unmarshal(dAtA []byte) error { } return nil } +func (m *EvmCoinInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EvmCoinInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EvmCoinInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtendedDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtendedDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayDenom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvm + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvm + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayDenom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Decimals", wireType) + } + m.Decimals = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Decimals |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEvm(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvm + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvm(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/vm/wrappers/feemarket.go b/x/vm/wrappers/feemarket.go index ad0cb2f6c..f864ec3e2 100644 --- a/x/vm/wrappers/feemarket.go +++ b/x/vm/wrappers/feemarket.go @@ -30,12 +30,13 @@ func NewFeeMarketWrapper( } // GetBaseFee returns the base fee converted to 18 decimals. -func (w FeeMarketWrapper) GetBaseFee(ctx sdk.Context) *big.Int { +func (w FeeMarketWrapper) GetBaseFee(ctx sdk.Context, decimals types.Decimals) *big.Int { baseFee := w.FeeMarketKeeper.GetBaseFee(ctx) if baseFee.IsNil() { return nil } - return types.ConvertAmountTo18DecimalsLegacy(baseFee).TruncateInt().BigInt() + + return baseFee.MulInt(decimals.ConversionFactor()).TruncateInt().BigInt() } // CalculateBaseFee returns the calculated base fee converted to 18 decimals. diff --git a/x/vm/wrappers/feemarket_test.go b/x/vm/wrappers/feemarket_test.go index 710f905ff..e23bfb713 100644 --- a/x/vm/wrappers/feemarket_test.go +++ b/x/vm/wrappers/feemarket_test.go @@ -100,7 +100,7 @@ func TestGetBaseFee(t *testing.T) { tc.mockSetup(mockFeeMarketKeeper) feeMarketWrapper := wrappers.NewFeeMarketWrapper(mockFeeMarketKeeper) - result := feeMarketWrapper.GetBaseFee(sdk.Context{}) + result := feeMarketWrapper.GetBaseFee(sdk.Context{}, evmtypes.Decimals(tc.coinInfo.Decimals)) require.Equal(t, tc.expResult, result) }) From 87904e3b7381346003b7c73dec7d92271da13195 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 17:15:00 -0400 Subject: [PATCH 14/45] remove debugging artifact --- $CHAINDIR/config/client.toml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 $CHAINDIR/config/client.toml diff --git a/$CHAINDIR/config/client.toml b/$CHAINDIR/config/client.toml deleted file mode 100644 index 27f74c5d5..000000000 --- a/$CHAINDIR/config/client.toml +++ /dev/null @@ -1,19 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Client Configuration ### -############################################################################### - -# The network chain ID -chain-id = "" -# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) -keyring-backend = "os" -# Default key name, if set, defines the default key to use for signing transaction when the --from flag is not specified -keyring-default-keyname = "" -# CLI output format (text|json) -output = "text" -# : to CometBFT RPC interface for this chain -node = "tcp://localhost:26657" -# Transaction broadcasting mode (sync|async) -broadcast-mode = "sync" From bedbd6d56cc7c2034ac4030d514711c159acd2de Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 17:37:00 -0400 Subject: [PATCH 15/45] artifact removal 2 --- evmd/$CHAINDIR/config/client.toml | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 evmd/$CHAINDIR/config/client.toml diff --git a/evmd/$CHAINDIR/config/client.toml b/evmd/$CHAINDIR/config/client.toml deleted file mode 100644 index 27f74c5d5..000000000 --- a/evmd/$CHAINDIR/config/client.toml +++ /dev/null @@ -1,19 +0,0 @@ -# This is a TOML config file. -# For more information, see https://github.com/toml-lang/toml - -############################################################################### -### Client Configuration ### -############################################################################### - -# The network chain ID -chain-id = "" -# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory) -keyring-backend = "os" -# Default key name, if set, defines the default key to use for signing transaction when the --from flag is not specified -keyring-default-keyname = "" -# CLI output format (text|json) -output = "text" -# : to CometBFT RPC interface for this chain -node = "tcp://localhost:26657" -# Transaction broadcasting mode (sync|async) -broadcast-mode = "sync" From 799db42f212773eff6cae728cbc826ec18bbc9d6 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 24 Sep 2025 17:42:06 -0400 Subject: [PATCH 16/45] fix unit tests --- tests/integration/ante/ante_test_suite.go | 2 +- tests/integration/x/vm/keeper_test_suite.go | 2 +- tests/integration/x/vm/test_grpc_query.go | 2 +- testutil/integration/evm/network/amounts.go | 6 +++--- testutil/integration/evm/network/coins.go | 2 +- testutil/integration/evm/network/config.go | 4 ++-- x/vm/keeper/keeper_test.go | 2 ++ x/vm/types/denom_config_testing.go | 8 ++++---- x/vm/types/mocks/StakingKeeper.go | 4 ++++ x/vm/types/scaling_test.go | 4 ++-- 10 files changed, 21 insertions(+), 15 deletions(-) diff --git a/tests/integration/ante/ante_test_suite.go b/tests/integration/ante/ante_test_suite.go index d6a72cfa3..369d6c212 100644 --- a/tests/integration/ante/ante_test_suite.go +++ b/tests/integration/ante/ante_test_suite.go @@ -127,7 +127,7 @@ func (s *AnteTestSuite) SetupTest() { Denom: denom, ExtendedDenom: extendedDenom, DisplayDenom: displayDenom, - Decimals: decimals, + Decimals: decimals.Uint32(), }). Configure() s.Require().NoError(err) diff --git a/tests/integration/x/vm/keeper_test_suite.go b/tests/integration/x/vm/keeper_test_suite.go index 8f3f3b39a..1e7f90c30 100644 --- a/tests/integration/x/vm/keeper_test_suite.go +++ b/tests/integration/x/vm/keeper_test_suite.go @@ -114,7 +114,7 @@ func (s *KeeperTestSuite) SetupTest() { Denom: denom, ExtendedDenom: extendedDenom, DisplayDenom: displayDenom, - Decimals: decimals, + Decimals: decimals.Uint32(), }). Configure() s.Require().NoError(err) diff --git a/tests/integration/x/vm/test_grpc_query.go b/tests/integration/x/vm/test_grpc_query.go index f9b55fac3..aa97c7aea 100644 --- a/tests/integration/x/vm/test_grpc_query.go +++ b/tests/integration/x/vm/test_grpc_query.go @@ -1635,7 +1635,7 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { Denom: types.GetEVMCoinDenom(), ExtendedDenom: types.GetEVMCoinExtendedDenom(), DisplayDenom: types.GetEVMCoinDisplayDenom(), - Decimals: types.GetEVMCoinDecimals(), + Decimals: types.GetEVMCoinDecimals().Uint32(), } chainConfig := types.DefaultChainConfig(s.Network.GetEIP155ChainID().Uint64()) diff --git a/testutil/integration/evm/network/amounts.go b/testutil/integration/evm/network/amounts.go index a70b6d239..919465091 100644 --- a/testutil/integration/evm/network/amounts.go +++ b/testutil/integration/evm/network/amounts.go @@ -21,15 +21,15 @@ func DefaultInitialAmounts() InitialAmounts { baseCoinInfo := testconstants.ExampleChainCoinInfo[defaultChain] return InitialAmounts{ - Base: GetInitialAmount(baseCoinInfo.Decimals), - Evm: GetInitialAmount(baseCoinInfo.Decimals), + Base: GetInitialAmount(evmtypes.Decimals(baseCoinInfo.Decimals)), + Evm: GetInitialAmount(evmtypes.Decimals(baseCoinInfo.Decimals)), } } func DefaultInitialBondedAmount() math.Int { baseCoinInfo := testconstants.ExampleChainCoinInfo[defaultChain] - return GetInitialBondedAmount(baseCoinInfo.Decimals) + return GetInitialBondedAmount(evmtypes.Decimals(baseCoinInfo.Decimals)) } func GetInitialAmount(decimals evmtypes.Decimals) math.Int { diff --git a/testutil/integration/evm/network/coins.go b/testutil/integration/evm/network/coins.go index 022a5d55f..6b722329d 100644 --- a/testutil/integration/evm/network/coins.go +++ b/testutil/integration/evm/network/coins.go @@ -40,7 +40,7 @@ func DefaultChainCoins() ChainCoins { func getCoinInfo(coinInfo evmtypes.EvmCoinInfo) CoinInfo { return CoinInfo{ Denom: coinInfo.Denom, - Decimals: coinInfo.Decimals, + Decimals: evmtypes.Decimals(coinInfo.Decimals), } } diff --git a/testutil/integration/evm/network/config.go b/testutil/integration/evm/network/config.go index ed612f75f..e83758ebc 100644 --- a/testutil/integration/evm/network/config.go +++ b/testutil/integration/evm/network/config.go @@ -133,10 +133,10 @@ func WithChainID(chainID testconstants.ChainID) ConfigOption { if cfg.chainCoins.IsBaseEqualToEVM() { cfg.chainCoins.baseCoin.Denom = evmCoinInfo.Denom - cfg.chainCoins.baseCoin.Decimals = evmCoinInfo.Decimals + cfg.chainCoins.baseCoin.Decimals = evmtypes.Decimals(evmCoinInfo.Decimals) } cfg.chainCoins.evmCoin.Denom = evmCoinInfo.Denom - cfg.chainCoins.evmCoin.Decimals = evmCoinInfo.Decimals + cfg.chainCoins.evmCoin.Decimals = evmtypes.Decimals(evmCoinInfo.Decimals) } } diff --git a/x/vm/keeper/keeper_test.go b/x/vm/keeper/keeper_test.go index 7e2a2f42f..5aff94abd 100644 --- a/x/vm/keeper/keeper_test.go +++ b/x/vm/keeper/keeper_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "github.com/cosmos/evm/config" "testing" "github.com/stretchr/testify/mock" @@ -95,6 +96,7 @@ func (suite *KeeperTestSuite) SetupTest() { suite.fmKeeper, suite.consensusKeeper, suite.erc20Keeper, + config.EighteenDecimalsChainID, "", ) } diff --git a/x/vm/types/denom_config_testing.go b/x/vm/types/denom_config_testing.go index 66b849c0c..fede6ffdb 100644 --- a/x/vm/types/denom_config_testing.go +++ b/x/vm/types/denom_config_testing.go @@ -25,7 +25,7 @@ func setEVMCoinDecimals(d Decimals) error { return fmt.Errorf("setting EVM coin decimals: %w", err) } - testingEvmCoinInfo.Decimals = d + testingEvmCoinInfo.Decimals = d.Uint32() return nil } @@ -58,7 +58,7 @@ func setDisplayDenom(displayDenom string) error { // GetEVMCoinDecimals returns the decimals used in the representation of the EVM // coin. func GetEVMCoinDecimals() Decimals { - return testingEvmCoinInfo.Decimals + return Decimals(testingEvmCoinInfo.Decimals) } // GetEVMCoinDenom returns the denom used for the EVM coin. @@ -82,7 +82,7 @@ func setTestingEVMCoinInfo(eci EvmCoinInfo) error { return errors.New("testing EVM coin info already set. Make sure you run the configurator's ResetTestConfig before trying to set a new evm coin info") } - if eci.Decimals == EighteenDecimals { + if eci.Decimals == EighteenDecimals.Uint32() { if eci.Denom != eci.ExtendedDenom { return errors.New("EVM coin denom and extended denom must be the same for 18 decimals") } @@ -99,7 +99,7 @@ func setTestingEVMCoinInfo(eci EvmCoinInfo) error { if err := setDisplayDenom(eci.DisplayDenom); err != nil { return err } - return setEVMCoinDecimals(eci.Decimals) + return setEVMCoinDecimals(Decimals(eci.Decimals)) } // resetEVMCoinInfo resets to nil the testingEVMCoinInfo diff --git a/x/vm/types/mocks/StakingKeeper.go b/x/vm/types/mocks/StakingKeeper.go index f78205f7a..9081b7d5d 100644 --- a/x/vm/types/mocks/StakingKeeper.go +++ b/x/vm/types/mocks/StakingKeeper.go @@ -19,6 +19,10 @@ type StakingKeeper struct { mock.Mock } +func (_m *StakingKeeper) BondDenom(ctx context.Context) (string, error) { + return "aatom", nil +} + // GetHistoricalInfo provides a mock function with given fields: ctx, height func (_m *StakingKeeper) GetHistoricalInfo(ctx context.Context, height int64) (types.HistoricalInfo, error) { ret := _m.Called(ctx, height) diff --git a/x/vm/types/scaling_test.go b/x/vm/types/scaling_test.go index 421914fe1..0fcade100 100644 --- a/x/vm/types/scaling_test.go +++ b/x/vm/types/scaling_test.go @@ -193,7 +193,7 @@ func TestConvertAmountTo18DecimalsLegacy(t *testing.T) { require.NoError(t, configurator.WithEVMCoinInfo(coinInfo).Configure()) res := evmtypes.ConvertBigIntFrom18DecimalsToLegacyDec(tc.amt.ToBig()) exp := math.LegacyNewDecFromBigInt(tc.amt.ToBig()) - if coinInfo.Decimals == evmtypes.SixDecimals { + if coinInfo.Decimals == evmtypes.SixDecimals.Uint32() { exp = tc.exp6dec } require.Equal(t, exp, res) @@ -231,7 +231,7 @@ func TestConvertAmountTo18DecimalsBigInt(t *testing.T) { require.NoError(t, configurator.WithEVMCoinInfo(coinInfo).Configure()) res := evmtypes.ConvertAmountTo18DecimalsBigInt(tc.amt) exp := tc.amt - if coinInfo.Decimals == evmtypes.SixDecimals { + if coinInfo.Decimals == evmtypes.SixDecimals.Uint32() { exp = tc.exp6dec } require.Equal(t, exp, res) From 5bd1add746c7afe3530a801c2633155ab743ea78 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 25 Sep 2025 13:55:41 -0400 Subject: [PATCH 17/45] wip: fix ibc testing --- ante/evm/mono_decorator.go | 5 +- config/config.go | 10 +- config/evm_app_options.go | 89 ----------- config/evm_app_options_prod.go | 12 -- config/evm_app_options_testing.go | 12 -- evmd/cmd/evmd/cmd/root.go | 2 +- evmd/tests/integration/create_app.go | 13 +- evmd/tests/integration/x_vm_test.go | 2 +- .../precompiles/staking/test_staking.go | 4 +- testutil/ibc/chain.go | 29 +++- testutil/ibc/coordinator.go | 5 +- testutil/ibc/helpers.go | 6 +- testutil/ibc/testing_app.go | 147 ++++++++++++++++++ .../evm/network/chain_id_modifiers.go | 27 +++- testutil/integration/evm/network/network.go | 4 + testutil/integration/evm/network/setup.go | 41 ++++- x/vm/types/chain_config.go | 20 --- x/vm/types/config.go | 20 +++ x/vm/types/config_testing.go | 31 ++-- x/vm/types/params.go | 5 +- 20 files changed, 309 insertions(+), 175 deletions(-) delete mode 100644 config/evm_app_options.go delete mode 100644 config/evm_app_options_prod.go delete mode 100644 config/evm_app_options_testing.go create mode 100644 testutil/ibc/testing_app.go diff --git a/ante/evm/mono_decorator.go b/ante/evm/mono_decorator.go index 982336cf2..e8b96bb97 100644 --- a/ante/evm/mono_decorator.go +++ b/ante/evm/mono_decorator.go @@ -104,8 +104,11 @@ func (md MonoDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne Time: uint64(ctx.BlockTime().Unix()), //nolint:gosec Difficulty: big.NewInt(0), } + + chainConfig := evmtypes.GetEthChainConfig() + if err := txpool.ValidateTransaction(ethTx, &header, decUtils.Signer, &txpool.ValidationOptions{ - Config: evmtypes.GetEthChainConfig(), + Config: chainConfig, Accept: AcceptedTxType, MaxSize: math.MaxUint64, // tx size is checked in cometbft MinTip: new(big.Int), diff --git a/config/config.go b/config/config.go index a9fd92cf9..272a623de 100644 --- a/config/config.go +++ b/config/config.go @@ -72,10 +72,12 @@ const ( Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key. Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic - // DisplayDenom defines the denomination displayed to users in client applications. - DisplayDenom = "atom" - // BaseDenom defines to the default denomination used in the Cosmos EVM example chain. - BaseDenom = "aatom" + // TestDisplayDenom defines the denomination displayed to users in client applications. + TestDisplayDenom = "atom" + // TestEvmDenom defines the non-18-decimal denomination + TestEvmDenom = "uatom" + // TestExtendedDenom defines to the default denomination used in the Cosmos EVM example chain. + TestExtendedDenom = "aatom" // BaseDenomUnit defines the precision of the base denomination. BaseDenomUnit = 18 // EVMChainID defines the EIP-155 replay-protection chain id for the current ethereum chain config. diff --git a/config/evm_app_options.go b/config/evm_app_options.go deleted file mode 100644 index 305169687..000000000 --- a/config/evm_app_options.go +++ /dev/null @@ -1,89 +0,0 @@ -package config - -import ( - "cosmossdk.io/math" - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ethereum/go-ethereum/core/vm" - - evmtypes "github.com/cosmos/evm/x/vm/types" -) - -// EVMOptionsFn defines a function type for setting app options specifically for -// the Cosmos EVM app. The function should receive the chainID and return an error if -// any. -type EVMOptionsFn func(uint64) error - -var sealed = false - -func EvmAppOptionsWithConfig( // TODO:VLAD - This should all be set within the VM module - chainID uint64, - chainsCoinInfo map[uint64]evmtypes.EvmCoinInfo, - cosmosEVMActivators map[int]func(*vm.JumpTable), -) error { - if sealed { - return nil - } - - if err := EvmAppOptionsWithConfigWithReset(chainID, chainsCoinInfo, cosmosEVMActivators, false); err != nil { - return err - } - - sealed = true - return nil -} - -func EvmAppOptionsWithConfigWithReset( - chainID uint64, - chainsCoinInfo map[uint64]evmtypes.EvmCoinInfo, - cosmosEVMActivators map[int]func(*vm.JumpTable), - withReset bool, -) error { - coinInfo, found := chainsCoinInfo[chainID] - if !found { - return fmt.Errorf("unknown chain id: %d", chainID) - } - - // set the denom info for the chain - if err := setBaseDenom(coinInfo); err != nil { - return err - } - - ethCfg := evmtypes.DefaultChainConfig(chainID) - configurator := evmtypes.NewEVMConfigurator() - if withReset { - // reset configuration to set the new one - configurator.ResetTestConfig() - } - err := configurator. - WithExtendedEips(cosmosEVMActivators). - WithChainConfig(ethCfg). - // NOTE: we're using the 18 decimals default for the example chain - WithEVMCoinInfo(coinInfo). - Configure() - if err != nil { - return err - } - - return nil -} - -// setBaseDenom registers the display denom and base denom and sets the -// base denom for the chain. The function registered different values based on -// the EvmCoinInfo to allow different configurations in mainnet and testnet. -func setBaseDenom(ci evmtypes.EvmCoinInfo) (err error) { - // Defer setting the base denom, and capture any potential error from it. - // So when failing because the denom was already registered, we ignore it and set - // the corresponding denom to be base denom - defer func() { - err = sdk.SetBaseDenom(ci.Denom) - }() - if err := sdk.RegisterDenom(ci.DisplayDenom, math.LegacyOneDec()); err != nil { - return err - } - - // sdk.RegisterDenom will automatically overwrite the base denom when the - // new setBaseDenom() units are lower than the current base denom's units. - return sdk.RegisterDenom(ci.Denom, math.LegacyNewDecWithPrec(1, int64(ci.Decimals))) -} diff --git a/config/evm_app_options_prod.go b/config/evm_app_options_prod.go deleted file mode 100644 index 8846dae12..000000000 --- a/config/evm_app_options_prod.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !test -// +build !test - -package config - -import "github.com/cosmos/evm/x/vm/types" - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return EvmAppOptionsWithConfig(chainID, ChainsCoinInfo, types.DefaultCosmosEVMActivators) -} diff --git a/config/evm_app_options_testing.go b/config/evm_app_options_testing.go deleted file mode 100644 index c5a6bb0b4..000000000 --- a/config/evm_app_options_testing.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build test -// +build test - -package config - -import "github.com/cosmos/evm/x/vm/types" - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return EvmAppOptionsWithConfigWithReset(chainID, ChainsCoinInfo, types.DefaultCosmosEVMActivators, true) -} diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index b5df3eeb5..067d9af14 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -126,7 +126,7 @@ func NewRootCmd() *cobra.Command { return err } - customAppTemplate, customAppConfig := config.InitAppConfig(config.BaseDenom, config.EVMChainID) // TODO:VLAD - Remove this + customAppTemplate, customAppConfig := config.InitAppConfig(config.TestExtendedDenom, config.EVMChainID) // TODO:VLAD - Remove this customTMConfig := initCometConfig() return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) diff --git a/evmd/tests/integration/create_app.go b/evmd/tests/integration/create_app.go index dff6ce513..6427e9f56 100644 --- a/evmd/tests/integration/create_app.go +++ b/evmd/tests/integration/create_app.go @@ -2,6 +2,8 @@ package integration import ( "encoding/json" + "github.com/cosmos/cosmos-sdk/client/flags" + srvflags "github.com/cosmos/evm/server/flags" dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/evm" @@ -31,7 +33,7 @@ func CreateEvmd(chainID string, evmChainID uint64, customBaseAppOptions ...func( db := dbm.NewMemDB() logger := log.NewNopLogger() loadLatest := true - appOptions := simutils.NewAppOptionsWithFlagHome(defaultNodeHome) + appOptions := NewAppOptionsWithFlagHomeAndChainID(defaultNodeHome, evmChainID) baseAppOptions := append(customBaseAppOptions, baseapp.SetChainID(chainID)) @@ -54,7 +56,7 @@ func SetupEvmd() (ibctesting.TestingApp, map[string]json.RawMessage) { dbm.NewMemDB(), nil, true, - simutils.EmptyAppOptions{}, + NewAppOptionsWithFlagHomeAndChainID("", constants.ExampleEIP155ChainID), constants.ExampleEIP155ChainID, ) // disable base fee for testing @@ -71,3 +73,10 @@ func SetupEvmd() (ibctesting.TestingApp, map[string]json.RawMessage) { return app, genesisState } + +func NewAppOptionsWithFlagHomeAndChainID(home string, evmChainID uint64) simutils.AppOptionsMap { + return simutils.AppOptionsMap{ + flags.FlagHome: home, + srvflags.EVMChainID: evmChainID, + } +} diff --git a/evmd/tests/integration/x_vm_test.go b/evmd/tests/integration/x_vm_test.go index c1aec6e9f..76030a1a3 100644 --- a/evmd/tests/integration/x_vm_test.go +++ b/evmd/tests/integration/x_vm_test.go @@ -48,7 +48,7 @@ func BenchmarkGasEstimation(b *testing.B) { Denom: denom, ExtendedDenom: extendedDenom, DisplayDenom: displayDenom, - Decimals: decimals, + Decimals: decimals.Uint32(), }). Configure() require.NoError(b, err) diff --git a/tests/integration/precompiles/staking/test_staking.go b/tests/integration/precompiles/staking/test_staking.go index f66a2ba1a..9bc4c7155 100644 --- a/tests/integration/precompiles/staking/test_staking.go +++ b/tests/integration/precompiles/staking/test_staking.go @@ -381,7 +381,7 @@ func (s *PrecompileTestSuite) TestRun() { s.Require().NoError(err, "failed to pack input") return input }, - 19103, // use enough gas to avoid out of gas error + 21295, // use enough gas to avoid out of gas error true, false, "write protection", @@ -391,7 +391,7 @@ func (s *PrecompileTestSuite) TestRun() { func(_ keyring.Key) []byte { return []byte("invalid") }, - 19103, // use enough gas to avoid out of gas error + 21295, // use enough gas to avoid out of gas error false, false, "no method with id", diff --git a/testutil/ibc/chain.go b/testutil/ibc/chain.go index 67987e40f..4c04d1619 100644 --- a/testutil/ibc/chain.go +++ b/testutil/ibc/chain.go @@ -2,6 +2,7 @@ package ibctesting import ( + "encoding/json" "fmt" "math/big" "testing" @@ -45,6 +46,8 @@ import ( var MaxAccounts = 10 +type AppCreator func() (TestingApp, map[string]json.RawMessage) + type SenderAccount struct { SenderPrivKey cryptotypes.PrivKey SenderAccount sdk.AccountI @@ -135,7 +138,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Address: acc.GetAddress().String(), Coins: sdk.NewCoins( sdk.NewCoin(sdk.DefaultBondDenom, amount), - sdk.NewCoin(config.ExampleChainDenom, amount), + sdk.NewCoin(config.TestExtendedDenom, amount), ), } @@ -150,7 +153,29 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain senderAccs = append(senderAccs, senderAcc) } - app := ibctesting.SetupWithGenesisValSet(tb, valSet, genAccs, chainID, sdk.DefaultPowerReduction, genBals...) + metadata := []banktypes.Metadata{{ + Description: "", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: config.TestExtendedDenom, + Exponent: 0, + Aliases: nil, + }, + { + Denom: config.TestDisplayDenom, + Exponent: 6, + Aliases: nil, + }, + }, + Base: config.TestExtendedDenom, + Display: config.TestDisplayDenom, + Name: config.TestEvmDenom, + Symbol: config.TestEvmDenom, + URI: config.TestEvmDenom, + URIHash: config.TestEvmDenom, + }} + + app := SetupWithGenesisValSet(tb, valSet, genAccs, chainID, sdk.DefaultPowerReduction, metadata, genBals...) // create current header and call begin block header := cmtproto.Header{ ChainID: chainID, diff --git a/testutil/ibc/coordinator.go b/testutil/ibc/coordinator.go index 8f6e03dac..c21bad066 100644 --- a/testutil/ibc/coordinator.go +++ b/testutil/ibc/coordinator.go @@ -2,13 +2,13 @@ package ibctesting import ( "fmt" + "github.com/cosmos/evm/x/vm/types" "strconv" "testing" "time" "github.com/stretchr/testify/require" - evmconfig "github.com/cosmos/evm/config" ibctesting "github.com/cosmos/ibc-go/v10/testing" ) @@ -39,10 +39,11 @@ func NewCoordinator(t *testing.T, nEVMChains, mCosmosChains int, evmAppCreator i ibctesting.DefaultTestingAppInit = evmAppCreator for i := 1; i <= nEVMChains; i++ { + configurator := types.NewEVMConfigurator() + configurator.ResetTestConfig() chainID := GetChainID(i) evmChainID, err := strconv.ParseUint(GetEvmChainID(i), 10, 64) require.NoError(t, err) - require.NoError(t, evmconfig.EvmAppOptions(evmChainID)) // setup EVM chains chains[strconv.FormatUint(evmChainID, 10)] = NewTestChain(t, true, coord, chainID) } diff --git a/testutil/ibc/helpers.go b/testutil/ibc/helpers.go index 1dae0d467..a4379fc43 100644 --- a/testutil/ibc/helpers.go +++ b/testutil/ibc/helpers.go @@ -23,9 +23,9 @@ const FeeAmt = 10000000000 func FeeCoins() sdk.Coins { // Note: evmChain requires for gas price higher than base fee (see fee_checker.go). - // Other Cosmos chains using simapp don’t rely on gas prices, so this works even if simapp isn’t aware of evmChain’s BaseDenom. + // Other Cosmos chains using simapp don’t rely on gas prices, so this works even if simapp isn’t aware of evmChain’s TestExtendedDenom. sdkExp := new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil) - return sdk.Coins{sdk.NewInt64Coin(config.BaseDenom, new(big.Int).Mul(big.NewInt(FeeAmt), sdkExp).Int64())} + return sdk.Coins{sdk.NewInt64Coin(config.TestExtendedDenom, new(big.Int).Mul(big.NewInt(FeeAmt), sdkExp).Int64())} } // SignAndDeliver signs and delivers a transaction. No simulation occurs as the @@ -42,7 +42,7 @@ func SignAndDeliver( txCfg, msgs, // Note: evmChain requires for gas price higher than base fee (see fee_checker.go). - // Other Cosmos chains using simapp don’t rely on gas prices, so this works even if simapp isn’t aware of evmChain’s BaseDenom. + // Other Cosmos chains using simapp don’t rely on gas prices, so this works even if simapp isn’t aware of evmChain’s TestExtendedDenom. FeeCoins(), simtestutil.DefaultGenTxGas, chainID, diff --git a/testutil/ibc/testing_app.go b/testutil/ibc/testing_app.go new file mode 100644 index 000000000..f26e83968 --- /dev/null +++ b/testutil/ibc/testing_app.go @@ -0,0 +1,147 @@ +package ibctesting + +import ( + "encoding/json" + "github.com/cosmos/evm/config" + evmtypes "github.com/cosmos/evm/x/vm/types" + ibctesting "github.com/cosmos/ibc-go/v10/testing" + "testing" + "time" + + dbm "github.com/cosmos/cosmos-db" + "github.com/stretchr/testify/require" + + "cosmossdk.io/log" + sdkmath "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + abci "github.com/cometbft/cometbft/abci/types" + cmttypes "github.com/cometbft/cometbft/types" + + "github.com/cosmos/ibc-go/v10/modules/core/keeper" + "github.com/cosmos/ibc-go/v10/testing/simapp" +) + +type TestingApp interface { + servertypes.ABCI + + // ibc-go additions + GetBaseApp() *baseapp.BaseApp + GetIBCKeeper() *keeper.Keeper + GetTxConfig() client.TxConfig + + // Implemented by SimApp + AppCodec() codec.Codec + + // Implemented by BaseApp + LastCommitID() storetypes.CommitID + LastBlockHeight() int64 +} + +func SetupTestingApp() (TestingApp, map[string]json.RawMessage) { + db := dbm.NewMemDB() + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}) + return app, app.DefaultGenesis() +} + +// SetupWithGenesisValSet initializes a new SimApp with a validator set and genesis accounts +// that also act as delegators. For simplicity, each validator is bonded with a delegation +// of one consensus engine unit (10^6) in the default token of the simapp from first genesis +// account. A Nop logger is set in SimApp. +func SetupWithGenesisValSet(tb testing.TB, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, powerReduction sdkmath.Int, metadata []banktypes.Metadata, balances ...banktypes.Balance) TestingApp { + tb.Helper() + return setupWithGenesisValSet(tb, valSet, genAccs, chainID, powerReduction, ibctesting.DefaultTestingAppInit, metadata, balances...) +} + +func setupWithGenesisValSet(tb testing.TB, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, powerReduction sdkmath.Int, appCreator ibctesting.AppCreator, metadata []banktypes.Metadata, balances ...banktypes.Balance) TestingApp { + tb.Helper() + app, genesisState := appCreator() + + // ensure baseapp has a chain-id set before running InitChain + baseapp.SetChainID(chainID)(app.GetBaseApp()) + + // set genesis accounts + authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) + genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) + + validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) + delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) + + bondAmt := sdk.TokensFromConsensusPower(1, powerReduction) + + for _, val := range valSet.Validators { + pk, err := cryptocodec.FromCmtPubKeyInterface(val.PubKey) + require.NoError(tb, err) + pkAny, err := codectypes.NewAnyWithValue(pk) + require.NoError(tb, err) + validator := stakingtypes.Validator{ + OperatorAddress: sdk.ValAddress(val.Address).String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: bondAmt, + DelegatorShares: sdkmath.LegacyOneDec(), + Description: stakingtypes.Description{}, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: stakingtypes.NewCommission(sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec(), sdkmath.LegacyZeroDec()), + MinSelfDelegation: sdkmath.ZeroInt(), + } + + validators = append(validators, validator) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress().String(), sdk.ValAddress(val.Address).String(), sdkmath.LegacyOneDec())) + } + + // set validators and delegations + var stakingGenesis stakingtypes.GenesisState + app.AppCodec().MustUnmarshalJSON(genesisState[stakingtypes.ModuleName], &stakingGenesis) + + bondDenom := stakingGenesis.Params.BondDenom + + // add bonded amount to bonded pool module account + balances = append(balances, banktypes.Balance{ + Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), + Coins: sdk.Coins{sdk.NewCoin(bondDenom, bondAmt.Mul(sdkmath.NewInt(int64(len(valSet.Validators)))))}, + }) + + // set validators and delegations + stakingGenesis = *stakingtypes.NewGenesisState(stakingGenesis.Params, validators, delegations) + genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(&stakingGenesis) + + // update total supply + bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, sdk.NewCoins(), metadata, []banktypes.SendEnabled{}) + genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) + + evmGenesis := evmtypes.DefaultGenesisState() + evmGenesis.Params.EvmDenom = config.TestExtendedDenom + evmGenesis.Params.ActiveStaticPrecompiles = evmtypes.AvailableStaticPrecompiles + genesisState[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis) + + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + require.NoError(tb, err) + + // init chain will set the validator set and initialize the genesis accounts + _, err = app.InitChain( + &abci.RequestInitChain{ + ChainId: chainID, + Validators: []abci.ValidatorUpdate{}, + AppStateBytes: stateBytes, + ConsensusParams: simtestutil.DefaultConsensusParams, + }, + ) + require.NoError(tb, err) + + return app +} diff --git a/testutil/integration/evm/network/chain_id_modifiers.go b/testutil/integration/evm/network/chain_id_modifiers.go index 736c14e5c..d5ee701b9 100644 --- a/testutil/integration/evm/network/chain_id_modifiers.go +++ b/testutil/integration/evm/network/chain_id_modifiers.go @@ -5,9 +5,9 @@ package network import ( + "github.com/cosmos/evm/config" testconstants "github.com/cosmos/evm/testutil/constants" erc20types "github.com/cosmos/evm/x/erc20/types" - "github.com/cosmos/evm/x/precisebank/types" evmtypes "github.com/cosmos/evm/x/vm/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -15,20 +15,22 @@ import ( // updateErc20GenesisStateForChainID modify the default genesis state for the // bank module of the testing suite depending on the chainID. -func updateBankGenesisStateForChainID(bankGenesisState banktypes.GenesisState) banktypes.GenesisState { - bankGenesisState.DenomMetadata = generateBankGenesisMetadata() +func updateBankGenesisStateForChainID(bankGenesisState banktypes.GenesisState, evmChainID uint64) banktypes.GenesisState { + bankGenesisState.DenomMetadata = generateBankGenesisMetadata(evmChainID) return bankGenesisState } // generateBankGenesisMetadata generates the metadata entries // for both extended and native EVM denominations depending on the chain. -func generateBankGenesisMetadata() []banktypes.Metadata { +func generateBankGenesisMetadata(evmChainID uint64) []banktypes.Metadata { + denomConfig := config.ChainsCoinInfo[evmChainID] + // Basic denom settings - displayDenom := evmtypes.GetEVMCoinDisplayDenom() // e.g., "atom" - evmDenom := evmtypes.GetEVMCoinDenom() // e.g., "uatom" - extDenom := types.ExtendedCoinDenom() // always 18-decimals base denom - evmDecimals := evmtypes.GetEVMCoinDecimals() // native decimal precision, e.g., 6, 12, ..., or 18 + displayDenom := denomConfig.DisplayDenom // e.g., "atom" + evmDenom := denomConfig.Denom // e.g., "uatom" + extDenom := denomConfig.ExtendedDenom // always 18-decimals base denom + evmDecimals := denomConfig.Decimals // native decimal precision, e.g., 6, 12, ..., or 18 // Standard metadata fields name := "Cosmos EVM" @@ -78,6 +80,15 @@ func updateErc20GenesisStateForChainID(chainID testconstants.ChainID, erc20Genes return erc20GenesisState } +// updateErc20GenesisStateForChainID modify the default genesis state for the +// erc20 module on the testing suite depending on the chainID. +func updateVMGenesisStateForChainID(chainID testconstants.ChainID, vmGenesisState evmtypes.GenesisState) evmtypes.GenesisState { + vmGenesisState.Params.EvmDenom = config.ChainsCoinInfo[chainID.EVMChainID].Denom + vmGenesisState.Params.ExtendedDenomOptions = &evmtypes.ExtendedDenomOptions{ExtendedDenom: config.ChainsCoinInfo[chainID.EVMChainID].ExtendedDenom} + + return vmGenesisState +} + // updateErc20TokenPairs modifies the erc20 token pairs to use the correct // WEVMOS depending on ChainID func updateErc20TokenPairs(chainID testconstants.ChainID, tokenPairs []erc20types.TokenPair) []erc20types.TokenPair { diff --git a/testutil/integration/evm/network/network.go b/testutil/integration/evm/network/network.go index b1db05400..505d4ac23 100644 --- a/testutil/integration/evm/network/network.go +++ b/testutil/integration/evm/network/network.go @@ -77,6 +77,8 @@ type IntegrationNetwork struct { // // It panics if an error occurs. func New(createEvmApp CreateEvmApp, opts ...ConfigOption) *IntegrationNetwork { + configurator := evmtypes.NewEVMConfigurator() + configurator.ResetTestConfig() cfg := DefaultConfig() // Modify the default config with the given options for _, opt := range opts { @@ -92,6 +94,8 @@ func New(createEvmApp CreateEvmApp, opts ...ConfigOption) *IntegrationNetwork { // create a new testing app with the following params evmApp := createEvmApp(cfg.chainID, cfg.eip155ChainID.Uint64(), cfg.customBaseAppOpts...) + evmConfig := evmtypes.GetChainConfig() + fmt.Println(evmConfig.ChainId) err := network.configureAndInitChain(evmApp) if err != nil { panic(err) diff --git a/testutil/integration/evm/network/setup.go b/testutil/integration/evm/network/setup.go index f352bd4af..57b1e6885 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/config" "maps" "slices" "time" @@ -299,7 +300,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 cosmosevmtypes.GenesisState, overwriteParams BankCustomGenesisState, evmChainID uint64) cosmosevmtypes.GenesisState { bankGenesis := banktypes.NewGenesisState( banktypes.DefaultGenesisState().Params, overwriteParams.balances, @@ -307,7 +308,7 @@ func setDefaultBankGenesisState(cosmosEVMApp evm.EvmApp, genesisState cosmosevmt []banktypes.Metadata{}, []banktypes.SendEnabled{}, ) - updatedBankGen := updateBankGenesisStateForChainID(*bankGenesis) + updatedBankGen := updateBankGenesisStateForChainID(*bankGenesis, evmChainID) genesisState[banktypes.ModuleName] = cosmosEVMApp.AppCodec().MustMarshalJSON(&updatedBankGen) return genesisState } @@ -414,10 +415,13 @@ 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 cosmosevmtypes.GenesisState, overwriteParams GovCustomGenesisState, evmChainID uint64) cosmosevmtypes.GenesisState { govGen := govtypesv1.DefaultGenesisState() + + denomConfig := config.ChainsCoinInfo[evmChainID] + updatedParams := govGen.Params - minDepositAmt := sdkmath.NewInt(1e18).Quo(evmtypes.GetEVMCoinDecimals().ConversionFactor()) + minDepositAmt := sdkmath.NewInt(1e18).Quo(evmtypes.Decimals(denomConfig.Decimals).ConversionFactor()) updatedParams.MinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(overwriteParams.denom, minDepositAmt)) updatedParams.ExpeditedMinDeposit = sdktypes.NewCoins(sdktypes.NewCoin(overwriteParams.denom, minDepositAmt)) govGen.Params = updatedParams @@ -485,6 +489,30 @@ func newErc20GenesisState() *erc20types.GenesisState { return erc20GenState } +func setDefaultVMGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, genesisState cosmosevmtypes.GenesisState) cosmosevmtypes.GenesisState { + // NOTE: here we are using the setup from the example chain + var vmGen evmtypes.GenesisState + cosmosEVMApp.AppCodec().MustUnmarshalJSON(genesisState[evmtypes.ModuleName], &vmGen) + updatedVMGen := updateVMGenesisStateForChainID(testconstants.ChainID{ + ChainID: cosmosEVMApp.ChainID(), + EVMChainID: evmChainID, + }, vmGen) + + genesisState[evmtypes.ModuleName] = cosmosEVMApp.AppCodec().MustMarshalJSON(&updatedVMGen) + return genesisState +} + +// newErc20GenesisState returns the default genesis state for the ERC20 module. +// This is a duplicate of the function in utils to avoid an import cycle +// +// NOTE: for the example chain implementation we are also adding a default token pair, +// which is the base denomination of the chain (i.e. the WEVMOS contract). +func newVMGenesisState() *evmtypes.GenesisState { + vmGenState := evmtypes.DefaultGenesisState() + + return vmGenState +} + // defaultAuthGenesisState sets the default genesis state // for the testing setup func newDefaultGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, params defaultGenesisParams) cosmosevmtypes.GenesisState { @@ -492,12 +520,13 @@ 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) - genesisState = setDefaultGovGenesisState(cosmosEVMApp, genesisState, params.gov) + genesisState = setDefaultBankGenesisState(cosmosEVMApp, genesisState, params.bank, evmChainID) + genesisState = setDefaultGovGenesisState(cosmosEVMApp, genesisState, params.gov, evmChainID) genesisState = setDefaultFeeMarketGenesisState(cosmosEVMApp, genesisState, params.feemarket) genesisState = setDefaultSlashingGenesisState(cosmosEVMApp, genesisState, params.slashing) genesisState = setDefaultMintGenesisState(cosmosEVMApp, genesisState, params.mint) genesisState = setDefaultErc20GenesisState(cosmosEVMApp, evmChainID, genesisState) + genesisState = setDefaultVMGenesisState(cosmosEVMApp, evmChainID, genesisState) return genesisState } diff --git a/x/vm/types/chain_config.go b/x/vm/types/chain_config.go index ea92d97c8..930ffdcf8 100644 --- a/x/vm/types/chain_config.go +++ b/x/vm/types/chain_config.go @@ -1,7 +1,6 @@ package types import ( - "errors" "math/big" gethparams "github.com/ethereum/go-ethereum/params" @@ -108,25 +107,6 @@ func DefaultChainConfig(evmChainID uint64) *ChainConfig { return cfg } -// SetChainConfig allows to set the `chainConfig` variable modifying the -// default values. The method is private because it should only be called once -// in the EVMConfigurator. -func SetChainConfig(cc *ChainConfig) error { - if chainConfig != nil && chainConfig.ChainId != DefaultEVMChainID { - return errors.New("chainConfig already set. Cannot set again the chainConfig") - } - config := DefaultChainConfig(0) - if cc != nil { - config = cc - } - if err := config.Validate(); err != nil { - return err - } - chainConfig = config - - return nil -} - func getBlockValue(block *sdkmath.Int) *big.Int { if block == nil || block.IsNegative() { return nil diff --git a/x/vm/types/config.go b/x/vm/types/config.go index 44fa6f31f..4fc952a76 100644 --- a/x/vm/types/config.go +++ b/x/vm/types/config.go @@ -8,6 +8,7 @@ package types import ( + "errors" "fmt" "github.com/ethereum/go-ethereum/core/vm" @@ -54,3 +55,22 @@ func GetEthChainConfig() *geth.ChainConfig { func GetChainConfig() *ChainConfig { return chainConfig } + +// SetChainConfig allows to set the `chainConfig` variable modifying the +// default values. The method is private because it should only be called once +// in the EVMConfigurator. +func SetChainConfig(cc *ChainConfig) error { + if chainConfig != nil && chainConfig.ChainId != DefaultEVMChainID { + return errors.New("chainConfig already set. Cannot set again the chainConfig") + } + config := DefaultChainConfig(0) + if cc != nil { + config = cc + } + if err := config.Validate(); err != nil { + return err + } + chainConfig = config + + return nil +} diff --git a/x/vm/types/config_testing.go b/x/vm/types/config_testing.go index 1440ccb86..e10a94106 100644 --- a/x/vm/types/config_testing.go +++ b/x/vm/types/config_testing.go @@ -9,8 +9,6 @@ package types import ( "errors" - "fmt" - "github.com/ethereum/go-ethereum/core/vm" geth "github.com/ethereum/go-ethereum/params" ) @@ -23,13 +21,9 @@ var testChainConfig *ChainConfig func (ec *EVMConfigurator) Configure() error { // If Configure method has been already used in the object, return // an error to avoid overriding configuration. - if ec.sealed { - return fmt.Errorf("error configuring EVMConfigurator: already sealed and cannot be modified") - } - - if err := setTestChainConfig(ec.chainConfig); err != nil { - return err - } + //if ec.sealed { + // return fmt.Errorf("error configuring EVMConfigurator: already sealed and cannot be modified") + //} if err := setTestingEVMCoinInfo(ec.evmCoinInfo); err != nil { return err @@ -71,6 +65,25 @@ func setTestChainConfig(cc *ChainConfig) error { return nil } +// SetChainConfig allows to set the `chainConfig` variable modifying the +// default values. The method is private because it should only be called once +// in the EVMConfigurator. +func SetChainConfig(cc *ChainConfig) error { + if chainConfig != nil && chainConfig.ChainId != DefaultEVMChainID { + return errors.New("chainConfig already set. Cannot set again the chainConfig") + } + config := DefaultChainConfig(0) + if cc != nil { + config = cc + } + if err := config.Validate(); err != nil { + return err + } + testChainConfig = config + + return nil +} + // GetEthChainConfig returns the `chainConfig` used in the EVM (geth type). func GetEthChainConfig() *geth.ChainConfig { return testChainConfig.EthereumConfig(nil) diff --git a/x/vm/types/params.go b/x/vm/types/params.go index 9294839f4..19df9328b 100644 --- a/x/vm/types/params.go +++ b/x/vm/types/params.go @@ -18,7 +18,9 @@ import ( var ( // DefaultEVMDenom is the default value for the evm denom - DefaultEVMDenom = "atest" + DefaultEVMDenom = "uatom" + // DefaultEVMExtendedDenom is the default value for the evm extended denom + DefaultEVMExtendedDenom = "aatom" // DefaultEVMChainID is the default value for the evm chain ID DefaultEVMChainID uint64 = 262144 // DefaultEVMDecimals is the default value for the evm denom decimal precision @@ -69,6 +71,7 @@ func DefaultParams() Params { EVMChannels: DefaultEVMChannels, AccessControl: DefaultAccessControl, HistoryServeWindow: DefaultHistoryServeWindow, + ExtendedDenomOptions: &ExtendedDenomOptions{ExtendedDenom: DefaultEVMExtendedDenom}, } } From f16467cf801db227a2369188533c9e9673251821 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 25 Sep 2025 14:21:31 -0400 Subject: [PATCH 18/45] delete all evmappoptions from tests --- ante/evm/fee_checker_test.go | 2 -- ante/evm/mono_decorator_test.go | 1 - x/precisebank/keeper/keeper_test.go | 1 - x/vm/types/msg_test.go | 3 --- 4 files changed, 7 deletions(-) diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index 91d326467..ee7fa24ab 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -59,8 +59,6 @@ func TestSDKTxFeeChecker(t *testing.T) { // london hardfork enableness chainID := uint64(config.EighteenDecimalsChainID) encodingConfig := encoding.MakeConfig(chainID) - err := config.EvmAppOptions(chainID) - require.NoError(t, err) evmDenom := evmtypes.GetEVMCoinDenom() minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin(evmDenom, math.NewInt(10))) diff --git a/ante/evm/mono_decorator_test.go b/ante/evm/mono_decorator_test.go index 45edf1e52..246e8fb47 100644 --- a/ante/evm/mono_decorator_test.go +++ b/ante/evm/mono_decorator_test.go @@ -145,7 +145,6 @@ func toMsgSlice(msgs []*evmsdktypes.MsgEthereumTx) []sdk.Msg { func TestMonoDecorator(t *testing.T) { chainID := uint64(config.EighteenDecimalsChainID) - require.NoError(t, config.EvmAppOptions(chainID)) cfg := encoding.MakeConfig(chainID) testCases := []struct { diff --git a/x/precisebank/keeper/keeper_test.go b/x/precisebank/keeper/keeper_test.go index 8caef5c93..7c401ecaf 100644 --- a/x/precisebank/keeper/keeper_test.go +++ b/x/precisebank/keeper/keeper_test.go @@ -44,7 +44,6 @@ func newMockedTestData(t *testing.T) testData { cfg := evmosencoding.MakeConfig(chainID) cdc := cfg.Codec k := keeper.NewKeeper(cdc, storeKey, bk, ak) - err := evmconfig.EvmAppOptions(chainID) if err != nil { return testData{} } diff --git a/x/vm/types/msg_test.go b/x/vm/types/msg_test.go index 00c70f3a9..0e2ca6498 100644 --- a/x/vm/types/msg_test.go +++ b/x/vm/types/msg_test.go @@ -13,7 +13,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" - evmconfig "github.com/cosmos/evm/config" "github.com/cosmos/evm/encoding" testconstants "github.com/cosmos/evm/testutil/constants" utiltx "github.com/cosmos/evm/testutil/tx" @@ -56,8 +55,6 @@ func (suite *MsgsTestSuite) SetupTest() { configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() - err := evmconfig.EvmAppOptions(9001) - suite.Require().NoError(err) } func (suite *MsgsTestSuite) TestMsgEthereumTx_Constructor() { From b9fb2a7491203676fabc8b69df55ed8faba72263 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 25 Sep 2025 15:05:26 -0400 Subject: [PATCH 19/45] fix ibc precompile integration test balance getters we were getting the 6 decimal balance when we were operating in 18-balance territory. now that we have a separation in the ibc tests, we should check balances accordingly --- .../precompiles/ics20/test_integration.go | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/tests/integration/precompiles/ics20/test_integration.go b/tests/integration/precompiles/ics20/test_integration.go index 0a7630ff8..64f5d027d 100644 --- a/tests/integration/precompiles/ics20/test_integration.go +++ b/tests/integration/precompiles/ics20/test_integration.go @@ -309,8 +309,9 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A ) Expect(escrowBalance.Amount).To(Equal(math.ZeroInt()), "Escrow balance should be 0 before transfer") - // send some tokens to the conoract address + // send some tokens to the contract address fundAmt := math.NewInt(100) + fundAmtConverted := fundAmt.Mul(math.NewInt(1e12)) err = evmAppA.GetBankKeeper().SendCoins( s.chainA.GetContext(), s.chainA.SenderAccount.GetAddress(), @@ -319,14 +320,14 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A ) Expect(err).To(BeNil(), "Failed to send tokens to contract address") // check contract balance - contractBalance := evmAppA.GetBankKeeper().GetBalance( + contractBalance := evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - ics20CallerAddr.Bytes(), - sourceBondDenom, + ics20CallerAddr, ) - Expect(contractBalance.Amount).To(Equal(fundAmt), "Contract balance should be equal to the fund amount") + Expect(contractBalance.ToBig()).To(Equal(fundAmt.Mul(math.NewInt(1e12)).BigInt()), "Contract balance should be equal to the fund amount") sendAmt := math.NewInt(1) + sendAmtConverted := sendAmt.Mul(math.NewInt(1e12)) callArgs := testutiltypes.CallArgs{ ContractABI: ics20CallerContract.ABI, MethodName: "testIbcTransferWithTransfer", @@ -355,7 +356,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A 0, ) Expect(err).To(BeNil(), "Failed to testTransfer") - expectedContractBalance := fundAmt.Sub(sendAmt) + expectedContractBalance := fundAmtConverted.Sub(sendAmtConverted) if tc.before { expectedContractBalance = expectedContractBalance.Sub(math.NewInt(15)) } @@ -363,12 +364,11 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A expectedContractBalance = expectedContractBalance.Sub(math.NewInt(15)) } // balance after transfer should be 0 - contractBalance = evmAppA.GetBankKeeper().GetBalance( + contractBalance = evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - ics20CallerAddr.Bytes(), - sourceBondDenom, + ics20CallerAddr, ) - Expect(contractBalance.Amount).To(Equal(expectedContractBalance), "Contract balance should be equal to the expected amount after transfer") + Expect(contractBalance.ToBig()).To(Equal(expectedContractBalance.BigInt()), "Contract balance should be equal to the expected amount after transfer") escrowBalance = evmAppA.GetBankKeeper().GetBalance( s.chainA.GetContext(), escrowAddr, @@ -399,12 +399,11 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A sourceChannelID := path.EndpointA.ChannelID sourceBondDenom := s.chainABondDenom escrowAddr := types.GetEscrowAddress(sourcePortID, sourceChannelID) - escrowBalance := evmAppA.GetBankKeeper().GetBalance( + escrowBalance := evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - escrowAddr, - sourceBondDenom, + common.BytesToAddress(escrowAddr.Bytes()), ) - Expect(escrowBalance.Amount).To(Equal(math.ZeroInt()), "Escrow balance should be 0 before transfer") + Expect(escrowBalance.ToBig().Uint64()).To(Equal(math.ZeroInt().Uint64()), "Escrow balance should be 0 before transfer") // send some tokens to the contract address fundAmt := math.NewInt(100) @@ -415,13 +414,12 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A sdk.NewCoins(sdk.NewCoin(sourceBondDenom, fundAmt)), ) Expect(err).To(BeNil(), "Failed to send tokens to contract address") - contractBalance := evmAppA.GetBankKeeper().GetBalance( + contractBalance := evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - ics20CallerAddr.Bytes(), - sourceBondDenom, + common.BytesToAddress(ics20CallerAddr.Bytes()), ) // check contract balance - Expect(contractBalance.Amount).To(Equal(fundAmt), "Contract balance should be equal to the fund amount") + Expect(contractBalance.ToBig()).To(Equal(fundAmt.Mul(math.NewInt(1e12)).BigInt()), "Contract balance should be equal to the fund amount") sendAmt := math.NewInt(1) callArgs := testutiltypes.CallArgs{ @@ -452,24 +450,21 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A 0, ) Expect(err).To(BeNil(), "Failed to testTransfer") - contractBalanceAfter := evmAppA.GetBankKeeper().GetBalance( + contractBalanceAfter := evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - ics20CallerAddr.Bytes(), - sourceBondDenom, + common.BytesToAddress(ics20CallerAddr.Bytes()), ) - Expect(contractBalanceAfter.Amount).To(Equal(contractBalance.Amount.Sub(math.NewInt(15)))) - escrowBalance = evmAppA.GetBankKeeper().GetBalance( + Expect(contractBalanceAfter.ToBig()).To(Equal(math.NewIntFromBigInt(contractBalance.ToBig()).Sub(math.NewInt(15)).BigInt()), "Contract balance should be equal to the expected amount after transfer") + escrowBalance = evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - escrowAddr, - sourceBondDenom, + common.BytesToAddress(escrowAddr.Bytes()), ) - Expect(escrowBalance.Amount).To(Equal(math.ZeroInt())) - randomAccBalance := evmAppA.GetBankKeeper().GetBalance( + Expect(escrowBalance.ToBig().Uint64()).To(Equal(math.ZeroInt().BigInt().Uint64())) + randomAccBalance := evmAppA.GetEVMKeeper().GetBalance( s.chainA.GetContext(), - randomAccAddr, - sourceBondDenom, + common.BytesToAddress(randomAccAddr.Bytes()), ) - Expect(randomAccBalance.Amount).To(Equal(math.NewInt(15))) + Expect(randomAccBalance.ToBig()).To(Equal(math.NewInt(15).BigInt())) }) }) From 71b772279eb22b3845a86fceb3e43734fa5967bf Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 14:01:15 -0400 Subject: [PATCH 20/45] fix all evmd tests --- ante/evm/fee_checker_test.go | 18 ++++++ config/config.go | 24 ------- config/evm_app_options_testing.go | 10 --- evmd/test_helpers.go | 9 ++- mempool/blockchain_test.go | 9 ++- mempool/mocks/VMKeeper.go | 62 ++++++++++++------- tests/integration/x/vm/genesis_test_suite.go | 4 ++ tests/integration/x/vm/keeper_test_suite.go | 4 +- tests/integration/x/vm/test_genesis.go | 26 ++++++-- tests/integration/x/vm/test_grpc_query.go | 6 +- tests/integration/x/vm/test_statedb.go | 2 +- .../evm/network/chain_id_modifiers.go | 6 +- testutil/integration/evm/network/network.go | 2 - x/precisebank/keeper/keeper_test.go | 11 ++-- x/vm/keeper/keeper.go | 2 +- x/vm/types/configurator_test.go | 2 +- x/vm/types/msg_test.go | 1 - x/vm/types/params.go | 2 +- 18 files changed, 120 insertions(+), 80 deletions(-) delete mode 100644 config/evm_app_options_testing.go diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index ee7fa24ab..bdd12718a 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -60,6 +60,24 @@ func TestSDKTxFeeChecker(t *testing.T) { chainID := uint64(config.EighteenDecimalsChainID) encodingConfig := encoding.MakeConfig(chainID) + configurator := evmtypes.NewEVMConfigurator() + configurator.ResetTestConfig() + // set global chain config + ethCfg := evmtypes.DefaultChainConfig(chainID) + if err := evmtypes.SetChainConfig(ethCfg); err != nil { + panic(err) + } + err := configurator. + WithExtendedEips(evmtypes.DefaultCosmosEVMActivators). + WithChainConfig(ethCfg). + // NOTE: we're using the 18 decimals default for the example chain + WithEVMCoinInfo(config.ChainsCoinInfo[chainID]). + Configure() + require.NoError(t, err) + if err != nil { + panic(err) + } + evmDenom := evmtypes.GetEVMCoinDenom() minGasPrices := sdk.NewDecCoins(sdk.NewDecCoin(evmDenom, math.NewInt(10))) diff --git a/config/config.go b/config/config.go index a157dc470..272a623de 100644 --- a/config/config.go +++ b/config/config.go @@ -55,30 +55,6 @@ var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ // TODO:VLAD - Remove this DisplayDenom: ExampleChainDenom, Decimals: evmtypes.EighteenDecimals.Uint32(), }, - TwelveDecimalsChainID: { - Denom: "ptest2", - ExtendedDenom: "atest2", - DisplayDenom: "test2", - Decimals: evmtypes.TwelveDecimals, - }, - TwoDecimalsChainID: { - Denom: "ctest3", - ExtendedDenom: "atest3", - DisplayDenom: "test3", - Decimals: evmtypes.TwoDecimals, - }, - TestChainID1: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleChainDenom, - Decimals: evmtypes.EighteenDecimals, - }, - TestChainID2: { - Denom: ExampleChainDenom, - ExtendedDenom: ExampleChainDenom, - DisplayDenom: ExampleChainDenom, - Decimals: evmtypes.EighteenDecimals, - }, } const ( diff --git a/config/evm_app_options_testing.go b/config/evm_app_options_testing.go deleted file mode 100644 index 0f30dcaa4..000000000 --- a/config/evm_app_options_testing.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build test -// +build test - -package config - -// EvmAppOptions allows to setup the global configuration -// for the Cosmos EVM chain. -func EvmAppOptions(chainID uint64) error { - return EvmAppOptionsWithConfigWithReset(chainID, ChainsCoinInfo, cosmosEVMActivators, true) -} diff --git a/evmd/test_helpers.go b/evmd/test_helpers.go index 05aad5dc3..2644f233d 100644 --- a/evmd/test_helpers.go +++ b/evmd/test_helpers.go @@ -4,6 +4,8 @@ import ( "encoding/json" "fmt" "github.com/cosmos/evm/config" + "github.com/cosmos/evm/testutil/integration/evm/network" + "github.com/cosmos/evm/x/vm/types" "testing" "github.com/stretchr/testify/require" @@ -79,7 +81,7 @@ func Setup(t *testing.T, chainID string, evmChainID uint64) *EVMD { acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) balance := banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100000000000000))), + Coins: sdk.NewCoins(sdk.NewCoin(types.DefaultEVMExtendedDenom, math.NewInt(100000000000000))), } app := SetupWithGenesisValSet(t, chainID, evmChainID, valSet, []authtypes.GenesisAccount{acc}, balance) @@ -96,6 +98,11 @@ func SetupWithGenesisValSet(t *testing.T, chainID string, evmChainID uint64, val app, genesisState := setup(true, 5, chainID, evmChainID) genesisState, err := simtestutil.GenesisStateWithValSet(app.AppCodec(), genesisState, valSet, genAccs, balances...) + var bankGenesis banktypes.GenesisState + app.AppCodec().MustUnmarshalJSON(genesisState[banktypes.ModuleName], &bankGenesis) + require.NoError(t, err) + bankGenesis.DenomMetadata = network.GenerateBankGenesisMetadata(evmChainID) + genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(&bankGenesis) require.NoError(t, err) stateBytes, err := json.MarshalIndent(genesisState, "", " ") diff --git a/mempool/blockchain_test.go b/mempool/blockchain_test.go index d4f854802..c566dfd5f 100644 --- a/mempool/blockchain_test.go +++ b/mempool/blockchain_test.go @@ -38,9 +38,14 @@ func TestBlockchainRaceCondition(t *testing.T) { logger := log.NewNopLogger() // Create mock keepers using generated mocks - mockVMKeeper := mocks.NewVmKeeper(t) + mockVMKeeper := mocks.NewVMKeeper(t) mockFeeMarketKeeper := mocks.NewFeeMarketKeeper(t) + ethCfg := vmtypes.DefaultChainConfig(config.EighteenDecimalsChainID) + if err := vmtypes.SetChainConfig(ethCfg); err != nil { + panic(err) + } + // Set up mock expectations for methods that will be called mockVMKeeper.On("GetBaseFee", mock.Anything).Return(big.NewInt(1000000000)).Maybe() // 1 gwei mockFeeMarketKeeper.On("GetBlockGasWanted", mock.Anything).Return(uint64(10000000)).Maybe() // 10M gas @@ -52,7 +57,7 @@ func TestBlockchainRaceCondition(t *testing.T) { mockVMKeeper.On("ForEachStorage", mock.Anything, common.Address{}, mock.AnythingOfType("func(common.Hash, common.Hash) bool")).Maybe() mockVMKeeper.On("KVStoreKeys").Return(make(map[string]*storetypes.KVStoreKey)).Maybe() - err := vmtypes.NewEVMConfigurator().WithEVMCoinInfo(config.ChainsCoinInfo[config.EighteenDecimalsChainID]).Configure() + err := vmtypes.NewEVMConfigurator().WithEVMCoinInfo(config.ChainsCoinInfo[config.EighteenDecimalsChainID]).WithChainConfig(ethCfg).Configure() require.NoError(t, err) // Mock context callback that returns a valid context diff --git a/mempool/mocks/VMKeeper.go b/mempool/mocks/VMKeeper.go index 0644b8293..585af69d6 100644 --- a/mempool/mocks/VMKeeper.go +++ b/mempool/mocks/VMKeeper.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.5. DO NOT EDIT. +// Code generated by mockery v2.53.4. DO NOT EDIT. package mocks @@ -19,13 +19,13 @@ import ( vmtypes "github.com/cosmos/evm/x/vm/types" ) -// VmKeeper is an autogenerated mock type for the VMKeeperI type -type VmKeeper struct { +// VMKeeper is an autogenerated mock type for the VMKeeper type +type VMKeeper struct { mock.Mock } // DeleteAccount provides a mock function with given fields: ctx, addr -func (_m *VmKeeper) DeleteAccount(ctx types.Context, addr common.Address) error { +func (_m *VMKeeper) DeleteAccount(ctx types.Context, addr common.Address) error { ret := _m.Called(ctx, addr) if len(ret) == 0 { @@ -43,22 +43,22 @@ func (_m *VmKeeper) DeleteAccount(ctx types.Context, addr common.Address) error } // DeleteCode provides a mock function with given fields: ctx, codeHash -func (_m *VmKeeper) DeleteCode(ctx types.Context, codeHash []byte) { +func (_m *VMKeeper) DeleteCode(ctx types.Context, codeHash []byte) { _m.Called(ctx, codeHash) } // DeleteState provides a mock function with given fields: ctx, addr, key -func (_m *VmKeeper) DeleteState(ctx types.Context, addr common.Address, key common.Hash) { +func (_m *VMKeeper) DeleteState(ctx types.Context, addr common.Address, key common.Hash) { _m.Called(ctx, addr, key) } // ForEachStorage provides a mock function with given fields: ctx, addr, cb -func (_m *VmKeeper) ForEachStorage(ctx types.Context, addr common.Address, cb func(common.Hash, common.Hash) bool) { +func (_m *VMKeeper) ForEachStorage(ctx types.Context, addr common.Address, cb func(common.Hash, common.Hash) bool) { _m.Called(ctx, addr, cb) } // GetAccount provides a mock function with given fields: ctx, addr -func (_m *VmKeeper) GetAccount(ctx types.Context, addr common.Address) *statedb.Account { +func (_m *VMKeeper) GetAccount(ctx types.Context, addr common.Address) *statedb.Account { ret := _m.Called(ctx, addr) if len(ret) == 0 { @@ -78,7 +78,7 @@ func (_m *VmKeeper) GetAccount(ctx types.Context, addr common.Address) *statedb. } // GetBaseFee provides a mock function with given fields: ctx -func (_m *VmKeeper) GetBaseFee(ctx types.Context) *big.Int { +func (_m *VMKeeper) GetBaseFee(ctx types.Context) *big.Int { ret := _m.Called(ctx) if len(ret) == 0 { @@ -98,7 +98,7 @@ func (_m *VmKeeper) GetBaseFee(ctx types.Context) *big.Int { } // GetCode provides a mock function with given fields: ctx, codeHash -func (_m *VmKeeper) GetCode(ctx types.Context, codeHash common.Hash) []byte { +func (_m *VMKeeper) GetCode(ctx types.Context, codeHash common.Hash) []byte { ret := _m.Called(ctx, codeHash) if len(ret) == 0 { @@ -118,7 +118,7 @@ func (_m *VmKeeper) GetCode(ctx types.Context, codeHash common.Hash) []byte { } // GetCodeHash provides a mock function with given fields: ctx, addr -func (_m *VmKeeper) GetCodeHash(ctx types.Context, addr common.Address) common.Hash { +func (_m *VMKeeper) GetCodeHash(ctx types.Context, addr common.Address) common.Hash { ret := _m.Called(ctx, addr) if len(ret) == 0 { @@ -137,8 +137,26 @@ func (_m *VmKeeper) GetCodeHash(ctx types.Context, addr common.Address) common.H return r0 } +// GetEvmCoinInfo provides a mock function with given fields: ctx +func (_m *VMKeeper) GetEvmCoinInfo(ctx types.Context) vmtypes.EvmCoinInfo { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for GetEvmCoinInfo") + } + + var r0 vmtypes.EvmCoinInfo + if rf, ok := ret.Get(0).(func(types.Context) vmtypes.EvmCoinInfo); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(vmtypes.EvmCoinInfo) + } + + return r0 +} + // GetParams provides a mock function with given fields: ctx -func (_m *VmKeeper) GetParams(ctx types.Context) vmtypes.Params { +func (_m *VMKeeper) GetParams(ctx types.Context) vmtypes.Params { ret := _m.Called(ctx) if len(ret) == 0 { @@ -156,7 +174,7 @@ func (_m *VmKeeper) GetParams(ctx types.Context) vmtypes.Params { } // GetState provides a mock function with given fields: ctx, addr, key -func (_m *VmKeeper) GetState(ctx types.Context, addr common.Address, key common.Hash) common.Hash { +func (_m *VMKeeper) GetState(ctx types.Context, addr common.Address, key common.Hash) common.Hash { ret := _m.Called(ctx, addr, key) if len(ret) == 0 { @@ -176,7 +194,7 @@ func (_m *VmKeeper) GetState(ctx types.Context, addr common.Address, key common. } // KVStoreKeys provides a mock function with no fields -func (_m *VmKeeper) KVStoreKeys() map[string]*storetypes.KVStoreKey { +func (_m *VMKeeper) KVStoreKeys() map[string]*storetypes.KVStoreKey { ret := _m.Called() if len(ret) == 0 { @@ -196,7 +214,7 @@ func (_m *VmKeeper) KVStoreKeys() map[string]*storetypes.KVStoreKey { } // SetAccount provides a mock function with given fields: ctx, addr, account -func (_m *VmKeeper) SetAccount(ctx types.Context, addr common.Address, account statedb.Account) error { +func (_m *VMKeeper) SetAccount(ctx types.Context, addr common.Address, account statedb.Account) error { ret := _m.Called(ctx, addr, account) if len(ret) == 0 { @@ -214,27 +232,27 @@ func (_m *VmKeeper) SetAccount(ctx types.Context, addr common.Address, account s } // SetCode provides a mock function with given fields: ctx, codeHash, code -func (_m *VmKeeper) SetCode(ctx types.Context, codeHash []byte, code []byte) { +func (_m *VMKeeper) SetCode(ctx types.Context, codeHash []byte, code []byte) { _m.Called(ctx, codeHash, code) } // SetEvmMempool provides a mock function with given fields: evmMempool -func (_m *VmKeeper) SetEvmMempool(evmMempool *mempool.ExperimentalEVMMempool) { +func (_m *VMKeeper) SetEvmMempool(evmMempool *mempool.ExperimentalEVMMempool) { _m.Called(evmMempool) } // SetState provides a mock function with given fields: ctx, addr, key, value -func (_m *VmKeeper) SetState(ctx types.Context, addr common.Address, key common.Hash, value []byte) { +func (_m *VMKeeper) SetState(ctx types.Context, addr common.Address, key common.Hash, value []byte) { _m.Called(ctx, addr, key, value) } -// NewVmKeeper creates a new instance of VmKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// NewVMKeeper creates a new instance of VMKeeper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewVmKeeper(t interface { +func NewVMKeeper(t interface { mock.TestingT Cleanup(func()) -}) *VmKeeper { - mock := &VmKeeper{} +}) *VMKeeper { + mock := &VMKeeper{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/tests/integration/x/vm/genesis_test_suite.go b/tests/integration/x/vm/genesis_test_suite.go index 74b8f4fce..f6f639a35 100644 --- a/tests/integration/x/vm/genesis_test_suite.go +++ b/tests/integration/x/vm/genesis_test_suite.go @@ -35,8 +35,12 @@ func (s *GenesisTestSuite) SetupTest() { if s.options == nil { s.options = []network.ConfigOption{} } + + customGenesis := network.CustomGenesisState{} + opts := []network.ConfigOption{ network.WithPreFundedAccounts(s.keyring.GetAllAccAddrs()...), + network.WithCustomGenesis(customGenesis), } opts = append(opts, s.options...) s.network = network.NewUnitTestNetwork(s.create, opts...) diff --git a/tests/integration/x/vm/keeper_test_suite.go b/tests/integration/x/vm/keeper_test_suite.go index 1e7f90c30..532efdec8 100644 --- a/tests/integration/x/vm/keeper_test_suite.go +++ b/tests/integration/x/vm/keeper_test_suite.go @@ -108,7 +108,9 @@ func (s *KeeperTestSuite) SetupTest() { configurator := evmtypes.NewEVMConfigurator() configurator.ResetTestConfig() - err := configurator. + err := evmtypes.SetChainConfig(chainConfig) + s.Require().NoError(err) + err = configurator. WithChainConfig(chainConfig). WithEVMCoinInfo(evmtypes.EvmCoinInfo{ Denom: denom, diff --git a/tests/integration/x/vm/test_genesis.go b/tests/integration/x/vm/test_genesis.go index 38947cc0e..06b266f54 100644 --- a/tests/integration/x/vm/test_genesis.go +++ b/tests/integration/x/vm/test_genesis.go @@ -27,6 +27,16 @@ func (s *GenesisTestSuite) TestInitGenesis() { s.Require().NoError(err) address := common.HexToAddress(privkey.PubKey().Address().String()) + params := types.Params{ + EvmDenom: "aatom", + ExtraEIPs: types.DefaultExtraEIPs, + EVMChannels: types.DefaultEVMChannels, + AccessControl: types.DefaultAccessControl, + ActiveStaticPrecompiles: types.DefaultStaticPrecompiles, + HistoryServeWindow: types.DefaultHistoryServeWindow, + ExtendedDenomOptions: nil, + } + var ( vmdb *statedb.StateDB ctx sdk.Context @@ -43,7 +53,10 @@ func (s *GenesisTestSuite) TestInitGenesis() { { name: "pass - default", malleate: func(_ *network.UnitTestNetwork) {}, - genState: types.DefaultGenesisState(), + genState: &types.GenesisState{ + Params: params, + Accounts: []types.GenesisAccount{}, + }, expPanic: false, }, { @@ -52,7 +65,7 @@ func (s *GenesisTestSuite) TestInitGenesis() { vmdb.AddBalance(address, uint256.NewInt(1), tracing.BalanceChangeUnspecified) }, genState: &types.GenesisState{ - Params: types.DefaultParams(), + Params: params, Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -68,7 +81,7 @@ func (s *GenesisTestSuite) TestInitGenesis() { name: "account not found", malleate: func(_ *network.UnitTestNetwork) {}, genState: &types.GenesisState{ - Params: types.DefaultParams(), + Params: params, Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -84,7 +97,7 @@ func (s *GenesisTestSuite) TestInitGenesis() { network.App.GetAccountKeeper().SetAccount(ctx, acc) }, genState: &types.GenesisState{ - Params: types.DefaultParams(), + Params: params, Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -101,7 +114,7 @@ func (s *GenesisTestSuite) TestInitGenesis() { network.App.GetAccountKeeper().SetAccount(ctx, acc) }, genState: &types.GenesisState{ - Params: types.DefaultParams(), + Params: params, Accounts: []types.GenesisAccount{ { Address: address.String(), @@ -126,6 +139,9 @@ func (s *GenesisTestSuite) TestInitGenesis() { err := vmdb.Commit() s.Require().NoError(err) + configurator := types.NewEVMConfigurator() + configurator.ResetTestConfig() + if tc.expPanic { s.Require().Panics(func() { _ = vm.InitGenesis( diff --git a/tests/integration/x/vm/test_grpc_query.go b/tests/integration/x/vm/test_grpc_query.go index aa97c7aea..c838f4fc3 100644 --- a/tests/integration/x/vm/test_grpc_query.go +++ b/tests/integration/x/vm/test_grpc_query.go @@ -1604,7 +1604,9 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() - err := configurator. + err := types.SetChainConfig(chainConfig) + s.Require().NoError(err) + err = configurator. WithChainConfig(chainConfig). WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.ExampleChainID]). Configure() @@ -1660,6 +1662,8 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { s.Require().NoError(s.Network.NextBlock()) configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() + err = types.SetChainConfig(chainConfig) + s.Require().NoError(err) err = configurator. WithChainConfig(chainConfig). WithEVMCoinInfo(coinInfo). diff --git a/tests/integration/x/vm/test_statedb.go b/tests/integration/x/vm/test_statedb.go index 5ac2ac861..0aedd5b8c 100644 --- a/tests/integration/x/vm/test_statedb.go +++ b/tests/integration/x/vm/test_statedb.go @@ -636,7 +636,7 @@ func (s *KeeperTestSuite) CreateTestTx(msg *types.MsgEthereumTx, priv cryptotype s.Require().NoError(err) clientCtx := client.Context{}.WithTxConfig(s.Network.App.GetTxConfig()) - ethSigner := ethtypes.LatestSignerForChainID(types.GetEthChainConfig().ChainID) + ethSigner := ethtypes.LatestSignerForChainID(s.Network.GetEIP155ChainID()) txBuilder := clientCtx.TxConfig.NewTxBuilder() builder, ok := txBuilder.(authtx.ExtensionOptionsTxBuilder) diff --git a/testutil/integration/evm/network/chain_id_modifiers.go b/testutil/integration/evm/network/chain_id_modifiers.go index d5ee701b9..f0c9243b2 100644 --- a/testutil/integration/evm/network/chain_id_modifiers.go +++ b/testutil/integration/evm/network/chain_id_modifiers.go @@ -16,14 +16,14 @@ import ( // updateErc20GenesisStateForChainID modify the default genesis state for the // bank module of the testing suite depending on the chainID. func updateBankGenesisStateForChainID(bankGenesisState banktypes.GenesisState, evmChainID uint64) banktypes.GenesisState { - bankGenesisState.DenomMetadata = generateBankGenesisMetadata(evmChainID) + bankGenesisState.DenomMetadata = GenerateBankGenesisMetadata(evmChainID) return bankGenesisState } -// generateBankGenesisMetadata generates the metadata entries +// GenerateBankGenesisMetadata generates the metadata entries // for both extended and native EVM denominations depending on the chain. -func generateBankGenesisMetadata(evmChainID uint64) []banktypes.Metadata { +func GenerateBankGenesisMetadata(evmChainID uint64) []banktypes.Metadata { denomConfig := config.ChainsCoinInfo[evmChainID] // Basic denom settings diff --git a/testutil/integration/evm/network/network.go b/testutil/integration/evm/network/network.go index 505d4ac23..0721426bc 100644 --- a/testutil/integration/evm/network/network.go +++ b/testutil/integration/evm/network/network.go @@ -94,8 +94,6 @@ func New(createEvmApp CreateEvmApp, opts ...ConfigOption) *IntegrationNetwork { // create a new testing app with the following params evmApp := createEvmApp(cfg.chainID, cfg.eip155ChainID.Uint64(), cfg.customBaseAppOpts...) - evmConfig := evmtypes.GetChainConfig() - fmt.Println(evmConfig.ChainId) err := network.configureAndInitChain(evmApp) if err != nil { panic(err) diff --git a/x/precisebank/keeper/keeper_test.go b/x/precisebank/keeper/keeper_test.go index 7c401ecaf..2d5470b40 100644 --- a/x/precisebank/keeper/keeper_test.go +++ b/x/precisebank/keeper/keeper_test.go @@ -1,9 +1,10 @@ package keeper_test import ( + vmtypes "github.com/cosmos/evm/x/vm/types" + "github.com/stretchr/testify/require" "testing" - evmconfig "github.com/cosmos/evm/config" evmosencoding "github.com/cosmos/evm/encoding" testconstants "github.com/cosmos/evm/testutil/constants" "github.com/cosmos/evm/x/precisebank/keeper" @@ -44,9 +45,11 @@ func newMockedTestData(t *testing.T) testData { cfg := evmosencoding.MakeConfig(chainID) cdc := cfg.Codec k := keeper.NewKeeper(cdc, storeKey, bk, ak) - if err != nil { - return testData{} - } + evmConfigurator := vmtypes.NewEVMConfigurator(). + WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.ExampleChainID]) + evmConfigurator.ResetTestConfig() + err := evmConfigurator.Configure() + require.NoError(t, err) return testData{ ctx: ctx, diff --git a/x/vm/keeper/keeper.go b/x/vm/keeper/keeper.go index fc1599bf0..77479843d 100644 --- a/x/vm/keeper/keeper.go +++ b/x/vm/keeper/keeper.go @@ -112,7 +112,7 @@ func NewKeeper( feeMarketWrapper := wrappers.NewFeeMarketWrapper(fmk) // set global chain config - ethCfg := types.DefaultChainConfig(evmChainId) //TODO:VLAD make this configurable + ethCfg := types.DefaultChainConfig(evmChainId) if err := types.SetChainConfig(ethCfg); err != nil { panic(err) } diff --git a/x/vm/types/configurator_test.go b/x/vm/types/configurator_test.go index 8ba74f536..00fa54d53 100644 --- a/x/vm/types/configurator_test.go +++ b/x/vm/types/configurator_test.go @@ -18,7 +18,7 @@ func TestEVMConfigurator(t *testing.T) { err = evmConfigurator.Configure() require.Error(t, err) - require.Contains(t, err.Error(), "sealed", "expected different error") + require.Contains(t, err.Error(), "already set", "expected different error") } func TestExtendedEips(t *testing.T) { diff --git a/x/vm/types/msg_test.go b/x/vm/types/msg_test.go index a084d5f28..0e2ca6498 100644 --- a/x/vm/types/msg_test.go +++ b/x/vm/types/msg_test.go @@ -13,7 +13,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" - evmconfig "github.com/cosmos/evm/config" "github.com/cosmos/evm/encoding" testconstants "github.com/cosmos/evm/testutil/constants" utiltx "github.com/cosmos/evm/testutil/tx" diff --git a/x/vm/types/params.go b/x/vm/types/params.go index 19df9328b..d808e6be2 100644 --- a/x/vm/types/params.go +++ b/x/vm/types/params.go @@ -65,7 +65,7 @@ func NewParams( // DefaultParams returns default evm parameters func DefaultParams() Params { return Params{ - EvmDenom: DefaultEVMDenom, + EvmDenom: DefaultEVMExtendedDenom, ExtraEIPs: DefaultExtraEIPs, ActiveStaticPrecompiles: DefaultStaticPrecompiles, EVMChannels: DefaultEVMChannels, From f8c0743985938facf457a6031a5fd4c26b56253a Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 14:11:54 -0400 Subject: [PATCH 21/45] fix precisebank keeper test --- x/precisebank/keeper/keeper_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/precisebank/keeper/keeper_test.go b/x/precisebank/keeper/keeper_test.go index 2d5470b40..4872528a3 100644 --- a/x/precisebank/keeper/keeper_test.go +++ b/x/precisebank/keeper/keeper_test.go @@ -46,7 +46,7 @@ func newMockedTestData(t *testing.T) testData { cdc := cfg.Codec k := keeper.NewKeeper(cdc, storeKey, bk, ak) evmConfigurator := vmtypes.NewEVMConfigurator(). - WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.ExampleChainID]) + WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.SixDecimalsChainID]) evmConfigurator.ResetTestConfig() err := evmConfigurator.Configure() require.NoError(t, err) From de569ea54c8468c64ea3db3d7459cc814566f6f4 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 15:07:31 -0400 Subject: [PATCH 22/45] fix smore tests --- evmd/cmd/evmd/cmd/testnet.go | 10 ++++++++++ tests/jsonrpc/scripts/evmd/container-start-evmd.sh | 1 + x/vm/module.go | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/evmd/cmd/evmd/cmd/testnet.go b/evmd/cmd/evmd/cmd/testnet.go index 9677fb146..bd44be778 100644 --- a/evmd/cmd/evmd/cmd/testnet.go +++ b/evmd/cmd/evmd/cmd/testnet.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" "github.com/cosmos/evm/config" + network2 "github.com/cosmos/evm/testutil/integration/evm/network" + evmtypes "github.com/cosmos/evm/x/vm/types" "net" "os" "path/filepath" @@ -511,12 +513,20 @@ func initGenFiles( var bankGenState banktypes.GenesisState clientCtx.Codec.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState) + bankGenState.DenomMetadata = network2.GenerateBankGenesisMetadata(config.EVMChainID) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances) for _, bal := range bankGenState.Balances { bankGenState.Supply = bankGenState.Supply.Add(bal.Coins...) } appGenState[banktypes.ModuleName] = clientCtx.Codec.MustMarshalJSON(&bankGenState) + var evmGenState evmtypes.GenesisState + clientCtx.Codec.MustUnmarshalJSON(appGenState[evmtypes.ModuleName], &evmGenState) + + evmGenState.Params.EvmDenom = TEST_DENOM + appGenState[evmtypes.ModuleName] = clientCtx.Codec.MustMarshalJSON(&evmGenState) + appGenStateJSON, err := json.MarshalIndent(appGenState, "", " ") if err != nil { return err diff --git a/tests/jsonrpc/scripts/evmd/container-start-evmd.sh b/tests/jsonrpc/scripts/evmd/container-start-evmd.sh index 7d27b8921..83c201ebd 100755 --- a/tests/jsonrpc/scripts/evmd/container-start-evmd.sh +++ b/tests/jsonrpc/scripts/evmd/container-start-evmd.sh @@ -54,6 +54,7 @@ jq '.app_state["staking"]["params"]["bond_denom"]="atest"' "$GENESIS" > "$TMP_GE jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="atest"' "$GENESIS" > "$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["gov"]["params"]["min_deposit"][0]["denom"]="atest"' "$GENESIS" > "$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["gov"]["params"]["expedited_min_deposit"][0]["denom"]="atest"' "$GENESIS" > "$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" +jq '.app_state["bank"]["denom_metadata"]=[{"description":"The native staking token for evmd.","denom_units":[{"denom":"atest","exponent":0,"aliases":["attotest"]},{"denom":"test","exponent":18,"aliases":[]}],"base":"atest","display":"test","name":"Test Token","symbol":"TEST","uri":"","uri_hash":""}]' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["evm"]["params"]["evm_denom"]="atest"' "$GENESIS" > "$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["mint"]["params"]["mint_denom"]="atest"' "$GENESIS" > "$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" diff --git a/x/vm/module.go b/x/vm/module.go index b05ea091f..1baed5e5f 100644 --- a/x/vm/module.go +++ b/x/vm/module.go @@ -216,7 +216,7 @@ func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeep evmDenomMetadata, found := bankKeeper.GetDenomMetaData(ctx, params.EvmDenom) if !found { - panic("denom metadata could not be found") + panic(fmt.Sprintf("denom metadata %s could not be found", params.EvmDenom)) } for _, denomUnit := range evmDenomMetadata.DenomUnits { From 0eeb6ec25a743b5adead9276f91e34c0ba7b1eff Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 15:24:11 -0400 Subject: [PATCH 23/45] lol --- local_node.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/local_node.sh b/local_node.sh index 7ca691319..a7e410825 100755 --- a/local_node.sh +++ b/local_node.sh @@ -340,9 +340,9 @@ fi # Start the node evmd start "$TRACE" \ --pruning nothing \ - --log_level "info" \ + --log_level $LOGLEVEL \ --minimum-gas-prices=0atest \ --evm.min-tip=0 \ - --home "/Users/vlad/.evmd/" \ + --home "$CHAINDIR" \ --json-rpc.api eth,txpool,personal,net,debug,web3 \ --chain-id "$CHAINID" From 0995962c2fd77a7a23e93001d5a531abbb1b61e5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 15:51:32 -0400 Subject: [PATCH 24/45] add upgrade handler --- evmd/cmd/evmd/cmd/testnet.go | 2 +- evmd/upgrades.go | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/evmd/cmd/evmd/cmd/testnet.go b/evmd/cmd/evmd/cmd/testnet.go index bd44be778..2b39b3849 100644 --- a/evmd/cmd/evmd/cmd/testnet.go +++ b/evmd/cmd/evmd/cmd/testnet.go @@ -513,7 +513,7 @@ func initGenFiles( var bankGenState banktypes.GenesisState clientCtx.Codec.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState) - bankGenState.DenomMetadata = network2.GenerateBankGenesisMetadata(config.EVMChainID) + bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, network2.GenerateBankGenesisMetadata(config.EVMChainID)...) bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances) for _, bal := range bankGenState.Balances { diff --git a/evmd/upgrades.go b/evmd/upgrades.go index 2413912c1..3a24e4cbe 100644 --- a/evmd/upgrades.go +++ b/evmd/upgrades.go @@ -2,6 +2,7 @@ package evmd import ( "context" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -23,6 +24,29 @@ func (app EVMD) RegisterUpgradeHandlers() { UpgradeName, func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { sdk.UnwrapSDKContext(ctx).Logger().Debug("this is a debug level message to test that verbose logging mode has properly been enabled during a chain upgrade") + + app.BankKeeper.SetDenomMetaData(ctx, banktypes.Metadata{ + Description: "Example description", + DenomUnits: []*banktypes.DenomUnit{ + { + Denom: "atest", + Exponent: 0, + Aliases: nil, + }, + { + Denom: "test", + Exponent: 18, + Aliases: nil, + }, + }, + Base: "atest", + Display: "test", + Name: "Test Token", + Symbol: "TEST", + URI: "example_uri", + URIHash: "example_uri_hash", + }) + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, ) From 79d63fc3504dc4020fe6ad39bd58ab7c8fc24461 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 16:05:36 -0400 Subject: [PATCH 25/45] lints --- ante/evm/fee_checker_test.go | 2 +- .../precompiles/werc20/test_integration.go | 2 +- testutil/ibc/coordinator.go | 4 ++-- testutil/ibc/testing_app.go | 20 +++++++++---------- .../evm/network/chain_id_modifiers.go | 2 +- testutil/integration/evm/network/setup.go | 13 +----------- x/precisebank/keeper/keeper_test.go | 9 +++++---- x/vm/keeper/coin_info.go | 3 ++- x/vm/keeper/keeper.go | 4 ++-- x/vm/keeper/keeper_test.go | 2 +- x/vm/module.go | 7 ++++--- 11 files changed, 30 insertions(+), 38 deletions(-) diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index bdd12718a..8cdfe501d 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -58,7 +58,7 @@ func TestSDKTxFeeChecker(t *testing.T) { // without extension option // london hardfork enableness chainID := uint64(config.EighteenDecimalsChainID) - encodingConfig := encoding.MakeConfig(chainID) + encodingConfig := encoding.MakeConfig(chainID) //nolint:staticcheck // this is used configurator := evmtypes.NewEVMConfigurator() configurator.ResetTestConfig() diff --git a/tests/integration/precompiles/werc20/test_integration.go b/tests/integration/precompiles/werc20/test_integration.go index 9dfbf865c..ea5e1a0e5 100644 --- a/tests/integration/precompiles/werc20/test_integration.go +++ b/tests/integration/precompiles/werc20/test_integration.go @@ -556,7 +556,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, create network.CreateEvmAp ChainID: is.network.GetChainID(), EVMChainID: is.network.GetEIP155ChainID().Uint64(), }] - Expect(decimals).To(Equal(uint8(coinInfo.Decimals)), "expected different decimals") + Expect(decimals).To(Equal(uint8(coinInfo.Decimals)), "expected different decimals") //nolint:gosec // G115 }, ) }) diff --git a/testutil/ibc/coordinator.go b/testutil/ibc/coordinator.go index c21bad066..0d235d324 100644 --- a/testutil/ibc/coordinator.go +++ b/testutil/ibc/coordinator.go @@ -2,13 +2,13 @@ package ibctesting import ( "fmt" - "github.com/cosmos/evm/x/vm/types" "strconv" "testing" "time" "github.com/stretchr/testify/require" + "github.com/cosmos/evm/x/vm/types" ibctesting "github.com/cosmos/ibc-go/v10/testing" ) @@ -38,7 +38,7 @@ func NewCoordinator(t *testing.T, nEVMChains, mCosmosChains int, evmAppCreator i } ibctesting.DefaultTestingAppInit = evmAppCreator - for i := 1; i <= nEVMChains; i++ { + for i := 1; i <= nEVMChains; i++ { //nolint: staticcheck // this variable does change when the number of evmchains is 2 configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() chainID := GetChainID(i) diff --git a/testutil/ibc/testing_app.go b/testutil/ibc/testing_app.go index f26e83968..a63999a53 100644 --- a/testutil/ibc/testing_app.go +++ b/testutil/ibc/testing_app.go @@ -2,15 +2,21 @@ package ibctesting import ( "encoding/json" - "github.com/cosmos/evm/config" - evmtypes "github.com/cosmos/evm/x/vm/types" - ibctesting "github.com/cosmos/ibc-go/v10/testing" "testing" "time" - dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + abci "github.com/cometbft/cometbft/abci/types" + cmttypes "github.com/cometbft/cometbft/types" + + dbm "github.com/cosmos/cosmos-db" + "github.com/cosmos/evm/config" + evmtypes "github.com/cosmos/evm/x/vm/types" + "github.com/cosmos/ibc-go/v10/modules/core/keeper" + ibctesting "github.com/cosmos/ibc-go/v10/testing" + "github.com/cosmos/ibc-go/v10/testing/simapp" + "cosmossdk.io/log" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -26,12 +32,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - abci "github.com/cometbft/cometbft/abci/types" - cmttypes "github.com/cometbft/cometbft/types" - - "github.com/cosmos/ibc-go/v10/modules/core/keeper" - "github.com/cosmos/ibc-go/v10/testing/simapp" ) type TestingApp interface { diff --git a/testutil/integration/evm/network/chain_id_modifiers.go b/testutil/integration/evm/network/chain_id_modifiers.go index f0c9243b2..4bf9f67de 100644 --- a/testutil/integration/evm/network/chain_id_modifiers.go +++ b/testutil/integration/evm/network/chain_id_modifiers.go @@ -48,7 +48,7 @@ func GenerateBankGenesisMetadata(evmChainID uint64) []banktypes.Metadata { Base: evmDenom, DenomUnits: []*banktypes.DenomUnit{ {Denom: evmDenom, Exponent: 0}, - {Denom: displayDenom, Exponent: uint32(evmDecimals)}, + {Denom: displayDenom, Exponent: evmDecimals}, }, Name: name, Symbol: symbol, diff --git a/testutil/integration/evm/network/setup.go b/testutil/integration/evm/network/setup.go index 57b1e6885..b30349102 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/config" "maps" "slices" "time" @@ -10,6 +9,7 @@ import ( cmttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/evm" + "github.com/cosmos/evm/config" testconstants "github.com/cosmos/evm/testutil/constants" cosmosevmtypes "github.com/cosmos/evm/types" erc20types "github.com/cosmos/evm/x/erc20/types" @@ -502,17 +502,6 @@ func setDefaultVMGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, genesi return genesisState } -// newErc20GenesisState returns the default genesis state for the ERC20 module. -// This is a duplicate of the function in utils to avoid an import cycle -// -// NOTE: for the example chain implementation we are also adding a default token pair, -// which is the base denomination of the chain (i.e. the WEVMOS contract). -func newVMGenesisState() *evmtypes.GenesisState { - vmGenState := evmtypes.DefaultGenesisState() - - return vmGenState -} - // defaultAuthGenesisState sets the default genesis state // for the testing setup func newDefaultGenesisState(cosmosEVMApp evm.EvmApp, evmChainID uint64, params defaultGenesisParams) cosmosevmtypes.GenesisState { diff --git a/x/precisebank/keeper/keeper_test.go b/x/precisebank/keeper/keeper_test.go index 4872528a3..b96ce57e7 100644 --- a/x/precisebank/keeper/keeper_test.go +++ b/x/precisebank/keeper/keeper_test.go @@ -1,15 +1,16 @@ package keeper_test import ( - vmtypes "github.com/cosmos/evm/x/vm/types" - "github.com/stretchr/testify/require" "testing" + "github.com/stretchr/testify/require" + evmosencoding "github.com/cosmos/evm/encoding" testconstants "github.com/cosmos/evm/testutil/constants" "github.com/cosmos/evm/x/precisebank/keeper" "github.com/cosmos/evm/x/precisebank/types" "github.com/cosmos/evm/x/precisebank/types/mocks" + vmtypes "github.com/cosmos/evm/x/vm/types" sdkmath "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" @@ -36,7 +37,7 @@ func newMockedTestData(t *testing.T) testData { storeKey := storetypes.NewKVStoreKey(types.ModuleName) // Not required by module, but needs to be non-nil for context tKey := storetypes.NewTransientStoreKey("transient_test") - ctx := testutil.DefaultContext(storeKey, tKey) + ctx := testutil.DefaultContext(storeKey, tKey) //nolint: staticcheck // this variable is used bk := mocks.NewBankKeeper(t) ak := mocks.NewAccountKeeper(t) @@ -44,7 +45,7 @@ func newMockedTestData(t *testing.T) testData { chainID := testconstants.SixDecimalsChainID.EVMChainID cfg := evmosencoding.MakeConfig(chainID) cdc := cfg.Codec - k := keeper.NewKeeper(cdc, storeKey, bk, ak) + k := keeper.NewKeeper(cdc, storeKey, bk, ak) //nolint: staticcheck // this variable is used evmConfigurator := vmtypes.NewEVMConfigurator(). WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.SixDecimalsChainID]) evmConfigurator.ResetTestConfig() diff --git a/x/vm/keeper/coin_info.go b/x/vm/keeper/coin_info.go index 713a66e4a..b30d6bb1c 100644 --- a/x/vm/keeper/coin_info.go +++ b/x/vm/keeper/coin_info.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/evm/x/vm/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetEvmCoinInfo returns the EVM Coin Info stored in the module diff --git a/x/vm/keeper/keeper.go b/x/vm/keeper/keeper.go index 77479843d..8e9ee8edb 100644 --- a/x/vm/keeper/keeper.go +++ b/x/vm/keeper/keeper.go @@ -95,7 +95,7 @@ func NewKeeper( fmk types.FeeMarketKeeper, consensusKeeper types.ConsensusParamsKeeper, erc20Keeper types.Erc20Keeper, - evmChainId uint64, + evmChainID uint64, tracer string, ) *Keeper { // ensure evm module account is set @@ -112,7 +112,7 @@ func NewKeeper( feeMarketWrapper := wrappers.NewFeeMarketWrapper(fmk) // set global chain config - ethCfg := types.DefaultChainConfig(evmChainId) + ethCfg := types.DefaultChainConfig(evmChainID) if err := types.SetChainConfig(ethCfg); err != nil { panic(err) } diff --git a/x/vm/keeper/keeper_test.go b/x/vm/keeper/keeper_test.go index 5aff94abd..a2117754b 100644 --- a/x/vm/keeper/keeper_test.go +++ b/x/vm/keeper/keeper_test.go @@ -1,7 +1,6 @@ package keeper_test import ( - "github.com/cosmos/evm/config" "testing" "github.com/stretchr/testify/mock" @@ -10,6 +9,7 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttime "github.com/cometbft/cometbft/types/time" + "github.com/cosmos/evm/config" erc20types "github.com/cosmos/evm/x/erc20/types" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" precisebanktypes "github.com/cosmos/evm/x/precisebank/types" diff --git a/x/vm/module.go b/x/vm/module.go index 1baed5e5f..797fe4d5c 100644 --- a/x/vm/module.go +++ b/x/vm/module.go @@ -2,13 +2,13 @@ package vm import ( "context" - "cosmossdk.io/math" "encoding/json" "fmt" + "sync" + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" - "sync" abci "github.com/cometbft/cometbft/abci/types" @@ -18,6 +18,7 @@ import ( "cosmossdk.io/core/address" "cosmossdk.io/core/appmodule" + "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -252,7 +253,7 @@ func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeep } configurator := types.NewEVMConfigurator() - //if withReset { + // if withReset { // // reset configuration to set the new one // configurator.ResetTestConfig() //} From 356d183c4698deef405261be8baab41ebf3d6743 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 26 Sep 2025 16:47:32 -0400 Subject: [PATCH 26/45] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a80de32e..7475e66ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,8 @@ - [\#477](https://github.com/cosmos/evm/pull/477) Refactor precompile constructors to accept keeper interfaces instead of concrete implementations, breaking the existing `NewPrecompile` function signatures. - [\#594](https://github.com/cosmos/evm/pull/594) Remove all usage of x/params - [\#577](https://github.com/cosmos/evm/pull/577) Changed the way to create a stateful precompile based on the cmn.Precompile, change `NewPrecompile` to not return error. +- [\#661](https://github.com/cosmos/evm/pull/661) Removes evmAppOptions from the repository and moves initialization to genesis. Chains must now have a display and denom metadata set for the defined EVM denom in the bank module's metadata. + ## v0.4.1 From c65a7cb8486b5fb54806c494d53ceeb480b34d89 Mon Sep 17 00:00:00 2001 From: Vlad Date: Sat, 27 Sep 2025 16:23:58 -0400 Subject: [PATCH 27/45] Fix imports, add upgrade for non-18-decimal chains, and add migration guide --- .../migrations/v0.4.0_to_v0.5.0_UNRELEASED.md | 67 +++++++++++++++++++ evmd/cmd/evmd/cmd/testnet.go | 18 ++--- evmd/tests/integration/create_app.go | 5 +- evmd/upgrades.go | 14 +++- 4 files changed, 93 insertions(+), 11 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 9ada43446..74fb0b373 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 @@ -113,6 +113,73 @@ function can now happen *alongside the keeper instantiation*, and not after. The ) ``` +### Denom Configs + +[#661](https://github.com/cosmos/evm/pull/661) removes the instantiation of chain configs via app.go +and moves them to state or genesis. +It is critical to remove any use of EvmAppOptions as calling the configurator will panic the chain +at runtime during startup. + +In `app.go`, remove evmChainID and evmAppOptions from the NewApp signature. + +```diff +// NewExampleApp returns a reference to an initialized EVMD. +func NewExampleApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + appOpts servertypes.AppOptions, +- evmChainID uint64, +- evmAppOptions evmconfig.EVMOptionsFn, + baseAppOptions ...func(*baseapp.BaseApp), +) *EVMD { +``` + +Afterwards, fix any reference to the function by removing the inputs. + +Then, remove any reference of evmAppOptions being called: + +`app.go` +```diff +- if err := evmAppOptions(evmChainID); err != nil { +- panic(err) +- } +``` + +`root.go` +```diff +- noOpEvmAppOptions := func(_ uint64) error { +- return nil +- } +``` +```diff +- if initClientCtx.ChainID != "" { +- if err := config.EvmAppOptions(config.EVMChainID); err != nil { +- panic(err) +- } +- } +``` + +`evmd_config.go`, `chain_id.go`, `config.go`, `constants.go` have been moved to +`github.com/cosmos/evm/config` and may be removed to your repo. + +#### UpgradeHandler + +As the configs have been moved to state and genesis, you must include an UpgradeHandler if your chain does +not satisfy the following conditions. +1. Your EVM Denom set in the `x/vm` params must have `DenomMetadata` registered for it in `x/bank`. +2. Your EVM Denom must have a display denom associated with in in the `DenomMetadata`. + 1. The display denom for the EVM Denom must have an accurate decimal value (i.e. for `uatom`, `atom` must have a decimal value of 6. +3. Your chain is an 18-decimal chain. + +In your UpgradeHandler: + +- **If your chain does not have DenomMetadata set for the EVM Denom, you must include it.** +- **If your chain's EVM denom is *not* 18 decimals, you must add ExtendedDenomOptions to your `x/vm` params.** + +Please refer to the [upgrade example](https://github.com/cosmos/evm/blob/0995962c2fd77a7a23e93001d5a531abbb1b61e5/evmd/upgrades.go) for more information. + --- ## 3) Build & quick tests diff --git a/evmd/cmd/evmd/cmd/testnet.go b/evmd/cmd/evmd/cmd/testnet.go index 2b39b3849..67de118e7 100644 --- a/evmd/cmd/evmd/cmd/testnet.go +++ b/evmd/cmd/evmd/cmd/testnet.go @@ -4,18 +4,12 @@ import ( "bufio" "encoding/json" "fmt" - "github.com/cosmos/evm/config" - network2 "github.com/cosmos/evm/testutil/integration/evm/network" - evmtypes "github.com/cosmos/evm/x/vm/types" + "net" "os" "path/filepath" "time" - cosmosevmhd "github.com/cosmos/evm/crypto/hd" - cosmosevmkeyring "github.com/cosmos/evm/crypto/keyring" - "github.com/cosmos/evm/evmd" - cosmosevmserverconfig "github.com/cosmos/evm/server/config" "github.com/spf13/cobra" "github.com/spf13/pflag" @@ -48,6 +42,14 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + "github.com/cosmos/evm/config" + cosmosevmhd "github.com/cosmos/evm/crypto/hd" + cosmosevmkeyring "github.com/cosmos/evm/crypto/keyring" + "github.com/cosmos/evm/evmd" + cosmosevmserverconfig "github.com/cosmos/evm/server/config" + evmnetwork "github.com/cosmos/evm/testutil/integration/evm/network" + evmtypes "github.com/cosmos/evm/x/vm/types" ) var ( @@ -513,7 +515,7 @@ func initGenFiles( var bankGenState banktypes.GenesisState clientCtx.Codec.MustUnmarshalJSON(appGenState[banktypes.ModuleName], &bankGenState) - bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, network2.GenerateBankGenesisMetadata(config.EVMChainID)...) + bankGenState.DenomMetadata = append(bankGenState.DenomMetadata, evmnetwork.GenerateBankGenesisMetadata(config.EVMChainID)...) bankGenState.Balances = banktypes.SanitizeGenesisBalances(genBalances) for _, bal := range bankGenState.Balances { diff --git a/evmd/tests/integration/create_app.go b/evmd/tests/integration/create_app.go index 6427e9f56..6d2d98f08 100644 --- a/evmd/tests/integration/create_app.go +++ b/evmd/tests/integration/create_app.go @@ -3,15 +3,16 @@ package integration import ( "encoding/json" "github.com/cosmos/cosmos-sdk/client/flags" - srvflags "github.com/cosmos/evm/server/flags" dbm "github.com/cosmos/cosmos-db" + ibctesting "github.com/cosmos/ibc-go/v10/testing" + "github.com/cosmos/evm" "github.com/cosmos/evm/config" "github.com/cosmos/evm/evmd" + srvflags "github.com/cosmos/evm/server/flags" "github.com/cosmos/evm/testutil/constants" feemarkettypes "github.com/cosmos/evm/x/feemarket/types" - ibctesting "github.com/cosmos/ibc-go/v10/testing" clienthelpers "cosmossdk.io/client/v2/helpers" "cosmossdk.io/log" diff --git a/evmd/upgrades.go b/evmd/upgrades.go index 3a24e4cbe..966655cca 100644 --- a/evmd/upgrades.go +++ b/evmd/upgrades.go @@ -23,7 +23,8 @@ func (app EVMD) RegisterUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( UpgradeName, func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - sdk.UnwrapSDKContext(ctx).Logger().Debug("this is a debug level message to test that verbose logging mode has properly been enabled during a chain upgrade") + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.Logger().Debug("this is a debug level message to test that verbose logging mode has properly been enabled during a chain upgrade") app.BankKeeper.SetDenomMetaData(ctx, banktypes.Metadata{ Description: "Example description", @@ -47,6 +48,17 @@ func (app EVMD) RegisterUpgradeHandlers() { URIHash: "example_uri_hash", }) + // (Required for NON-18 denom chains *only) + // Update EVM params to add Extended denom options + // Ensure that this corresponds to the EVM denom + // (tyically the bond denom) + evmParams := app.EVMKeeper.GetParams(sdkCtx) + evmParams.ExtendedDenomOptions.ExtendedDenom = "atest" + err := app.EVMKeeper.SetParams(sdkCtx, evmParams) + if err != nil { + return nil, err + } + return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM) }, ) From 20f33be36935fcd0a6377a692eaa80e677659fe5 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 7 Oct 2025 12:30:27 -0400 Subject: [PATCH 28/45] fix system test --- evmd/upgrades.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evmd/upgrades.go b/evmd/upgrades.go index 966655cca..31c422788 100644 --- a/evmd/upgrades.go +++ b/evmd/upgrades.go @@ -3,6 +3,7 @@ package evmd import ( "context" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/evm/x/vm/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -53,7 +54,7 @@ func (app EVMD) RegisterUpgradeHandlers() { // Ensure that this corresponds to the EVM denom // (tyically the bond denom) evmParams := app.EVMKeeper.GetParams(sdkCtx) - evmParams.ExtendedDenomOptions.ExtendedDenom = "atest" + evmParams.ExtendedDenomOptions = &types.ExtendedDenomOptions{ExtendedDenom: "atest"} err := app.EVMKeeper.SetParams(sdkCtx, evmParams) if err != nil { return nil, err From 47d2ec9c8a5ac827981b2d5cce87a1bc5de1c3d3 Mon Sep 17 00:00:00 2001 From: Vlad J Date: Wed, 8 Oct 2025 10:48:59 -0400 Subject: [PATCH 29/45] Update docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md Co-authored-by: Abdul Malek --- docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 74fb0b373..2aaf9d202 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 @@ -169,7 +169,7 @@ Then, remove any reference of evmAppOptions being called: As the configs have been moved to state and genesis, you must include an UpgradeHandler if your chain does not satisfy the following conditions. 1. Your EVM Denom set in the `x/vm` params must have `DenomMetadata` registered for it in `x/bank`. -2. Your EVM Denom must have a display denom associated with in in the `DenomMetadata`. +2. Your EVM Denom must have a display denom associated with it in `DenomMetadata`. 1. The display denom for the EVM Denom must have an accurate decimal value (i.e. for `uatom`, `atom` must have a decimal value of 6. 3. Your chain is an 18-decimal chain. From 6ec0eeafbefcfb793bc2f2d778ea8c7398fe6f23 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 13:02:53 -0400 Subject: [PATCH 30/45] fix monodecorator test --- ante/evm/mono_decorator_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ante/evm/mono_decorator_test.go b/ante/evm/mono_decorator_test.go index 51f94d732..d294bc123 100644 --- a/ante/evm/mono_decorator_test.go +++ b/ante/evm/mono_decorator_test.go @@ -196,6 +196,24 @@ func TestMonoDecorator(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { + configurator := evmsdktypes.NewEVMConfigurator() + configurator.ResetTestConfig() + chainConfig := evmsdktypes.DefaultChainConfig(evmsdktypes.DefaultEVMChainID) + err := evmsdktypes.SetChainConfig(chainConfig) + require.NoError(t, err) + coinInfo := evmsdktypes.EvmCoinInfo{ + Denom: evmsdktypes.DefaultEVMExtendedDenom, + ExtendedDenom: evmsdktypes.DefaultEVMExtendedDenom, + DisplayDenom: evmsdktypes.DefaultEVMDisplayDenom, + Decimals: 18, + } + err = configurator. + WithExtendedEips(evmsdktypes.DefaultCosmosEVMActivators). + WithChainConfig(chainConfig). + // NOTE: we're using the 18 decimals default for the example chain + WithEVMCoinInfo(coinInfo). + Configure() + require.NoError(t, err) privKey, _ := ethsecp256k1.GenerateKey() keeper, cosmosAddr := setupFundedKeeper(t, privKey) accountKeeper := MockAccountKeeper{FundedAddr: cosmosAddr} From bb572eb5c86dd533735bcef68f6332d95cd00cd3 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 13:05:46 -0400 Subject: [PATCH 31/45] Remove test* denoms and replace with default* --- config/config.go | 6 ------ evmd/cmd/evmd/cmd/root.go | 3 ++- testutil/ibc/chain.go | 19 +++++++++---------- testutil/ibc/helpers.go | 5 ++--- testutil/ibc/testing_app.go | 3 +-- x/vm/types/params.go | 2 ++ 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/config/config.go b/config/config.go index 272a623de..d7cfce0f6 100644 --- a/config/config.go +++ b/config/config.go @@ -72,12 +72,6 @@ const ( Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key. Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic - // TestDisplayDenom defines the denomination displayed to users in client applications. - TestDisplayDenom = "atom" - // TestEvmDenom defines the non-18-decimal denomination - TestEvmDenom = "uatom" - // TestExtendedDenom defines to the default denomination used in the Cosmos EVM example chain. - TestExtendedDenom = "aatom" // BaseDenomUnit defines the precision of the base denomination. BaseDenomUnit = 18 // EVMChainID defines the EIP-155 replay-protection chain id for the current ethereum chain config. diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index 0a25222e5..0a1e8214f 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( "errors" "github.com/cosmos/evm/config" + "github.com/cosmos/evm/x/vm/types" "io" "os" @@ -126,7 +127,7 @@ func NewRootCmd() *cobra.Command { return err } - customAppTemplate, customAppConfig := config.InitAppConfig(config.TestExtendedDenom, config.EVMChainID) // TODO:VLAD - Remove this + customAppTemplate, customAppConfig := config.InitAppConfig(types.DefaultEVMExtendedDenom, config.EVMChainID) // TODO:VLAD - Remove this customTMConfig := initCometConfig() return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig) diff --git a/testutil/ibc/chain.go b/testutil/ibc/chain.go index 4c04d1619..1f8d29163 100644 --- a/testutil/ibc/chain.go +++ b/testutil/ibc/chain.go @@ -19,7 +19,6 @@ import ( cmtversion "github.com/cometbft/cometbft/version" "github.com/cosmos/evm" - "github.com/cosmos/evm/config" "github.com/cosmos/evm/crypto/ethsecp256k1" "github.com/cosmos/evm/testutil/tx" "github.com/cosmos/evm/x/vm/types" @@ -138,7 +137,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Address: acc.GetAddress().String(), Coins: sdk.NewCoins( sdk.NewCoin(sdk.DefaultBondDenom, amount), - sdk.NewCoin(config.TestExtendedDenom, amount), + sdk.NewCoin(types.DefaultEVMExtendedDenom, amount), ), } @@ -157,22 +156,22 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Description: "", DenomUnits: []*banktypes.DenomUnit{ { - Denom: config.TestExtendedDenom, + Denom: types.DefaultEVMExtendedDenom, Exponent: 0, Aliases: nil, }, { - Denom: config.TestDisplayDenom, + Denom: types.DefaultEVMDisplayDenom, Exponent: 6, Aliases: nil, }, }, - Base: config.TestExtendedDenom, - Display: config.TestDisplayDenom, - Name: config.TestEvmDenom, - Symbol: config.TestEvmDenom, - URI: config.TestEvmDenom, - URIHash: config.TestEvmDenom, + Base: types.DefaultEVMExtendedDenom, + Display: types.DefaultEVMDisplayDenom, + Name: types.DefaultEVMDenom, + Symbol: types.DefaultEVMDenom, + URI: types.DefaultEVMDenom, + URIHash: types.DefaultEVMDenom, }} app := SetupWithGenesisValSet(tb, valSet, genAccs, chainID, sdk.DefaultPowerReduction, metadata, genBals...) diff --git a/testutil/ibc/helpers.go b/testutil/ibc/helpers.go index a4379fc43..996e19bee 100644 --- a/testutil/ibc/helpers.go +++ b/testutil/ibc/helpers.go @@ -1,6 +1,7 @@ package ibctesting import ( + "github.com/cosmos/evm/x/vm/types" "math/big" "math/rand" "testing" @@ -10,8 +11,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/evm/config" - bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -25,7 +24,7 @@ func FeeCoins() sdk.Coins { // Note: evmChain requires for gas price higher than base fee (see fee_checker.go). // Other Cosmos chains using simapp don’t rely on gas prices, so this works even if simapp isn’t aware of evmChain’s TestExtendedDenom. sdkExp := new(big.Int).Exp(big.NewInt(10), big.NewInt(6), nil) - return sdk.Coins{sdk.NewInt64Coin(config.TestExtendedDenom, new(big.Int).Mul(big.NewInt(FeeAmt), sdkExp).Int64())} + return sdk.Coins{sdk.NewInt64Coin(types.DefaultEVMExtendedDenom, new(big.Int).Mul(big.NewInt(FeeAmt), sdkExp).Int64())} } // SignAndDeliver signs and delivers a transaction. No simulation occurs as the diff --git a/testutil/ibc/testing_app.go b/testutil/ibc/testing_app.go index a63999a53..5988c7b35 100644 --- a/testutil/ibc/testing_app.go +++ b/testutil/ibc/testing_app.go @@ -11,7 +11,6 @@ import ( cmttypes "github.com/cometbft/cometbft/types" dbm "github.com/cosmos/cosmos-db" - "github.com/cosmos/evm/config" evmtypes "github.com/cosmos/evm/x/vm/types" "github.com/cosmos/ibc-go/v10/modules/core/keeper" ibctesting "github.com/cosmos/ibc-go/v10/testing" @@ -125,7 +124,7 @@ func setupWithGenesisValSet(tb testing.TB, valSet *cmttypes.ValidatorSet, genAcc genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) evmGenesis := evmtypes.DefaultGenesisState() - evmGenesis.Params.EvmDenom = config.TestExtendedDenom + evmGenesis.Params.EvmDenom = evmtypes.DefaultEVMExtendedDenom evmGenesis.Params.ActiveStaticPrecompiles = evmtypes.AvailableStaticPrecompiles genesisState[evmtypes.ModuleName] = app.AppCodec().MustMarshalJSON(evmGenesis) diff --git a/x/vm/types/params.go b/x/vm/types/params.go index d808e6be2..d6991ae92 100644 --- a/x/vm/types/params.go +++ b/x/vm/types/params.go @@ -21,6 +21,8 @@ var ( DefaultEVMDenom = "uatom" // DefaultEVMExtendedDenom is the default value for the evm extended denom DefaultEVMExtendedDenom = "aatom" + // DefaultEVMDisplayDenom is the default value for the display denom in the bank metadata + DefaultEVMDisplayDenom = "atom" // DefaultEVMChainID is the default value for the evm chain ID DefaultEVMChainID uint64 = 262144 // DefaultEVMDecimals is the default value for the evm denom decimal precision From af5caaaeb13a2624607eed1b96fce8612c3acba1 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 13:43:02 -0400 Subject: [PATCH 32/45] extract var --- tests/integration/precompiles/ics20/test_integration.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/precompiles/ics20/test_integration.go b/tests/integration/precompiles/ics20/test_integration.go index 64f5d027d..ca5f18cb8 100644 --- a/tests/integration/precompiles/ics20/test_integration.go +++ b/tests/integration/precompiles/ics20/test_integration.go @@ -324,7 +324,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A s.chainA.GetContext(), ics20CallerAddr, ) - Expect(contractBalance.ToBig()).To(Equal(fundAmt.Mul(math.NewInt(1e12)).BigInt()), "Contract balance should be equal to the fund amount") + Expect(contractBalance.ToBig()).To(Equal(fundAmtConverted.BigInt()), "Contract balance should be equal to the fund amount") sendAmt := math.NewInt(1) sendAmtConverted := sendAmt.Mul(math.NewInt(1e12)) @@ -407,6 +407,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A // send some tokens to the contract address fundAmt := math.NewInt(100) + fundAmtConverted := fundAmt.Mul(math.NewInt(1e12)) err = evmAppA.GetBankKeeper().SendCoins( s.chainA.GetContext(), s.chainA.SenderAccount.GetAddress(), @@ -419,7 +420,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, evmAppCreator ibctesting.A common.BytesToAddress(ics20CallerAddr.Bytes()), ) // check contract balance - Expect(contractBalance.ToBig()).To(Equal(fundAmt.Mul(math.NewInt(1e12)).BigInt()), "Contract balance should be equal to the fund amount") + Expect(contractBalance.ToBig()).To(Equal(fundAmtConverted.BigInt()), "Contract balance should be equal to the fund amount") sendAmt := math.NewInt(1) callArgs := testutiltypes.CallArgs{ From e8ead269cdde5c33a80ff1949e764e057909339c Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 13:43:38 -0400 Subject: [PATCH 33/45] match vars --- tests/integration/precompiles/werc20/test_integration.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/precompiles/werc20/test_integration.go b/tests/integration/precompiles/werc20/test_integration.go index ea5e1a0e5..b0390d560 100644 --- a/tests/integration/precompiles/werc20/test_integration.go +++ b/tests/integration/precompiles/werc20/test_integration.go @@ -548,7 +548,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, create network.CreateEvmAp _, ethRes, err := is.factory.CallContractAndCheckLogs(txSender.Priv, txArgs, decimalsArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") - var decimals uint8 + var decimals uint32 err = is.precompile.UnpackIntoInterface(&decimals, erc20.DecimalsMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack result") @@ -556,7 +556,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, create network.CreateEvmAp ChainID: is.network.GetChainID(), EVMChainID: is.network.GetEIP155ChainID().Uint64(), }] - Expect(decimals).To(Equal(uint8(coinInfo.Decimals)), "expected different decimals") //nolint:gosec // G115 + Expect(decimals).To(Equal(uint8(coinInfo.Decimals)), "expected different decimals") }, ) }) From cc38dfbc1771a555360cb4811e0484c5699a0610 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 13:49:40 -0400 Subject: [PATCH 34/45] remove chain config from configurator --- ante/evm/fee_checker_test.go | 1 - ante/evm/mono_decorator_test.go | 1 - evmd/tests/integration/x_vm_test.go | 1 - mempool/blockchain_test.go | 2 +- tests/integration/ante/ante_test_suite.go | 1 - tests/integration/x/vm/keeper_test_suite.go | 1 - tests/integration/x/vm/test_grpc_query.go | 2 -- x/vm/module.go | 1 - x/vm/types/configurator.go | 8 -------- 9 files changed, 1 insertion(+), 17 deletions(-) diff --git a/ante/evm/fee_checker_test.go b/ante/evm/fee_checker_test.go index b03d2c943..fdd2db012 100644 --- a/ante/evm/fee_checker_test.go +++ b/ante/evm/fee_checker_test.go @@ -46,7 +46,6 @@ func TestSDKTxFeeChecker(t *testing.T) { } err := configurator. WithExtendedEips(evmtypes.DefaultCosmosEVMActivators). - WithChainConfig(ethCfg). // NOTE: we're using the 18 decimals default for the example chain WithEVMCoinInfo(config.ChainsCoinInfo[chainID]). Configure() diff --git a/ante/evm/mono_decorator_test.go b/ante/evm/mono_decorator_test.go index d294bc123..72e205993 100644 --- a/ante/evm/mono_decorator_test.go +++ b/ante/evm/mono_decorator_test.go @@ -209,7 +209,6 @@ func TestMonoDecorator(t *testing.T) { } err = configurator. WithExtendedEips(evmsdktypes.DefaultCosmosEVMActivators). - WithChainConfig(chainConfig). // NOTE: we're using the 18 decimals default for the example chain WithEVMCoinInfo(coinInfo). Configure() diff --git a/evmd/tests/integration/x_vm_test.go b/evmd/tests/integration/x_vm_test.go index 76030a1a3..297b3aa74 100644 --- a/evmd/tests/integration/x_vm_test.go +++ b/evmd/tests/integration/x_vm_test.go @@ -43,7 +43,6 @@ func BenchmarkGasEstimation(b *testing.B) { configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() err := configurator. - WithChainConfig(chainConfig). WithEVMCoinInfo(types.EvmCoinInfo{ Denom: denom, ExtendedDenom: extendedDenom, diff --git a/mempool/blockchain_test.go b/mempool/blockchain_test.go index c566dfd5f..6e076867c 100644 --- a/mempool/blockchain_test.go +++ b/mempool/blockchain_test.go @@ -57,7 +57,7 @@ func TestBlockchainRaceCondition(t *testing.T) { mockVMKeeper.On("ForEachStorage", mock.Anything, common.Address{}, mock.AnythingOfType("func(common.Hash, common.Hash) bool")).Maybe() mockVMKeeper.On("KVStoreKeys").Return(make(map[string]*storetypes.KVStoreKey)).Maybe() - err := vmtypes.NewEVMConfigurator().WithEVMCoinInfo(config.ChainsCoinInfo[config.EighteenDecimalsChainID]).WithChainConfig(ethCfg).Configure() + err := vmtypes.NewEVMConfigurator().WithEVMCoinInfo(config.ChainsCoinInfo[config.EighteenDecimalsChainID]).Configure() require.NoError(t, err) // Mock context callback that returns a valid context diff --git a/tests/integration/ante/ante_test_suite.go b/tests/integration/ante/ante_test_suite.go index 369d6c212..320d4a3be 100644 --- a/tests/integration/ante/ante_test_suite.go +++ b/tests/integration/ante/ante_test_suite.go @@ -122,7 +122,6 @@ func (s *AnteTestSuite) SetupTest() { configurator := evmtypes.NewEVMConfigurator() configurator.ResetTestConfig() err := configurator. - WithChainConfig(chainConfig). WithEVMCoinInfo(evmtypes.EvmCoinInfo{ Denom: denom, ExtendedDenom: extendedDenom, diff --git a/tests/integration/x/vm/keeper_test_suite.go b/tests/integration/x/vm/keeper_test_suite.go index 532efdec8..5f4aa1c52 100644 --- a/tests/integration/x/vm/keeper_test_suite.go +++ b/tests/integration/x/vm/keeper_test_suite.go @@ -111,7 +111,6 @@ func (s *KeeperTestSuite) SetupTest() { err := evmtypes.SetChainConfig(chainConfig) s.Require().NoError(err) err = configurator. - WithChainConfig(chainConfig). WithEVMCoinInfo(evmtypes.EvmCoinInfo{ Denom: denom, ExtendedDenom: extendedDenom, diff --git a/tests/integration/x/vm/test_grpc_query.go b/tests/integration/x/vm/test_grpc_query.go index c838f4fc3..6cd06d8d8 100644 --- a/tests/integration/x/vm/test_grpc_query.go +++ b/tests/integration/x/vm/test_grpc_query.go @@ -1607,7 +1607,6 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { err := types.SetChainConfig(chainConfig) s.Require().NoError(err) err = configurator. - WithChainConfig(chainConfig). WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.ExampleChainID]). Configure() s.Require().NoError(err) @@ -1665,7 +1664,6 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { err = types.SetChainConfig(chainConfig) s.Require().NoError(err) err = configurator. - WithChainConfig(chainConfig). WithEVMCoinInfo(coinInfo). Configure() s.Require().NoError(err) diff --git a/x/vm/module.go b/x/vm/module.go index 797fe4d5c..dd19bb686 100644 --- a/x/vm/module.go +++ b/x/vm/module.go @@ -259,7 +259,6 @@ func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeep //} err := configurator. WithExtendedEips(types.DefaultCosmosEVMActivators). - WithChainConfig(types.GetChainConfig()). // NOTE: we're using the 18 decimals default for the example chain WithEVMCoinInfo(coinInfo). Configure() diff --git a/x/vm/types/configurator.go b/x/vm/types/configurator.go index 44c1fd8ed..b661edf71 100644 --- a/x/vm/types/configurator.go +++ b/x/vm/types/configurator.go @@ -18,7 +18,6 @@ type EVMConfigurator struct { sealed bool extendedEIPs map[int]func(*vm.JumpTable) extendedDefaultExtraEIPs []int64 - chainConfig *ChainConfig evmCoinInfo EvmCoinInfo } @@ -41,13 +40,6 @@ func (ec *EVMConfigurator) WithExtendedDefaultExtraEIPs(eips ...int64) *EVMConfi return ec } -// WithChainConfig allows to define a custom `chainConfig` to be used in the -// EVM. -func (ec *EVMConfigurator) WithChainConfig(cc *ChainConfig) *EVMConfigurator { - ec.chainConfig = cc - return ec -} - // WithEVMCoinInfo allows to define the denom and decimals of the token used as the // EVM token. func (ec *EVMConfigurator) WithEVMCoinInfo(coinInfo EvmCoinInfo) *EVMConfigurator { From 2d283fafcffd9ce3421743d92a1bbe0519e3d0c7 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 13:59:38 -0400 Subject: [PATCH 35/45] undo uint8 change --- tests/integration/precompiles/werc20/test_integration.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/precompiles/werc20/test_integration.go b/tests/integration/precompiles/werc20/test_integration.go index b0390d560..ea5e1a0e5 100644 --- a/tests/integration/precompiles/werc20/test_integration.go +++ b/tests/integration/precompiles/werc20/test_integration.go @@ -548,7 +548,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, create network.CreateEvmAp _, ethRes, err := is.factory.CallContractAndCheckLogs(txSender.Priv, txArgs, decimalsArgs, passCheck) Expect(err).ToNot(HaveOccurred(), "unexpected result calling contract") - var decimals uint32 + var decimals uint8 err = is.precompile.UnpackIntoInterface(&decimals, erc20.DecimalsMethod, ethRes.Ret) Expect(err).ToNot(HaveOccurred(), "failed to unpack result") @@ -556,7 +556,7 @@ func TestPrecompileIntegrationTestSuite(t *testing.T, create network.CreateEvmAp ChainID: is.network.GetChainID(), EVMChainID: is.network.GetEIP155ChainID().Uint64(), }] - Expect(decimals).To(Equal(uint8(coinInfo.Decimals)), "expected different decimals") + Expect(decimals).To(Equal(uint8(coinInfo.Decimals)), "expected different decimals") //nolint:gosec // G115 }, ) }) From 97e8c3897cf00eab07592b6ba0af758d5a3ae62b Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 14:01:02 -0400 Subject: [PATCH 36/45] comment fixes --- x/vm/module.go | 4 ---- x/vm/types/config_testing.go | 7 ++++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/x/vm/module.go b/x/vm/module.go index dd19bb686..d4c205168 100644 --- a/x/vm/module.go +++ b/x/vm/module.go @@ -253,10 +253,6 @@ func SetGlobalConfigVariables(ctx sdk.Context, vmKeeper *keeper.Keeper, bankKeep } configurator := types.NewEVMConfigurator() - // if withReset { - // // reset configuration to set the new one - // configurator.ResetTestConfig() - //} err := configurator. WithExtendedEips(types.DefaultCosmosEVMActivators). // NOTE: we're using the 18 decimals default for the example chain diff --git a/x/vm/types/config_testing.go b/x/vm/types/config_testing.go index e10a94106..fe16fab17 100644 --- a/x/vm/types/config_testing.go +++ b/x/vm/types/config_testing.go @@ -9,6 +9,7 @@ package types import ( "errors" + "fmt" "github.com/ethereum/go-ethereum/core/vm" geth "github.com/ethereum/go-ethereum/params" ) @@ -21,9 +22,9 @@ var testChainConfig *ChainConfig func (ec *EVMConfigurator) Configure() error { // If Configure method has been already used in the object, return // an error to avoid overriding configuration. - //if ec.sealed { - // return fmt.Errorf("error configuring EVMConfigurator: already sealed and cannot be modified") - //} + if ec.sealed { + return fmt.Errorf("error configuring EVMConfigurator: already sealed and cannot be modified") + } if err := setTestingEVMCoinInfo(ec.evmCoinInfo); err != nil { return err From 0d932c04d1186883460032f4513037c8e757c534 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 14:03:53 -0400 Subject: [PATCH 37/45] Auto stash before merge of "vlad/remove-app-options" and "origin/main" --- evmd/cmd/evmd/cmd/root.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index 099069d57..48501f81a 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -2,13 +2,10 @@ package cmd import ( "errors" - "github.com/cosmos/evm/config" "github.com/cosmos/evm/x/vm/types" "io" "os" - "github.com/cosmos/evm/config" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/spf13/cast" "github.com/spf13/cobra" @@ -20,6 +17,7 @@ import ( dbm "github.com/cosmos/cosmos-db" cosmosevmcmd "github.com/cosmos/evm/client" evmdebug "github.com/cosmos/evm/client/debug" + "github.com/cosmos/evm/config" cosmosevmkeyring "github.com/cosmos/evm/crypto/keyring" "github.com/cosmos/evm/evmd" cosmosevmserver "github.com/cosmos/evm/server" From a16bba83c26119ede45e738994d1253dabb29663 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 14:04:12 -0400 Subject: [PATCH 38/45] set chain config in vm integ tests --- evmd/tests/integration/x_vm_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/evmd/tests/integration/x_vm_test.go b/evmd/tests/integration/x_vm_test.go index 297b3aa74..e0ce08f09 100644 --- a/evmd/tests/integration/x_vm_test.go +++ b/evmd/tests/integration/x_vm_test.go @@ -42,7 +42,9 @@ func BenchmarkGasEstimation(b *testing.B) { configurator := types.NewEVMConfigurator() configurator.ResetTestConfig() - err := configurator. + err := types.SetChainConfig(chainConfig) + require.NoError(b, err) + err = configurator. WithEVMCoinInfo(types.EvmCoinInfo{ Denom: denom, ExtendedDenom: extendedDenom, From 949698c77656848f30ea16ce9bd5a2751ed0de3e Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 14:23:46 -0400 Subject: [PATCH 39/45] lint --- testutil/ibc/helpers.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testutil/ibc/helpers.go b/testutil/ibc/helpers.go index 996e19bee..658c6f9af 100644 --- a/testutil/ibc/helpers.go +++ b/testutil/ibc/helpers.go @@ -1,7 +1,6 @@ package ibctesting import ( - "github.com/cosmos/evm/x/vm/types" "math/big" "math/rand" "testing" @@ -11,6 +10,8 @@ import ( abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/evm/x/vm/types" + bam "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" From 1a51a6f2988d5a556a118f0ae82a0aeb26325b40 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 8 Oct 2025 14:24:48 -0400 Subject: [PATCH 40/45] fix error on test --- x/vm/types/configurator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/vm/types/configurator_test.go b/x/vm/types/configurator_test.go index 00fa54d53..a278fa62d 100644 --- a/x/vm/types/configurator_test.go +++ b/x/vm/types/configurator_test.go @@ -18,7 +18,7 @@ func TestEVMConfigurator(t *testing.T) { err = evmConfigurator.Configure() require.Error(t, err) - require.Contains(t, err.Error(), "already set", "expected different error") + require.Contains(t, err.Error(), "already sealed", "expected different error") } func TestExtendedEips(t *testing.T) { From cbbaa4467fce517db410aec1960491ade58810f9 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 11:34:16 -0400 Subject: [PATCH 41/45] fix denoms for ibc chain --- testutil/ibc/chain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testutil/ibc/chain.go b/testutil/ibc/chain.go index 1f8d29163..74fdf63e6 100644 --- a/testutil/ibc/chain.go +++ b/testutil/ibc/chain.go @@ -156,7 +156,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Description: "", DenomUnits: []*banktypes.DenomUnit{ { - Denom: types.DefaultEVMExtendedDenom, + Denom: types.DefaultEVMDenom, Exponent: 0, Aliases: nil, }, @@ -166,7 +166,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Aliases: nil, }, }, - Base: types.DefaultEVMExtendedDenom, + Base: types.DefaultEVMDenom, Display: types.DefaultEVMDisplayDenom, Name: types.DefaultEVMDenom, Symbol: types.DefaultEVMDenom, From 0ed773a1702b0bc9b5dcc39e8aeeea305e8755ca Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 11:41:21 -0400 Subject: [PATCH 42/45] Revert "fix denoms for ibc chain" This reverts commit cbbaa4467fce517db410aec1960491ade58810f9. --- testutil/ibc/chain.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testutil/ibc/chain.go b/testutil/ibc/chain.go index 74fdf63e6..1f8d29163 100644 --- a/testutil/ibc/chain.go +++ b/testutil/ibc/chain.go @@ -156,7 +156,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Description: "", DenomUnits: []*banktypes.DenomUnit{ { - Denom: types.DefaultEVMDenom, + Denom: types.DefaultEVMExtendedDenom, Exponent: 0, Aliases: nil, }, @@ -166,7 +166,7 @@ func NewTestChainWithValSet(tb testing.TB, isEVM bool, coord *Coordinator, chain Aliases: nil, }, }, - Base: types.DefaultEVMDenom, + Base: types.DefaultEVMExtendedDenom, Display: types.DefaultEVMDisplayDenom, Name: types.DefaultEVMDenom, Symbol: types.DefaultEVMDenom, From 0b44e5b6a8be61c29edf7882f5fbfcbfaf689d1c Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 11:43:53 -0400 Subject: [PATCH 43/45] use app options chain id instead of passing param --- Makefile | 26 +++++++++++++------------- encoding/config.go | 4 ++-- evmd/app.go | 7 +++---- evmd/cmd/evmd/cmd/creator.go | 3 --- evmd/cmd/evmd/cmd/root.go | 6 ++---- evmd/cmd/evmd/cmd/testnet.go | 2 -- evmd/test_helpers.go | 5 ++--- evmd/tests/integration/create_app.go | 2 -- evmd/tests/network/network.go | 9 +++------ 9 files changed, 25 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index 96ebe8242..5bd994ea3 100644 --- a/Makefile +++ b/Makefile @@ -147,15 +147,15 @@ test-race: run-tests test-evmd: ARGS=-timeout=15m test-evmd: - @cd evmd && go test -race -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(PACKAGES_EVMD) + @cd evmd && go test -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 -race -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage.txt ./... + @go test -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage.txt ./... @echo "πŸ” Running evmd coverage..." - @cd evmd && go test -race -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage_evmd.txt ./... + @cd evmd && go test -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 -race -tags=test -mod=readonly -timeout=15m $(PACKAGES_NOSIMULATION) + @go test -tags=test -mod=readonly -timeout=15m $(PACKAGES_NOSIMULATION) @echo "πŸ” Running evmd module tests..." - @cd evmd && go test -race -tags=test -mod=readonly -timeout=15m $(PACKAGES_EVMD) + @cd evmd && go test -tags=test -mod=readonly -timeout=15m $(PACKAGES_EVMD) run-tests: ifneq (,$(shell which tparse 2>/dev/null)) - go test -race -tags=test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse + go test -tags=test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse else - go test -race -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) + go test -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 -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 + 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 test-scripts: @echo "Running scripts tests" @@ -201,7 +201,7 @@ test-solidity: .PHONY: run-tests test test-all $(TEST_TARGETS) benchmark: - @go test -race -tags=test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) + @go test -tags=test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION) .PHONY: benchmark diff --git a/encoding/config.go b/encoding/config.go index aa0c25629..b714f6dea 100644 --- a/encoding/config.go +++ b/encoding/config.go @@ -1,10 +1,10 @@ package encoding import ( + "github.com/cosmos/evm/ethereum/eip712" "google.golang.org/protobuf/reflect/protoreflect" enccodec "github.com/cosmos/evm/encoding/codec" - "github.com/cosmos/evm/ethereum/eip712" erc20types "github.com/cosmos/evm/x/erc20/types" evmtypes "github.com/cosmos/evm/x/vm/types" "github.com/cosmos/gogoproto/proto" @@ -52,11 +52,11 @@ func MakeConfig(evmChainID uint64) Config { codec := amino.NewProtoCodec(interfaceRegistry) enccodec.RegisterLegacyAminoCodec(cdc) enccodec.RegisterInterfaces(interfaceRegistry) + eip712.SetEncodingConfig(cdc, interfaceRegistry, evmChainID) // This is needed for the EIP712 txs because currently is using // the deprecated method legacytx.StdSignBytes legacytx.RegressionTestingAminoCodec = cdc - eip712.SetEncodingConfig(cdc, interfaceRegistry, evmChainID) return Config{ InterfaceRegistry: interfaceRegistry, diff --git a/evmd/app.go b/evmd/app.go index 095fb9c88..1dc54f4fc 100644 --- a/evmd/app.go +++ b/evmd/app.go @@ -210,10 +210,10 @@ func NewExampleApp( traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, - evmChainID uint64, // TODO:VLAD - Remove this baseAppOptions ...func(*baseapp.BaseApp), ) *EVMD { - encodingConfig := evmosencoding.MakeConfig(evmChainID) // TODO:VLAD - Remove chain id from this + evmChainID := cast.ToUint64(appOpts.Get(srvflags.EVMChainID)) + encodingConfig := evmosencoding.MakeConfig(evmChainID) appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino @@ -439,7 +439,6 @@ func NewExampleApp( // Set up EVM keeper tracer := cast.ToString(appOpts.Get(srvflags.EVMTracer)) - evmChainId := cast.ToUint64(appOpts.Get(srvflags.EVMChainID)) // NOTE: it's required to set up the EVM keeper before the ERC-20 keeper, because it is used in its instantiation. app.EVMKeeper = evmkeeper.NewKeeper( @@ -452,7 +451,7 @@ func NewExampleApp( app.FeeMarketKeeper, &app.ConsensusParamsKeeper, &app.Erc20Keeper, - evmChainId, + evmChainID, tracer, ).WithStaticPrecompiles( precompiletypes.DefaultStaticPrecompiles( diff --git a/evmd/cmd/evmd/cmd/creator.go b/evmd/cmd/evmd/cmd/creator.go index 861892f1c..8ba418dcd 100644 --- a/evmd/cmd/evmd/cmd/creator.go +++ b/evmd/cmd/evmd/cmd/creator.go @@ -2,7 +2,6 @@ package cmd import ( "errors" - "github.com/cosmos/evm/config" "io" "path/filepath" @@ -94,7 +93,6 @@ func (a appCreator) newApp( traceStore, true, simtestutil.EmptyAppOptions{}, - config.EVMChainID, baseappOptions..., ) } @@ -136,7 +134,6 @@ func (a appCreator) appExport( traceStore, loadLatest, appOpts, - config.EVMChainID, ) if height != -1 { diff --git a/evmd/cmd/evmd/cmd/root.go b/evmd/cmd/evmd/cmd/root.go index 48501f81a..f535093be 100644 --- a/evmd/cmd/evmd/cmd/root.go +++ b/evmd/cmd/evmd/cmd/root.go @@ -61,7 +61,6 @@ func NewRootCmd() *cobra.Command { nil, true, simtestutil.EmptyAppOptions{}, - config.EVMChainID, ) encodingConfig := sdktestutil.TestEncodingConfig{ @@ -311,7 +310,6 @@ func newApp( return evmd.NewExampleApp( logger, db, traceStore, true, appOpts, - config.EVMChainID, // TODO:VLAD - Remove this baseappOptions..., ) } @@ -352,13 +350,13 @@ func appExport( } if height != -1 { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, config.EVMChainID, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove appoptions and evmchainid + exampleApp = evmd.NewExampleApp(logger, db, traceStore, false, appOpts, baseapp.SetChainID(chainID)) if err := exampleApp.LoadHeight(height); err != nil { return servertypes.ExportedApp{}, err } } else { - exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, config.EVMChainID, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid + exampleApp = evmd.NewExampleApp(logger, db, traceStore, true, appOpts, baseapp.SetChainID(chainID)) // TODO:VLAD - Remove // TODO:VLAD - Remove appoptions and evmchainid } return exampleApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport) diff --git a/evmd/cmd/evmd/cmd/testnet.go b/evmd/cmd/evmd/cmd/testnet.go index 67de118e7..5c6d018d2 100644 --- a/evmd/cmd/evmd/cmd/testnet.go +++ b/evmd/cmd/evmd/cmd/testnet.go @@ -697,7 +697,6 @@ func NewTestNetworkFixture() network.TestFixture { nil, true, simtestutil.EmptyAppOptions{}, - config.EVMChainID, ) appCtr := func(val network.ValidatorI) servertypes.Application { @@ -707,7 +706,6 @@ func NewTestNetworkFixture() network.TestFixture { nil, true, simtestutil.EmptyAppOptions{}, - config.EVMChainID, ) } diff --git a/evmd/test_helpers.go b/evmd/test_helpers.go index 2644f233d..b8fb1386d 100644 --- a/evmd/test_helpers.go +++ b/evmd/test_helpers.go @@ -56,7 +56,7 @@ func setup(withGenesis bool, invCheckPeriod uint, chainID string, evmChainID uin appOptions[flags.FlagHome] = defaultNodeHome appOptions[server.FlagInvCheckPeriod] = invCheckPeriod - app := NewExampleApp(log.NewNopLogger(), db, nil, true, appOptions, evmChainID, baseapp.SetChainID(chainID)) + app := NewExampleApp(log.NewNopLogger(), db, nil, true, appOptions, baseapp.SetChainID(chainID)) if withGenesis { return app, app.DefaultGenesis() } @@ -130,14 +130,13 @@ func SetupWithGenesisValSet(t *testing.T, chainID string, evmChainID uint64, val // SetupTestingApp initializes the IBC-go testing application // need to keep this design to comply with the ibctesting SetupTestingApp func // and be able to set the chainID for the tests properly -func SetupTestingApp(chainID string, evmChainID uint64) func() (ibctesting.TestingApp, map[string]json.RawMessage) { +func SetupTestingApp(chainID string) func() (ibctesting.TestingApp, map[string]json.RawMessage) { return func() (ibctesting.TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() app := NewExampleApp( log.NewNopLogger(), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(defaultNodeHome), - evmChainID, baseapp.SetChainID(chainID), ) return app, app.DefaultGenesis() diff --git a/evmd/tests/integration/create_app.go b/evmd/tests/integration/create_app.go index 6d2d98f08..5582468f0 100644 --- a/evmd/tests/integration/create_app.go +++ b/evmd/tests/integration/create_app.go @@ -44,7 +44,6 @@ func CreateEvmd(chainID string, evmChainID uint64, customBaseAppOptions ...func( nil, loadLatest, appOptions, - evmChainID, baseAppOptions..., ) } @@ -58,7 +57,6 @@ func SetupEvmd() (ibctesting.TestingApp, map[string]json.RawMessage) { nil, true, NewAppOptionsWithFlagHomeAndChainID("", constants.ExampleEIP155ChainID), - constants.ExampleEIP155ChainID, ) // disable base fee for testing genesisState := app.DefaultGenesis() diff --git a/evmd/tests/network/network.go b/evmd/tests/network/network.go index a1516cc96..ffe926440 100644 --- a/evmd/tests/network/network.go +++ b/evmd/tests/network/network.go @@ -23,7 +23,6 @@ import ( "golang.org/x/sync/errgroup" "google.golang.org/grpc" - cmtrand "github.com/cometbft/cometbft/libs/rand" "github.com/cometbft/cometbft/node" cmtclient "github.com/cometbft/cometbft/rpc/client" @@ -103,13 +102,12 @@ type Config struct { // testing requirements. func DefaultConfig() Config { chainID := "evmos-1" - evmChainID := uint64(cmtrand.Int63n(9999999999999) + 1) //nolint:gosec // G115 // won't exceed uint64 dir, err := os.MkdirTemp("", "simapp") if err != nil { panic(fmt.Sprintf("failed creating temporary directory: %v", err)) } defer os.RemoveAll(dir) - tempApp := evmd.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), evmChainID, baseapp.SetChainID(chainID)) + tempApp := evmd.NewExampleApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(dir), baseapp.SetChainID(chainID)) cfg := Config{ Codec: tempApp.AppCodec(), @@ -117,7 +115,7 @@ func DefaultConfig() Config { LegacyAmino: tempApp.LegacyAmino(), InterfaceRegistry: tempApp.InterfaceRegistry(), AccountRetriever: authtypes.AccountRetriever{}, - AppConstructor: NewAppConstructor(chainID, evmChainID), + AppConstructor: NewAppConstructor(chainID), GenesisState: tempApp.DefaultGenesis(), TimeoutCommit: 3 * time.Second, ChainID: chainID, @@ -137,12 +135,11 @@ func DefaultConfig() Config { } // NewAppConstructor returns a new Cosmos EVM AppConstructor -func NewAppConstructor(chainID string, evmChainID uint64) AppConstructor { +func NewAppConstructor(chainID string) AppConstructor { return func(val Validator) servertypes.Application { return evmd.NewExampleApp( val.Ctx.Logger, dbm.NewMemDB(), nil, true, simutils.NewAppOptionsWithFlagHome(val.Ctx.Config.RootDir), - evmChainID, baseapp.SetPruning(pruningtypes.NewPruningOptionsFromString(val.AppConfig.Pruning)), baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), baseapp.SetChainID(chainID), From e56e942739b6daefb0197993835989b44e7d6d84 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 11:44:03 -0400 Subject: [PATCH 44/45] lints --- encoding/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoding/config.go b/encoding/config.go index b714f6dea..549a932e1 100644 --- a/encoding/config.go +++ b/encoding/config.go @@ -1,10 +1,10 @@ package encoding import ( - "github.com/cosmos/evm/ethereum/eip712" "google.golang.org/protobuf/reflect/protoreflect" enccodec "github.com/cosmos/evm/encoding/codec" + "github.com/cosmos/evm/ethereum/eip712" erc20types "github.com/cosmos/evm/x/erc20/types" evmtypes "github.com/cosmos/evm/x/vm/types" "github.com/cosmos/gogoproto/proto" From 8d966ffa19ba579d3b4bc333b33d790b290541ae Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 9 Oct 2025 11:44:38 -0400 Subject: [PATCH 45/45] revert make race --- Makefile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 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