From df68cfffd931c44a2ff8585d5f868a3468e0fec3 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 29 Apr 2022 11:16:28 +0800 Subject: [PATCH 1/5] Problem: query legacy block failed after upgrade Solution: - fix in ethermint and update the dependency --- go.mod | 6 +++--- go.sum | 4 ++-- integration_tests/test_upgrade.py | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 36bf8ebd4e..874f16b280 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.17 require ( github.com/armon/go-metrics v0.3.10 github.com/cosmos/cosmos-sdk v0.45.4 - github.com/cosmos/ibc-go/v2 v2.0.2 + github.com/cosmos/ibc-go/v2 v2.2.0 github.com/ethereum/go-ethereum v1.10.15 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 @@ -22,6 +22,7 @@ require ( github.com/tharsis/ethermint v0.10.0-alpha1 google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac google.golang.org/grpc v1.45.0 + google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -142,7 +143,6 @@ require ( golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 // indirect @@ -160,7 +160,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-8.0.20220426081631-a178ce6dba6e + github.com/tharsis/ethermint => github.com/yihuang/ethermint v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index ebe07ef9d6..453e954e70 100644 --- a/go.sum +++ b/go.sum @@ -271,8 +271,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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.10.0-alpha1-cronos-8.0.20220426081631-a178ce6dba6e h1:/IvLzce4Bp0noxIL7iPgTB/ShOiMaGDNiapTZgu2JXE= -github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-8.0.20220426081631-a178ce6dba6e/go.mod h1:diM7A56La2YMnIFA2rB/NPH2PbTYy6aevsgEdj+bJgc= github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2 h1:elj+Tb/3O9GA3pv62zkc1B0P8hl1WHmF6vF8PInEJm4= github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2/go.mod h1:rAHRlBcRiHPP/JszN+08SJx3pegww9bcVncIb9QLx7I= github.com/crypto-org-chain/keyring v1.1.6-fixes h1:AUFSu56NY6XobY6XfRoDx6v3loiOrHK5MNUm32GEjwA= @@ -1160,6 +1158,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= +github.com/yihuang/ethermint v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121 h1:2y4AQ105wfysFJEhnqi10+zINdKrKCy7iKwOISGphlg= +github.com/yihuang/ethermint v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121/go.mod h1:FLjeCtSiiWzDhAKO6usihVrnJwGw88I+KGYfr/geQSs= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index 799c29da69..044bb08458 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -123,3 +123,6 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos): fee2 = fee1 - fee1 // 100000000 assert w3.eth.get_block(target_height).baseFeePerGas == fee1 assert w3.eth.get_block(target_height + 1).baseFeePerGas == fee2 + + # query legacy blocks after upgrade + assert w3.eth.get_block(target_height - 1).baseFeePerGas is None From d9375a5a3e7f75863b2b18dc9e47c996e721ebc1 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 29 Apr 2022 11:36:32 +0800 Subject: [PATCH 2/5] update gomod2nix --- gomod2nix.toml | 10 +++++----- integration_tests/configs/cosmovisor.yaml | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gomod2nix.toml b/gomod2nix.toml index 0be27c4bbf..9efe708eed 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -3849,13 +3849,13 @@ sha256 = "0nlf9w791ln0n49fiaczy7bsr0i1cnrrm78frhv4k9kbn13gfpw6" ["github.com/tharsis/ethermint"] - sumVersion = "v0.10.0-alpha1-cronos-8.0.20220426081631-a178ce6dba6e" - vendorPath = "github.com/crypto-org-chain/ethermint" + sumVersion = "v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121" + vendorPath = "github.com/yihuang/ethermint" ["github.com/tharsis/ethermint".fetch] type = "git" - url = "https://github.com/crypto-org-chain/ethermint" - rev = "a178ce6dba6ea0687c0c23a76ee4beda7397a97e" - sha256 = "1bzj086rr55i4sqdmcn0bgsh2hax3idknl48xgh42zas06w4rvdc" + url = "https://github.com/yihuang/ethermint" + rev = "ae1b6f2f1121282b0b135b3491c525b0feb21cf8" + sha256 = "1pvgq35iydiqcn1wayzcwbjdx2hf3wghc4hgivsf0q1dk57hks6m" ["github.com/tidwall/gjson"] sumVersion = "v1.6.7" diff --git a/integration_tests/configs/cosmovisor.yaml b/integration_tests/configs/cosmovisor.yaml index 40b6cbeb17..7989a871ca 100644 --- a/integration_tests/configs/cosmovisor.yaml +++ b/integration_tests/configs/cosmovisor.yaml @@ -1,6 +1,7 @@ dotenv: ../../scripts/.env cronos_777-1: cmd: cronosd + start-flags: "--trace" app-config: minimum-gas-prices: 5000000000000basetcro json-rpc: From 2c60cc778632da6e3ef6a1555a38ef362bfb0c6f Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 29 Apr 2022 12:12:46 +0800 Subject: [PATCH 3/5] fix upgrade integration test --- integration_tests/configs/cosmovisor.yaml | 2 ++ integration_tests/test_upgrade.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/integration_tests/configs/cosmovisor.yaml b/integration_tests/configs/cosmovisor.yaml index 7989a871ca..7e3701c627 100644 --- a/integration_tests/configs/cosmovisor.yaml +++ b/integration_tests/configs/cosmovisor.yaml @@ -37,6 +37,8 @@ cronos_777-1: evm: params: evm_denom: basetcro + chain_config: + london_block: null cronos: params: cronos_admin: ${CRONOS_ADMIN} diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index 044bb08458..0f3b59dbd9 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -124,5 +124,5 @@ def test_cosmovisor_upgrade(custom_cronos: Cronos): assert w3.eth.get_block(target_height).baseFeePerGas == fee1 assert w3.eth.get_block(target_height + 1).baseFeePerGas == fee2 - # query legacy blocks after upgrade - assert w3.eth.get_block(target_height - 1).baseFeePerGas is None + # query legacy blocks before the upgrade + assert "baseFeePerGas" not in w3.eth.get_block(target_height - 1) From bfbfdba5e4b6de7040ef77182d44bda46189caf4 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Sun, 1 May 2022 00:34:54 +0800 Subject: [PATCH 4/5] use crypto-org-chain fork --- go.mod | 2 +- go.sum | 4 ++-- gomod2nix.toml | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 874f16b280..f6c8b9bc2b 100644 --- a/go.mod +++ b/go.mod @@ -160,7 +160,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/tharsis/ethermint => github.com/yihuang/ethermint v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121 + github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-8.0.20220430162531-36b9c095b351 google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 453e954e70..2c605faec1 100644 --- a/go.sum +++ b/go.sum @@ -271,6 +271,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 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.10.0-alpha1-cronos-8.0.20220430162531-36b9c095b351 h1:l4GpuY1NmkQVGM8D5aEB0y5NBspl+CAuPeI1QLCawXU= +github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-8.0.20220430162531-36b9c095b351/go.mod h1:FLjeCtSiiWzDhAKO6usihVrnJwGw88I+KGYfr/geQSs= github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2 h1:elj+Tb/3O9GA3pv62zkc1B0P8hl1WHmF6vF8PInEJm4= github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2/go.mod h1:rAHRlBcRiHPP/JszN+08SJx3pegww9bcVncIb9QLx7I= github.com/crypto-org-chain/keyring v1.1.6-fixes h1:AUFSu56NY6XobY6XfRoDx6v3loiOrHK5MNUm32GEjwA= @@ -1158,8 +1160,6 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yihuang/ethermint v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121 h1:2y4AQ105wfysFJEhnqi10+zINdKrKCy7iKwOISGphlg= -github.com/yihuang/ethermint v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121/go.mod h1:FLjeCtSiiWzDhAKO6usihVrnJwGw88I+KGYfr/geQSs= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/gomod2nix.toml b/gomod2nix.toml index 9efe708eed..d6acf41017 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -3849,13 +3849,13 @@ sha256 = "0nlf9w791ln0n49fiaczy7bsr0i1cnrrm78frhv4k9kbn13gfpw6" ["github.com/tharsis/ethermint"] - sumVersion = "v0.10.0-alpha1-cronos-8.0.20220429031316-ae1b6f2f1121" - vendorPath = "github.com/yihuang/ethermint" + sumVersion = "v0.10.0-alpha1-cronos-8.0.20220430162531-36b9c095b351" + vendorPath = "github.com/crypto-org-chain/ethermint" ["github.com/tharsis/ethermint".fetch] type = "git" - url = "https://github.com/yihuang/ethermint" - rev = "ae1b6f2f1121282b0b135b3491c525b0feb21cf8" - sha256 = "1pvgq35iydiqcn1wayzcwbjdx2hf3wghc4hgivsf0q1dk57hks6m" + url = "https://github.com/crypto-org-chain/ethermint" + rev = "36b9c095b35131c41b5c5f72a2be555e90e0ce11" + sha256 = "1cdsvf1jw5pa06y8ilsz0kqsqqfyg83g3j9iyv6zih2xjfi9zgsn" ["github.com/tidwall/gjson"] sumVersion = "v1.6.7" From 9319573ca3158477c009e245d6c35b0ff148ca96 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 3 May 2022 09:13:54 +0800 Subject: [PATCH 5/5] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5c2b2adad..469ba7b739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - [cronos#340](https://github.com/crypto-org-chain/cronos/pull/340) Update dependencies to include several bug fixes: a) fix subscription deadlock issue in ethermint, b) fix data races `traceContext`. - [cronos#370](https://github.com/crypto-org-chain/cronos/pull/370) Update ethermint to fix a websocket bug, add websockets integration tests. - [cronos#378](https://github.com/crypto-org-chain/cronos/pull/378) Backport recent ethermint bug fixes: a) fix tx inclusion issue by report correct gasWanted of eth tx, b) Add buffer to eth_gasPrice response to fix client UX, c) Quick fix for eth_feeHistory when reward is nil, d) add returnValue message on tracing. +- [cronos#446](https://github.com/crypto-org-chain/cronos/pull/446) Fix failure of query legacy block after upgrade. *December 10, 2021*