Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit 3587015

Browse files
mmsqefedekunze
andauthored
fix(rpc): bind default json-rpc listen address to localhost (#1613)
* update nix * bind default json-rpc to 127.0.0.1 * add change doc * Update CHANGELOG.md Co-authored-by: Federico Kunze Küllmer <[email protected]> Co-authored-by: Federico Kunze Küllmer <[email protected]>
1 parent c5fdad7 commit 3587015

File tree

10 files changed

+25
-22
lines changed

10 files changed

+25
-22
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3838

3939
## Unreleased
4040

41+
### Bug Fixes
42+
43+
* (rpc) [#1613](https://github.com/evmos/ethermint/pull/1613) Change the default json-rpc listen address to localhost.
44+
4145
## [v0.21.0-rc1] - 2022-1-13
4246

4347
### State Machine Breaking

go.mod

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ require (
3838
github.com/tyler-smith/go-bip39 v1.1.0
3939
golang.org/x/net v0.5.0
4040
golang.org/x/text v0.6.0
41-
golang.org/x/text v0.6.0
4241
google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6
4342
google.golang.org/grpc v1.52.0
4443
sigs.k8s.io/yaml v1.3.0

gomod2nix.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ schema = 3
358358
version = "v0.0.5"
359359
hash = "sha256-/5i70IkH/qSW5KjGzv8aQNKh9tHoz98tqtL0K2DMFn4="
360360
[mod."github.com/onsi/ginkgo/v2"]
361-
version = "v2.6.1"
362-
hash = "sha256-OEiWYKCGPCaqL3vzSrHquHGm+Q8URT2anpanAVK5hRo="
361+
version = "v2.7.0"
362+
hash = "sha256-BKqQKCsPA73FaQwYpAY+QsWFHIncrG5jgRhC2IiNmCk="
363363
[mod."github.com/onsi/gomega"]
364364
version = "v1.24.2"
365365
hash = "sha256-iascSzzBT1Uv/XybezSblIwwrq78BU4a9BVB5MvK6MM="
@@ -496,23 +496,23 @@ schema = 3
496496
version = "v0.0.0-20220722155223-a9213eeb770e"
497497
hash = "sha256-kNgzydWRpjm0sZl4uXEs3LX5L0xjJtJRAFf/CTlYUN4="
498498
[mod."golang.org/x/net"]
499-
version = "v0.4.0"
500-
hash = "sha256-7IwGZh/xg4mQz88cJio2Ov5d3jGRXKj1itlAja/EAbQ="
499+
version = "v0.5.0"
500+
hash = "sha256-HpbIAiLs7S1+tVsaSSdbCPw1IK43A0bFFuSzPSyjLbo="
501501
[mod."golang.org/x/oauth2"]
502502
version = "v0.0.0-20221014153046-6fdb5e3db783"
503503
hash = "sha256-IoygidVNqyAZmN+3macDeIefK8hhJToygpcqlwehdYQ="
504504
[mod."golang.org/x/sync"]
505505
version = "v0.1.0"
506506
hash = "sha256-Hygjq9euZ0qz6TvHYQwOZEjNiTbTh1nSLRAWZ6KFGR8="
507507
[mod."golang.org/x/sys"]
508-
version = "v0.3.0"
509-
hash = "sha256-TIHhfYbZ99sCU1ZMikxwomXH5AEtD/lA1VMMW+UAhbU="
508+
version = "v0.4.0"
509+
hash = "sha256-jchMzHCH5dg+IL/F+LqaX/fyAcB/nvHQpfBjqwaRJH0="
510510
[mod."golang.org/x/term"]
511-
version = "v0.3.0"
512-
hash = "sha256-NKv2o8wz8DB/2W2h/muGEIHb+S06mBXZxhG254RpQ5s="
511+
version = "v0.4.0"
512+
hash = "sha256-wQKxHV10TU4vCU8Re2/hFmAbur/jRWEOB8QXBzgTFNY="
513513
[mod."golang.org/x/text"]
514-
version = "v0.5.0"
515-
hash = "sha256-ztH+xQyM/clOcQl+y/UEPcfNKbc3xApMbEPDDZ9up0o="
514+
version = "v0.6.0"
515+
hash = "sha256-+bpeRWR3relKACdal6NPj+eP5dnWCplTViArSN7/qA4="
516516
[mod."golang.org/x/xerrors"]
517517
version = "v0.0.0-20220907171357-04be3eba64a2"
518518
hash = "sha256-6+zueutgefIYmgXinOflz8qGDDDj0Zhv+2OkGhBTKno="

scripts/contract-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cat $HOME/.ethermint/config/genesis.json | jq '.app_state["mint"]["params"]["min
3535
"$PWD"/build/ethermintd validate-genesis
3636

3737
# Start the node (remove the --pruning=nothing flag if historical queries are not needed) in background and log to file
38-
"$PWD"/build/ethermintd start --pruning=nothing --rpc.unsafe --json-rpc.address="0.0.0.0:8545" --keyring-backend test > ethermintd.log 2>&1 &
38+
"$PWD"/build/ethermintd start --pruning=nothing --rpc.unsafe --json-rpc.address="127.0.0.1:8545" --keyring-backend test > ethermintd.log 2>&1 &
3939

4040
# Give ethermintd node enough time to launch
4141
sleep 5

scripts/ethermint-devnet.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ethermint_9000-1:
77
index-events:
88
- ethereum_tx.ethereumTxHash
99
json-rpc:
10-
address: "0.0.0.0:{EVMRPC_PORT}"
11-
ws-address: "0.0.0.0:{EVMRPC_PORT_WS}"
10+
address: "127.0.0.1:{EVMRPC_PORT}"
11+
ws-address: "127.0.0.1:{EVMRPC_PORT_WS}"
1212
api: "eth,net,web3,debug"
1313
validators:
1414
- coins: 1000000000000000000stake,10000000000000000000000aphoton

scripts/integration-test-all.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ REMOVE_DATA_DIR=false
1616
RPC_PORT="854"
1717
# Ethereum JSONRPC Websocket
1818
WS_PORT="855"
19-
IP_ADDR="0.0.0.0"
19+
IP_ADDR="127.0.0.1"
2020

2121
KEY="mykey"
2222
CHAINID="ethermint_9000-1"

scripts/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TEST_QTD=1
1111

1212
#PORT AND RPC_PORT 3 initial digits, to be concat with a suffix later when node is initialized
1313
RPC_PORT="854"
14-
IP_ADDR="0.0.0.0"
14+
IP_ADDR="127.0.0.1"
1515
MODE="rpc"
1616

1717
KEY="mykey"

server/config/config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ const (
3535
DefaultGRPCAddress = "0.0.0.0:9900"
3636

3737
// DefaultJSONRPCAddress is the default address the JSON-RPC server binds to.
38-
DefaultJSONRPCAddress = "0.0.0.0:8545"
38+
DefaultJSONRPCAddress = "127.0.0.1:8545"
3939

4040
// DefaultJSONRPCWsAddress is the default address the JSON-RPC WebSocket server binds to.
41-
DefaultJSONRPCWsAddress = "0.0.0.0:8546"
41+
DefaultJSONRPCWsAddress = "127.0.0.1:8546"
4242

4343
// DefaultJsonRPCMetricsAddress is the default address the JSON-RPC Metrics server binds to.
44-
DefaultJSONRPCMetricsAddress = "0.0.0.0:6065"
44+
DefaultJSONRPCMetricsAddress = "127.0.0.1:6065"
4545

4646
// DefaultEVMTracer is the default vm.Tracer type
4747
DefaultEVMTracer = ""

tests/integration_tests/configs/default.jsonnet

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
'minimum-gas-prices': '0aphoton',
1414
'index-events': ['ethereum_tx.ethereumTxHash'],
1515
'json-rpc': {
16-
address: '0.0.0.0:{EVMRPC_PORT}',
17-
'ws-address': '0.0.0.0:{EVMRPC_PORT_WS}',
16+
address: '127.0.0.1:{EVMRPC_PORT}',
17+
'ws-address': '127.0.0.1:{EVMRPC_PORT_WS}',
1818
api: 'eth,net,web3,debug',
1919
'feehistory-cap': 100,
2020
'block-range-cap': 10000,

testutil/network/network.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
332332
if err != nil {
333333
return nil, err
334334
}
335-
appCfg.JSONRPC.Address = fmt.Sprintf("0.0.0.0:%s", jsonRPCPort)
335+
appCfg.JSONRPC.Address = fmt.Sprintf("127.0.0.1:%s", jsonRPCPort)
336336
}
337337
appCfg.JSONRPC.Enable = true
338338
appCfg.JSONRPC.API = config.GetAPINamespaces()

0 commit comments

Comments
 (0)