Skip to content

Commit

Permalink
Problem: failed tx are ignored in json-rpc apis (backport crypto-org-…
Browse files Browse the repository at this point in the history
…chain#502) (crypto-org-chain#503)

* Problem: failed tx are ignored in json-rpc apis (backport crypto-org-chain#502)

Solution:
- fix the issue in ethermint by emitting extra events in ante handler.
- add integration test to test it.
- update cosmos-sdk dependency
- fix getTransactionReceiptsByBlock

fix integration test

move to crypto-org-chain repo

Update CHANGELOG.md

update cosmos-sdk to most recent

cosmos-sdk v0.45.5

Problem: gravity bridge integration test fails occasionally (crypto-org-chain#538)

* Problem: gravity bridge integration test fails occasionally

WIP: crypto-org-chain#48

- Add traceback env var to debug

* run ibc test together

* avoid port conflict

* Update scripts/run-integration-tests

* delay start of gorc
  • Loading branch information
yihuang authored Jun 14, 2022
1 parent cdfe53c commit 75c2672
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 124 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bug Fixes

- [#454](https://github.com/crypto-org-chain/cronos/pull/454) Add back the latest testnet upgrade handler.
- [cronos#503](https://github.com/crypto-org-chain/cronos/pull/503) Fix failed tx are ignored in json-rpc apis (backport #502).

### Improvements

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/armon/go-metrics v0.3.10
github.com/cosmos/cosmos-sdk v0.45.4
github.com/cosmos/cosmos-sdk v0.45.5
github.com/cosmos/ibc-go/v2 v2.2.0
github.com/ethereum/go-ethereum v1.10.15
github.com/gogo/protobuf v1.3.3
Expand All @@ -13,7 +13,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/peggyjv/gravity-bridge/module v0.3.9
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.4.1
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.1
Expand Down Expand Up @@ -153,14 +153,14 @@ require (
replace (
// TODO: fix keyring upstream
github.com/99designs/keyring => github.com/crypto-org-chain/keyring v1.1.6-fixes
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.4
github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.45.5

// TODO: remove when middleware will be implemented
github.com/cosmos/ibc-go/v2 => github.com/crypto-org-chain/ibc-go/v2 v2.2.0-hooks2

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-9
github.com/tharsis/ethermint => github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-10

google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
18 changes: 12 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44=
github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU=
github.com/cosmos/cosmos-sdk v0.45.4 h1:eStDAhJdMY8n5arbBRe+OwpNeBSunxSBHp1g55ulfdA=
github.com/cosmos/cosmos-sdk v0.45.4/go.mod h1:WOqtDxN3eCCmnYLVla10xG7lEXkFjpTaqm2a2WasgCc=
github.com/cosmos/cosmos-sdk v0.45.5 h1:GVrZM+lss6y626Pq6loxh/3KLRgK/J6/alTkcKkYmGU=
github.com/cosmos/cosmos-sdk v0.45.5/go.mod h1:WOqtDxN3eCCmnYLVla10xG7lEXkFjpTaqm2a2WasgCc=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
Expand All @@ -271,8 +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-9 h1:szlis/QH5l7ETOsB3Ot/aItDywBDlV4i7ZjRROdIBFI=
github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-9/go.mod h1:FLjeCtSiiWzDhAKO6usihVrnJwGw88I+KGYfr/geQSs=
github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-10 h1:QLICrljqG8eJ4X+JCqvWf1Lbg/TXS+lxoFbcezBpyjc=
github.com/crypto-org-chain/ethermint v0.10.0-alpha1-cronos-10/go.mod h1:T4f1p3L5kccbjBZMtJLKfOLiUXTO1OuS1I7FzQuJD+w=
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=
Expand Down Expand Up @@ -364,6 +364,8 @@ github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVB
github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
Expand Down Expand Up @@ -716,8 +718,9 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -998,6 +1001,8 @@ github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRr
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U=
Expand Down Expand Up @@ -1049,8 +1054,9 @@ github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
Expand Down
24 changes: 12 additions & 12 deletions gomod2nix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ schema = 1
version = "v1.0.4"
hash = "sha256-JvcBXBdjdmnaW/nyf/tw/uaOAGn1b78yxrtl2/Rs3kA="
[mod."github.com/cosmos/cosmos-sdk"]
version = "v0.45.4"
hash = "sha256-ll4HgVrDhwN/2vWP5fVraZT4MbrCsokwJLvcA0qP3fE="
version = "v0.45.5"
hash = "sha256-AW9ogzt//VLXKRwKsa7AgmBAfnVqm8MLl2PGa2zUvSI="
replaced = "github.com/cosmos/cosmos-sdk"
[mod."github.com/cosmos/go-bip39"]
version = "v1.0.0"
Expand Down Expand Up @@ -536,8 +536,8 @@ schema = 1
version = "v0.0.0-20171204163338-bcd34c9993f8"
hash = "sha256-Sx911OBB67XYUSbjoGtJ5I/WL+aXR67FpCu4wiwQqhQ="
[mod."github.com/frankban/quicktest"]
version = "v1.11.3"
hash = "sha256-Gg+S16VMcweQybw9RhiwdJockd/U1kh3AkhgN3mVtjQ="
version = "v1.14.3"
hash = "sha256-WCIb0lIRAaluIhKSUJNKpnNt4/mOII8/SwVXUeY9NWQ="
[mod."github.com/fsnotify/fsnotify"]
version = "v1.5.1"
hash = "sha256-B8kZ8yiWgallT7R2j1kSRJcJkSGFVf9ise+TpXa+7XY="
Expand Down Expand Up @@ -969,8 +969,8 @@ schema = 1
version = "v0.0.0-20140226030751-b84e30acd515"
hash = "sha256-CePQbqWGtS8qP/Av9pkLiqZwH6RaZQff/s1l+1//jQo="
[mod."github.com/kr/pretty"]
version = "v0.2.1"
hash = "sha256-HhaxBizBlvhiQ+tuByY69++QCtB+gt6t0A/h5A347m8="
version = "v0.3.0"
hash = "sha256-5KfVas96NAU7pmN2ZOwQFFpUeagiJTqYKBLxq5aM5W4="
[mod."github.com/kr/pty"]
version = "v1.1.1"
hash = "sha256-AVeS+ivwNzIrgWQaLtsmO2f2MYGpxIVqdac/EzaYI1Q="
Expand Down Expand Up @@ -1293,8 +1293,8 @@ schema = 1
version = "v1.2.0"
hash = "sha256-yDnHsLw8KF4zfbJska1igIo4IbVpGDq+vH3+YV5jCgk="
[mod."github.com/rogpeppe/go-internal"]
version = "v1.3.0"
hash = "sha256-JgiasZeXDy10syy7wmXtqRffDY7CJ1o5VNY+FmmAjVU="
version = "v1.6.1"
hash = "sha256-1IBwoA4d15vIBLjkGGVuBoNXh/jTRh74bu/pFe7dQgI="
[mod."github.com/rs/cors"]
version = "v1.8.2"
hash = "sha256-FxBbQVb8zIoDGGaAJKfsYV0+POkh1tyX7P6A/Lk5Vsc="
Expand Down Expand Up @@ -1371,8 +1371,8 @@ schema = 1
version = "v1.8.2"
hash = "sha256-ERuG4GK1LOn72DRbT9URpo1QoVIm2A3mPtlf+xSPgx8="
[mod."github.com/spf13/cast"]
version = "v1.4.1"
hash = "sha256-jaY+/RKUviKnE2h8Ly5cdZYinSE0uc32FW6+xfZ1Ghs="
version = "v1.5.0"
hash = "sha256-Pdp+wC5FWqyJKzyYHb7JCcV9BoJk/sxQw6nLyuLJvuQ="
[mod."github.com/spf13/cobra"]
version = "v1.4.0"
hash = "sha256-I6j9sD61Ztcc2W/WGeWo3ggYtnGTxNxZ2EFPdtO0UEY="
Expand Down Expand Up @@ -1434,8 +1434,8 @@ schema = 1
version = "v0.6.7"
hash = "sha256-hl/3RrBrpkk2zA6dmrNlIYKs1/GfqegSscDSkA5Pjlo="
[mod."github.com/tharsis/ethermint"]
version = "v0.10.0-alpha1-cronos-9"
hash = "sha256-0UYsRcen9DBGo1ykI3pUg/6Tnw2vBYtuSEJ33/jn9yE="
version = "v0.10.0-alpha1-cronos-10"
hash = "sha256-EfYOvGreGToosDcqg1MBCHwSRSFdBIVvMlXIlYFFH0A="
replaced = "github.com/crypto-org-chain/ethermint"
[mod."github.com/tidwall/gjson"]
version = "v1.6.7"
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/cosmoscli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1068,4 +1068,4 @@ def fix_unlucky_tx(self, start_block, end_block):
min_block_height=1,
home=self.data_dir,
).decode()
return [tuple(line.split()[1:]) for line in output.split("\n")]
return [tuple(line.split()[1:]) for line in output.split("\n") if line]
7 changes: 4 additions & 3 deletions integration_tests/test_gravity.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def cronos(request, tmp_path_factory):
params: enable_auto_deployment
"""
yield from setup_cronos_experimental(
tmp_path_factory.mktemp("cronos_experimental"), 26700, request.param
tmp_path_factory.mktemp("cronos_experimental"), 26600, request.param
)


Expand Down Expand Up @@ -168,9 +168,10 @@ def gravity(cronos, geth):

programs[f"program:{chain_id}-orchestrator{i}"] = {
"command": (
f'gorc -c "{gorc_config_path}" orchestrator start '
"--cosmos-key cronos --ethereum-key eth"
f'bash -c \'sleep 5 && gorc -c "{gorc_config_path}" orchestrator start '
"--cosmos-key cronos --ethereum-key eth'"
),
"environment": "RUST_BACKTRACE=full",
"autostart": "true",
"autorestart": "true",
"startsecs": "3",
Expand Down
54 changes: 34 additions & 20 deletions integration_tests/test_replay_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest
import web3
from pystarport import ports
from web3._utils.method_formatters import receipt_formatter
from web3.datastructures import AttributeDict

Expand All @@ -14,7 +13,6 @@
deploy_contract,
sign_transaction,
supervisorctl,
wait_for_port,
)


Expand All @@ -37,19 +35,23 @@ def test_replay_block(custom_cronos):
)
iterations = 400
gas_limit = 800000
gas_price = 100000000000
for i in range(10):
nonce = w3.eth.get_transaction_count(ADDRS["validator"])
begin_balance = w3.eth.get_balance(ADDRS["validator"])
txs = [
contract.functions.test(iterations).buildTransaction(
{
"nonce": nonce,
"gas": gas_limit,
"gasPrice": gas_price,
}
),
contract.functions.test(iterations).buildTransaction(
{
"nonce": nonce + 1,
"gas": gas_limit,
"gasPrice": gas_price,
}
),
]
Expand All @@ -58,12 +60,8 @@ def test_replay_block(custom_cronos):
for tx in txs
]
receipt1 = w3.eth.wait_for_transaction_receipt(txhashes[0])
try:
receipt2 = w3.eth.wait_for_transaction_receipt(txhashes[1], timeout=10)
except web3.exceptions.TimeExhausted:
# expected exception, tx2 is included but failed.
receipt2 = None
break
# the tx2 should be included in json-rpc response too.
receipt2 = w3.eth.wait_for_transaction_receipt(txhashes[1], timeout=10)
if receipt1.blockNumber == receipt2.blockNumber:
break
print(
Expand All @@ -73,9 +71,34 @@ def test_replay_block(custom_cronos):
)
else:
assert False, "timeout"
assert not receipt2

# the first tx succeds.
assert receipt1.status == 1
assert receipt1.gasUsed < gas_limit
assert receipt1.cumulativeGasUsed == receipt1.gasUsed

# the second tx should fail and cost the whole gasLimit
assert receipt2.status == 0
assert receipt2.gasUsed == gas_limit
assert receipt2.cumulativeGasUsed == receipt1.cumulativeGasUsed + gas_limit

# check get block apis
assert w3.eth.get_block(receipt1.blockNumber).transactions == [
receipt1.transactionHash,
receipt2.transactionHash,
]
assert (
w3.eth.get_transaction_by_block(receipt1.blockNumber, 1).hash
== receipt2.transactionHash
)

# check sender's nonce is increased twice, which means both txs are executed.
assert nonce + 2 == w3.eth.get_transaction_count(ADDRS["validator"])
# check sender's balance is deducted as expected
assert receipt2.cumulativeGasUsed * gas_price == begin_balance - w3.eth.get_balance(
ADDRS["validator"]
)

rsp = w3.provider.make_request(
"cronos_replayBlock", [hex(receipt1.blockNumber), False]
)
Expand Down Expand Up @@ -111,19 +134,10 @@ def test_replay_block(custom_cronos):
assert replay_receipts[1].status == 0
assert replay_receipts[1].gasUsed == gas_limit

# patch the unlucky tx with the new cli command
# try to patch the unlucky tx, should have nothing to patch.
# stop the node0
end_height = cli.block_height()
supervisorctl(custom_cronos.base_dir / "../tasks.ini", "stop", "cronos_777-1-node0")
cli = custom_cronos.cosmos_cli()
results = cli.fix_unlucky_tx(begin_height, end_height)
# the second tx is patched
assert results[0][1] == txhashes[1].hex()
# start the node0 again
supervisorctl(
custom_cronos.base_dir / "../tasks.ini", "start", "cronos_777-1-node0"
)
# wait for tm-rpc port
wait_for_port(ports.rpc_port(custom_cronos.base_port(0)))
# check the tx indexer
assert len(cli.txs(f"ethereum_tx.ethereumTxHash={txhashes[1].hex()}")["txs"]) == 1
assert not results
Loading

0 comments on commit 75c2672

Please sign in to comment.