Skip to content

Conversation

@hebasto
Copy link
Member

@hebasto hebasto commented Oct 16, 2020

This is a non-gui part of adding Tor icon to the GUI.

Split from bitcoin-core/gui#86 as requested:

Also, the RPC and net changes are not gui related, so should go into the main repo

The first approach was in #19926.

@hebasto
Copy link
Member Author

hebasto commented Oct 16, 2020

The commits moved from bitcoin-core/gui#86 already have two ACKs:

Code review ACK bitcoin-core/gui@6549abc (node changes only. Did not fully review qt changes)

tACK bitcoin-core/gui@6549abc with notes for followup

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Approach ACK, only skimmed the code so far but the changes look good. Needs test coverage for the new getnetworkinfo "connections_onion_only" field. Debug build is clean and I did some quick manual testing. The counts fields contain the correct values. With mixed peers:

  "connections_onion_only": false,

With only onion peers:

  "connections_onion_only": true,

RPC help:

  "connections_onion_only" : true|false,             (boolean) whether all connection are through the onion network

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 17, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot mentioned this pull request Oct 17, 2020
@Sjors
Copy link
Member

Sjors commented Oct 17, 2020

Concept ACK.

Agree that a functional test for connections_onion_only would be good, but not sure how easy it is. You could spin up two test nodes, 0 with default settings, 1 with -onlynet=onion and -bind=...=onion, and then connect node 0 to node 1 via it's "onion" port. In that case node 1 should have connections_onion_only=true.

@hebasto
Copy link
Member Author

hebasto commented Oct 17, 2020

Updated 174848f -> 9371757 (pr20172.01 -> pr20172.02, diff):

  • addressed all of @jonatack's and @Sjors' comments
  • added a functional test

@hebasto hebasto force-pushed the 201016-tor branch 3 times, most recently from 3dc8e15 to b9fc611 Compare October 17, 2020 21:08
@hebasto
Copy link
Member Author

hebasto commented Oct 17, 2020

Hmm, the current pr20172.03 branch does not pass macOS 10.14 build on Travis.

The alternative pr20172.04 branch pass locally on macOS 10.15 and Linux Mint 20 (Focal codebase), but it does not pass on Travis at all.

What is the correct portable way to -bind=localhost and -bind=localhost:port=onion simultaneously?

UPDATE: it was such a silly error, and I've caught it after sleep 😃

@hebasto hebasto force-pushed the 201016-tor branch 2 times, most recently from 8d66f6c to d301cc5 Compare October 18, 2020 11:25
@hebasto
Copy link
Member Author

hebasto commented Oct 18, 2020

Updated 9371757 -> d301cc5 (pr20172.02 -> pr20172.06, diff):

  • fixed functional test

Travis is green now!

Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

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

One question and one small naming suggestion.

This PR contains qt-only changes. It shouldn't be too difficult to separate the changes so that PRs to the main repo only contain changes to the node code, and PRs to the GUI repo only contain changes to qt code.

@hebasto
Copy link
Member Author

hebasto commented Oct 19, 2020

@jnewbery

This PR contains qt-only changes. It shouldn't be too difficult to separate the changes so that PRs to the main repo only contain changes to the node code, and PRs to the GUI repo only contain changes to qt code.

Clear qt-only changes are already leaved in the GUI repo. This pull contains two commits that modify signal signatures. As these signals propagate through the qt code, I do not want to break those commits in "non-qt" and "qt" parts.

@hebasto hebasto force-pushed the 201016-tor branch 2 times, most recently from ddced9f to caebabf Compare October 19, 2020 22:26
@hebasto
Copy link
Member Author

hebasto commented Oct 19, 2020

Updated d301cc5 -> caebabf (pr20172.06 -> pr20172.09, diff):

This repetitious code could potentially be refactored into a small helper function get_connection_info().

@hebasto
Copy link
Member Author

hebasto commented Oct 20, 2020

Updated 85ff09e -> da8b109 (pr20172.10 -> pr20172.11, diff):

Stop-starting the nodes 11 times just to test new connections seems very inefficient. Is there a reason you need to do this stop-start?

  • improved robustness

@Sjors
Copy link
Member

Sjors commented Oct 20, 2020

tACK da8b109

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

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

Concept NACK per bitcoin-core/gui#86 (review)

@kristapsk
Copy link
Contributor

kristapsk commented Nov 5, 2020

I'm thinking about this in a context of if / when other privacy network support is added to Bitcoin Core (like I2P, #20254). What people might want then is not "are all of my connections Tor only?", but "are all of my connections using privacy networks?" and "which privacy networks are they using?".

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 1, 2020

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@hebasto
Copy link
Member Author

hebasto commented May 3, 2021

Closing. Leaving it up for grabs.

@hebasto hebasto closed this May 3, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants