diff --git a/CHANGELOG.md b/CHANGELOG.md index 850d104ba4..4cde95bf2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### State Machine Breaking - [#1232](https://github.com/crypto-org-chain/cronos/pull/1232) Adjust require gas in relayer precompile to be closed with actual consumed. +- [#1247](https://github.com/crypto-org-chain/cronos/pull/1247) Update ethermint to develop, go-ethereum to `v1.11.2`. - [#1235](https://github.com/crypto-org-chain/cronos/pull/1235) Add channel detail in ica packet callback. ### Improvements diff --git a/app/app.go b/app/app.go index 0d4f74ec5f..3a8a3f0a2e 100644 --- a/app/app.go +++ b/app/app.go @@ -152,13 +152,14 @@ import ( cronosprecompiles "github.com/crypto-org-chain/cronos/v2/x/cronos/keeper/precompiles" "github.com/crypto-org-chain/cronos/v2/x/cronos/middleware" cronostypes "github.com/crypto-org-chain/cronos/v2/x/cronos/types" - "github.com/ethereum/go-ethereum/core/vm" "github.com/crypto-org-chain/cronos/v2/client/docs" // Force-load the tracer engines to trigger registration + "github.com/ethereum/go-ethereum/core/vm" _ "github.com/ethereum/go-ethereum/eth/tracers/js" _ "github.com/ethereum/go-ethereum/eth/tracers/native" + ethparams "github.com/ethereum/go-ethereum/params" // force register the extension json-rpc. _ "github.com/crypto-org-chain/cronos/v2/x/cronos/rpc" @@ -535,9 +536,13 @@ func New( app.FeeMarketKeeper, tracer, evmS, - []vm.PrecompiledContract{ - cronosprecompiles.NewRelayerContract(app.IBCKeeper, appCodec, app.Logger()), - cronosprecompiles.NewIcaContract(&app.ICAAuthKeeper, &app.CronosKeeper, appCodec, gasConfig), + []evmkeeper.CustomContractFn{ + func(rules ethparams.Rules) vm.PrecompiledContract { + return cronosprecompiles.NewRelayerContract(app.IBCKeeper, appCodec, rules, app.Logger()) + }, + func(rules ethparams.Rules) vm.PrecompiledContract { + return cronosprecompiles.NewIcaContract(&app.ICAAuthKeeper, &app.CronosKeeper, appCodec, gasConfig) + }, }, allKeys, ) @@ -1155,7 +1160,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(ibcexported.ModuleName) paramsKeeper.Subspace(icacontrollertypes.SubModuleName) paramsKeeper.Subspace(icaauthtypes.ModuleName) - paramsKeeper.Subspace(evmtypes.ModuleName).WithKeyTable(evmtypes.ParamKeyTable()) //nolint: staticcheck + paramsKeeper.Subspace(evmtypes.ModuleName) paramsKeeper.Subspace(feemarkettypes.ModuleName).WithKeyTable(feemarkettypes.ParamKeyTable()) if !skipGravity { paramsKeeper.Subspace(gravitytypes.ModuleName) diff --git a/app/upgrades.go b/app/upgrades.go index 04dae04776..fe504c1cac 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -30,6 +30,7 @@ import ( ibctmmigrations "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint/migrations" cronostypes "github.com/crypto-org-chain/cronos/v2/x/cronos/types" icaauthtypes "github.com/crypto-org-chain/cronos/v2/x/icaauth/types" + v0evmtypes "github.com/evmos/ethermint/x/evm/migrations/v0/types" evmtypes "github.com/evmos/ethermint/x/evm/types" feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" ) @@ -63,7 +64,7 @@ func (app *App) RegisterUpgradeHandlers(cdc codec.BinaryCodec, clientKeeper clie case icaauthtypes.ModuleName: keyTable = icaauthtypes.ParamKeyTable() case evmtypes.ModuleName: - keyTable = evmtypes.ParamKeyTable() //nolint:staticcheck + keyTable = v0evmtypes.ParamKeyTable() //nolint:staticcheck case feemarkettypes.ModuleName: keyTable = feemarkettypes.ParamKeyTable() case cronostypes.ModuleName: diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 78f872b4da..2de16873f2 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -2187,6 +2187,12 @@ paths: required: false type: string format: int64 + - name: overrides + description: state overrides encoded as json. + in: query + required: false + type: string + format: byte tags: - Query /ethermint/evm/v1/eth_call: @@ -2517,6 +2523,12 @@ paths: required: false type: string format: int64 + - name: overrides + description: state overrides encoded as json. + in: query + required: false + type: string + format: byte tags: - Query /ethermint/evm/v1/params: @@ -2645,16 +2657,21 @@ paths: title: >- merge_netsplit_block: Virtual fork after The Merge to use as a network splitter - shanghai_block: + shanghai_time: type: string title: >- - shanghai_block switch block (nil = no fork, 0 = - already on shanghai) - cancun_block: + shanghai switch time (nil = no fork, 0 = already on + shanghai) + cancun_time: type: string title: >- - cancun_block switch block (nil = no fork, 0 = already - on cancun) + cancun switch time (nil = no fork, 0 = already on + cancun) + prague_time: + type: string + title: >- + prague switch time (nil = no fork, 0 = already on + prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -3451,15 +3468,18 @@ paths: in: query required: false type: string - - name: trace_config.overrides.shanghai_block - description: >- - shanghai_block switch block (nil = no fork, 0 = already on - shanghai). + - name: trace_config.overrides.shanghai_time + description: shanghai switch time (nil = no fork, 0 = already on shanghai). + in: query + required: false + type: string + - name: trace_config.overrides.cancun_time + description: cancun switch time (nil = no fork, 0 = already on cancun). in: query required: false type: string - - name: trace_config.overrides.cancun_block - description: cancun_block switch block (nil = no fork, 0 = already on cancun). + - name: trace_config.overrides.prague_time + description: prague switch time (nil = no fork, 0 = already on prague). in: query required: false type: string @@ -3787,10 +3807,14 @@ paths: in: query required: false type: string + - name: msg.deprecated_from + in: query + required: false + type: string - name: msg.from description: >- - from is the ethereum signer address in hex format. This address - value is checked + from is the bytes of ethereum signer address. This address value is + checked against the address derived from the signature (V, R, S) using the @@ -3798,6 +3822,7 @@ paths: in: query required: false type: string + format: byte - name: trace_config.tracer description: tracer is a custom javascript tracer. in: query @@ -3958,15 +3983,18 @@ paths: in: query required: false type: string - - name: trace_config.overrides.shanghai_block - description: >- - shanghai_block switch block (nil = no fork, 0 = already on - shanghai). + - name: trace_config.overrides.shanghai_time + description: shanghai switch time (nil = no fork, 0 = already on shanghai). + in: query + required: false + type: string + - name: trace_config.overrides.cancun_time + description: cancun switch time (nil = no fork, 0 = already on cancun). in: query required: false type: string - - name: trace_config.overrides.cancun_block - description: cancun_block switch block (nil = no fork, 0 = already on cancun). + - name: trace_config.overrides.prague_time + description: prague switch time (nil = no fork, 0 = already on prague). in: query required: false type: string @@ -44219,11 +44247,14 @@ definitions: hash: type: string title: hash of the transaction in hex format + deprecated_from: + type: string from: type: string + format: byte title: >- - from is the ethereum signer address in hex format. This address value - is checked + from is the bytes of ethereum signer address. This address value is + checked against the address derived from the signature (V, R, S) using the @@ -44734,12 +44765,15 @@ definitions: title: >- merge_netsplit_block: Virtual fork after The Merge to use as a network splitter - shanghai_block: + shanghai_time: type: string - title: shanghai_block switch block (nil = no fork, 0 = already on shanghai) - cancun_block: + title: shanghai switch time (nil = no fork, 0 = already on shanghai) + cancun_time: type: string - title: cancun_block switch block (nil = no fork, 0 = already on cancun) + title: cancun switch time (nil = no fork, 0 = already on cancun) + prague_time: + type: string + title: prague switch time (nil = no fork, 0 = already on prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -44871,14 +44905,15 @@ definitions: title: >- merge_netsplit_block: Virtual fork after The Merge to use as a network splitter - shanghai_block: + shanghai_time: type: string - title: >- - shanghai_block switch block (nil = no fork, 0 = already on - shanghai) - cancun_block: + title: shanghai switch time (nil = no fork, 0 = already on shanghai) + cancun_time: type: string - title: cancun_block switch block (nil = no fork, 0 = already on cancun) + title: cancun switch time (nil = no fork, 0 = already on cancun) + prague_time: + type: string + title: prague switch time (nil = no fork, 0 = already on prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -45066,16 +45101,15 @@ definitions: title: >- merge_netsplit_block: Virtual fork after The Merge to use as a network splitter - shanghai_block: + shanghai_time: type: string - title: >- - shanghai_block switch block (nil = no fork, 0 = already on - shanghai) - cancun_block: + title: shanghai switch time (nil = no fork, 0 = already on shanghai) + cancun_time: type: string - title: >- - cancun_block switch block (nil = no fork, 0 = already on - cancun) + title: cancun switch time (nil = no fork, 0 = already on cancun) + prague_time: + type: string + title: prague switch time (nil = no fork, 0 = already on prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values @@ -45249,14 +45283,15 @@ definitions: title: >- merge_netsplit_block: Virtual fork after The Merge to use as a network splitter - shanghai_block: + shanghai_time: type: string - title: >- - shanghai_block switch block (nil = no fork, 0 = already on - shanghai) - cancun_block: + title: shanghai switch time (nil = no fork, 0 = already on shanghai) + cancun_time: + type: string + title: cancun switch time (nil = no fork, 0 = already on cancun) + prague_time: type: string - title: cancun_block switch block (nil = no fork, 0 = already on cancun) + title: prague switch time (nil = no fork, 0 = already on prague) description: >- ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values diff --git a/go.mod b/go.mod index 24f5a4ac6e..4a8d715a28 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect - github.com/DataDog/zstd v1.4.5 // indirect + github.com/DataDog/zstd v1.5.2 // indirect github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/alitto/pond v1.8.3 // indirect @@ -83,14 +83,14 @@ require ( github.com/crypto-org-chain/cronos/memiavl v0.0.4 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deckarep/golang-set v1.8.0 // indirect + github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect - github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect + github.com/dlclark/regexp2 v1.7.0 // indirect + github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect @@ -132,6 +132,7 @@ require ( github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect + github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect @@ -172,7 +173,6 @@ require ( github.com/rakyll/statik v0.1.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect - github.com/rjeczalik/notify v0.9.1 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.30.0 // indirect @@ -181,7 +181,7 @@ require ( github.com/spf13/afero v1.9.5 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/viper v1.16.0 // indirect - github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 // indirect + github.com/status-im/keycard-go v0.2.0 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -233,8 +233,8 @@ replace ( // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 - github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26-evmos-rc1 - github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20231114052006-8b1ec2327fac + github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231122021350-f905c2ec3570 + github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20231204041029-ccb83e2e0688 // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 diff --git a/go.sum b/go.sum index d28f92ba54..001dc381db 100644 --- a/go.sum +++ b/go.sum @@ -233,8 +233,8 @@ github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v2 v2.2.0/go.mod h1:n/vLeA7V+QY84iYAGwMkkUUp9ooeuftMEvaDrSVch+Q= github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= @@ -484,8 +484,10 @@ github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63 h1:R1 github.com/crypto-org-chain/cometbft-db v0.0.0-20231011055109-57922ac52a63/go.mod h1:rocwIfnS+kA060x64gkSIRvWB9StSppIkJuo5MWzL24= github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467 h1:m0/aHPIJAzi2MSP3TXzzbLTFf+koRFQiaYmerRZUtK4= github.com/crypto-org-chain/cosmos-sdk v0.46.0-beta2.0.20231013072415-eec017435467/go.mod h1:G384omH7cXgm90xXR7xpHvsKG7vdBaDuz4To6GpTHUU= -github.com/crypto-org-chain/ethermint v0.6.1-0.20231114052006-8b1ec2327fac h1:b2Zd0b52V+AyCNRGLRiMtxzNGSzG9aLJmrBhmV2wzvc= -github.com/crypto-org-chain/ethermint v0.6.1-0.20231114052006-8b1ec2327fac/go.mod h1:rbAKU2rftDobCIoCiol3SO+bTqw2cERu9TEki7PvfK0= +github.com/crypto-org-chain/ethermint v0.6.1-0.20231204041029-ccb83e2e0688 h1:6bjEkpymCMWfhUEhTuVj8g46sGuYS1D5I6XPuSuUWm4= +github.com/crypto-org-chain/ethermint v0.6.1-0.20231204041029-ccb83e2e0688/go.mod h1:y8DDupItqxfGglMpak/ow8E7qvqXM2Vb7t6kdb6s96Q= +github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231122021350-f905c2ec3570 h1:GukXF6eVCJZbK5pgTF+SHJoY9Wr0mPh95/LIOUQNMMM= +github.com/crypto-org-chain/go-ethereum v1.10.20-0.20231122021350-f905c2ec3570/go.mod h1:DuefStAgaxoaYGLR0FueVcVbehmn5n9QUcVrMCuOvuc= github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e h1:rSTc35OBjjCBx47rHPWBCIHNGPbMnEj8f7fNcK2TjVI= github.com/crypto-org-chain/gravity-bridge/module/v2 v2.0.1-0.20230825054824-75403cd90c6e/go.mod h1:HBaDqlFjlaXJwVQtA7jHejyaA7xwjXI2o6pU/ccP3tE= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= @@ -497,8 +499,8 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= -github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= +github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= @@ -519,8 +521,9 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn 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/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 h1:Izz0+t1Z5nI16/II7vuEo/nHjodOg0p7+OiDpjX5t1E= 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/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= @@ -530,9 +533,11 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf h1:Yt+4K30SdjOkRoRRm3vYNQgR+/ZIy0RmeUDZo7Y8zeQ= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20211022113120-dc8c55024d06/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 h1:kgvzE5wLsLa7XKfV85VZl40QXaMCaeFtHpPwJ8fhotY= +github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7/go.mod h1:yRkwfj0CBpOGre+TwBsqPV0IH0Pk73e4PXJOeNDboGs= 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= @@ -561,8 +566,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= -github.com/evmos/go-ethereum v1.10.26-evmos-rc1 h1:8+jrotZVyO0eIJGRGa1Kga3Fo7DjgFUE9rd6A8Yrbcg= -github.com/evmos/go-ethereum v1.10.26-evmos-rc1/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= @@ -928,6 +931,8 @@ github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpT github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e h1:pIYdhNkDh+YENVNi3gto8n9hAmRxKxoar0iE6BLucjw= +github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e/go.mod h1:j9cQbcqHQujT0oKJ38PylVfqohClLr3CvDC+Qcg+lhU= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.1 h1:XRtyuda/zw2l+Bq/38n5XUoEF72aSOu/77Thd9pPp2o= @@ -1355,8 +1360,6 @@ github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNw github.com/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= -github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -1452,8 +1455,8 @@ github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiu github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969 h1:Oo2KZNP70KE0+IUJSidPj/BFS/RXNHmKIJOdckzml2E= -github.com/status-im/keycard-go v0.0.0-20200402102358-957c09536969/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= +github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -1546,7 +1549,7 @@ github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= +github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= diff --git a/gomod2nix.toml b/gomod2nix.toml index 3a0372dad4..38c36fbc34 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -54,8 +54,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-atJ2waz124m0DVHjol8v3NfCLKidU3fYu5AgzT9xCBA=" [mod."github.com/DataDog/zstd"] - version = "v1.4.5" - hash = "sha256-WFHcU2EFRIIc1wSc0jN2VPeJzBMcZTIN5LFNBFk+NAY=" + version = "v1.5.2" + hash = "sha256-LVkZHLG8O4CzmqyQVbGn+0r6AKIMABej8a4HKMFw/xo=" [mod."github.com/StackExchange/wmi"] version = "v0.0.0-20180116203802-5d049714c4a6" hash = "sha256-0yUxhZB3v3ZE3QY36zHs2cJ1S4GXptXIhyAi6sI2nOo=" @@ -178,9 +178,9 @@ schema = 3 [mod."github.com/davecgh/go-spew"] version = "v1.1.1" hash = "sha256-nhzSUrE1fCkN0+RL04N4h8jWmRFPPPWbCuDc7Ss0akI=" - [mod."github.com/deckarep/golang-set"] - version = "v1.8.0" - hash = "sha256-ELJKphksU9AOYwV3BtjvwPtUpbZvX9YMmo7eIiauQSc=" + [mod."github.com/deckarep/golang-set/v2"] + version = "v2.1.0" + hash = "sha256-Co6gfAcVn256IUEJNNPmVlx8LZRI4sT+KmqGs2uIQ90=" [mod."github.com/decred/dcrd/dcrec/secp256k1/v4"] version = "v4.1.0" hash = "sha256-cS4ZrKz1B4G7+vqih6B7C/WNkcMvRKmvR6S8aw7PotY=" @@ -197,11 +197,11 @@ schema = 3 version = "v0.0.0-20200201041132-a6ae2369ad13" hash = "sha256-aOMlPwFY36bLiiIx4HonbCYRAhagk5N6HAWN7Ygif+E=" [mod."github.com/dlclark/regexp2"] - version = "v1.4.1-0.20201116162257-a2a8dda75c91" - hash = "sha256-VNNMZIc7NkDg3DVLnqeJNM/KZqkkaZu2/HTLBL8X2xE=" + version = "v1.7.0" + hash = "sha256-Z/M62esiZ0fVwvueVQhwz18z0eS22LZ3DJ4O8FKp3AY=" [mod."github.com/dop251/goja"] - version = "v0.0.0-20220405120441-9037c2b61cbf" - hash = "sha256-ueVIwPRUwxzd9+NybuFv1Pvp5tbwl9gGEgXB6cwqzEc=" + version = "v0.0.0-20230122112309-96b1610dd4f7" + hash = "sha256-iKN5Eqr61dDSipTfdf8gd5Va+rSfsKdlDteAkjZXq2g=" [mod."github.com/dustin/go-humanize"] version = "v1.0.1" hash = "sha256-yuvxYYngpfVkUg9yAmG99IUVmADTQA0tMbBXe0Fq0Mc=" @@ -212,12 +212,12 @@ schema = 3 version = "v1.1.0" hash = "sha256-LFcJue98awAFkSPRc93tVvon3kWS7AvumrluxxRzt4c=" [mod."github.com/ethereum/go-ethereum"] - version = "v1.10.26-evmos-rc1" - hash = "sha256-GgcReGsIIuBE2TabDYqDO9sBGogdVr9RSh4arQzdPnE=" - replaced = "github.com/evmos/go-ethereum" + version = "v1.10.20-0.20231122021350-f905c2ec3570" + hash = "sha256-1LRIM5dPmwjBxd57c9Y+2mZuBrbGWfMvEIlqYpdVBPA=" + replaced = "github.com/crypto-org-chain/go-ethereum" [mod."github.com/evmos/ethermint"] - version = "v0.6.1-0.20231114052006-8b1ec2327fac" - hash = "sha256-+Rgexd0GX8/afOw2lMULQfOn8tW5dk5RkxpCFrco3og=" + version = "v0.6.1-0.20231204041029-ccb83e2e0688" + hash = "sha256-JluJj+FrL5gA3twvxt/IwiMxHcTKEs0ciz+MF+bHZFk=" replaced = "github.com/crypto-org-chain/ethermint" [mod."github.com/felixge/httpsnoop"] version = "v1.0.2" @@ -342,6 +342,9 @@ schema = 3 [mod."github.com/hdevalence/ed25519consensus"] version = "v0.1.0" hash = "sha256-MkqFWnyXt653RaJQUMWWxcW6NCskIxou8VEfj+8vd3Y=" + [mod."github.com/holiman/big"] + version = "v0.0.0-20221017200358-a027dc42d04e" + hash = "sha256-BPYwQRH3ckgrA7DhEsWkXiIbKmYcBlUT0wqEPiFpRIc=" [mod."github.com/holiman/bloomfilter/v2"] version = "v2.0.3" hash = "sha256-5VsJMQzJSNd4F7yAl3iF/q6JodWOlE4dUvTQ0UGPe+k=" @@ -470,9 +473,6 @@ schema = 3 [mod."github.com/regen-network/cosmos-proto"] version = "v0.3.1" hash = "sha256-Bchbq/Hg72EA7Hevs8+PNuENuQaZAzk3qeVjMqFMUxc=" - [mod."github.com/rjeczalik/notify"] - version = "v0.9.1" - hash = "sha256-YLGNrHHM+mN4ElW/XWuylOnFrA/VjSY+eBuC4LN//5c=" [mod."github.com/rogpeppe/go-internal"] version = "v1.11.0" hash = "sha256-BucSndJVnqX9e6p5PfA6Z8N2bGfIeRfxAxYLUDXTbIo=" @@ -507,8 +507,8 @@ schema = 3 version = "v1.16.0" hash = "sha256-TgBr1SBMaus1oAlA5Kn+iNUJfQCMyo0hT/xFaA7hreQ=" [mod."github.com/status-im/keycard-go"] - version = "v0.0.0-20200402102358-957c09536969" - hash = "sha256-yddXXuu6mEFEO2/K6c1tWymeBKzOcvLQnNsFGRjtfXk=" + version = "v0.2.0" + hash = "sha256-UUiGmlgaIZDeMUJv3fdZBoQ9hJeSsg2ixRGmm6TgHug=" [mod."github.com/stretchr/testify"] version = "v1.8.4" hash = "sha256-MoOmRzbz9QgiJ+OOBo5h5/LbilhJfRUryvzHJmXAWjo=" diff --git a/integration_tests/network.py b/integration_tests/network.py index 893321d72f..8e18ad7d53 100644 --- a/integration_tests/network.py +++ b/integration_tests/network.py @@ -114,6 +114,8 @@ def setup_geth(path, base_port): str(base_port + 1), "--networkid", str(15), + "--miner.etherbase", + "0x57f96e6B86CdeFdB3d412547816a82E3E0EbF9D2", ] print(*cmd) proc = subprocess.Popen( diff --git a/nix/go-ethereum.nix b/nix/go-ethereum.nix index eb16356dbd..5423f06a30 100644 --- a/nix/go-ethereum.nix +++ b/nix/go-ethereum.nix @@ -10,16 +10,16 @@ let in buildGoModule rec { pname = "go-ethereum"; - version = "1.10.15"; + version = "1.11.2"; src = fetchFromGitHub { owner = "ethereum"; repo = pname; rev = "v${version}"; - sha256 = "0f6n9rg42ph47mvykc9f0lf99yzwqy4jm7mlzyks4l6i6fl1g3q1"; + sha256 = "sha256-LCJDpSyQUL7DXZDbZepaoU78uXfoPPMKMETy/uq+0LE="; }; - vendorSha256 = "1s5yfpk2yn7f3zwjl2fdrh6c63ki2b8rlmnlss27yxibsidaj0yd"; + vendorSha256 = "sha256-6yLkeT5DrAPUohAmobssKkvxgXI8kACxiu17WYbw+n0="; doCheck = false; @@ -42,7 +42,6 @@ buildGoModule rec { "cmd/faucet" "cmd/geth" "cmd/p2psim" - "cmd/puppeth" "cmd/rlpdump" "cmd/utils" ]; diff --git a/scripts/geth-genesis.json b/scripts/geth-genesis.json index 33c0b05790..4712fd63e4 100644 --- a/scripts/geth-genesis.json +++ b/scripts/geth-genesis.json @@ -14,6 +14,7 @@ "berlinBlock": 0, "yoloV3Block": 0, "londonBlock": 0, + "shanghaiTime": 0, "clique": { "period": 2, "epoch": 30000 diff --git a/scripts/start-geth b/scripts/start-geth index e9aaa23bb7..151fb577a9 100755 --- a/scripts/start-geth +++ b/scripts/start-geth @@ -33,7 +33,7 @@ print(Account.from_mnemonic('$VALIDATOR1_MNEMONIC').key.hex().replace('0x','')) cat > $tmpfile << EOF $validator_key EOF -geth --datadir $DATA account import $tmpfile --password $pwdfile +geth --datadir $DATA --password $pwdfile account import $tmpfile # import community key community_key=$(python -c """ @@ -45,7 +45,7 @@ print(Account.from_mnemonic('$COMMUNITY_MNEMONIC').key.hex().replace('0x','')) cat > $tmpfile << EOF $community_key EOF -geth --datadir $DATA account import $tmpfile --password $pwdfile +geth --datadir $DATA --password $pwdfile account import $tmpfile rm $tmpfile diff --git a/third_party/proto/ethermint/evm/v1/access_tuple.proto b/third_party/proto/ethermint/evm/v1/access_tuple.proto new file mode 100644 index 0000000000..d03c41d735 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/access_tuple.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// AccessTuple is the element type of an access list. +message AccessTuple { + option (gogoproto.goproto_getters) = false; + + // address is a hex formatted ethereum address + string address = 1; + // storage_keys are hex formatted hashes of the storage keys + repeated string storage_keys = 2 [(gogoproto.jsontag) = "storageKeys"]; +} diff --git a/third_party/proto/ethermint/evm/v1/chain_config.proto b/third_party/proto/ethermint/evm/v1/chain_config.proto new file mode 100644 index 0000000000..2bdb2d24c8 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/chain_config.proto @@ -0,0 +1,117 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values +// instead of *big.Int. +message ChainConfig { + // homestead_block switch (nil no fork, 0 = already homestead) + string homestead_block = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"homestead_block\"" + ]; + // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) + string dao_fork_block = 2 [ + (gogoproto.customname) = "DAOForkBlock", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"dao_fork_block\"" + ]; + // dao_fork_support defines whether the nodes supports or opposes the DAO hard-fork + bool dao_fork_support = 3 + [(gogoproto.customname) = "DAOForkSupport", (gogoproto.moretags) = "yaml:\"dao_fork_support\""]; + // eip150_block: EIP150 implements the Gas price changes + // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) + string eip150_block = 4 [ + (gogoproto.customname) = "EIP150Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip150_block\"" + ]; + // eip150_hash: EIP150 HF hash (needed for header only clients as only gas pricing changed) + string eip150_hash = 5 [(gogoproto.customname) = "EIP150Hash", (gogoproto.moretags) = "yaml:\"byzantium_block\""]; + // eip155_block: EIP155Block HF block + string eip155_block = 6 [ + (gogoproto.customname) = "EIP155Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip155_block\"" + ]; + // eip158_block: EIP158 HF block + string eip158_block = 7 [ + (gogoproto.customname) = "EIP158Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip158_block\"" + ]; + // byzantium_block: Byzantium switch block (nil no fork, 0 = already on byzantium) + string byzantium_block = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"byzantium_block\"" + ]; + // constantinople_block: Constantinople switch block (nil no fork, 0 = already activated) + string constantinople_block = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"constantinople_block\"" + ]; + // petersburg_block: Petersburg switch block (nil same as Constantinople) + string petersburg_block = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"petersburg_block\"" + ]; + // istanbul_block: Istanbul switch block (nil no fork, 0 = already on istanbul) + string istanbul_block = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"istanbul_block\"" + ]; + // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = already activated) + string muir_glacier_block = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"muir_glacier_block\"" + ]; + // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) + string berlin_block = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"berlin_block\"" + ]; + // DEPRECATED: EWASM, YOLOV3 and Catalyst block have been deprecated + reserved 14, 15, 16; + reserved "yolo_v3_block", "ewasm_block", "catalyst_block"; + // london_block: London switch block (nil = no fork, 0 = already on london) + string london_block = 17 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"london_block\"" + ]; + // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) + string arrow_glacier_block = 18 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"arrow_glacier_block\"" + ]; + // DEPRECATED: merge fork block was deprecated: https://github.com/ethereum/go-ethereum/pull/24904 + reserved 19; + reserved "merge_fork_block"; + // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = already activated) + string gray_glacier_block = 20 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"gray_glacier_block\"" + ]; + // merge_netsplit_block: Virtual fork after The Merge to use as a network splitter + string merge_netsplit_block = 21 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"merge_netsplit_block\"" + ]; + // shanghai switch time (nil = no fork, 0 = already on shanghai) + string shanghai_time = 22 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"shanghai_time\"" + ]; + // cancun switch time (nil = no fork, 0 = already on cancun) + string cancun_time = 23 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"cancun_time\"" + ]; + // prague switch time (nil = no fork, 0 = already on prague) + string prague_time = 24 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"prague_time\"" + ]; +} \ No newline at end of file diff --git a/third_party/proto/ethermint/evm/v1/chain_config_v0.proto b/third_party/proto/ethermint/evm/v1/chain_config_v0.proto new file mode 100644 index 0000000000..b1a4a02430 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/chain_config_v0.proto @@ -0,0 +1,112 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// V0ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values +// instead of *big.Int. +message V0ChainConfig { + // homestead_block switch (nil no fork, 0 = already homestead) + string homestead_block = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"homestead_block\"" + ]; + // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) + string dao_fork_block = 2 [ + (gogoproto.customname) = "DAOForkBlock", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"dao_fork_block\"" + ]; + // dao_fork_support defines whether the nodes supports or opposes the DAO hard-fork + bool dao_fork_support = 3 + [(gogoproto.customname) = "DAOForkSupport", (gogoproto.moretags) = "yaml:\"dao_fork_support\""]; + // eip150_block: EIP150 implements the Gas price changes + // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) + string eip150_block = 4 [ + (gogoproto.customname) = "EIP150Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip150_block\"" + ]; + // eip150_hash: EIP150 HF hash (needed for header only clients as only gas pricing changed) + string eip150_hash = 5 [(gogoproto.customname) = "EIP150Hash", (gogoproto.moretags) = "yaml:\"byzantium_block\""]; + // eip155_block: EIP155Block HF block + string eip155_block = 6 [ + (gogoproto.customname) = "EIP155Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip155_block\"" + ]; + // eip158_block: EIP158 HF block + string eip158_block = 7 [ + (gogoproto.customname) = "EIP158Block", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"eip158_block\"" + ]; + // byzantium_block: Byzantium switch block (nil no fork, 0 = already on byzantium) + string byzantium_block = 8 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"byzantium_block\"" + ]; + // constantinople_block: Constantinople switch block (nil no fork, 0 = already activated) + string constantinople_block = 9 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"constantinople_block\"" + ]; + // petersburg_block: Petersburg switch block (nil same as Constantinople) + string petersburg_block = 10 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"petersburg_block\"" + ]; + // istanbul_block: Istanbul switch block (nil no fork, 0 = already on istanbul) + string istanbul_block = 11 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"istanbul_block\"" + ]; + // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = already activated) + string muir_glacier_block = 12 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"muir_glacier_block\"" + ]; + // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) + string berlin_block = 13 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"berlin_block\"" + ]; + // DEPRECATED: EWASM, YOLOV3 and Catalyst block have been deprecated + reserved 14, 15, 16; + reserved "yolo_v3_block", "ewasm_block", "catalyst_block"; + // london_block: London switch block (nil = no fork, 0 = already on london) + string london_block = 17 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"london_block\"" + ]; + // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) + string arrow_glacier_block = 18 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"arrow_glacier_block\"" + ]; + // DEPRECATED: merge fork block was deprecated: https://github.com/ethereum/go-ethereum/pull/24904 + reserved 19; + reserved "merge_fork_block"; + // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = already activated) + string gray_glacier_block = 20 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"gray_glacier_block\"" + ]; + // merge_netsplit_block: Virtual fork after The Merge to use as a network splitter + string merge_netsplit_block = 21 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"merge_netsplit_block\"" + ]; + // shanghai_block switch block (nil = no fork, 0 = already on shanghai) + string shanghai_block = 22 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"shanghai_block\"" + ]; + // cancun_block switch block (nil = no fork, 0 = already on cancun) + string cancun_block = 23 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"cancun_block\"" + ]; +} diff --git a/third_party/proto/ethermint/evm/v1/evm.proto b/third_party/proto/ethermint/evm/v1/evm.proto deleted file mode 100644 index 9535335234..0000000000 --- a/third_party/proto/ethermint/evm/v1/evm.proto +++ /dev/null @@ -1,242 +0,0 @@ -syntax = "proto3"; -package ethermint.evm.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/evmos/ethermint/x/evm/types"; - -// Params defines the EVM module parameters -message Params { - // evm_denom represents the token denomination used to run the EVM state - // transitions. - string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""]; - // enable_create toggles state transitions that use the vm.Create function - bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""]; - // enable_call toggles state transitions that use the vm.Call function - bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""]; - // extra_eips defines the additional EIPs for the vm.Config - repeated int64 extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.moretags) = "yaml:\"extra_eips\""]; - // chain_config defines the EVM chain configuration parameters - ChainConfig chain_config = 5 [(gogoproto.moretags) = "yaml:\"chain_config\"", (gogoproto.nullable) = false]; - // allow_unprotected_txs defines if replay-protected (i.e non EIP155 - // signed) transactions can be executed on the state machine. - bool allow_unprotected_txs = 6; -} - -// ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values -// instead of *big.Int. -message ChainConfig { - // homestead_block switch (nil no fork, 0 = already homestead) - string homestead_block = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"homestead_block\"" - ]; - // dao_fork_block corresponds to TheDAO hard-fork switch block (nil no fork) - string dao_fork_block = 2 [ - (gogoproto.customname) = "DAOForkBlock", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"dao_fork_block\"" - ]; - // dao_fork_support defines whether the nodes supports or opposes the DAO hard-fork - bool dao_fork_support = 3 - [(gogoproto.customname) = "DAOForkSupport", (gogoproto.moretags) = "yaml:\"dao_fork_support\""]; - // eip150_block: EIP150 implements the Gas price changes - // (https://github.com/ethereum/EIPs/issues/150) EIP150 HF block (nil no fork) - string eip150_block = 4 [ - (gogoproto.customname) = "EIP150Block", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"eip150_block\"" - ]; - // eip150_hash: EIP150 HF hash (needed for header only clients as only gas pricing changed) - string eip150_hash = 5 [(gogoproto.customname) = "EIP150Hash", (gogoproto.moretags) = "yaml:\"byzantium_block\""]; - // eip155_block: EIP155Block HF block - string eip155_block = 6 [ - (gogoproto.customname) = "EIP155Block", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"eip155_block\"" - ]; - // eip158_block: EIP158 HF block - string eip158_block = 7 [ - (gogoproto.customname) = "EIP158Block", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"eip158_block\"" - ]; - // byzantium_block: Byzantium switch block (nil no fork, 0 = already on byzantium) - string byzantium_block = 8 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"byzantium_block\"" - ]; - // constantinople_block: Constantinople switch block (nil no fork, 0 = already activated) - string constantinople_block = 9 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"constantinople_block\"" - ]; - // petersburg_block: Petersburg switch block (nil same as Constantinople) - string petersburg_block = 10 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"petersburg_block\"" - ]; - // istanbul_block: Istanbul switch block (nil no fork, 0 = already on istanbul) - string istanbul_block = 11 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"istanbul_block\"" - ]; - // muir_glacier_block: Eip-2384 (bomb delay) switch block (nil no fork, 0 = already activated) - string muir_glacier_block = 12 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"muir_glacier_block\"" - ]; - // berlin_block: Berlin switch block (nil = no fork, 0 = already on berlin) - string berlin_block = 13 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"berlin_block\"" - ]; - // DEPRECATED: EWASM, YOLOV3 and Catalyst block have been deprecated - reserved 14, 15, 16; - reserved "yolo_v3_block", "ewasm_block", "catalyst_block"; - // london_block: London switch block (nil = no fork, 0 = already on london) - string london_block = 17 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"london_block\"" - ]; - // arrow_glacier_block: Eip-4345 (bomb delay) switch block (nil = no fork, 0 = already activated) - string arrow_glacier_block = 18 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"arrow_glacier_block\"" - ]; - // DEPRECATED: merge fork block was deprecated: https://github.com/ethereum/go-ethereum/pull/24904 - reserved 19; - reserved "merge_fork_block"; - // gray_glacier_block: EIP-5133 (bomb delay) switch block (nil = no fork, 0 = already activated) - string gray_glacier_block = 20 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"gray_glacier_block\"" - ]; - // merge_netsplit_block: Virtual fork after The Merge to use as a network splitter - string merge_netsplit_block = 21 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"merge_netsplit_block\"" - ]; - // shanghai_block switch block (nil = no fork, 0 = already on shanghai) - string shanghai_block = 22 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"shanghai_block\"" - ]; - // cancun_block switch block (nil = no fork, 0 = already on cancun) - string cancun_block = 23 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"cancun_block\"" - ]; -} - -// State represents a single Storage key value pair item. -message State { - // key is the stored key - string key = 1; - // value is the stored value for the given key - string value = 2; -} - -// TransactionLogs define the logs generated from a transaction execution -// with a given hash. It it used for import/export data as transactions are not -// persisted on blockchain state after an upgrade. -message TransactionLogs { - // hash of the transaction - string hash = 1; - // logs is an array of Logs for the given transaction hash - repeated Log logs = 2; -} - -// Log represents an protobuf compatible Ethereum Log that defines a contract -// log event. These events are generated by the LOG opcode and stored/indexed by -// the node. -// -// NOTE: address, topics and data are consensus fields. The rest of the fields -// are derived, i.e. filled in by the nodes, but not secured by consensus. -message Log { - // address of the contract that generated the event - string address = 1; - // topics is a list of topics provided by the contract. - repeated string topics = 2; - // data which is supplied by the contract, usually ABI-encoded - bytes data = 3; - - // block_number of the block in which the transaction was included - uint64 block_number = 4 [(gogoproto.jsontag) = "blockNumber"]; - // tx_hash is the transaction hash - string tx_hash = 5 [(gogoproto.jsontag) = "transactionHash"]; - // tx_index of the transaction in the block - uint64 tx_index = 6 [(gogoproto.jsontag) = "transactionIndex"]; - // block_hash of the block in which the transaction was included - string block_hash = 7 [(gogoproto.jsontag) = "blockHash"]; - // index of the log in the block - uint64 index = 8 [(gogoproto.jsontag) = "logIndex"]; - - // removed is true if this log was reverted due to a chain - // reorganisation. You must pay attention to this field if you receive logs - // through a filter query. - bool removed = 9; -} - -// TxResult stores results of Tx execution. -message TxResult { - option (gogoproto.goproto_getters) = false; - - // contract_address contains the ethereum address of the created contract (if - // any). If the state transition is an evm.Call, the contract address will be - // empty. - string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""]; - // bloom represents the bloom filter bytes - bytes bloom = 2; - // tx_logs contains the transaction hash and the proto-compatible ethereum - // logs. - TransactionLogs tx_logs = 3 [(gogoproto.moretags) = "yaml:\"tx_logs\"", (gogoproto.nullable) = false]; - // ret defines the bytes from the execution. - bytes ret = 4; - // reverted flag is set to true when the call has been reverted - bool reverted = 5; - // gas_used notes the amount of gas consumed while execution - uint64 gas_used = 6; -} - -// AccessTuple is the element type of an access list. -message AccessTuple { - option (gogoproto.goproto_getters) = false; - - // address is a hex formatted ethereum address - string address = 1; - // storage_keys are hex formatted hashes of the storage keys - repeated string storage_keys = 2 [(gogoproto.jsontag) = "storageKeys"]; -} - -// TraceConfig holds extra parameters to trace functions. -message TraceConfig { - // DEPRECATED: DisableMemory and DisableReturnData have been renamed to - // Enable*. - reserved 4, 7; - reserved "disable_memory", "disable_return_data"; - - // tracer is a custom javascript tracer - string tracer = 1; - // timeout overrides the default timeout of 5 seconds for JavaScript-based tracing - // calls - string timeout = 2; - // reexec defines the number of blocks the tracer is willing to go back - uint64 reexec = 3; - // disable_stack switches stack capture - bool disable_stack = 5 [(gogoproto.jsontag) = "disableStack"]; - // disable_storage switches storage capture - bool disable_storage = 6 [(gogoproto.jsontag) = "disableStorage"]; - // debug can be used to print output during capture end - bool debug = 8; - // limit defines the maximum length of output, but zero means unlimited - int32 limit = 9; - // overrides can be used to execute a trace using future fork rules - ChainConfig overrides = 10; - // enable_memory switches memory capture - bool enable_memory = 11 [(gogoproto.jsontag) = "enableMemory"]; - // enable_return_data switches the capture of return data - bool enable_return_data = 12 [(gogoproto.jsontag) = "enableReturnData"]; - // tracer_json_config configures the tracer using a JSON string - string tracer_json_config = 13 [(gogoproto.jsontag) = "tracerConfig"]; -} diff --git a/third_party/proto/ethermint/evm/v1/genesis.proto b/third_party/proto/ethermint/evm/v1/genesis.proto index a7e4f04a11..67092d42d9 100644 --- a/third_party/proto/ethermint/evm/v1/genesis.proto +++ b/third_party/proto/ethermint/evm/v1/genesis.proto @@ -1,7 +1,8 @@ syntax = "proto3"; package ethermint.evm.v1; -import "ethermint/evm/v1/evm.proto"; +import "ethermint/evm/v1/params.proto"; +import "ethermint/evm/v1/state.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/evmos/ethermint/x/evm/types"; diff --git a/third_party/proto/ethermint/evm/v1/log.proto b/third_party/proto/ethermint/evm/v1/log.proto new file mode 100644 index 0000000000..e248b29256 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/log.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// Log represents an protobuf compatible Ethereum Log that defines a contract +// log event. These events are generated by the LOG opcode and stored/indexed by +// the node. +// +// NOTE: address, topics and data are consensus fields. The rest of the fields +// are derived, i.e. filled in by the nodes, but not secured by consensus. +message Log { + // address of the contract that generated the event + string address = 1; + // topics is a list of topics provided by the contract. + repeated string topics = 2; + // data which is supplied by the contract, usually ABI-encoded + bytes data = 3; + + // block_number of the block in which the transaction was included + uint64 block_number = 4 [(gogoproto.jsontag) = "blockNumber"]; + // tx_hash is the transaction hash + string tx_hash = 5 [(gogoproto.jsontag) = "transactionHash"]; + // tx_index of the transaction in the block + uint64 tx_index = 6 [(gogoproto.jsontag) = "transactionIndex"]; + // block_hash of the block in which the transaction was included + string block_hash = 7 [(gogoproto.jsontag) = "blockHash"]; + // index of the log in the block + uint64 index = 8 [(gogoproto.jsontag) = "logIndex"]; + + // removed is true if this log was reverted due to a chain + // reorganisation. You must pay attention to this field if you receive logs + // through a filter query. + bool removed = 9; +} \ No newline at end of file diff --git a/third_party/proto/ethermint/evm/v1/params.proto b/third_party/proto/ethermint/evm/v1/params.proto new file mode 100644 index 0000000000..c4c64323aa --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/params.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; +import "ethermint/evm/v1/chain_config.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// Params defines the EVM module parameters +message Params { + // evm_denom represents the token denomination used to run the EVM state + // transitions. + string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""]; + // enable_create toggles state transitions that use the vm.Create function + bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""]; + // enable_call toggles state transitions that use the vm.Call function + bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""]; + // extra_eips defines the additional EIPs for the vm.Config + repeated int64 extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.moretags) = "yaml:\"extra_eips\""]; + // chain_config defines the EVM chain configuration parameters + ChainConfig chain_config = 5 [(gogoproto.nullable) = false]; + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + bool allow_unprotected_txs = 6; +} \ No newline at end of file diff --git a/third_party/proto/ethermint/evm/v1/params_v0.proto b/third_party/proto/ethermint/evm/v1/params_v0.proto new file mode 100644 index 0000000000..e968e2a36e --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/params_v0.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; +import "ethermint/evm/v1/chain_config_v0.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// V0Params defines the EVM module parameters +message V0Params { + // evm_denom represents the token denomination used to run the EVM state + // transitions. + string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""]; + // enable_create toggles state transitions that use the vm.Create function + bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""]; + // enable_call toggles state transitions that use the vm.Call function + bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""]; + // extra_eips defines the additional EIPs for the vm.Config + repeated int64 extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.moretags) = "yaml:\"extra_eips\""]; + // chain_config defines the EVM chain configuration parameters + V0ChainConfig chain_config = 5 [(gogoproto.nullable) = false]; + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + bool allow_unprotected_txs = 6; +} diff --git a/third_party/proto/ethermint/evm/v1/params_v4.proto b/third_party/proto/ethermint/evm/v1/params_v4.proto new file mode 100644 index 0000000000..d7404e8340 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/params_v4.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; +import "ethermint/evm/v1/chain_config_v0.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// V4Params defines the EVM module parameters +message V4Params { + // evm_denom represents the token denomination used to run the EVM state + // transitions. + string evm_denom = 1 [(gogoproto.moretags) = "yaml:\"evm_denom\""]; + // enable_create toggles state transitions that use the vm.Create function + bool enable_create = 2 [(gogoproto.moretags) = "yaml:\"enable_create\""]; + // enable_call toggles state transitions that use the vm.Call function + bool enable_call = 3 [(gogoproto.moretags) = "yaml:\"enable_call\""]; + // extra_eips defines the additional EIPs for the vm.Config + ExtraEIPs extra_eips = 4 [(gogoproto.customname) = "ExtraEIPs", (gogoproto.nullable) = false]; + // chain_config defines the EVM chain configuration parameters + V0ChainConfig chain_config = 5 [(gogoproto.nullable) = false]; + // allow_unprotected_txs defines if replay-protected (i.e non EIP155 + // signed) transactions can be executed on the state machine. + bool allow_unprotected_txs = 6; +} + +// ExtraEIPs represents extra EIPs for the vm.Config +message ExtraEIPs { + // eips defines the additional EIPs for the vm.Config + repeated int64 eips = 1 [(gogoproto.customname) = "EIPs", (gogoproto.moretags) = "yaml:\"eips\""]; +} \ No newline at end of file diff --git a/third_party/proto/ethermint/evm/v1/query.proto b/third_party/proto/ethermint/evm/v1/query.proto index 49feb723fc..f14ad86e57 100644 --- a/third_party/proto/ethermint/evm/v1/query.proto +++ b/third_party/proto/ethermint/evm/v1/query.proto @@ -2,8 +2,10 @@ syntax = "proto3"; package ethermint.evm.v1; import "cosmos/base/query/v1beta1/pagination.proto"; -import "ethermint/evm/v1/evm.proto"; import "ethermint/evm/v1/tx.proto"; +import "ethermint/evm/v1/log.proto"; +import "ethermint/evm/v1/params.proto"; +import "ethermint/evm/v1/trace_config.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; @@ -225,6 +227,8 @@ message EthCallRequest { bytes proposer_address = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; // chain_id is the eip155 chain id parsed from the requested block header int64 chain_id = 4; + // state overrides encoded as json + bytes overrides = 5; } // EstimateGasResponse defines EstimateGas response diff --git a/third_party/proto/ethermint/evm/v1/state.proto b/third_party/proto/ethermint/evm/v1/state.proto new file mode 100644 index 0000000000..b7c00189b8 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/state.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// State represents a single Storage key value pair item. +message State { + // key is the stored key + string key = 1; + // value is the stored value for the given key + string value = 2; +} \ No newline at end of file diff --git a/third_party/proto/ethermint/evm/v1/trace_config.proto b/third_party/proto/ethermint/evm/v1/trace_config.proto new file mode 100644 index 0000000000..b861b8509c --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/trace_config.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; +import "ethermint/evm/v1/chain_config.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// TraceConfig holds extra parameters to trace functions. +message TraceConfig { + // DEPRECATED: DisableMemory and DisableReturnData have been renamed to + // Enable*. + reserved 4, 7; + reserved "disable_memory", "disable_return_data"; + + // tracer is a custom javascript tracer + string tracer = 1; + // timeout overrides the default timeout of 5 seconds for JavaScript-based tracing + // calls + string timeout = 2; + // reexec defines the number of blocks the tracer is willing to go back + uint64 reexec = 3; + // disable_stack switches stack capture + bool disable_stack = 5 [(gogoproto.jsontag) = "disableStack"]; + // disable_storage switches storage capture + bool disable_storage = 6 [(gogoproto.jsontag) = "disableStorage"]; + // debug can be used to print output during capture end + bool debug = 8; + // limit defines the maximum length of output, but zero means unlimited + int32 limit = 9; + // overrides can be used to execute a trace using future fork rules + ChainConfig overrides = 10; + // enable_memory switches memory capture + bool enable_memory = 11 [(gogoproto.jsontag) = "enableMemory"]; + // enable_return_data switches the capture of return data + bool enable_return_data = 12 [(gogoproto.jsontag) = "enableReturnData"]; + // tracer_json_config configures the tracer using a JSON string + string tracer_json_config = 13 [(gogoproto.jsontag) = "tracerConfig"]; +} diff --git a/third_party/proto/ethermint/evm/v1/trace_config_v0.proto b/third_party/proto/ethermint/evm/v1/trace_config_v0.proto new file mode 100644 index 0000000000..2f3657cad8 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/trace_config_v0.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; +import "ethermint/evm/v1/chain_config_v0.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// V0TraceConfig holds extra parameters to trace functions. +message V0TraceConfig { + // DEPRECATED: DisableMemory and DisableReturnData have been renamed to + // Enable*. + reserved 4, 7; + reserved "disable_memory", "disable_return_data"; + + // tracer is a custom javascript tracer + string tracer = 1; + // timeout overrides the default timeout of 5 seconds for JavaScript-based tracing + // calls + string timeout = 2; + // reexec defines the number of blocks the tracer is willing to go back + uint64 reexec = 3; + // disable_stack switches stack capture + bool disable_stack = 5 [(gogoproto.jsontag) = "disableStack"]; + // disable_storage switches storage capture + bool disable_storage = 6 [(gogoproto.jsontag) = "disableStorage"]; + // debug can be used to print output during capture end + bool debug = 8; + // limit defines the maximum length of output, but zero means unlimited + int32 limit = 9; + // overrides can be used to execute a trace using future fork rules + V0ChainConfig overrides = 10; + // enable_memory switches memory capture + bool enable_memory = 11 [(gogoproto.jsontag) = "enableMemory"]; + // enable_return_data switches the capture of return data + bool enable_return_data = 12 [(gogoproto.jsontag) = "enableReturnData"]; + // tracer_json_config configures the tracer using a JSON string + string tracer_json_config = 13 [(gogoproto.jsontag) = "tracerConfig"]; +} diff --git a/third_party/proto/ethermint/evm/v1/transaction_logs.proto b/third_party/proto/ethermint/evm/v1/transaction_logs.proto new file mode 100644 index 0000000000..b9d69871c3 --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/transaction_logs.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "ethermint/evm/v1/log.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// TransactionLogs define the logs generated from a transaction execution +// with a given hash. It it used for import/export data as transactions are not +// persisted on blockchain state after an upgrade. +message TransactionLogs { + // hash of the transaction + string hash = 1; + // logs is an array of Logs for the given transaction hash + repeated Log logs = 2; +} diff --git a/third_party/proto/ethermint/evm/v1/tx.proto b/third_party/proto/ethermint/evm/v1/tx.proto index dbfb0dd2bb..5f08baa03b 100644 --- a/third_party/proto/ethermint/evm/v1/tx.proto +++ b/third_party/proto/ethermint/evm/v1/tx.proto @@ -3,10 +3,12 @@ package ethermint.evm.v1; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "ethermint/evm/v1/evm.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/any.proto"; +import "ethermint/evm/v1/access_tuple.proto"; +import "ethermint/evm/v1/log.proto"; +import "ethermint/evm/v1/params.proto"; option go_package = "github.com/evmos/ethermint/x/evm/types"; @@ -32,10 +34,11 @@ message MsgEthereumTx { double size = 2 [(gogoproto.jsontag) = "-"]; // hash of the transaction in hex format string hash = 3 [(gogoproto.moretags) = "rlp:\"-\""]; - // from is the ethereum signer address in hex format. This address value is checked + string deprecated_from = 4 [deprecated = true]; + // from is the bytes of ethereum signer address. This address value is checked // against the address derived from the signature (V, R, S) using the // secp256k1 elliptic curve - string from = 4; + bytes from = 5; } // LegacyTx is the transaction data of regular Ethereum transactions. diff --git a/third_party/proto/ethermint/evm/v1/tx_result.proto b/third_party/proto/ethermint/evm/v1/tx_result.proto new file mode 100644 index 0000000000..41a1d3110c --- /dev/null +++ b/third_party/proto/ethermint/evm/v1/tx_result.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package ethermint.evm.v1; + +import "gogoproto/gogo.proto"; +import "ethermint/evm/v1/transaction_logs.proto"; + +option go_package = "github.com/evmos/ethermint/x/evm/types"; + +// TxResult stores results of Tx execution. +message TxResult { + option (gogoproto.goproto_getters) = false; + + // contract_address contains the ethereum address of the created contract (if + // any). If the state transition is an evm.Call, the contract address will be + // empty. + string contract_address = 1 [(gogoproto.moretags) = "yaml:\"contract_address\""]; + // bloom represents the bloom filter bytes + bytes bloom = 2; + // tx_logs contains the transaction hash and the proto-compatible ethereum + // logs. + TransactionLogs tx_logs = 3 [(gogoproto.moretags) = "yaml:\"tx_logs\"", (gogoproto.nullable) = false]; + // ret defines the bytes from the execution. + bytes ret = 4; + // reverted flag is set to true when the call has been reverted + bool reverted = 5; + // gas_used notes the amount of gas consumed while execution + uint64 gas_used = 6; +} diff --git a/x/cronos/keeper/grpc_query.go b/x/cronos/keeper/grpc_query.go index ad025cf544..33bb7b8968 100644 --- a/x/cronos/keeper/grpc_query.go +++ b/x/cronos/keeper/grpc_query.go @@ -67,6 +67,7 @@ func (k Keeper) ReplayBlock(goCtx context.Context, req *types.ReplayBlockRequest blockHeight := big.NewInt(req.BlockNumber) homestead := ethCfg.IsHomestead(blockHeight) istanbul := ethCfg.IsIstanbul(blockHeight) + shanghai := ethCfg.IsShanghai(uint64(req.BlockTime.Unix())) evmDenom := params.EvmDenom baseFee := k.evmKeeper.GetBaseFee(ctx, ethCfg) @@ -82,7 +83,7 @@ func (k Keeper) ReplayBlock(goCtx context.Context, req *types.ReplayBlockRequest if _, err := msg.GetSenderLegacy(chainID); err != nil { return nil, err } - fees, err := evmkeeper.VerifyFee(txData, evmDenom, baseFee, homestead, istanbul, ctx.IsCheckTx()) + fees, err := evmkeeper.VerifyFee(txData, evmDenom, baseFee, homestead, istanbul, shanghai, ctx.IsCheckTx()) if err != nil { return nil, errorsmod.Wrapf(err, "failed to verify the fees") } diff --git a/x/cronos/keeper/precompiles/bank.go b/x/cronos/keeper/precompiles/bank.go index cd0d35c306..96717d85ff 100644 --- a/x/cronos/keeper/precompiles/bank.go +++ b/x/cronos/keeper/precompiles/bank.go @@ -85,10 +85,6 @@ func (bc *BankContract) RequiredGas(input []byte) uint64 { return baseCost } -func (bc *BankContract) IsStateful() bool { - return true -} - func (bc *BankContract) checkBlockedAddr(addr sdk.AccAddress) error { to, err := sdk.AccAddressFromBech32(addr.String()) if err != nil { diff --git a/x/cronos/keeper/precompiles/ica.go b/x/cronos/keeper/precompiles/ica.go index d63baac8c7..6016e64e4b 100644 --- a/x/cronos/keeper/precompiles/ica.go +++ b/x/cronos/keeper/precompiles/ica.go @@ -101,10 +101,6 @@ func (ic *IcaContract) RequiredGas(input []byte) uint64 { return baseCost } -func (ic *IcaContract) IsStateful() bool { - return true -} - func (ic *IcaContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error) { // parse input methodID := contract.Input[:4] diff --git a/x/cronos/keeper/precompiles/relayer.go b/x/cronos/keeper/precompiles/relayer.go index 439a0080f7..33d6d0b259 100644 --- a/x/cronos/keeper/precompiles/relayer.go +++ b/x/cronos/keeper/precompiles/relayer.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/params" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" cronosevents "github.com/crypto-org-chain/cronos/v2/x/cronos/events" @@ -45,16 +46,22 @@ func init() { type RelayerContract struct { BaseContract - cdc codec.Codec - ibcKeeper types.IbcKeeper - logger log.Logger + cdc codec.Codec + ibcKeeper types.IbcKeeper + logger log.Logger + isHomestead bool + isIstanbul bool + isShanghai bool } -func NewRelayerContract(ibcKeeper types.IbcKeeper, cdc codec.Codec, logger log.Logger) vm.PrecompiledContract { +func NewRelayerContract(ibcKeeper types.IbcKeeper, cdc codec.Codec, rules params.Rules, logger log.Logger) vm.PrecompiledContract { return &RelayerContract{ BaseContract: NewBaseContract(relayerContractAddress), ibcKeeper: ibcKeeper, cdc: cdc, + isHomestead: rules.IsHomestead, + isIstanbul: rules.IsIstanbul, + isShanghai: rules.IsShanghai, logger: logger.With("precompiles", "relayer"), } } @@ -69,7 +76,7 @@ func (bc *RelayerContract) RequiredGas(input []byte) (gas uint64) { if len(input) < prefixSize4Bytes { return 0 } - intrinsicGas, err := core.IntrinsicGas(input, nil, false, true, true) + intrinsicGas, err := core.IntrinsicGas(input, nil, false, bc.isHomestead, bc.isIstanbul, bc.isShanghai) if err != nil { return 0 } @@ -90,10 +97,6 @@ func (bc *RelayerContract) RequiredGas(input []byte) (gas uint64) { return total - intrinsicGas } -func (bc *RelayerContract) IsStateful() bool { - return true -} - // prefix bytes for the relayer msg type const ( prefixSize4Bytes = 4