Skip to content

Make RPC bind to localhost by default#3746

Merged
ebuchman merged 13 commits intodevelopfrom
3724-rpc-localhost
Jun 24, 2019
Merged

Make RPC bind to localhost by default#3746
ebuchman merged 13 commits intodevelopfrom
3724-rpc-localhost

Conversation

@thanethomson
Copy link
Contributor

@thanethomson thanethomson commented Jun 23, 2019

Addresses #3724

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@thanethomson thanethomson self-assigned this Jun 23, 2019
@thanethomson
Copy link
Contributor Author

thanethomson commented Jun 24, 2019

Changing the default RPC binding address to tcp://127.0.0.1:26657 breaks the localnet and p2p tests, because both rely on the tendermint testnet command and implicitly assume that the RPC is going to be available externally.

I've now added a flag to the testnet subcommand (--rpc-laddr) to allow one to manually override this, but by default it still binds to localhost to keep with the security-oriented theme of making localhost the default. EDIT: This has been changed to rather use the tendermint testnet --config parameter to override the default configuration.

The relevant CircleCI tests have been modified now to cater for this change.

@thanethomson thanethomson marked this pull request as ready for review June 24, 2019 11:45
@codecov-io
Copy link

codecov-io commented Jun 24, 2019

Codecov Report

Merging #3746 into develop will decrease coverage by 0.02%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #3746      +/-   ##
===========================================
- Coverage    63.97%   63.95%   -0.03%     
===========================================
  Files          242      242              
  Lines        20010    19931      -79     
===========================================
- Hits         12801    12746      -55     
+ Misses        6166     6150      -16     
+ Partials      1043     1035       -8
Impacted Files Coverage Δ
config/config.go 65.91% <100%> (+0.35%) ⬆️
consensus/reactor.go 70.57% <0%> (-1.06%) ⬇️
consensus/state.go 79.85% <0%> (+0.11%) ⬆️
p2p/pex/pex_reactor.go 81.47% <0%> (+0.58%) ⬆️
consensus/replay.go 71.02% <0%> (+0.81%) ⬆️

@melekes
Copy link
Contributor

melekes commented Jun 24, 2019

We can also move

config.P2P.AddrBookStrict = false
config.P2P.AllowDuplicateIP = true
into config template.


COPY wrapper.sh /usr/bin/wrapper.sh

COPY config-template.toml /etc/tendermint/config-template.toml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this here but to no effect (see the CircleCI build logs).

Upon investigation, it appears as though the localnet test pulls the localnode Docker image, which was last updated 6 months ago.

@greg-szabo: Is there somewhere where localnode gets built/pushed automatically? Or is it a manual process?

I'm going to make it a prerequisite for localnet-start to build localnode locally for now and see if that helps the build process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it did help the build process 😁

@ebuchman ebuchman merged commit d88a639 into develop Jun 24, 2019
@ebuchman ebuchman deleted the 3724-rpc-localhost branch June 24, 2019 14:32
unclezoro pushed a commit to unclezoro/tendermint that referenced this pull request Sep 6, 2019
* Make RPC bind to localhost by default

* Add CHANGELOG_PENDING entry

* Allow testnet command to override RPC listen address

* Update localnet test to bind RPC to 0.0.0.0

* Update p2p test to bind RPC to 0.0.0.0

* Remove rpc-laddr parameter

* Update localnet to use config template with RPC listen address override

* Use config template override method for RPC listen address

* Build config template into localnode image

* Build localnode image locally before starting localnet

* Move testnet config overrides into templates

* Revert deletion of config overrides

* Remove extraneous config parameter overrides
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants