Skip to content

Commit

Permalink
Merge branch 'main' into release/v0.10.x
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Feb 14, 2022
2 parents caa29c2 + b51907a commit ded914a
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
.sum
- run: |
make build
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF
2 changes: 1 addition & 1 deletion .github/workflows/deploy-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
run: |
sudo make contract-tools
sudo make test-contract
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF
24 changes: 22 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: test-importer
run: |
make test-import
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF

test-solidity:
runs-on: ubuntu-latest
Expand All @@ -100,7 +100,7 @@ jobs:
- name: test-solidity
run: |
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }}
if: "env.GIT_DIFF != ''"
if: env.GIT_DIFF

liveness-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -150,3 +150,23 @@ jobs:
run: |
make test-rpc
if: env.GIT_DIFF

test-e2e:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/[email protected]
with:
go-version: 1.17
- uses: actions/[email protected]
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.sol
**/**.go
go.mod
go.sum
- name: Test e2e
run: |
make test-integration
if: env.GIT_DIFF
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [tharsis#871](https://github.com/tharsis/ethermint/pull/871) Set correct nonce in `EthCall` and `EstimateGas` grpc query.
* (rpc) [tharsis#878](https://github.com/tharsis/ethermint/pull/878) Workaround to make GetBlock RPC api report correct block gas used.
* (rpc) [tharsis#900](https://github.com/tharsis/ethermint/pull/900) newPendingTransactions filter return ethereum tx hash.
* (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.

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

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ test-import:
test-rpc:
./scripts/integration-test-all.sh -t "rpc" -q 1 -z 1 -s 2 -m "rpc" -r "true"

test-integration:
./scripts/integration-test-all.sh -t "integration" -q 1 -z 1 -s 2 -m "integration" -r "true"

test-rpc-pending:
./scripts/integration-test-all.sh -t "pending" -q 1 -z 1 -s 2 -m "pending" -r "true"

Expand Down
1 change: 0 additions & 1 deletion app/ante/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func NewEthGasConsumeDecorator(
// of data supplied with the transaction.
//
// This AnteHandler decorator will fail if:
// - the transaction contains more than one message
// - the message is not a MsgEthereumTx
// - sender account cannot be found
// - transaction's gas limit is lower than the intrinsic gas
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.17
require (
github.com/btcsuite/btcd v0.22.0-beta
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cosmos/cosmos-sdk v0.45.0
github.com/cosmos/cosmos-sdk v0.45.1
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v2 v2.0.2
github.com/davecgh/go-spew v1.1.1
Expand Down Expand Up @@ -37,7 +37,7 @@ require (
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect
google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb
google.golang.org/grpc v1.43.0
google.golang.org/grpc v1.44.0
google.golang.org/protobuf v1.27.1
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
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.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiOWU5t1HEGaY=
github.com/cosmos/cosmos-sdk v0.45.0 h1:DHD+CIRZ+cYgiLXuTEUL/aprnfPsWSwaww/fIZEsZlk=
github.com/cosmos/cosmos-sdk v0.45.0/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ=
github.com/cosmos/cosmos-sdk v0.45.1 h1:PY79YxPea5qlRLExRnzg8/rT1Scc8GGgRs22p7DX99Q=
github.com/cosmos/cosmos-sdk v0.45.1/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ=
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 Down
10 changes: 9 additions & 1 deletion rpc/websockets.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,8 +712,16 @@ func (api *pubSubAPI) subscribePendingTransactions(wsConn *wsConn) (rpc.ID, erro
api.logger.Debug("error writing header, will drop peer", "error", err.Error())

try(func() {
// Release the initial read lock in .RUnlock() before
// invoking .Lock() to avoid the deadlock in
// https://github.com/tharsis/ethermint/issues/821#issuecomment-1033959984
// and as documented at https://pkg.go.dev/sync#RWMutex
api.filtersMu.RUnlock()
api.filtersMu.Lock()
defer api.filtersMu.Unlock()
defer func() {
api.filtersMu.Unlock()
api.filtersMu.RLock()
}()

if err != websocket.ErrCloseSent {
_ = wsSub.wsConn.Close()
Expand Down
19 changes: 14 additions & 5 deletions scripts/integration-test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,18 @@ echo "done sleeping"

set +e

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

for i in $(seq 1 "$TEST_QTD"); do
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
echo "going to test ethermint node $HOST_RPC ..."
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=$time_out -v -short
TEST_FAIL=$?
done
fi

if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
time_out=300s
if [[ $TEST == "pending" ]]; then
time_out=60m0s
Expand All @@ -149,10 +159,9 @@ if [[ -z $TEST || $TEST == "rpc" || $TEST == "pending" ]]; then
for i in $(seq 1 "$TEST_QTD"); do
HOST_RPC=http://$IP_ADDR:$RPC_PORT"$i"
echo "going to test ethermint node $HOST_RPC ..."
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=$time_out -v -short
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=$time_out -v -short

RPC_FAIL=$?
TEST_FAIL=$?
done

fi
Expand All @@ -175,8 +184,8 @@ for i in "${arr[@]}"; do
stop_func "$i"
done

if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
exit $RPC_FAIL
if [[ (-z $TEST || $TEST == "rpc" || $TEST == "integration" ) && $TEST_FAIL -ne 0 ]]; then
exit $TEST_FAIL
else
exit 0
fi
6 changes: 3 additions & 3 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ if [[ -z $TEST || $TEST == "rpc" ]]; then
MODE=$MODE HOST=$HOST_RPC go test ./tests/e2e/... -timeout=300s -v -short
MODE=$MODE HOST=$HOST_RPC go test ./tests/rpc/... -timeout=300s -v -short

RPC_FAIL=$?
TEST_FAIL=$?
done

fi
Expand All @@ -150,8 +150,8 @@ for i in "${arr[@]}"; do
stop_func "$i"
done

if [[ (-z $TEST || $TEST == "rpc") && $RPC_FAIL -ne 0 ]]; then
exit $RPC_FAIL
if [[ (-z $TEST || $TEST == "rpc") && $TEST_FAIL -ne 0 ]]; then
exit $TEST_FAIL
else
exit 0
fi
6 changes: 4 additions & 2 deletions tests/e2e/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"bytes"
"context"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
evmtypes "github.com/tharsis/ethermint/x/evm/types"
"math/big"
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
evmtypes "github.com/tharsis/ethermint/x/evm/types"

// . "github.com/onsi/ginkgo"
// . "github.com/onsi/gomega"

Expand Down Expand Up @@ -392,6 +393,7 @@ func (s *IntegrationTestSuite) TestGetLogs() {
common.HexToHash("0x000000000000000000000000" + fmt.Sprintf("%x", common.BytesToAddress(s.network.Validators[0].Address))),
common.HexToHash("0x000000000000000000000000378c50d9264c63f3f92b806d4ee56e9d86ffb3ec"),
}

s.Require().Equal(expectedTopics, logs[0].Topics)
}

Expand Down
6 changes: 3 additions & 3 deletions tests/solidity/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13788,9 +13788,9 @@ simple-concat@^1.0.0:
integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==

simple-get@^2.7.0:
version "2.8.1"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d"
integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==
version "2.8.2"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.2.tgz#5708fb0919d440657326cd5fe7d2599d07705019"
integrity sha512-Ijd/rV5o+mSBBs4F/x9oDPtTx9Zb6X9brmnXvMW4J7IR15ngi9q5xxqWBKU744jTZiaXtxaPL7uHG6vtN8kUkw==
dependencies:
decompress-response "^3.3.0"
once "^1.3.1"
Expand Down
1 change: 0 additions & 1 deletion x/evm/spec/08_params.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ By default, all block configuration fields but `ConstantinopleBlock`, are enable
| IstanbulBlock | 0 |
| MuirGlacierBlock | 0 |
| BerlinBlock | 0 |
| CatalystBlock | `nil` |
| LondonBlock | 0 |

0 comments on commit ded914a

Please sign in to comment.