8000 Allow whitelisting outgoing connections by luke-jr · Pull Request #17167 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow whitelisting outgoing connections #17167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

luke-jr
Copy link
Member
@luke-jr luke-jr commented Oct 16, 2019

Rethinking/rewrite of #10594 in light of whitelist flags: new flags are added for "in" and "out" to specify the connection direction matched. Both can be specified to match either direction.

@luke-jr luke-jr force-pushed the whitelist_outgoing branch from 3b91c15 to ad1991a Compare October 16, 2019 21:38
@fanquake fanquake added the P2P label Oct 16, 2019
@luke-jr luke-jr force-pushed the whitelist_outgoing branch 2 times, most recently from 806c237 to bcb43ce Compare October 16, 2019 23:01
@DrahtBot
Copy link
Contributor
DrahtBot commented Oct 16, 2019

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25515 ([draft] PeerManager unit tests by dergoegge)
  • #25514 (net processing: Move CNode::nServices and CNode::nLocalServices to Peer by dergoegge)
  • #25500 (refactor: Move inbound eviction logic to its own translation unit by dergoegge)
  • #25268 (refactor: Introduce EvictionManager by dergoegge)

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.

@luke-jr luke-jr force-pushed the whitelist_outgoing branch 2 times, most recently from 17bf6da to dce1080 Compare October 17, 2019 01:44
@laanwj
Copy link
Member
laanwj commented Oct 17, 2019

Concept ACK.

As for implementation, I'm not sure about having In and Out as permissions.

This doesn't allow having different flags for a IP for incoming and outgoing. Not sure that's ever necessary, but this seems a bit muddled to me. Might also consider e.g. whiteconnect (for outgoing connections) could have a completely different flag list structure from the normal whitelist (for incoming connections).

Edit: in a way you already do this by having separate connOptions.vWhitelistedRangeOutgoing versus connOptions.vWhitelistedRange, it's just not exposed all the way.

@luk
8000
e-jr
Copy link
Member Author
luke-jr commented Oct 17, 2019

As you noticed, the implementation already doesn't treat in/out as permissions.

Using -whitelist for both allows for easily specifying the same flags for both in,out. I can't think of any benefit to having separate options. (I'm not sure why we'd want to support different sets of flags...)

@luke-jr
Copy link
Member Author
luke-jr commented Aug 20, 2020

Rebased

luke-jr added a commit to luke-jr/bitcoin that referenced this pull request May 21, 2022
luke-jr added a commit to luke-jr/bitcoin that referenced this pull request May 21, 2022
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 27, 2022
Currently there are some confusions in net_processing:

* There is confusion between `-blocksonly mode` and `block-relay-only`,
  so adjust all comments to use the same nomenclature.
* Whether to disconnect peers for providing invs/txs is implemented
  differently. For example, it seems a bit confusing to disconnect
  `block-relay-only` peers with `relay` permission when they send a tx
  message, but not when they send an inv message. Also, keeping track of
  their inv announcements seems both wasteful and confusing, as it does
  nothing. This isn't possible in practice, as outbound connections do
  not have permissions assigned, but sees fragile to rely on. Especially
  in light of proposed changes to make that possible:
  bitcoin#17167
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Jun 14, 2022
Currently there are some confusions in net_processing:

* There is confusion between `-blocksonly mode` and `block-relay-only`,
  so adjust all comments to use the same nomenclature.
* Whether to disconnect peers for providing invs/txs is implemented
  differently. For example, it seems a bit confusing to disconnect
  `block-relay-only` peers with `relay` permission when they send a tx
  message, but not when they send an inv message. Also, keeping track of
  their inv announcements seems both wasteful and confusing, as it does
  nothing. This isn't possible in practice, as outbound connections do
  not have permissions assigned, but sees fragile to rely on. Especially
  in light of proposed changes to make that possible:
  bitcoin#17167
maflcko pushed a commit to bitcoin-core/gui that referenced this pull request Jun 15, 2022
…ectIncomingTxs

fafddaf refactor: Introduce PeerManagerImpl::RejectIncomingTxs (MacroFake)

Pull request description:

  Currently there are some confusions in net_processing:

  * There is confusion between `-blocksonly mode` and `block-relay-only`, so adjust all comments to use the same nomenclature.
  * Whether to disconnect peers for providing invs/txs is implemented differently. For example, it seems a bit confusing to disconnect `block-relay-only` peers with `relay` permission when they send a tx message, but not when they send an inv message. Also, keeping track of their inv announcements seems both wasteful and confusing, as it does nothing. This isn't possible in practice, as outbound connections do not have permissions assigned, but sees fragile to rely on. Especially in light of proposed changes to make that possible: bitcoin/bitcoin#17167

ACKs for top commit:
  MarcoFalke:
    Should be trivial to re-ACK with `git range-diff bitcoin-core/master  fa2b5fe0c1 fafddaf`.
  jnewbery:
    Code review ACK fafddaf
  mzumsande:
    ACK fafddaf

Tree-SHA512: 73bf91afe93be619169cfbf3bf80cb08a5e6f73df4e0318b86817bd4d45f67408ea85998855992281d2decc9d24f7d75cffb83a0518d670090907309df8a3490
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 15, 2022
@ghost
Copy link
ghost commented Jun 23, 2022

Concept ACK

@vasild
Copy link
Contributor
vasild commented Jun 28, 2022

This would allow us to use transient (aka one-time / random / disposable) I2P addresses when making outgoing connections to all nodes, except to whitelisted ones for which we would use our persistent I2P address.

@DrahtBot
Copy link
Contributor
DrahtBot 8000 commented Jul 7, 2022

🐙 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".

janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Aug 4, 2022
Currently there are some confusions in net_processing:

* There is confusion between `-blocksonly mode` and `block-relay-only`,
  so adjust all comments to use the same nomenclature.
* Whether to disconnect peers for providing invs/txs is implemented
  differently. For example, it seems a bit confusing to disconnect
  `block-relay-only` peers with `relay` permission when they send a tx
  message, but not when they send an inv message. Also, keeping track of
  their inv announcements seems both wasteful and confusing, as it does
  nothing. This isn't possible in practice, as outbound connections do
  not have permissions assigned, but sees fragile to rely on. Especially
  in light of proposed changes to make that possible:
  bitcoin/bitcoin#17167
@achow101
Copy link
Member

Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.

@achow101 achow101 closed this Oct 12, 2022
@brunoerg
Copy link
Contributor

@luke-jr Are you intending to work on this?

@ghost
Copy link
ghost commented Oct 24, 2022

Seems a little weird because I tried to filter bitcoin core pull requests with is:pr is:open sort:updated-asc and first PR in the result has 1 Concept ACK from dev who no longer contributes to this repo in reviews and second was only active for a few days/weeks. Those comments were posted in May 2022 and PR is in draft mode.

Whereas, this PR got last 2 Concept ACK or comments agreeing from active contributors in May 2022. And a Concept ACK from present maintainer.

@luke-jr Are you intending to work on this?

Anyway, PR author has not commented since Jul 7, 2021 so we cannot blame others for this PR to get more review and eventually merged.


Whitelist could be a taboo in bitcoin, however this is already possible manually. This PR makes it easier to manage your outgoing connections. I haven't reviewed each commit but I conceptually agree with the idea.

@luke-jr
Copy link
Member Author
luke-jr commented Oct 24, 2022

@brunoerg I have never stopped maintaining it.

@brunoerg
Copy link
Contributor

@luke-jr Cool, just to know, because it's been closed and I am interesting on it.

@brunoerg
Copy link
Contributor

Concept ACK

@bitcoin bitcoin deleted a comment Nov 2, 2022
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Aug 8, 2023
…enum class ConnectionDirection

c77de62 net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection (Luke Dashjr)

Pull request description:

  Refactor split out of bitcoin#17167

ACKs for top commit:
  practicalswift:
    cr ACK c77de62: patch looks correct & `enum class` is strictly better

Tree-SHA512: 40a1bf69d8ab2651b04ba6adbab789369a5a1a29a64ba764c3e6aab575b7943ea8dfd6e35b0abf5bcffa10e7265f4b523a93aa899c0fd581a84fc51ae5377b90
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Aug 8, 2023
…enum class ConnectionDirection

c77de62 net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection (Luke Dashjr)

Pull request description:

  Refactor split out of bitcoin#17167

ACKs for top commit:
  practicalswift:
    cr ACK c77de62: patch looks correct & `enum class` is strictly better

Tree-SHA512: 40a1bf69d8ab2651b04ba6adbab789369a5a1a29a64ba764c3e6aab575b7943ea8dfd6e35b0abf5bcffa10e7265f4b523a93aa899c0fd581a84fc51ae5377b90
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Aug 9, 2023
…enum class ConnectionDirection

c77de62 net: Replace enum CConnMan::NumConnections with enum class ConnectionDirection (Luke Dashjr)

Pull request description:

  Refactor split out of bitcoin#17167

ACKs for top commit:
  practicalswift:
    cr ACK c77de62: patch looks correct & `enum class` is strictly better

Tree-SHA512: 40a1bf69d8ab2651b04ba6adbab789369a5a1a29a64ba764c3e6aab575b7943ea8dfd6e35b0abf5bcffa10e7265f4b523a93aa899c0fd581a84fc51ae5377b90
@bitcoin bitcoin locked and limited conversation to collaborators Nov 2, 2023
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.

10 participants
0