Skip to content

Commit ded914a

Browse files
author
HuangYi
committed
Merge branch 'main' into release/v0.10.x
2 parents caa29c2 + b51907a commit ded914a

File tree

14 files changed

+65
-24
lines changed

14 files changed

+65
-24
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
.sum
3030
- run: |
3131
make build
32-
if: "env.GIT_DIFF != ''"
32+
if: env.GIT_DIFF

.github/workflows/deploy-contract.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
run: |
3636
sudo make contract-tools
3737
sudo make test-contract
38-
if: "env.GIT_DIFF != ''"
38+
if: env.GIT_DIFF

.github/workflows/test.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: test-importer
7474
run: |
7575
make test-import
76-
if: "env.GIT_DIFF != ''"
76+
if: env.GIT_DIFF
7777

7878
test-solidity:
7979
runs-on: ubuntu-latest
@@ -100,7 +100,7 @@ jobs:
100100
- name: test-solidity
101101
run: |
102102
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }}
103-
if: "env.GIT_DIFF != ''"
103+
if: env.GIT_DIFF
104104

105105
liveness-test:
106106
runs-on: ubuntu-latest
@@ -150,3 +150,23 @@ jobs:
150150
run: |
151151
make test-rpc
152152
if: env.GIT_DIFF
153+
154+
test-e2e:
155+
runs-on: ubuntu-latest
156+
timeout-minutes: 15
157+
steps:
158+
- uses: actions/[email protected]
159+
with:
160+
go-version: 1.17
161+
- uses: actions/[email protected]
162+
- uses: technote-space/[email protected]
163+
with:
164+
PATTERNS: |
165+
**/**.sol
166+
**/**.go
167+
go.mod
168+
go.sum
169+
- name: Test e2e
170+
run: |
171+
make test-integration
172+
if: env.GIT_DIFF

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
7979
* (evm) [tharsis#871](https://github.com/tharsis/ethermint/pull/871) Set correct nonce in `EthCall` and `EstimateGas` grpc query.
8080
* (rpc) [tharsis#878](https://github.com/tharsis/ethermint/pull/878) Workaround to make GetBlock RPC api report correct block gas used.
8181
* (rpc) [tharsis#900](https://github.com/tharsis/ethermint/pull/900) newPendingTransactions filter return ethereum tx hash.
82+
* (rpc) [tharsis#933](https://github.com/tharsis/ethermint/pull/933) Fix newPendingTransactions subscription deadlock when a Websocket client exits without unsubscribing and the node errors.
8283

8384
## [v0.9.0] - 2021-12-01
8485

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ test-import:
324324
test-rpc:
325325
./scripts/integration-test-all.sh -t "rpc" -q 1 -z 1 -s 2 -m "rpc" -r "true"
326326

327+
test-integration:
328+
./scripts/integration-test-all.sh -t "integration" -q 1 -z 1 -s 2 -m "integration" -r "true"
329+
327330
test-rpc-pending:
328331
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"
329332

app/ante/eth.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ func NewEthGasConsumeDecorator(
154154
// of data supplied with the transaction.
155155
//
156156
// This AnteHandler decorator will fail if:
157-
// - the transaction contains more than one message
158157
// - the message is not a MsgEthereumTx
159158
// - sender account cannot be found
160159
// - transaction's gas limit is lower than the intrinsic gas

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.17
55
require (
66
github.com/btcsuite/btcd v0.22.0-beta
77
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
8-
github.com/cosmos/cosmos-sdk v0.45.0
8+
github.com/cosmos/cosmos-sdk v0.45.1
99
github.com/cosmos/go-bip39 v1.0.0
1010
github.com/cosmos/ibc-go/v2 v2.0.2
1111
github.com/davecgh/go-spew v1.1.1
@@ -37,7 +37,7 @@ require (
3737
go.etcd.io/bbolt v1.3.6 // indirect
3838
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
3939
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb
40-
google.golang.org/grpc v1.43.0
40+
google.golang.org/grpc v1.44.0
4141
google.golang.org/protobuf v1.27.1
4242
gopkg.in/yaml.v2 v2.4.0
4343
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
228228
github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44=
229229
github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU=
230230
github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiOWU5t1HEGaY=
231-
github.com/cosmos/cosmos-sdk v0.45.0 h1:DHD+CIRZ+cYgiLXuTEUL/aprnfPsWSwaww/fIZEsZlk=
232-
github.com/cosmos/cosmos-sdk v0.45.0/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ=
231+
github.com/cosmos/cosmos-sdk v0.45.1 h1:PY79YxPea5qlRLExRnzg8/rT1Scc8GGgRs22p7DX99Q=
232+
github.com/cosmos/cosmos-sdk v0.45.1/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ=
233233
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
234234
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
235235
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=

rpc/websockets.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,8 +712,16 @@ func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn) (rpc.ID, erro
712712
api.logger.Debug("error writing header, will drop peer", "error", err.Error())
713713

714714
try(func() {
715+
// Release the initial read lock in .RUnlock() before
716+
// invoking .Lock() to avoid the deadlock in
717+
// https://github.com/tharsis/ethermint/issues/821#issuecomment-1033959984
718+
// and as documented at https://pkg.go.dev/sync#RWMutex
719+
api.filtersMu.RUnlock()
715720
api.filtersMu.Lock()
716-
defer api.filtersMu.Unlock()
721+
defer func() {
722+
api.filtersMu.Unlock()
723+
api.filtersMu.RLock()
724+
}()
717725

718726
if err != websocket.ErrCloseSent {
719727
_ = wsSub.wsConn.Close()

scripts/integration-test-all.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,18 @@ echo "done sleeping"
139139

140140
set +e
141141

142-
if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
142+
if [[ -z $TEST || $TEST == "integration" ]] ; then
143+
time_out=300s
143144

145+
for i in $(seq 1 "$TEST_QTD"); do
146+
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
147+
echo "going to test ethermint node $HOST_RPC ..."
148+
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=$time_out -v -short
149+
TEST_FAIL=$?
150+
done
151+
fi
152+
153+
if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
144154
time_out=300s
145155
if [[ $TEST == "pending" ]]; then
146156
time_out=60m0s
@@ -149,10 +159,9 @@ if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
149159
for i in $(seq 1 "$TEST_QTD"); do
150160
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
151161
echo "going to test ethermint node $HOST_RPC ..."
152-
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=$time_out -v -short
153162
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=$time_out -v -short
154163

155-
RPC_FAIL=$?
164+
TEST_FAIL=$?
156165
done
157166

158167
fi
@@ -175,8 +184,8 @@ for i in "${arr[@]}"; do
175184
stop_func "$i"
176185
done
177186

178-
if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
179-
exit $RPC_FAIL
187+
if [[ (-z $TEST || $TEST == "rpc" || $TEST == "integration" ) && $TEST_FAIL -ne 0 ]]; then
188+
exit $TEST_FAIL
180189
else
181190
exit 0
182191
fi

0 commit comments

Comments
 (0)