From f7971d5831036809efc3fa6694712a050ddbe7db Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Wed, 18 May 2022 20:56:25 +0200 Subject: [PATCH 01/18] min gas denominator implementation --- docs/api/proto-docs.md | 1 + go.mod | 15 +- go.sum | 41 ++++++ proto/ethermint/evm/v1/evm.proto | 3 + x/evm/keeper/state_transition.go | 8 ++ x/evm/simulation/genesis.go | 2 +- x/evm/types/evm.pb.go | 227 ++++++++++++++++++------------- x/evm/types/params.go | 55 +++++--- x/evm/types/params_test.go | 12 +- 9 files changed, 247 insertions(+), 117 deletions(-) diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index ab1bbb4877..0b9416a8b2 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -227,6 +227,7 @@ Params defines the EVM module parameters | `enable_call` | [bool](#bool) | | enable call toggles state transitions that use the vm.Call function | | `extra_eips` | [int64](#int64) | repeated | extra eips defines the additional EIPs for the vm.Config | | `chain_config` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | chain config defines the EVM chain configuration parameters | +| `min_gas_denominator` | [uint64](#uint64) | | min gas denominator bounds the minimum gasUsed to be charge to senders based on GasLimit | diff --git a/go.mod b/go.mod index 6512fccf21..d2761eadc7 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/tendermint/tendermint v0.34.20-0.20220517115723-e6f071164839 github.com/tendermint/tm-db v0.6.7 github.com/tyler-smith/go-bip39 v1.1.0 - google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4 + google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 google.golang.org/grpc v1.46.2 google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.4.0 @@ -42,9 +42,13 @@ require ( github.com/99designs/keyring v1.1.6 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/DataDog/zstd v1.4.5 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect + github.com/aokoli/goutils v1.1.1 // indirect github.com/armon/go-metrics v0.3.10 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -68,6 +72,7 @@ require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect @@ -94,7 +99,9 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/huandu/xstrings v1.3.2 // indirect github.com/huin/goupnp v1.0.2 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmhodges/levigo v1.0.0 // indirect @@ -108,8 +115,10 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/mwitkow/go-proto-validators v0.3.2 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.4 // indirect @@ -121,6 +130,8 @@ require ( github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/tsdb v0.7.1 // indirect + github.com/pseudomuto/protoc-gen-doc v1.5.1 // indirect + github.com/pseudomuto/protokit v0.2.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect github.com/rjeczalik/notify v0.9.1 // indirect github.com/rs/zerolog v1.23.0 // indirect @@ -138,7 +149,7 @@ require ( github.com/tklauser/numcpus v0.2.2 // indirect github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 // indirect golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect diff --git a/go.sum b/go.sum index b45b52a05f..6714ed7ff5 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,14 @@ github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= @@ -130,6 +138,9 @@ github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKS github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= +github.com/aokoli/goutils v1.1.1 h1:/hA+Ywo3AxoDZY5ZMnkiEkUvkK4BPp927ax110KCqqg= +github.com/aokoli/goutils v1.1.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -332,7 +343,10 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.3.0-java/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= +github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg= github.com/ethereum/go-ethereum v1.10.16 h1:3oPrumn0bCW/idjcxMn5YYVCdK7VzJYIvwGZUGLEaoc= @@ -453,6 +467,7 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -634,6 +649,9 @@ github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25 github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= @@ -644,6 +662,9 @@ github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3 github.com/iancoleman/strcase v0.2.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/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= 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= @@ -742,6 +763,7 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= +github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= @@ -795,6 +817,8 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -809,6 +833,8 @@ github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGg github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -825,6 +851,9 @@ github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ib github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= +github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= +github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= @@ -983,6 +1012,11 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/pseudomuto/protoc-gen-doc v1.5.1 h1:Ah259kcrio7Ix1Rhb6u8FCaOkzf9qRBqXnvAufg061w= +github.com/pseudomuto/protoc-gen-doc v1.5.1/go.mod h1:XpMKYg6zkcpgfpCfQ8GcWBDRtRxOmMR5w7pz4Xo+dYM= +github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= +github.com/pseudomuto/protokit v0.2.1 h1:kCYpE3thoR6Esm0CUvd5xbrDTOZPvQPTDeyXpZfrJdk= +github.com/pseudomuto/protokit v0.2.1/go.mod h1:gt7N5Rz2flBzYafvaxyIxMZC0TTF5jDZfRnw25hAAyo= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1086,6 +1120,7 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1237,6 +1272,8 @@ golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0= +golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1627,6 +1664,7 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= @@ -1642,6 +1680,7 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180427144745-86e600f69ee4/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1727,6 +1766,8 @@ google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2I google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4 h1:myaecH64R0bIEDjNORIel4iXubqzaHU1K2z8ajBwWcM= google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= +google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto index 406276a290..f3256575ae 100644 --- a/proto/ethermint/evm/v1/evm.proto +++ b/proto/ethermint/evm/v1/evm.proto @@ -24,6 +24,9 @@ message Params { (gogoproto.moretags) = "yaml:\"chain_config\"", (gogoproto.nullable) = false ]; + // min gas denominator bounds the minimum gasUsed to be charge + // to senders based on GasLimit + uint64 min_gas_denominator = 6 [ (gogoproto.moretags) = "yaml:\"min_gas_denominator\"" ]; } // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index a0fcf7928b..8b1c413dbf 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -1,6 +1,7 @@ package keeper import ( + math2 "github.com/ethereum/go-ethereum/common/math" "math" "math/big" @@ -416,6 +417,13 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace } } + intGasLimit := new(big.Int).SetUint64(msg.Gas()) + // MinGasDenominator can not be 0 as it is validated on Validate params + intMinDenominatorParam := new(big.Int).SetUint64(cfg.Params.MinGasDenominator) + intGasUsed := new(big.Int).SetUint64(gasUsed) + minGasUsed := new(big.Int).Div(intGasLimit, intMinDenominatorParam) + gasUsed = math2.BigMax(minGasUsed, intGasUsed).Uint64() + return &types.MsgEthereumTxResponse{ GasUsed: gasUsed, VmError: vmError, diff --git a/x/evm/simulation/genesis.go b/x/evm/simulation/genesis.go index 73110b89d7..72678471d0 100644 --- a/x/evm/simulation/genesis.go +++ b/x/evm/simulation/genesis.go @@ -48,7 +48,7 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { extraEIPs = GenExtraEIPs(r) }, ) - params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), extraEIPs...) + params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), types.DefaultMinGasDenominator, extraEIPs...) evmGenesis := types.NewGenesisState(params, []types.GenesisAccount{}) bz, err := json.MarshalIndent(evmGenesis, "", " ") diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 78977f2b5f..9a69c07a73 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -37,6 +37,9 @@ type Params struct { ExtraEIPs []int64 `protobuf:"varint,4,rep,packed,name=extra_eips,json=extraEips,proto3" json:"extra_eips,omitempty" yaml:"extra_eips"` // chain config defines the EVM chain configuration parameters ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` + // min gas denominator bounds the minimum gasUsed to be charge + // to senders based on GasLimit + MinGasDenominator uint64 `protobuf:"varint,6,opt,name=min_gas_denominator,json=minGasDenominator,proto3" json:"min_gas_denominator,omitempty" yaml:"min_gas_denominator"` } func (m *Params) Reset() { *m = Params{} } @@ -107,6 +110,13 @@ func (m *Params) GetChainConfig() ChainConfig { return ChainConfig{} } +func (m *Params) GetMinGasDenominator() uint64 { + if m != nil { + return m.MinGasDenominator + } + return 0 +} + // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values // instead of *big.Int. type ChainConfig struct { @@ -657,100 +667,102 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) } var fileDescriptor_d21ecc92c8c8583e = []byte{ - // 1475 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xdf, 0x6e, 0xdb, 0xb6, - 0x1a, 0x4f, 0x62, 0x27, 0x91, 0x69, 0xc7, 0x56, 0x98, 0x34, 0xc7, 0x4d, 0x71, 0xa2, 0x1c, 0x5d, - 0x1c, 0xe4, 0x00, 0x6d, 0xdc, 0xa4, 0x08, 0x4e, 0xd1, 0x62, 0x17, 0x51, 0x92, 0xb6, 0xc9, 0xba, - 0x2d, 0x60, 0x32, 0x0c, 0x18, 0x30, 0x08, 0xb4, 0xc4, 0xca, 0x5a, 0x24, 0xd1, 0x20, 0x29, 0xd7, - 0x1e, 0xf6, 0x00, 0x03, 0x76, 0xb3, 0x47, 0xd8, 0x2b, 0xec, 0x2d, 0x8a, 0x5d, 0xf5, 0x66, 0xc0, - 0xb0, 0x0b, 0xa1, 0x48, 0xef, 0x72, 0xe9, 0x27, 0x18, 0x44, 0xd2, 0x7f, 0x13, 0x6c, 0x4b, 0xae, - 0xcc, 0xdf, 0xf7, 0xe7, 0xf7, 0x23, 0x3f, 0x7e, 0x14, 0x69, 0xb0, 0x4e, 0x44, 0x8b, 0xb0, 0x38, - 0x4c, 0x44, 0x83, 0x74, 0xe2, 0x46, 0x67, 0x27, 0xff, 0xd9, 0x6e, 0x33, 0x2a, 0x28, 0x34, 0x87, - 0xbe, 0xed, 0xdc, 0xd8, 0xd9, 0x59, 0x5f, 0x0d, 0x68, 0x40, 0xa5, 0xb3, 0x91, 0x8f, 0x54, 0x9c, - 0xfd, 0xdb, 0x1c, 0x58, 0x38, 0xc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, 0x0f, 0xb5, 0xca, - 0x95, 0x63, 0xf8, 0x3f, 0x50, 0x8c, 0x68, 0xc0, 0xeb, 0x73, 0x9b, 0x85, 0xad, 0xf2, 0xee, 0xbd, - 0xeb, 0x57, 0xfc, 0x6b, 0x1a, 0x20, 0x19, 0x62, 0xff, 0x3a, 0x07, 0x0a, 0xaf, 0x69, 0x00, 0xeb, - 0x60, 0x11, 0xfb, 0x3e, 0x23, 0x9c, 0x6b, 0xa6, 0x01, 0x84, 0x6b, 0x60, 0x41, 0xd0, 0x76, 0xe8, - 0x29, 0xba, 0x12, 0xd2, 0x28, 0x17, 0xf6, 0xb1, 0xc0, 0xf2, 0xaa, 0xab, 0x20, 0x39, 0x86, 0xbb, - 0xa0, 0x22, 0x57, 0xe6, 0x26, 0x69, 0xdc, 0x24, 0x4c, 0xde, 0x58, 0x45, 0xa7, 0x76, 0x95, 0x59, - 0x65, 0x69, 0xff, 0x5c, 0x9a, 0xd1, 0x38, 0x80, 0x0f, 0xc1, 0xa2, 0xe8, 0x8e, 0x5f, 0x36, 0x2b, - 0x57, 0x99, 0x55, 0x13, 0xa3, 0x65, 0xe6, 0x77, 0x09, 0x5a, 0x10, 0x5d, 0x79, 0xa7, 0x34, 0x80, - 0x21, 0xba, 0x6e, 0x98, 0xf8, 0xa4, 0x2b, 0xef, 0x93, 0xa2, 0xb3, 0x7a, 0x95, 0x59, 0xe6, 0x58, - 0xf8, 0x71, 0xee, 0x43, 0x8b, 0xa2, 0x2b, 0x07, 0xf0, 0x21, 0x00, 0x6a, 0x4a, 0x52, 0x41, 0xdd, - 0x06, 0x4b, 0x57, 0x99, 0x55, 0x92, 0x56, 0xc9, 0x3d, 0x1a, 0x42, 0x1b, 0xcc, 0x2b, 0x6e, 0x43, - 0x72, 0x57, 0xae, 0x32, 0xcb, 0x88, 0x68, 0xa0, 0x38, 0x95, 0x2b, 0x2f, 0x15, 0x23, 0x31, 0xed, - 0x10, 0x5f, 0x7e, 0x70, 0x0d, 0x34, 0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x63, 0xe6, 0xf7, 0x8f, 0x1b, 0x33, 0x5f, 0x6f, 0x8d, 0x7d, 0xce, - 0x45, 0x0b, 0x33, 0x1e, 0xf2, 0xc6, 0xe8, 0x0f, 0x62, 0x57, 0xfe, 0x45, 0x94, 0x1f, 0xf5, 0xe6, - 0x82, 0xfc, 0xeb, 0xf7, 0xe4, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0xef, 0x82, 0x39, 0x40, - 0x0e, 0x00, 0x00, + // 1514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6e, 0x1b, 0x37, + 0x1a, 0xb7, 0x2c, 0xd9, 0x1e, 0x51, 0xb2, 0x34, 0xa6, 0x1d, 0xaf, 0xe2, 0x60, 0x3d, 0xde, 0x39, + 0x2c, 0xb4, 0x40, 0x62, 0xc5, 0x0e, 0x8c, 0x0d, 0x12, 0xec, 0xc1, 0xb2, 0x9d, 0xc4, 0xde, 0x34, + 0x35, 0x68, 0x17, 0x05, 0x0a, 0x14, 0x03, 0x6a, 0x86, 0x19, 0x4d, 0x3d, 0x33, 0x14, 0x48, 0x8e, + 0x22, 0x15, 0x7d, 0x80, 0x02, 0xbd, 0xf4, 0x11, 0x7a, 0xe9, 0x03, 0xf4, 0x2d, 0x82, 0x9e, 0x72, + 0x2c, 0x7a, 0x18, 0x04, 0xce, 0xcd, 0x47, 0x3d, 0x41, 0x31, 0x24, 0xf5, 0xd7, 0x46, 0x5b, 0xfb, + 0x24, 0xfe, 0xbe, 0x3f, 0xbf, 0x1f, 0xf9, 0xf1, 0x1b, 0x92, 0x02, 0x1b, 0x44, 0xb4, 0x09, 0x8b, + 0x82, 0x58, 0x34, 0x48, 0x37, 0x6a, 0x74, 0x77, 0xb2, 0x9f, 0xed, 0x0e, 0xa3, 0x82, 0x42, 0x73, + 0xe4, 0xdb, 0xce, 0x8c, 0xdd, 0x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0x90, 0x51, + 0xc5, 0xc5, 0x02, 0x87, 0x7d, 0x2e, 0x34, 0x5d, 0x03, 0x2c, 0x9c, 0x89, 0xec, 0x9d, 0x61, 0x82, + 0xfc, 0x05, 0xe9, 0xab, 0x0b, 0x12, 0x65, 0x43, 0xb8, 0x06, 0x16, 0xba, 0x38, 0x4c, 0xd4, 0x83, + 0xa5, 0x88, 0x14, 0xb0, 0x4f, 0x41, 0xf5, 0x9c, 0xe1, 0x98, 0x63, 0x57, 0x04, 0x34, 0x7e, 0x4d, + 0x7d, 0x0e, 0x21, 0x28, 0xc8, 0x83, 0x5a, 0xe5, 0xca, 0x31, 0xfc, 0x0f, 0x28, 0x84, 0xd4, 0xe7, + 0xb5, 0xf9, 0xad, 0x7c, 0xbd, 0xb4, 0x7b, 0xef, 0xfa, 0x93, 0xe1, 0x35, 0xf5, 0x91, 0x0c, 0xb1, + 0x7f, 0x9d, 0x07, 0xf9, 0xd7, 0xd4, 0x87, 0x35, 0xb0, 0x84, 0x3d, 0x8f, 0x11, 0xce, 0x35, 0xd3, + 0x10, 0xc2, 0x75, 0xb0, 0x28, 0x68, 0x27, 0x70, 0x15, 0x5d, 0x11, 0x69, 0x94, 0x09, 0x7b, 0x58, + 0x60, 0x79, 0xd5, 0x95, 0x91, 0x1c, 0xc3, 0x5d, 0x50, 0x96, 0x2b, 0x73, 0xe2, 0x24, 0x6a, 0x11, + 0x26, 0x6f, 0xac, 0x42, 0xb3, 0x7a, 0x95, 0x5a, 0x25, 0x69, 0x7f, 0x23, 0xcd, 0x68, 0x12, 0xc0, + 0x87, 0x60, 0x49, 0xf4, 0x26, 0x2f, 0x9b, 0xd5, 0xab, 0xd4, 0xaa, 0x8a, 0xf1, 0x32, 0xb3, 0xbb, + 0x04, 0x2d, 0x8a, 0x9e, 0xbc, 0x53, 0x1a, 0xc0, 0x10, 0x3d, 0x27, 0x88, 0x3d, 0xd2, 0xd3, 0x6f, + 0x95, 0xb5, 0xab, 0xd4, 0x32, 0x27, 0xc2, 0x8f, 0x33, 0x1f, 0x5a, 0x12, 0x3d, 0x39, 0x80, 0x0f, + 0x01, 0x50, 0x53, 0x92, 0x0a, 0xea, 0x36, 0x58, 0xbe, 0x4a, 0xad, 0xa2, 0xb4, 0x4a, 0xee, 0xf1, + 0x10, 0xda, 0x60, 0x41, 0x71, 0x1b, 0x92, 0xbb, 0x7c, 0x95, 0x5a, 0x46, 0x48, 0x7d, 0xc5, 0xa9, + 0x5c, 0x59, 0xa9, 0x18, 0x89, 0x68, 0x97, 0x78, 0xf2, 0xc0, 0x35, 0xd0, 0x10, 0xda, 0x3f, 0xcc, + 0x03, 0xe3, 0xbc, 0x87, 0x08, 0x4f, 0x42, 0x01, 0x5f, 0x00, 0xd3, 0xa5, 0xb1, 0x60, 0xd8, 0x15, + 0xce, 0x54, 0x69, 0x9b, 0x0f, 0xc6, 0x1d, 0x36, 0x1b, 0x61, 0xa3, 0xea, 0xd0, 0xb4, 0xaf, 0xeb, + 0xbf, 0x06, 0x16, 0x5a, 0x21, 0xa5, 0x91, 0xec, 0x84, 0x32, 0x52, 0x00, 0x22, 0x59, 0x35, 0xb9, + 0xcb, 0x79, 0xf9, 0x30, 0xfc, 0xd7, 0xf5, 0x5d, 0x9e, 0x69, 0x95, 0xe6, 0xba, 0x7e, 0x1c, 0x56, + 0x94, 0xb6, 0xce, 0xb7, 0xb3, 0xda, 0xca, 0x56, 0x32, 0x41, 0x9e, 0x11, 0x21, 0x37, 0xad, 0x8c, + 0xb2, 0x21, 0xdc, 0x00, 0x06, 0x23, 0x5d, 0xc2, 0x04, 0xf1, 0xe4, 0xe6, 0x18, 0x68, 0x84, 0xe1, + 0x7d, 0x60, 0x64, 0xef, 0xc2, 0x84, 0x13, 0x4f, 0xed, 0x04, 0x5a, 0xf2, 0x31, 0xff, 0x82, 0x13, + 0xef, 0x59, 0xe1, 0xfb, 0x9f, 0xac, 0x39, 0x1b, 0x83, 0xd2, 0xbe, 0xeb, 0x12, 0xce, 0xcf, 0x93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2, 0xcc, 0x95, 0x5f, 0xa1, 0xf2, 0x22, 0xe9, 0x3c, 0xc4, + 0x02, 0xa3, 0x6b, 0x96, 0x93, 0x82, 0x51, 0x30, 0x17, 0x4e, 0x0a, 0xc6, 0x92, 0x69, 0x8c, 0xd6, + 0xaf, 0x67, 0x81, 0x56, 0x87, 0x78, 0x82, 0xbe, 0xd9, 0x7c, 0x7f, 0xb9, 0x99, 0xfb, 0x70, 0xb9, + 0x99, 0xfb, 0x78, 0xb9, 0x99, 0xfb, 0xf1, 0xd3, 0xe6, 0xdc, 0x87, 0x4f, 0x9b, 0x73, 0xbf, 0x7d, + 0xda, 0x9c, 0xfb, 0xaa, 0x3e, 0x71, 0x9c, 0x8b, 0x36, 0x66, 0x3c, 0xe0, 0x8d, 0xf1, 0x1f, 0xce, + 0x9e, 0xfc, 0xcb, 0x29, 0x0f, 0xf5, 0xd6, 0xa2, 0xfc, 0x2b, 0xf9, 0xe4, 0x8f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x47, 0x5d, 0x95, 0xa5, 0x90, 0x0e, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -773,6 +785,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MinGasDenominator != 0 { + i = encodeVarintEvm(dAtA, i, uint64(m.MinGasDenominator)) + i-- + dAtA[i] = 0x30 + } { size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1465,6 +1482,9 @@ func (m *Params) Size() (n int) { } l = m.ChainConfig.Size() n += 1 + l + sovEvm(uint64(l)) + if m.MinGasDenominator != 0 { + n += 1 + sovEvm(uint64(m.MinGasDenominator)) + } return n } @@ -1925,6 +1945,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinGasDenominator", wireType) + } + m.MinGasDenominator = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvm + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinGasDenominator |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipEvm(dAtA[iNdEx:]) diff --git a/x/evm/types/params.go b/x/evm/types/params.go index dc4caa20df..e3a51ffd0b 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -15,16 +15,18 @@ import ( var _ paramtypes.ParamSet = &Params{} const ( - DefaultEVMDenom = types.AttoPhoton + DefaultEVMDenom = types.AttoPhoton + DefaultMinGasDenominator = 2 ) // Parameter keys var ( - ParamStoreKeyEVMDenom = []byte("EVMDenom") - ParamStoreKeyEnableCreate = []byte("EnableCreate") - ParamStoreKeyEnableCall = []byte("EnableCall") - ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs") - ParamStoreKeyChainConfig = []byte("ChainConfig") + ParamStoreKeyEVMDenom = []byte("EVMDenom") + ParamStoreKeyEnableCreate = []byte("EnableCreate") + ParamStoreKeyEnableCall = []byte("EnableCall") + ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs") + ParamStoreKeyChainConfig = []byte("ChainConfig") + ParamStoreKeyMinGasDenominator = []byte("MinGasDenominator") // AvailableExtraEIPs define the list of all EIPs that can be enabled by the // EVM interpreter. These EIPs are applied in order and can override the @@ -40,13 +42,14 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, extraEIPs ...int64) Params { +func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, minGasDenom uint64, extraEIPs ...int64) Params { return Params{ - EvmDenom: evmDenom, - EnableCreate: enableCreate, - EnableCall: enableCall, - ExtraEIPs: extraEIPs, - ChainConfig: config, + EvmDenom: evmDenom, + EnableCreate: enableCreate, + EnableCall: enableCall, + ExtraEIPs: extraEIPs, + ChainConfig: config, + MinGasDenominator: minGasDenom, } } @@ -54,11 +57,12 @@ func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfi // ExtraEIPs is empty to prevent overriding the latest hard fork instruction set func DefaultParams() Params { return Params{ - EvmDenom: DefaultEVMDenom, - EnableCreate: true, - EnableCall: true, - ChainConfig: DefaultChainConfig(), - ExtraEIPs: nil, + EvmDenom: DefaultEVMDenom, + EnableCreate: true, + EnableCall: true, + ChainConfig: DefaultChainConfig(), + ExtraEIPs: nil, + MinGasDenominator: DefaultMinGasDenominator, } } @@ -70,6 +74,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool), paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs), paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig), + paramtypes.NewParamSetPair(ParamStoreKeyMinGasDenominator, &p.MinGasDenominator, validateMinGasDenominator), } } @@ -83,6 +88,10 @@ func (p Params) Validate() error { return err } + if err := validateMinGasDenominator(p.MinGasDenominator); err != nil { + return err + } + return p.ChainConfig.Validate() } @@ -127,6 +136,18 @@ func validateEIPs(i interface{}) error { return nil } +func validateMinGasDenominator(i interface{}) error { + gasDenom, ok := i.(uint64) + if !ok { + return fmt.Errorf("invalid parameter Minimum gas denominator type: %T", i) + } + + if gasDenom <= 0 { + return fmt.Errorf("min gas denominator can not be smaller than 0") + } + return nil +} + func validateChainConfig(i interface{}) error { cfg, ok := i.(ChainConfig) if !ok { diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index aa09fd5aef..662ce19779 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -22,7 +22,7 @@ func TestParamsValidate(t *testing.T) { {"default", DefaultParams(), false}, { "valid", - NewParams("ara", true, true, DefaultChainConfig(), 2929, 1884, 1344), + NewParams("ara", true, true, DefaultChainConfig(), 2, 2929, 1884, 1344), false, }, { @@ -47,9 +47,14 @@ func TestParamsValidate(t *testing.T) { }, { "invalid chain config", - NewParams("ara", true, true, ChainConfig{}, 2929, 1884, 1344), + NewParams("ara", true, true, ChainConfig{}, 2, 2929, 1884, 1344), false, }, + { + "invalid min gas denominator", + NewParams("ara", true, true, ChainConfig{}, 0, 2929, 1884, 1344), + true, + }, } for _, tc := range testCases { @@ -64,7 +69,7 @@ func TestParamsValidate(t *testing.T) { } func TestParamsEIPs(t *testing.T) { - params := NewParams("ara", true, true, DefaultChainConfig(), 2929, 1884, 1344) + params := NewParams("ara", true, true, DefaultChainConfig(), 556, 2929, 1884, 1344) actual := params.EIPs() require.Equal(t, []int([]int{2929, 1884, 1344}), actual) @@ -77,6 +82,7 @@ func TestParamsValidatePriv(t *testing.T) { require.NoError(t, validateBool(true)) require.Error(t, validateEIPs("")) require.NoError(t, validateEIPs([]int64{1884})) + require.Error(t, validateMinGasDenominator(-1)) } func TestValidateChainConfig(t *testing.T) { From aeb0e3bf4a5aa706d6a32b8685ed3b7c90da0cf0 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Wed, 18 May 2022 21:03:36 +0200 Subject: [PATCH 02/18] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e1bc91612..d080a4d9d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Move `rpc/ethereum/backend` -> `rpc/backend` * Move `rpc/ethereum/namespaces` -> `rpc/namespaces/ethereum` * (rpc) [tharsis#1068](https://github.com/tharsis/ethermint/pull/1068) Fix London hard-fork check logic in JSON-RPC APIs. +* (evm) [tharsis#1087](https://github.com/tharsis/ethermint/pull/1087) Minimum GasUsed proportional to GasLimit and `MinGasDenominator` EVM module param. ### Improvements From 6b516059c9aeaec59bfea0357573f675d171d39a Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 13:16:07 +0200 Subject: [PATCH 03/18] modify MinGasDenominator type to sdk.Dec --- docs/api/proto-docs.md | 2 +- go.mod | 2 +- go.sum | 2 + proto/ethermint/evm/v1/evm.proto | 5 +- x/evm/keeper/state_transition.go | 13 +- x/evm/simulation/genesis.go | 2 +- x/evm/types/evm.pb.go | 240 ++++++++++++++++--------------- x/evm/types/params.go | 24 ++-- x/evm/types/params_test.go | 11 +- 9 files changed, 163 insertions(+), 138 deletions(-) diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index 0b9416a8b2..5c471b5c70 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -227,7 +227,7 @@ Params defines the EVM module parameters | `enable_call` | [bool](#bool) | | enable call toggles state transitions that use the vm.Call function | | `extra_eips` | [int64](#int64) | repeated | extra eips defines the additional EIPs for the vm.Config | | `chain_config` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | chain config defines the EVM chain configuration parameters | -| `min_gas_denominator` | [uint64](#uint64) | | min gas denominator bounds the minimum gasUsed to be charge to senders based on GasLimit | +| `min_gas_denominator` | [string](#string) | | min gas denominator bounds the minimum gasUsed to be charge to senders based on GasLimit | diff --git a/go.mod b/go.mod index d2761eadc7..ce9e8e915a 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,7 @@ require ( github.com/tendermint/tendermint v0.34.20-0.20220517115723-e6f071164839 github.com/tendermint/tm-db v0.6.7 github.com/tyler-smith/go-bip39 v1.1.0 - google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 + google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335 google.golang.org/grpc v1.46.2 google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 6714ed7ff5..077c717bb8 100644 --- a/go.sum +++ b/go.sum @@ -1768,6 +1768,8 @@ google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4 h1:myaecH64R0bIEDj google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335 h1:2D0OT6tPVdrQTOnVe1VQjfJPTED6EZ7fdJ/f6Db6OsY= +google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto index f3256575ae..4d9f4ff6a3 100644 --- a/proto/ethermint/evm/v1/evm.proto +++ b/proto/ethermint/evm/v1/evm.proto @@ -26,7 +26,10 @@ message Params { ]; // min gas denominator bounds the minimum gasUsed to be charge // to senders based on GasLimit - uint64 min_gas_denominator = 6 [ (gogoproto.moretags) = "yaml:\"min_gas_denominator\"" ]; + string min_gas_denominator = 6 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 8b1c413dbf..4afb6350cf 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -1,7 +1,6 @@ package keeper import ( - math2 "github.com/ethereum/go-ethereum/common/math" "math" "math/big" @@ -417,12 +416,12 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace } } - intGasLimit := new(big.Int).SetUint64(msg.Gas()) - // MinGasDenominator can not be 0 as it is validated on Validate params - intMinDenominatorParam := new(big.Int).SetUint64(cfg.Params.MinGasDenominator) - intGasUsed := new(big.Int).SetUint64(gasUsed) - minGasUsed := new(big.Int).Div(intGasLimit, intMinDenominatorParam) - gasUsed = math2.BigMax(minGasUsed, intGasUsed).Uint64() + decGasLimit := sdk.NewDec(int64(msg.Gas())) + minimumGasUsed := decGasLimit.Mul(cfg.Params.MinGasDenominator) + + decGasUsed := sdk.NewDec(int64(gasUsed)) + // MinGasDenominator can not be negative as it is validated on Validate params + gasUsed = sdk.MaxDec(minimumGasUsed, decGasUsed).RoundInt().Uint64() return &types.MsgEthereumTxResponse{ GasUsed: gasUsed, diff --git a/x/evm/simulation/genesis.go b/x/evm/simulation/genesis.go index 72678471d0..fc15c37e40 100644 --- a/x/evm/simulation/genesis.go +++ b/x/evm/simulation/genesis.go @@ -48,7 +48,7 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { extraEIPs = GenExtraEIPs(r) }, ) - params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), types.DefaultMinGasDenominator, extraEIPs...) + params := types.DefaultParams() evmGenesis := types.NewGenesisState(params, []types.GenesisAccount{}) bz, err := json.MarshalIndent(evmGenesis, "", " ") diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 9a69c07a73..5076d44391 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -39,7 +39,7 @@ type Params struct { ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` // min gas denominator bounds the minimum gasUsed to be charge // to senders based on GasLimit - MinGasDenominator uint64 `protobuf:"varint,6,opt,name=min_gas_denominator,json=minGasDenominator,proto3" json:"min_gas_denominator,omitempty" yaml:"min_gas_denominator"` + MinGasDenominator github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=min_gas_denominator,json=minGasDenominator,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_gas_denominator"` } func (m *Params) Reset() { *m = Params{} } @@ -110,13 +110,6 @@ func (m *Params) GetChainConfig() ChainConfig { return ChainConfig{} } -func (m *Params) GetMinGasDenominator() uint64 { - if m != nil { - return m.MinGasDenominator - } - return 0 -} - // ChainConfig defines the Ethereum ChainConfig parameters using *sdk.Int values // instead of *big.Int. type ChainConfig struct { @@ -667,102 +660,102 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) } var fileDescriptor_d21ecc92c8c8583e = []byte{ - // 1514 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6e, 0x1b, 0x37, - 0x1a, 0xb7, 0x2c, 0xd9, 0x1e, 0x51, 0xb2, 0x34, 0xa6, 0x1d, 0xaf, 0xe2, 0x60, 0x3d, 0xde, 0x39, - 0x2c, 0xb4, 0x40, 0x62, 0xc5, 0x0e, 0x8c, 0x0d, 0x12, 0xec, 0xc1, 0xb2, 0x9d, 0xc4, 0xde, 0x34, - 0x35, 0x68, 0x17, 0x05, 0x0a, 0x14, 0x03, 0x6a, 0x86, 0x19, 0x4d, 0x3d, 0x33, 0x14, 0x48, 0x8e, - 0x22, 0x15, 0x7d, 0x80, 0x02, 0xbd, 0xf4, 0x11, 0x7a, 0xe9, 0x03, 0xf4, 0x2d, 0x82, 0x9e, 0x72, - 0x2c, 0x7a, 0x18, 0x04, 0xce, 0xcd, 0x47, 0x3d, 0x41, 0x31, 0x24, 0xf5, 0xd7, 0x46, 0x5b, 0xfb,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 0x97, 0x8d, 0x2a, 0xd2, 0x34, 0x3a, 0xfb, - 0x4f, 0x0a, 0x46, 0xc5, 0xac, 0x9e, 0x14, 0x8c, 0xaa, 0x69, 0x9e, 0x14, 0x0c, 0xd3, 0x5c, 0x41, - 0xcb, 0x7d, 0x1a, 0x52, 0xa7, 0xfb, 0x44, 0x65, 0xa0, 0x12, 0x79, 0x87, 0xb9, 0xfe, 0x90, 0x51, - 0xc5, 0xc5, 0x02, 0x87, 0x7d, 0x2e, 0x34, 0x5d, 0x03, 0x2c, 0x9c, 0x89, 0xec, 0x9d, 0x61, 0x82, - 0xfc, 0x05, 0xe9, 0xab, 0x0b, 0x12, 0x65, 0x43, 0xb8, 0x06, 0x16, 0xba, 0x38, 0x4c, 0xd4, 0x83, - 0xa5, 0x88, 0x14, 0xb0, 0x4f, 0x41, 0xf5, 0x9c, 0xe1, 0x98, 0x63, 0x57, 0x04, 0x34, 0x7e, 0x4d, - 0x7d, 0x0e, 0x21, 0x28, 0xc8, 0x83, 0x5a, 0xe5, 0xca, 0x31, 0xfc, 0x0f, 0x28, 0x84, 0xd4, 0xe7, - 0xb5, 0xf9, 0xad, 0x7c, 0xbd, 0xb4, 0x7b, 0xef, 0xfa, 0x93, 0xe1, 0x35, 0xf5, 0x91, 0x0c, 0xb1, - 0x7f, 0x9d, 0x07, 0xf9, 0xd7, 0xd4, 0x87, 0x35, 0xb0, 0x84, 0x3d, 0x8f, 0x11, 0xce, 0x35, 0xd3, - 0x10, 0xc2, 0x75, 0xb0, 0x28, 0x68, 0x27, 0x70, 0x15, 0x5d, 0x11, 0x69, 0x94, 0x09, 0x7b, 0x58, - 0x60, 0x79, 0xd5, 0x95, 0x91, 0x1c, 0xc3, 0x5d, 0x50, 0x96, 0x2b, 0x73, 0xe2, 0x24, 0x6a, 0x11, - 0x26, 0x6f, 0xac, 0x42, 0xb3, 0x7a, 0x95, 0x5a, 0x25, 0x69, 0x7f, 0x23, 0xcd, 0x68, 0x12, 0xc0, - 0x87, 0x60, 0x49, 0xf4, 0x26, 0x2f, 0x9b, 0xd5, 0xab, 0xd4, 0xaa, 0x8a, 0xf1, 0x32, 0xb3, 0xbb, - 0x04, 0x2d, 0x8a, 0x9e, 0xbc, 0x53, 0x1a, 0xc0, 0x10, 0x3d, 0x27, 0x88, 0x3d, 0xd2, 0xd3, 0x6f, - 0x95, 0xb5, 0xab, 0xd4, 0x32, 0x27, 0xc2, 0x8f, 0x33, 0x1f, 0x5a, 0x12, 0x3d, 0x39, 0x80, 0x0f, - 0x01, 0x50, 0x53, 0x92, 0x0a, 0xea, 0x36, 0x58, 0xbe, 0x4a, 0xad, 0xa2, 0xb4, 0x4a, 0xee, 0xf1, - 0x10, 0xda, 0x60, 0x41, 0x71, 0x1b, 0x92, 0xbb, 0x7c, 0x95, 0x5a, 0x46, 0x48, 0x7d, 0xc5, 0xa9, - 0x5c, 0x59, 0xa9, 0x18, 0x89, 0x68, 0x97, 0x78, 0xf2, 0xc0, 0x35, 0xd0, 0x10, 0xda, 0x3f, 0xcc, - 0x03, 0xe3, 0xbc, 0x87, 0x08, 0x4f, 0x42, 0x01, 0x5f, 0x00, 0xd3, 0xa5, 0xb1, 0x60, 0xd8, 0x15, - 0xce, 0x54, 0x69, 0x9b, 0x0f, 0xc6, 0x1d, 0x36, 0x1b, 0x61, 0xa3, 0xea, 0xd0, 0xb4, 0xaf, 0xeb, - 0xbf, 0x06, 0x16, 0x5a, 0x21, 0xa5, 0x91, 0xec, 0x84, 0x32, 0x52, 0x00, 0x22, 0x59, 0x35, 0xb9, - 0xcb, 0x79, 0xf9, 0x30, 0xfc, 0xd7, 0xf5, 0x5d, 0x9e, 0x69, 0x95, 0xe6, 0xba, 0x7e, 0x1c, 0x56, - 0x94, 0xb6, 0xce, 0xb7, 0xb3, 0xda, 0xca, 0x56, 0x32, 0x41, 0x9e, 0x11, 0x21, 0x37, 0xad, 0x8c, - 0xb2, 0x21, 0xdc, 0x00, 0x06, 0x23, 0x5d, 0xc2, 0x04, 0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e, 0xd5, 0x5f, 0x03, 0x34, 0x8e, 0xcf, 0x16, 0xa7, 0xff, 0xb9, 0x44, 0x24, 0xa2, 0xac, 0x2f, - 0xaf, 0x53, 0xbd, 0x38, 0xe5, 0xf8, 0x4c, 0xda, 0xd1, 0x14, 0x82, 0x4d, 0x00, 0x75, 0x1a, 0x23, - 0x22, 0x61, 0xb1, 0x23, 0xbf, 0xff, 0xb2, 0xcc, 0x95, 0x5f, 0xa1, 0xf2, 0x22, 0xe9, 0x3c, 0xc4, - 0x02, 0xa3, 0x6b, 0x96, 0x93, 0x82, 0x51, 0x30, 0x17, 0x4e, 0x0a, 0xc6, 0x92, 0x69, 0x8c, 0xd6, - 0xaf, 0x67, 0x81, 0x56, 0x87, 0x78, 0x82, 0xbe, 0xd9, 0x7c, 0x7f, 0xb9, 0x99, 0xfb, 0x70, 0xb9, - 0x99, 0xfb, 0x78, 0xb9, 0x99, 0xfb, 0xf1, 0xd3, 0xe6, 0xdc, 0x87, 0x4f, 0x9b, 0x73, 0xbf, 0x7d, - 0xda, 0x9c, 0xfb, 0xaa, 0x3e, 0x71, 0x9c, 0x8b, 0x36, 0x66, 0x3c, 0xe0, 0x8d, 0xf1, 0x1f, 0xce, - 0x9e, 0xfc, 0xcb, 0x29, 0x0f, 0xf5, 0xd6, 0xa2, 0xfc, 0x2b, 0xf9, 0xe4, 0x8f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x47, 0x5d, 0x95, 0xa5, 0x90, 0x0e, 0x00, 0x00, + // 1512 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x6f, 0xdb, 0x46, + 0x1a, 0xb6, 0x2d, 0xd9, 0xa6, 0x46, 0xb2, 0x44, 0x8f, 0x1d, 0xaf, 0xe2, 0x60, 0x4d, 0x2f, 0x0f, + 0x0b, 0x2f, 0x90, 0x58, 0xb1, 0x03, 0x63, 0x83, 0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f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x1f, 0x3b, 0x19, 0x3a, 0xa0, 0x0e, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -785,11 +778,16 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.MinGasDenominator != 0 { - i = encodeVarintEvm(dAtA, i, uint64(m.MinGasDenominator)) - i-- - dAtA[i] = 0x30 + { + size := m.MinGasDenominator.Size() + i -= size + if _, err := m.MinGasDenominator.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvm(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x32 { size, err := m.ChainConfig.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1482,9 +1480,8 @@ func (m *Params) Size() (n int) { } l = m.ChainConfig.Size() n += 1 + l + sovEvm(uint64(l)) - if m.MinGasDenominator != 0 { - n += 1 + sovEvm(uint64(m.MinGasDenominator)) - } + l = m.MinGasDenominator.Size() + n += 1 + l + sovEvm(uint64(l)) return n } @@ -1946,10 +1943,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 6: - if wireType != 0 { + if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MinGasDenominator", wireType) } - m.MinGasDenominator = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvm @@ -1959,11 +1956,26 @@ func (m *Params) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinGasDenominator |= uint64(b&0x7F) << shift + 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 + } + if err := m.MinGasDenominator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvm(dAtA[iNdEx:]) diff --git a/x/evm/types/params.go b/x/evm/types/params.go index e3a51ffd0b..e15cf2c5ae 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -15,8 +15,7 @@ import ( var _ paramtypes.ParamSet = &Params{} const ( - DefaultEVMDenom = types.AttoPhoton - DefaultMinGasDenominator = 2 + DefaultEVMDenom = types.AttoPhoton ) // Parameter keys @@ -42,7 +41,7 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, minGasDenom uint64, extraEIPs ...int64) Params { +func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, minGasDenom sdk.Dec, extraEIPs ...int64) Params { return Params{ EvmDenom: evmDenom, EnableCreate: enableCreate, @@ -62,7 +61,7 @@ func DefaultParams() Params { EnableCall: true, ChainConfig: DefaultChainConfig(), ExtraEIPs: nil, - MinGasDenominator: DefaultMinGasDenominator, + MinGasDenominator: sdk.NewDecWithPrec(50, 2), } } @@ -137,13 +136,22 @@ func validateEIPs(i interface{}) error { } func validateMinGasDenominator(i interface{}) error { - gasDenom, ok := i.(uint64) + v, ok := i.(sdk.Dec) + if !ok { - return fmt.Errorf("invalid parameter Minimum gas denominator type: %T", i) + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.IsNil() { + return fmt.Errorf("invalid parameter: nil") + } + + if v.IsNegative() { + return fmt.Errorf("value cannot be negative: %T", i) } - if gasDenom <= 0 { - return fmt.Errorf("min gas denominator can not be smaller than 0") + if v.GT(sdk.OneDec()) { + return fmt.Errorf("value cannot be greater than 1: %T", i) } return nil } diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index 662ce19779..163b8bfc09 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -1,6 +1,7 @@ package types import ( + sdk "github.com/cosmos/cosmos-sdk/types" "testing" "github.com/ethereum/go-ethereum/params" @@ -22,7 +23,7 @@ func TestParamsValidate(t *testing.T) { {"default", DefaultParams(), false}, { "valid", - NewParams("ara", true, true, DefaultChainConfig(), 2, 2929, 1884, 1344), + NewParams("ara", true, true, DefaultChainConfig(), sdk.NewDecWithPrec(50, 2), 2929, 1884, 1344), false, }, { @@ -47,12 +48,12 @@ func TestParamsValidate(t *testing.T) { }, { "invalid chain config", - NewParams("ara", true, true, ChainConfig{}, 2, 2929, 1884, 1344), + NewParams("ara", true, true, ChainConfig{}, sdk.NewDecWithPrec(50, 2), 2929, 1884, 1344), false, }, { "invalid min gas denominator", - NewParams("ara", true, true, ChainConfig{}, 0, 2929, 1884, 1344), + NewParams("ara", true, true, ChainConfig{}, sdk.NewDec(2), 2929, 1884, 1344), true, }, } @@ -69,7 +70,7 @@ func TestParamsValidate(t *testing.T) { } func TestParamsEIPs(t *testing.T) { - params := NewParams("ara", true, true, DefaultChainConfig(), 556, 2929, 1884, 1344) + params := NewParams("ara", true, true, DefaultChainConfig(), sdk.NewDecWithPrec(50, 2), 2929, 1884, 1344) actual := params.EIPs() require.Equal(t, []int([]int{2929, 1884, 1344}), actual) @@ -82,7 +83,7 @@ func TestParamsValidatePriv(t *testing.T) { require.NoError(t, validateBool(true)) require.Error(t, validateEIPs("")) require.NoError(t, validateEIPs([]int64{1884})) - require.Error(t, validateMinGasDenominator(-1)) + require.Error(t, validateMinGasDenominator(sdk.NewDec(-5))) } func TestValidateChainConfig(t *testing.T) { From 3928a4724fe263e6f6072838999c6fe801098ba8 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 13:17:46 +0200 Subject: [PATCH 04/18] fix typo in comments --- x/evm/keeper/state_transition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 4afb6350cf..da3ee032a3 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -420,7 +420,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace minimumGasUsed := decGasLimit.Mul(cfg.Params.MinGasDenominator) decGasUsed := sdk.NewDec(int64(gasUsed)) - // MinGasDenominator can not be negative as it is validated on Validate params + // MinGasDenominator can not be negative as it is validated on ValidateParams gasUsed = sdk.MaxDec(minimumGasUsed, decGasUsed).RoundInt().Uint64() return &types.MsgEthereumTxResponse{ From d9cfa913e49f2f154ba4e59f881dfa76575df541 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 13:20:50 +0200 Subject: [PATCH 05/18] add comments --- x/evm/keeper/state_transition.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index da3ee032a3..7e67ab75b5 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -416,11 +416,12 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace } } + // calculate a minimum amount of gas to be charged to sender if GasLimit + // is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics + // NOTE: MinGasDenominator can not be negative as it is validated on ValidateParams decGasLimit := sdk.NewDec(int64(msg.Gas())) minimumGasUsed := decGasLimit.Mul(cfg.Params.MinGasDenominator) - decGasUsed := sdk.NewDec(int64(gasUsed)) - // MinGasDenominator can not be negative as it is validated on ValidateParams gasUsed = sdk.MaxDec(minimumGasUsed, decGasUsed).RoundInt().Uint64() return &types.MsgEthereumTxResponse{ From 8d6c76da6fb725afb5fa297514e1b6a8a960b2b1 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 13:21:45 +0200 Subject: [PATCH 06/18] update comment --- x/evm/keeper/state_transition.go | 1 + 1 file changed, 1 insertion(+) diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 7e67ab75b5..18ffe88308 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -418,6 +418,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace // calculate a minimum amount of gas to be charged to sender if GasLimit // is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics + // for more info https://github.com/tharsis/ethermint/issues/1085 // NOTE: MinGasDenominator can not be negative as it is validated on ValidateParams decGasLimit := sdk.NewDec(int64(msg.Gas())) minimumGasUsed := decGasLimit.Mul(cfg.Params.MinGasDenominator) From 3fe16ffd757f7e6bd90f49d378f79dff8a29b502 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 15:38:21 +0200 Subject: [PATCH 07/18] refactor logic --- x/evm/keeper/state_transition.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 18ffe88308..7dcdcda9c3 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -420,10 +420,9 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace // is considerably higher than GasUsed to stay more aligned with Tendermint gas mechanics // for more info https://github.com/tharsis/ethermint/issues/1085 // NOTE: MinGasDenominator can not be negative as it is validated on ValidateParams - decGasLimit := sdk.NewDec(int64(msg.Gas())) - minimumGasUsed := decGasLimit.Mul(cfg.Params.MinGasDenominator) - decGasUsed := sdk.NewDec(int64(gasUsed)) - gasUsed = sdk.MaxDec(minimumGasUsed, decGasUsed).RoundInt().Uint64() + gasLimit := sdk.NewDec(int64(msg.Gas())) + minimumGasUsed := gasLimit.Mul(cfg.Params.MinGasDenominator) + gasUsed = sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(gasUsed))).RoundInt().Uint64() return &types.MsgEthereumTxResponse{ GasUsed: gasUsed, From 4d4e7ca5bac006faf10651e98987fec96bc09f08 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 15:50:07 +0200 Subject: [PATCH 08/18] remove unnecesary test --- x/evm/types/params_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index 163b8bfc09..14ba599c8c 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -46,14 +46,9 @@ func TestParamsValidate(t *testing.T) { }, true, }, - { - "invalid chain config", - NewParams("ara", true, true, ChainConfig{}, sdk.NewDecWithPrec(50, 2), 2929, 1884, 1344), - false, - }, { "invalid min gas denominator", - NewParams("ara", true, true, ChainConfig{}, sdk.NewDec(2), 2929, 1884, 1344), + NewParams("ara", true, true, DefaultChainConfig(), sdk.NewDec(2), 2929, 1884, 1344), true, }, } From df744213558b5016d5f967a5f0d0d5690e82095b Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 15:50:53 +0200 Subject: [PATCH 09/18] fix typo on proto --- docs/api/proto-docs.md | 2 +- proto/ethermint/evm/v1/evm.proto | 2 +- x/evm/types/evm.pb.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index 5c471b5c70..fa79cf77ea 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -227,7 +227,7 @@ Params defines the EVM module parameters | `enable_call` | [bool](#bool) | | enable call toggles state transitions that use the vm.Call function | | `extra_eips` | [int64](#int64) | repeated | extra eips defines the additional EIPs for the vm.Config | | `chain_config` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | chain config defines the EVM chain configuration parameters | -| `min_gas_denominator` | [string](#string) | | min gas denominator bounds the minimum gasUsed to be charge to senders based on GasLimit | +| `min_gas_denominator` | [string](#string) | | min gas denominator bounds the minimum gasUsed to be charged to senders based on GasLimit | diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto index 4d9f4ff6a3..1087aa9060 100644 --- a/proto/ethermint/evm/v1/evm.proto +++ b/proto/ethermint/evm/v1/evm.proto @@ -24,7 +24,7 @@ message Params { (gogoproto.moretags) = "yaml:\"chain_config\"", (gogoproto.nullable) = false ]; - // min gas denominator bounds the minimum gasUsed to be charge + // min gas denominator bounds the minimum gasUsed to be charged // to senders based on GasLimit string min_gas_denominator = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 5076d44391..66ea8b3213 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -37,7 +37,7 @@ type Params struct { ExtraEIPs []int64 `protobuf:"varint,4,rep,packed,name=extra_eips,json=extraEips,proto3" json:"extra_eips,omitempty" yaml:"extra_eips"` // chain config defines the EVM chain configuration parameters ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` - // min gas denominator bounds the minimum gasUsed to be charge + // min gas denominator bounds the minimum gasUsed to be charged // to senders based on GasLimit MinGasDenominator github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=min_gas_denominator,json=minGasDenominator,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_gas_denominator"` } From 28409e79e5e849e03485e6fe6242352a5552c683 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 17:24:43 +0200 Subject: [PATCH 10/18] rename param --- docs/api/proto-docs.md | 2 +- proto/ethermint/evm/v1/evm.proto | 2 +- x/evm/keeper/state_transition.go | 2 +- x/evm/types/evm.pb.go | 204 +++++++++++++++---------------- x/evm/types/params.go | 44 +++---- x/evm/types/params_test.go | 4 +- 6 files changed, 129 insertions(+), 129 deletions(-) diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index fa79cf77ea..3ccc66e8cd 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -227,7 +227,7 @@ Params defines the EVM module parameters | `enable_call` | [bool](#bool) | | enable call toggles state transitions that use the vm.Call function | | `extra_eips` | [int64](#int64) | repeated | extra eips defines the additional EIPs for the vm.Config | | `chain_config` | [ChainConfig](#ethermint.evm.v1.ChainConfig) | | chain config defines the EVM chain configuration parameters | -| `min_gas_denominator` | [string](#string) | | min gas denominator bounds the minimum gasUsed to be charged to senders based on GasLimit | +| `min_gas_multiplier` | [string](#string) | | min gas denominator bounds the minimum gasUsed to be charged to senders based on GasLimit | diff --git a/proto/ethermint/evm/v1/evm.proto b/proto/ethermint/evm/v1/evm.proto index 1087aa9060..5f22fcc191 100644 --- a/proto/ethermint/evm/v1/evm.proto +++ b/proto/ethermint/evm/v1/evm.proto @@ -26,7 +26,7 @@ message Params { ]; // min gas denominator bounds the minimum gasUsed to be charged // to senders based on GasLimit - string min_gas_denominator = 6 [ + string min_gas_multiplier = 6 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false ]; diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 7dcdcda9c3..65c8f93f56 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -421,7 +421,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace // for more info https://github.com/tharsis/ethermint/issues/1085 // NOTE: MinGasDenominator can not be negative as it is validated on ValidateParams gasLimit := sdk.NewDec(int64(msg.Gas())) - minimumGasUsed := gasLimit.Mul(cfg.Params.MinGasDenominator) + minimumGasUsed := gasLimit.Mul(cfg.Params.MinGasMultiplier) gasUsed = sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(gasUsed))).RoundInt().Uint64() return &types.MsgEthereumTxResponse{ diff --git a/x/evm/types/evm.pb.go b/x/evm/types/evm.pb.go index 66ea8b3213..3f9e945974 100644 --- a/x/evm/types/evm.pb.go +++ b/x/evm/types/evm.pb.go @@ -39,7 +39,7 @@ type Params struct { ChainConfig ChainConfig `protobuf:"bytes,5,opt,name=chain_config,json=chainConfig,proto3" json:"chain_config" yaml:"chain_config"` // min gas denominator bounds the minimum gasUsed to be charged // to senders based on GasLimit - MinGasDenominator github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=min_gas_denominator,json=minGasDenominator,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_gas_denominator"` + MinGasMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=min_gas_multiplier,json=minGasMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"min_gas_multiplier"` } func (m *Params) Reset() { *m = Params{} } @@ -660,102 +660,102 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/evm.proto", fileDescriptor_d21ecc92c8c8583e) } var fileDescriptor_d21ecc92c8c8583e = []byte{ - // 1512 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x6f, 0xdb, 0x46, - 0x1a, 0xb6, 0x2d, 0xd9, 0xa6, 0x46, 0xb2, 0x44, 0x8f, 0x1d, 0xaf, 0xe2, 0x60, 0x4d, 0x2f, 0x0f, - 0x0b, 0x2f, 0x90, 0x58, 0xb1, 0x03, 0x63, 0x83, 0x04, 0x7b, 0xb0, 0x6c, 0x27, 0xb1, 0x37, 0xbb, - 0x35, 0xc6, 0x2e, 0x0a, 0x14, 0x68, 0x85, 0x11, 0x39, 0xa1, 0x58, 0x93, 0x1c, 0x61, 0x66, 0xa8, - 0x48, 0x45, 0x7f, 0x40, 0x81, 0x5e, 0xfa, 0x13, 0xfa, 0x17, 0x7a, 0xe8, 0x7f, 0x08, 0x7a, 0xca, - 0xb1, 0xe8, 0x81, 0x08, 0x9c, 0x9b, 0x8f, 0xfa, 0x05, 0xc5, 0x7c, 0xe8, 0xd3, 0x46, 0x1b, 0xfb, - 0xc4, 0x79, 0xde, 0x8f, 0xe7, 0x99, 0x79, 0xe7, 0x25, 0x67, 0x08, 0xd6, 0x89, 0x68, 0x11, 0x16,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0x94, 0xf5, 0xd4, 0x71, 0x6a, - 0x16, 0xa7, 0x1d, 0xff, 0x53, 0x76, 0x34, 0x81, 0x60, 0x1d, 0x40, 0x93, 0xc6, 0x88, 0x48, 0x59, - 0xd2, 0x50, 0xef, 0x7f, 0x49, 0xe5, 0xaa, 0xb7, 0x50, 0x7b, 0x91, 0x72, 0x1e, 0x62, 0x81, 0xd1, - 0x35, 0xcb, 0x49, 0xde, 0xca, 0xdb, 0xf3, 0x27, 0x79, 0x6b, 0xd1, 0xb6, 0x86, 0xeb, 0x37, 0xb3, - 0x40, 0x2b, 0x03, 0x3c, 0x46, 0x5f, 0xaf, 0xbf, 0xbb, 0xdc, 0x98, 0x7d, 0x7f, 0xb9, 0x31, 0xfb, - 0xe1, 0x72, 0x63, 0xf6, 0xc7, 0x8f, 0x1b, 0x33, 0xef, 0x3f, 0x6e, 0xcc, 0xfc, 0xf6, 0x71, 0x63, - 0xe6, 0xcb, 0xad, 0xb1, 0xcf, 0xb9, 0x68, 0x61, 0xc6, 0x43, 0x5e, 0x1b, 0xfd, 0x80, 0x76, 0xd5, - 0x2f, 0xa8, 0xfa, 0xa8, 0x37, 0x17, 0xd4, 0xaf, 0xe5, 0x93, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x1f, 0x3b, 0x19, 0x3a, 0xa0, 0x0e, 0x00, 0x00, + // 1514 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6e, 0xdb, 0x46, + 0x1a, 0xb7, 0x2d, 0xd9, 0xa6, 0x46, 0xb2, 0x44, 0x8f, 0x1d, 0xaf, 0xe2, 0x60, 0x4d, 0x2f, 0x0f, + 0x0b, 0x2f, 0x90, 0x58, 0xb1, 0x03, 0x63, 0x83, 0x04, 0x7b, 0xb0, 0x6c, 0x27, 0xb1, 0x37, 0xd9, + 0x35, 0xc6, 0x5e, 0x2c, 0x50, 0xb4, 0x20, 0x46, 0xe4, 0x84, 0x62, 0x4d, 0x72, 0x84, 0x99, 0xa1, + 0x22, 0x15, 0x7d, 0x80, 0x02, 0xbd, 0xf4, 0x11, 0xfa, 0x0a, 0x45, 0x5f, 0x22, 0xe8, 0x29, 0xc7, + 0xa2, 0x07, 0x22, 0x70, 0x6e, 0x3e, 0xea, 0x09, 0x0a, 0xce, 0x8c, 0xa8, 0x3f, 0x36, 0xda, 0xd8, + 0x27, 0xce, 0xef, 0xfb, 0xf3, 0xfb, 0xcd, 0x7c, 0xf3, 0x91, 0x33, 0x04, 0xeb, 0x44, 0xb4, 0x09, + 0x8b, 0x82, 0x58, 0x34, 0x48, 0x37, 0x6a, 0x74, 0x77, 0xb2, 0xc7, 0x76, 0x87, 0x51, 0x41, 0xa1, + 0x99, 0xfb, 0xb6, 0x33, 0x63, 0x77, 0x67, 0x7d, 0xd5, 0xa7, 0x3e, 0x95, 0xce, 0x46, 0x36, 0x52, + 0x71, 0xf6, 0xcf, 0x05, 0xb0, 0x70, 0x8a, 0x19, 0x8e, 0x38, 0xdc, 0x01, 0x25, 0xd2, 0x8d, 0x1c, + 0x8f, 0xc4, 0x34, 0xaa, 0xcf, 0x6e, 0xce, 0x6e, 0x95, 0x9a, 0xab, 0x83, 0xd4, 0x32, 0xfb, 0x38, + 0x0a, 0x9f, 0xd9, 0xb9, 0xcb, 0x46, 0x06, 0xe9, 0x46, 0x87, 0xd9, 0x10, 0xfe, 0x0b, 0x2c, 0x91, + 0x18, 0xb7, 0x42, 0xe2, 0xb8, 0x8c, 0x60, 0x41, 0xea, 0x73, 0x9b, 0xb3, 0x5b, 0x46, 0xb3, 0x3e, + 0x48, 0xad, 0x55, 0x9d, 0x36, 0xee, 0xb6, 0x51, 0x45, 0xe1, 0x03, 0x09, 0xe1, 0x3f, 0x41, 0x79, + 0xe8, 0xc7, 0x61, 0x58, 0x2f, 0xc8, 0xe4, 0xb5, 0x41, 0x6a, 0xc1, 0xc9, 0x64, 0x1c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x54, 0x7a, 0x60, 0x05, 0x33, 0x46, 0xdf, 0x4d, 0xd5, 0x10, 0x4a, 0xb1, 0x57, 0xb7, 0x12, 0x5b, + 0x57, 0x62, 0x37, 0xd0, 0xd9, 0x68, 0x59, 0x5a, 0x27, 0xaa, 0x48, 0x81, 0x19, 0x11, 0xe6, 0x93, + 0xf1, 0x73, 0x60, 0xe5, 0xee, 0xad, 0x39, 0xcd, 0x65, 0xa3, 0xaa, 0x34, 0xe5, 0xdf, 0xfe, 0x93, + 0xa2, 0x51, 0x35, 0x6b, 0x27, 0x45, 0xa3, 0x66, 0x9a, 0x27, 0x45, 0xc3, 0x34, 0x97, 0xd1, 0x52, + 0x9f, 0x86, 0xd4, 0xe9, 0x3e, 0x51, 0x19, 0xa8, 0x4c, 0xde, 0x61, 0xae, 0x5f, 0x64, 0x54, 0x75, + 0xb1, 0xc0, 0x61, 0x9f, 0x0b, 0x4d, 0xd7, 0x00, 0xf3, 0x67, 0x22, 0xbb, 0x75, 0x98, 0xa0, 0x70, + 0x41, 0xfa, 0xea, 0x80, 0x44, 0xd9, 0x10, 0xae, 0x82, 0xf9, 0x2e, 0x0e, 0x13, 0x75, 0x7d, 0x29, + 0x21, 0x05, 0xec, 0x53, 0x50, 0x3b, 0x67, 0x38, 0xe6, 0xd8, 0x15, 0x01, 0x8d, 0x5f, 0x53, 0x9f, + 0x43, 0x08, 0x8a, 0xf2, 0x43, 0xad, 0x72, 0xe5, 0x18, 0xfe, 0x03, 0x14, 0x43, 0xea, 0xf3, 0xfa, + 0xdc, 0x66, 0x61, 0xab, 0xbc, 0x7b, 0xef, 0xfa, 0x05, 0xe2, 0x35, 0xf5, 0x91, 0x0c, 0xb1, 0x7f, + 0x99, 0x03, 0x85, 0xd7, 0xd4, 0x87, 0x75, 0xb0, 0x88, 0x3d, 0x8f, 0x11, 0xce, 0x35, 0xd3, 0x10, + 0xc2, 0x35, 0xb0, 0x20, 0x68, 0x27, 0x70, 0x15, 0x5d, 0x09, 0x69, 0x94, 0x09, 0x7b, 0x58, 0x60, + 0x79, 0xd4, 0x55, 0x90, 0x1c, 0xc3, 0x5d, 0x50, 0x91, 0x2b, 0x73, 0xe2, 0x24, 0x6a, 0x11, 0x26, + 0x4f, 0xac, 0x62, 0xb3, 0x76, 0x95, 0x5a, 0x65, 0x69, 0xff, 0x8f, 0x34, 0xa3, 0x71, 0x00, 0x1f, + 0x82, 0x45, 0xd1, 0x1b, 0x3f, 0x6c, 0x56, 0xae, 0x52, 0xab, 0x26, 0x46, 0xcb, 0xcc, 0xce, 0x12, + 0xb4, 0x20, 0x7a, 0xf2, 0x4c, 0x69, 0x00, 0x43, 0xf4, 0x9c, 0x20, 0xf6, 0x48, 0x4f, 0x9e, 0x27, + 0xc5, 0xe6, 0xea, 0x55, 0x6a, 0x99, 0x63, 0xe1, 0xc7, 0x99, 0x0f, 0x2d, 0x8a, 0x9e, 0x1c, 0xc0, + 0x87, 0x00, 0xa8, 0x29, 0x49, 0x05, 0x75, 0x1a, 0x2c, 0x5d, 0xa5, 0x56, 0x49, 0x5a, 0x25, 0xf7, + 0x68, 0x08, 0x6d, 0x30, 0xaf, 0xb8, 0x0d, 0xc9, 0x5d, 0xb9, 0x4a, 0x2d, 0x23, 0xa4, 0xbe, 0xe2, + 0x54, 0xae, 0xac, 0x54, 0x8c, 0x44, 0xb4, 0x4b, 0x3c, 0xf9, 0xc1, 0x35, 0xd0, 0x10, 0xda, 0xdf, + 0xcf, 0x01, 0xe3, 0xbc, 0x87, 0x08, 0x4f, 0x42, 0x01, 0x5f, 0x00, 0xd3, 0xa5, 0xb1, 0x60, 0xd8, + 0x15, 0xce, 0x44, 0x69, 0x9b, 0x0f, 0x46, 0x1d, 0x36, 0x1d, 0x61, 0xa3, 0xda, 0xd0, 0xb4, 0xaf, + 0xeb, 0xbf, 0x0a, 0xe6, 0x5b, 0x21, 0xa5, 0x91, 0xec, 0x84, 0x0a, 0x52, 0x00, 0x22, 0x59, 0x35, + 0xb9, 0xcb, 0x05,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, 0xd5, 0x3c, 0x54, 0x7a, 0xd0, 0x14, + 0xce, 0x76, 0xda, 0x23, 0xad, 0xc4, 0x97, 0xcd, 0x67, 0x20, 0x05, 0x32, 0x6b, 0x18, 0x44, 0x81, + 0x90, 0xcd, 0x36, 0x8f, 0x14, 0x80, 0xcf, 0x41, 0x89, 0x76, 0x09, 0x63, 0x81, 0x47, 0xb8, 0x3c, + 0x7d, 0xff, 0xec, 0x47, 0x01, 0x8d, 0xe2, 0xb3, 0xc5, 0xe9, 0xff, 0x98, 0x88, 0x44, 0x94, 0xf5, + 0xe5, 0x71, 0xaa, 0x17, 0xa7, 0x1c, 0x6f, 0xa4, 0x1d, 0x4d, 0x20, 0xd8, 0x04, 0x50, 0xa7, 0x31, + 0x22, 0x12, 0x16, 0x3b, 0xf2, 0xfd, 0xaf, 0xc8, 0x5c, 0xf9, 0x16, 0x2a, 0x2f, 0x92, 0xce, 0x43, + 0x2c, 0x30, 0xba, 0x66, 0x39, 0x29, 0x1a, 0x45, 0x73, 0xfe, 0xa4, 0x68, 0x2c, 0x9a, 0x46, 0xbe, + 0x7e, 0x3d, 0x0b, 0xb4, 0x32, 0xc4, 0x63, 0xf4, 0xcd, 0xe6, 0xfb, 0xcb, 0x8d, 0xd9, 0x0f, 0x97, + 0x1b, 0xb3, 0x1f, 0x2f, 0x37, 0x66, 0x7f, 0xf8, 0xb4, 0x31, 0xf3, 0xe1, 0xd3, 0xc6, 0xcc, 0xaf, + 0x9f, 0x36, 0x66, 0xbe, 0xd8, 0x1a, 0xfb, 0x9c, 0x8b, 0x36, 0x66, 0x3c, 0xe0, 0x8d, 0xd1, 0xef, + 0x67, 0x4f, 0xfe, 0x80, 0xca, 0x8f, 0x7a, 0x6b, 0x41, 0xfe, 0x58, 0x3e, 0xf9, 0x3d, 0x00, 0x00, + 0xff, 0xff, 0xc9, 0xc5, 0x98, 0x42, 0x9e, 0x0e, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -779,9 +779,9 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size := m.MinGasDenominator.Size() + size := m.MinGasMultiplier.Size() i -= size - if _, err := m.MinGasDenominator.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.MinGasMultiplier.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintEvm(dAtA, i, uint64(size)) @@ -1480,7 +1480,7 @@ func (m *Params) Size() (n int) { } l = m.ChainConfig.Size() n += 1 + l + sovEvm(uint64(l)) - l = m.MinGasDenominator.Size() + l = m.MinGasMultiplier.Size() n += 1 + l + sovEvm(uint64(l)) return n } @@ -1944,7 +1944,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinGasDenominator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinGasMultiplier", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1972,7 +1972,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MinGasDenominator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.MinGasMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/evm/types/params.go b/x/evm/types/params.go index e15cf2c5ae..26b3ef8627 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -20,12 +20,12 @@ const ( // Parameter keys var ( - ParamStoreKeyEVMDenom = []byte("EVMDenom") - ParamStoreKeyEnableCreate = []byte("EnableCreate") - ParamStoreKeyEnableCall = []byte("EnableCall") - ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs") - ParamStoreKeyChainConfig = []byte("ChainConfig") - ParamStoreKeyMinGasDenominator = []byte("MinGasDenominator") + ParamStoreKeyEVMDenom = []byte("EVMDenom") + ParamStoreKeyEnableCreate = []byte("EnableCreate") + ParamStoreKeyEnableCall = []byte("EnableCall") + ParamStoreKeyExtraEIPs = []byte("EnableExtraEIPs") + ParamStoreKeyChainConfig = []byte("ChainConfig") + ParamStoreKeyMinGasMultiplier = []byte("MinGasMultiplier") // AvailableExtraEIPs define the list of all EIPs that can be enabled by the // EVM interpreter. These EIPs are applied in order and can override the @@ -41,14 +41,14 @@ func ParamKeyTable() paramtypes.KeyTable { } // NewParams creates a new Params instance -func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, minGasDenom sdk.Dec, extraEIPs ...int64) Params { +func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfig, minGasMultiplier sdk.Dec, extraEIPs ...int64) Params { return Params{ - EvmDenom: evmDenom, - EnableCreate: enableCreate, - EnableCall: enableCall, - ExtraEIPs: extraEIPs, - ChainConfig: config, - MinGasDenominator: minGasDenom, + EvmDenom: evmDenom, + EnableCreate: enableCreate, + EnableCall: enableCall, + ExtraEIPs: extraEIPs, + ChainConfig: config, + MinGasMultiplier: minGasMultiplier, } } @@ -56,12 +56,12 @@ func NewParams(evmDenom string, enableCreate, enableCall bool, config ChainConfi // ExtraEIPs is empty to prevent overriding the latest hard fork instruction set func DefaultParams() Params { return Params{ - EvmDenom: DefaultEVMDenom, - EnableCreate: true, - EnableCall: true, - ChainConfig: DefaultChainConfig(), - ExtraEIPs: nil, - MinGasDenominator: sdk.NewDecWithPrec(50, 2), + EvmDenom: DefaultEVMDenom, + EnableCreate: true, + EnableCall: true, + ChainConfig: DefaultChainConfig(), + ExtraEIPs: nil, + MinGasMultiplier: sdk.NewDecWithPrec(50, 2), } } @@ -73,7 +73,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(ParamStoreKeyEnableCall, &p.EnableCall, validateBool), paramtypes.NewParamSetPair(ParamStoreKeyExtraEIPs, &p.ExtraEIPs, validateEIPs), paramtypes.NewParamSetPair(ParamStoreKeyChainConfig, &p.ChainConfig, validateChainConfig), - paramtypes.NewParamSetPair(ParamStoreKeyMinGasDenominator, &p.MinGasDenominator, validateMinGasDenominator), + paramtypes.NewParamSetPair(ParamStoreKeyMinGasMultiplier, &p.MinGasMultiplier, validateMinGasMultiplier), } } @@ -87,7 +87,7 @@ func (p Params) Validate() error { return err } - if err := validateMinGasDenominator(p.MinGasDenominator); err != nil { + if err := validateMinGasMultiplier(p.MinGasMultiplier); err != nil { return err } @@ -135,7 +135,7 @@ func validateEIPs(i interface{}) error { return nil } -func validateMinGasDenominator(i interface{}) error { +func validateMinGasMultiplier(i interface{}) error { v, ok := i.(sdk.Dec) if !ok { diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index 14ba599c8c..b8204f29f0 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -47,7 +47,7 @@ func TestParamsValidate(t *testing.T) { true, }, { - "invalid min gas denominator", + "invalid min gas multplier", NewParams("ara", true, true, DefaultChainConfig(), sdk.NewDec(2), 2929, 1884, 1344), true, }, @@ -78,7 +78,7 @@ func TestParamsValidatePriv(t *testing.T) { require.NoError(t, validateBool(true)) require.Error(t, validateEIPs("")) require.NoError(t, validateEIPs([]int64{1884})) - require.Error(t, validateMinGasDenominator(sdk.NewDec(-5))) + require.Error(t, validateMinGasMultiplier(sdk.NewDec(-5))) } func TestValidateChainConfig(t *testing.T) { From 843bcfde53a563aa558d9dc2590289cbc696f911 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 19 May 2022 21:23:28 +0200 Subject: [PATCH 11/18] fix tests --- x/evm/simulation/genesis.go | 2 +- x/evm/types/params.go | 6 +++++- x/evm/types/params_test.go | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/x/evm/simulation/genesis.go b/x/evm/simulation/genesis.go index fc15c37e40..cab8815345 100644 --- a/x/evm/simulation/genesis.go +++ b/x/evm/simulation/genesis.go @@ -48,7 +48,7 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { extraEIPs = GenExtraEIPs(r) }, ) - params := types.DefaultParams() + params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), types.DefaultMinGasMultiplier(), extraEIPs...) evmGenesis := types.NewGenesisState(params, []types.GenesisAccount{}) bz, err := json.MarshalIndent(evmGenesis, "", " ") diff --git a/x/evm/types/params.go b/x/evm/types/params.go index 26b3ef8627..2b422aa287 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -61,10 +61,14 @@ func DefaultParams() Params { EnableCall: true, ChainConfig: DefaultChainConfig(), ExtraEIPs: nil, - MinGasMultiplier: sdk.NewDecWithPrec(50, 2), + MinGasMultiplier: DefaultMinGasMultiplier(), } } +func DefaultMinGasMultiplier() sdk.Dec { + return sdk.NewDecWithPrec(50, 2) +} + // ParamSetPairs returns the parameter set pairs. func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index b8204f29f0..1b54fe6471 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -23,7 +23,7 @@ func TestParamsValidate(t *testing.T) { {"default", DefaultParams(), false}, { "valid", - NewParams("ara", true, true, DefaultChainConfig(), sdk.NewDecWithPrec(50, 2), 2929, 1884, 1344), + NewParams("ara", true, true, DefaultChainConfig(), DefaultMinGasMultiplier(), 2929, 1884, 1344), false, }, { @@ -65,7 +65,7 @@ func TestParamsValidate(t *testing.T) { } func TestParamsEIPs(t *testing.T) { - params := NewParams("ara", true, true, DefaultChainConfig(), sdk.NewDecWithPrec(50, 2), 2929, 1884, 1344) + params := NewParams("ara", true, true, DefaultChainConfig(), DefaultMinGasMultiplier(), 2929, 1884, 1344) actual := params.EIPs() require.Equal(t, []int([]int{2929, 1884, 1344}), actual) From a315943610e782cfca9e223f49664e100c230cca Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Sun, 22 May 2022 10:45:01 +0200 Subject: [PATCH 12/18] use truncate and run mod tidy --- go.mod | 11 --------- go.sum | 42 -------------------------------- x/evm/keeper/state_transition.go | 2 +- 3 files changed, 1 insertion(+), 54 deletions(-) diff --git a/go.mod b/go.mod index ce9e8e915a..8955fb8201 100644 --- a/go.mod +++ b/go.mod @@ -42,13 +42,9 @@ require ( github.com/99designs/keyring v1.1.6 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/DataDog/zstd v1.4.5 // indirect - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect - github.com/aokoli/goutils v1.1.1 // indirect github.com/armon/go-metrics v0.3.10 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -72,7 +68,6 @@ require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect - github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect @@ -99,9 +94,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/huandu/xstrings v1.3.2 // indirect github.com/huin/goupnp v1.0.2 // indirect - github.com/imdario/mergo v0.3.12 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect github.com/jmhodges/levigo v1.0.0 // indirect @@ -115,10 +108,8 @@ require ( github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect github.com/minio/highwayhash v1.0.2 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/mwitkow/go-proto-validators v0.3.2 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.4 // indirect @@ -130,8 +121,6 @@ require ( github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/tsdb v0.7.1 // indirect - github.com/pseudomuto/protoc-gen-doc v1.5.1 // indirect - github.com/pseudomuto/protokit v0.2.1 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect github.com/rjeczalik/notify v0.9.1 // indirect github.com/rs/zerolog v1.23.0 // indirect diff --git a/go.sum b/go.sum index 077c717bb8..a33d300ee0 100644 --- a/go.sum +++ b/go.sum @@ -93,14 +93,6 @@ github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= @@ -138,9 +130,6 @@ github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKS github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= -github.com/aokoli/goutils v1.1.1 h1:/hA+Ywo3AxoDZY5ZMnkiEkUvkK4BPp927ax110KCqqg= -github.com/aokoli/goutils v1.1.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -343,10 +332,7 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.3.0-java/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= -github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg= github.com/ethereum/go-ethereum v1.10.16 h1:3oPrumn0bCW/idjcxMn5YYVCdK7VzJYIvwGZUGLEaoc= @@ -467,7 +453,6 @@ github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71 github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -649,9 +634,6 @@ github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25 github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= -github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= @@ -662,9 +644,6 @@ github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3 github.com/iancoleman/strcase v0.2.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/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= 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= @@ -763,7 +742,6 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= @@ -817,8 +795,6 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -833,8 +809,6 @@ github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGg github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -851,9 +825,6 @@ github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ib github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= -github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= -github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= @@ -1012,11 +983,6 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pseudomuto/protoc-gen-doc v1.5.1 h1:Ah259kcrio7Ix1Rhb6u8FCaOkzf9qRBqXnvAufg061w= -github.com/pseudomuto/protoc-gen-doc v1.5.1/go.mod h1:XpMKYg6zkcpgfpCfQ8GcWBDRtRxOmMR5w7pz4Xo+dYM= -github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= -github.com/pseudomuto/protokit v0.2.1 h1:kCYpE3thoR6Esm0CUvd5xbrDTOZPvQPTDeyXpZfrJdk= -github.com/pseudomuto/protokit v0.2.1/go.mod h1:gt7N5Rz2flBzYafvaxyIxMZC0TTF5jDZfRnw25hAAyo= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1120,7 +1086,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1270,7 +1235,6 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0= golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -1664,7 +1628,6 @@ google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6 google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.58.0/go.mod h1:cAbP2FsxoGVNwtgNAmmn3y5G1TWAiVYRmg4yku3lv+E= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= @@ -1680,7 +1643,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180427144745-86e600f69ee4/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1764,10 +1726,6 @@ google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2 google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4 h1:myaecH64R0bIEDjNORIel4iXubqzaHU1K2z8ajBwWcM= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335 h1:2D0OT6tPVdrQTOnVe1VQjfJPTED6EZ7fdJ/f6Db6OsY= google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 65c8f93f56..ae460f1181 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -422,7 +422,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace // NOTE: MinGasDenominator can not be negative as it is validated on ValidateParams gasLimit := sdk.NewDec(int64(msg.Gas())) minimumGasUsed := gasLimit.Mul(cfg.Params.MinGasMultiplier) - gasUsed = sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(gasUsed))).RoundInt().Uint64() + gasUsed = sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(gasUsed))).TruncateInt().Uint64() return &types.MsgEthereumTxResponse{ GasUsed: gasUsed, From 37270222d6b22f849467ab602b91fd6401211618 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Sun, 22 May 2022 10:47:51 +0200 Subject: [PATCH 13/18] comment to default value --- x/evm/types/params.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x/evm/types/params.go b/x/evm/types/params.go index 2b422aa287..7901864523 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -65,6 +65,8 @@ func DefaultParams() Params { } } +// DefaultMinGasMultiplier returns default value for MinGasMultiplier. +// Default value is 0.5 or 50% func DefaultMinGasMultiplier() sdk.Dec { return sdk.NewDecWithPrec(50, 2) } From 2ef56c22125eb128b740d2dc7d8326985206e08d Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Sun, 22 May 2022 10:51:06 +0200 Subject: [PATCH 14/18] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d080a4d9d9..8f528b33d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking * (ante) [tharsis#1060](https://github.com/tharsis/ethermint/pull/1060) Check `EnableCreate`/`EnableCall` in `AnteHandler` to short-circuit EVM transactions. +* (evm) [tharsis#1087](https://github.com/tharsis/ethermint/pull/1087) Minimum GasUsed proportional to GasLimit and `MinGasDenominator` EVM module param. ### API Breaking @@ -57,7 +58,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Move `rpc/ethereum/backend` -> `rpc/backend` * Move `rpc/ethereum/namespaces` -> `rpc/namespaces/ethereum` * (rpc) [tharsis#1068](https://github.com/tharsis/ethermint/pull/1068) Fix London hard-fork check logic in JSON-RPC APIs. -* (evm) [tharsis#1087](https://github.com/tharsis/ethermint/pull/1087) Minimum GasUsed proportional to GasLimit and `MinGasDenominator` EVM module param. ### Improvements From 7d23f32b3109a67536567bbf59689e9a69c12347 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Sun, 22 May 2022 10:53:25 +0200 Subject: [PATCH 15/18] rename temporary gas used --- x/evm/keeper/state_transition.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index ae460f1181..bd2ba8737a 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -396,12 +396,12 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace if msg.Gas() < leftoverGas { return nil, sdkerrors.Wrap(types.ErrGasOverflow, "apply message") } - gasUsed := msg.Gas() - leftoverGas - refund := GasToRefund(stateDB.GetRefund(), gasUsed, refundQuotient) - if refund > gasUsed { + temporaryGasUsed := msg.Gas() - leftoverGas + refund := GasToRefund(stateDB.GetRefund(), temporaryGasUsed, refundQuotient) + if refund > temporaryGasUsed { return nil, sdkerrors.Wrap(types.ErrGasOverflow, "apply message") } - gasUsed -= refund + temporaryGasUsed -= refund // EVM execution error needs to be available for the JSON-RPC client var vmError string @@ -422,7 +422,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace // NOTE: MinGasDenominator can not be negative as it is validated on ValidateParams gasLimit := sdk.NewDec(int64(msg.Gas())) minimumGasUsed := gasLimit.Mul(cfg.Params.MinGasMultiplier) - gasUsed = sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(gasUsed))).TruncateInt().Uint64() + gasUsed := sdk.MaxDec(minimumGasUsed, sdk.NewDec(int64(temporaryGasUsed))).TruncateInt().Uint64() return &types.MsgEthereumTxResponse{ GasUsed: gasUsed, From 267f4db70cb901d1b525c5da5dff11f518021236 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Mon, 23 May 2022 13:12:19 +0200 Subject: [PATCH 16/18] integration tests --- tests/e2e/integration_test.go | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/e2e/integration_test.go b/tests/e2e/integration_test.go index d9959b3388..a30c50a5b2 100644 --- a/tests/e2e/integration_test.go +++ b/tests/e2e/integration_test.go @@ -837,3 +837,58 @@ func (s *IntegrationTestSuite) TestBatchETHTransactions() { s.Require().Equal(accountNonce+uint64(i)+1, tx.Nonce()) } } + +func (s *IntegrationTestSuite) TestGasConsumptionOnNormalTransfer() { + testCases := []struct { + name string + gasLimit uint64 + expectedGasUsed uint64 + }{ + { + "gas used is the same as gas limit", + 21000, + 21000, + }, + { + "gas used is half of Gas limit", + 70000, + 35000, + }, + { + "gas used is less than half of gasLimit", + 30000, + 21000, + }, + } + + recipient := common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec") + chainID, err := s.network.Validators[0].JSONRPCClient.ChainID(s.ctx) + s.Require().NoError(err) + from := common.BytesToAddress(s.network.Validators[0].Address) + for _, tc := range testCases { + s.Run(tc.name, func() { + nonce := s.getAccountNonce(from) + s.Require().NoError(err) + gasPrice := s.getGasPrice() + msgTx := evmtypes.NewTx( + chainID, + nonce, + &recipient, + nil, + tc.gasLimit, + gasPrice, + nil, nil, + nil, + nil, + ) + msgTx.From = from.Hex() + err = msgTx.Sign(s.ethSigner, s.network.Validators[0].ClientCtx.Keyring) + s.Require().NoError(err) + err := s.network.Validators[0].JSONRPCClient.SendTransaction(s.ctx, msgTx.AsTransaction()) + s.Require().NoError(err) + s.waitForTransaction() + receipt := s.expectSuccessReceipt(msgTx.AsTransaction().Hash()) + s.Equal(receipt.GasUsed, tc.expectedGasUsed) + }) + } +} From 2ac4a52c03a6603b0550db64652ae394b33c4ea6 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Mon, 23 May 2022 14:12:38 +0200 Subject: [PATCH 17/18] add migrations --- x/evm/keeper/migrations.go | 10 ++++++ x/evm/migrations/v2/migration.go | 18 +++++++++++ x/evm/migrations/v2/migration_test.go | 46 +++++++++++++++++++++++++++ x/evm/module.go | 12 ++++--- 4 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 x/evm/migrations/v2/migration.go create mode 100644 x/evm/migrations/v2/migration_test.go diff --git a/x/evm/keeper/migrations.go b/x/evm/keeper/migrations.go index 3be1ada66f..70f78b69b6 100644 --- a/x/evm/keeper/migrations.go +++ b/x/evm/keeper/migrations.go @@ -1,5 +1,10 @@ package keeper +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + v2 "github.com/tharsis/ethermint/x/evm/migrations/v2" +) + // Migrator is a struct for handling in-place store migrations. type Migrator struct { keeper Keeper @@ -11,3 +16,8 @@ func NewMigrator(keeper Keeper) Migrator { keeper: keeper, } } + +// Migrate1to2 migrates the store from consensus version v1 to v2 +func (m Migrator) Migrate1to2(ctx sdk.Context) error { + return v2.AddMinGasMultiplierParam(ctx, &m.keeper.paramSpace) +} diff --git a/x/evm/migrations/v2/migration.go b/x/evm/migrations/v2/migration.go new file mode 100644 index 0000000000..1b149d4e49 --- /dev/null +++ b/x/evm/migrations/v2/migration.go @@ -0,0 +1,18 @@ +package v2 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tharsis/ethermint/x/evm/types" +) + +// AddMinGasMultiplierParam updates the module parameter MinGasMultiplier to 0.5 +func AddMinGasMultiplierParam(ctx sdk.Context, paramStore *paramtypes.Subspace) error { + if !paramStore.HasKeyTable() { + ps := paramStore.WithKeyTable(types.ParamKeyTable()) + paramStore = &ps + } + + paramStore.Set(ctx, types.ParamStoreKeyMinGasMultiplier, types.DefaultMinGasMultiplier()) + return nil +} diff --git a/x/evm/migrations/v2/migration_test.go b/x/evm/migrations/v2/migration_test.go new file mode 100644 index 0000000000..c4f61a8f52 --- /dev/null +++ b/x/evm/migrations/v2/migration_test.go @@ -0,0 +1,46 @@ +package v2_test + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/require" + "github.com/tharsis/ethermint/app" + "github.com/tharsis/ethermint/encoding" + v2 "github.com/tharsis/ethermint/x/evm/migrations/v2" + "github.com/tharsis/ethermint/x/evm/types" + "testing" +) + +func TestAddMinGasMultiplierParam(t *testing.T) { + encCfg := encoding.MakeConfig(app.ModuleBasics) + erc20Key := sdk.NewKVStoreKey(types.StoreKey) + tErc20Key := sdk.NewTransientStoreKey(fmt.Sprintf("%s_test", types.StoreKey)) + ctx := testutil.DefaultContext(erc20Key, tErc20Key) + paramStore := paramtypes.NewSubspace( + encCfg.Marshaler, encCfg.Amino, erc20Key, tErc20Key, "erc20", + ) + paramStore = paramStore.WithKeyTable(types.ParamKeyTable()) + require.True(t, paramStore.HasKeyTable()) + + // check no param + require.False(t, paramStore.Has(ctx, types.ParamStoreKeyMinGasMultiplier)) + + // Run migrations + err := v2.AddMinGasMultiplierParam(ctx, ¶mStore) + require.NoError(t, err) + + // Make sure the params are set + require.True(t, paramStore.Has(ctx, types.ParamStoreKeyMinGasMultiplier)) + + var minGasMultiplier sdk.Dec + + // Make sure the new params are set + require.NotPanics(t, func() { + paramStore.Get(ctx, types.ParamStoreKeyMinGasMultiplier, &minGasMultiplier) + }) + + // check the params is up + require.Equal(t, minGasMultiplier, types.DefaultMinGasMultiplier()) +} diff --git a/x/evm/module.go b/x/evm/module.go index 1335b263fc..f413e1e0e6 100644 --- a/x/evm/module.go +++ b/x/evm/module.go @@ -44,7 +44,7 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { // ConsensusVersion returns the consensus state-breaking version for the module. func (AppModuleBasic) ConsensusVersion() uint64 { - return 1 + return 2 } // DefaultGenesis returns default genesis state as raw bytes for the evm @@ -117,13 +117,17 @@ func (AppModule) Name() string { func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries and runs necessary migrations. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - _ = keeper.NewMigrator(*am.keeper) + migrator := keeper.NewMigrator(*am.keeper) + // register v1 -> v2 migration for MinGasMultiplierParam + if err := cfg.RegisterMigration(types.ModuleName, 1, migrator.Migrate1to2); err != nil { + panic(fmt.Errorf("failed to migrate %s to v2: %w", types.ModuleName, err)) + } } // Route returns the message routing key for the evm module. From 03bbfbc5f359b0dd9c14fe597634893c2ba9c04e Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Mon, 23 May 2022 16:55:21 +0200 Subject: [PATCH 18/18] add default as var --- x/evm/migrations/v2/migration.go | 2 +- x/evm/migrations/v2/migration_test.go | 2 +- x/evm/simulation/genesis.go | 2 +- x/evm/types/params.go | 11 ++++------- x/evm/types/params_test.go | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/x/evm/migrations/v2/migration.go b/x/evm/migrations/v2/migration.go index 1b149d4e49..421b49292a 100644 --- a/x/evm/migrations/v2/migration.go +++ b/x/evm/migrations/v2/migration.go @@ -13,6 +13,6 @@ func AddMinGasMultiplierParam(ctx sdk.Context, paramStore *paramtypes.Subspace) paramStore = &ps } - paramStore.Set(ctx, types.ParamStoreKeyMinGasMultiplier, types.DefaultMinGasMultiplier()) + paramStore.Set(ctx, types.ParamStoreKeyMinGasMultiplier, types.DefaultMinGasMultiplier) return nil } diff --git a/x/evm/migrations/v2/migration_test.go b/x/evm/migrations/v2/migration_test.go index c4f61a8f52..d8c70b6d1a 100644 --- a/x/evm/migrations/v2/migration_test.go +++ b/x/evm/migrations/v2/migration_test.go @@ -42,5 +42,5 @@ func TestAddMinGasMultiplierParam(t *testing.T) { }) // check the params is up - require.Equal(t, minGasMultiplier, types.DefaultMinGasMultiplier()) + require.Equal(t, minGasMultiplier, types.DefaultMinGasMultiplier) } diff --git a/x/evm/simulation/genesis.go b/x/evm/simulation/genesis.go index cab8815345..4dd020c95b 100644 --- a/x/evm/simulation/genesis.go +++ b/x/evm/simulation/genesis.go @@ -48,7 +48,7 @@ func RandomizedGenState(simState *module.SimulationState) { func(r *rand.Rand) { extraEIPs = GenExtraEIPs(r) }, ) - params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), types.DefaultMinGasMultiplier(), extraEIPs...) + params := types.NewParams(types.DefaultEVMDenom, true, true, types.DefaultChainConfig(), types.DefaultMinGasMultiplier, extraEIPs...) evmGenesis := types.NewGenesisState(params, []types.GenesisAccount{}) bz, err := json.MarshalIndent(evmGenesis, "", " ") diff --git a/x/evm/types/params.go b/x/evm/types/params.go index 7901864523..bfd5de3172 100644 --- a/x/evm/types/params.go +++ b/x/evm/types/params.go @@ -18,6 +18,9 @@ const ( DefaultEVMDenom = types.AttoPhoton ) +// DefaultMinGasMultiplier is 0.5 or 50% +var DefaultMinGasMultiplier = sdk.NewDecWithPrec(50, 2) + // Parameter keys var ( ParamStoreKeyEVMDenom = []byte("EVMDenom") @@ -61,16 +64,10 @@ func DefaultParams() Params { EnableCall: true, ChainConfig: DefaultChainConfig(), ExtraEIPs: nil, - MinGasMultiplier: DefaultMinGasMultiplier(), + MinGasMultiplier: DefaultMinGasMultiplier, } } -// DefaultMinGasMultiplier returns default value for MinGasMultiplier. -// Default value is 0.5 or 50% -func DefaultMinGasMultiplier() sdk.Dec { - return sdk.NewDecWithPrec(50, 2) -} - // ParamSetPairs returns the parameter set pairs. func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ diff --git a/x/evm/types/params_test.go b/x/evm/types/params_test.go index 1b54fe6471..f7333a61a2 100644 --- a/x/evm/types/params_test.go +++ b/x/evm/types/params_test.go @@ -23,7 +23,7 @@ func TestParamsValidate(t *testing.T) { {"default", DefaultParams(), false}, { "valid", - NewParams("ara", true, true, DefaultChainConfig(), DefaultMinGasMultiplier(), 2929, 1884, 1344), + NewParams("ara", true, true, DefaultChainConfig(), DefaultMinGasMultiplier, 2929, 1884, 1344), false, }, { @@ -65,7 +65,7 @@ func TestParamsValidate(t *testing.T) { } func TestParamsEIPs(t *testing.T) { - params := NewParams("ara", true, true, DefaultChainConfig(), DefaultMinGasMultiplier(), 2929, 1884, 1344) + params := NewParams("ara", true, true, DefaultChainConfig(), DefaultMinGasMultiplier, 2929, 1884, 1344) actual := params.EIPs() require.Equal(t, []int([]int{2929, 1884, 1344}), actual)