Skip to content

Commit

Permalink
Problem: transactions are not rejected when block gas limit exceeded (#…
Browse files Browse the repository at this point in the history
…377)

* Problem: checkTx/deliverTx don't report correct gasWanted

Solution:
- backport and modify the fix on ethermint to avoid breaking consensus.
- backport tx inclusion logic integration tests
- update nix dependencies to fix nix error

* fix integration test
  • Loading branch information
yihuang authored Mar 7, 2022
1 parent f1aba5a commit 93f9bd9
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 117 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## UNRELEASED

### Bug Fixes

- (tx, rpc) [cronos#377](https://github.com/crypto-org-chain/cronos/pull) back port bug fixes in ethermint: a) report correct gasWanted in checkTx, b) add returnValue message on tracing.

*March 2, 2022*

## v0.6.7
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/crypto-org-chain/cronos
go 1.17

require (
github.com/armon/go-metrics v0.3.9
github.com/armon/go-metrics v0.3.10
github.com/cosmos/cosmos-sdk v0.44.6
github.com/cosmos/ibc-go v1.2.2
github.com/ethereum/go-ethereum v1.10.3
Expand Down Expand Up @@ -82,7 +82,7 @@ require (
github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.1.1 // indirect
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88 // indirect
github.com/huin/goupnp v1.0.2 // indirect
github.com/improbable-eng/grpc-web v0.14.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 // indirect
Expand All @@ -97,7 +97,7 @@ 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.1 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/palantir/stacktrace v0.0.0-20161112013806-78658fd2d177 // indirect
Expand Down Expand Up @@ -164,7 +164,7 @@ replace github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethere
// TODO: remove when ibc-go and ethermint upgrades cosmos-sdk
replace github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.44.7-0.20220214161517-8a26cd10b4be

replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.7.2-cronos-12
replace github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.7.3-0.20220307013541-e3c38bb961a0

// Note: gorocksdb bindings for OptimisticTransactionDB are not merged upstream, so we use a fork
// See https://github.com/tecbot/gorocksdb/pull/216
Expand Down
13 changes: 8 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18=
github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo=
github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
Expand Down Expand Up @@ -237,8 +238,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/crypto-org-chain/ethermint v0.7.2-cronos-12 h1:mmE6jztiIRLHZVMsGFmasgRr2Rx/qAEPY4NMoG/Smf0=
github.com/crypto-org-chain/ethermint v0.7.2-cronos-12/go.mod h1:J96LX4KvLyl+5jV6+mt/4l6srtGX/mdDTuqQQuYrdDk=
github.com/crypto-org-chain/ethermint v0.7.3-0.20220307013541-e3c38bb961a0 h1:/mygBmxynU1ytA1lQoPNZ4z8VoOYSo4r0TQJQ7yaWD4=
github.com/crypto-org-chain/ethermint v0.7.3-0.20220307013541-e3c38bb961a0/go.mod h1:J96LX4KvLyl+5jV6+mt/4l6srtGX/mdDTuqQQuYrdDk=
github.com/crypto-org-chain/go-ethereum v1.10.3-patched h1:kr6oQIYOi2VC8SZwkhlUDZE1Omit/YHVysKMgCB2nes=
github.com/crypto-org-chain/go-ethereum v1.10.3-patched/go.mod h1:99onQmSd1GRGOziyGldI41YQb7EESX3Q4H41IfJgIQQ=
github.com/crypto-org-chain/ibc-go v1.2.1-hooks h1:wuWaQqm/TFKJQwuFgjCPiPumQio+Yik5Z1DObDExrrU=
Expand Down Expand Up @@ -549,8 +550,9 @@ github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw
github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88 h1:bcAj8KroPf552TScjFPIakjH2/tdIrIH8F+cc4v4SRo=
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo=
github.com/huin/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI=
github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
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=
Expand Down Expand Up @@ -699,8 +701,9 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo=
github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
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=
Expand Down
24 changes: 12 additions & 12 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,12 @@
sha256 = "1j6fdr1sg36qy4n4xjl7brq739fpm5npq98cmvklzjc9qrx98nk9"

["github.com/armon/go-metrics"]
sumVersion = "v0.3.9"
sumVersion = "v0.3.10"
["github.com/armon/go-metrics".fetch]
type = "git"
url = "https://github.com/armon/go-metrics"
rev = "f792dbc8f4b651df89dc7098fce61ca56a0a2bee"
sha256 = "0sbnzw7sdjcf2l6nsxynpv99m6sza1zyakl82by37sqhn60hj9is"
rev = "d1e5690ba72f7651735eb0a618d5523a6bdccf58"
sha256 = "07ycr1qswxx2r30r1dr27ggnjwxllcab17193sy2hfyps2ka31s2"

["github.com/armon/go-radix"]
sumVersion = "v1.0.0"
Expand Down Expand Up @@ -2095,12 +2095,12 @@
sha256 = "1f7pwj793p51nq03jiz834g0qvg502h9asry6nx4pdc10wzx2948"

["github.com/huin/goupnp"]
sumVersion = "v1.0.1-0.20210310174557-0ca763054c88"
sumVersion = "v1.0.2"
["github.com/huin/goupnp".fetch]
type = "git"
url = "https://github.com/huin/goupnp"
rev = "0ca763054c8882de233e45d2f61d8be91f86e536"
sha256 = "1wxy76z8dw491rck82xd13l90z68zsjhrijcfyn9gy4b1hi6p4dr"
rev = "5a0d4bd7ee6bee8e26f24664c8e0d0c8ec3b0a7e"
sha256 = "1cv561wlzlzwxwpwirmyck33bhfmgpgv4wfq65wv8wkk6lgvqz0m"

["github.com/huin/goutil"]
sumVersion = "v0.0.0-20170803182201-1ca381bf3150"
Expand Down Expand Up @@ -2734,12 +2734,12 @@
sha256 = "058n9bbf536f2nw3pbs7pysrg9cqvgkb28z2zf5wjyrzrknyk53g"

["github.com/mitchellh/mapstructure"]
sumVersion = "v1.4.2"
sumVersion = "v1.4.3"
["github.com/mitchellh/mapstructure".fetch]
type = "git"
url = "https://github.com/mitchellh/mapstructure"
rev = "5ac1f6aa4011ece0c4df24a4fe8020a9cc21e393"
sha256 = "0akjnwsng42vak978pny84d946fbaj2kgp7fzvx30zpc6fzrmli7"
rev = "b9b99d7d59762a5b2a43df840adc318b2fa229ee"
sha256 = "0crp7zd5qlvka5pyr42i16ag4dh1swdlzw6pc67i441b33yqbnys"

["github.com/moby/sys/mountinfo"]
sumVersion = "v0.4.1"
Expand Down Expand Up @@ -3712,13 +3712,13 @@
sha256 = "1sgjf2vaq554ybc0cwkzn17cz2ibzph2rq0dgaw21c2hym09437x"

["github.com/tharsis/ethermint"]
sumVersion = "v0.7.2-cronos-12"
sumVersion = "v0.7.3-0.20220307013541-e3c38bb961a0"
vendorPath = "github.com/crypto-org-chain/ethermint"
["github.com/tharsis/ethermint".fetch]
type = "git"
url = "https://github.com/crypto-org-chain/ethermint"
rev = "2934be7e4cfd5c45f5f0d4ed1027165716dcbf68"
sha256 = "1il63wa385yq0cyqb1qdspcfnxsxhrdjwg4f3ypjqr777igb2mvp"
rev = "e3c38bb961a0461af6281a5e24616f436cb93fcd"
sha256 = "0bqss02021rmkgfmbnkfd2q5aplk5caibpxyb440dahswp0v6r80"

["github.com/tidwall/gjson"]
sumVersion = "v1.6.7"
Expand Down
Loading

0 comments on commit 93f9bd9

Please sign in to comment.