Skip to content

Conversation

ivanpustogarov
Copy link
Contributor

The only time when a client sends a "getaddr" message is when he
esatblishes an Outbound connection (see ProcessMessage() in
src/main.cpp). Another bitcoin client is expected to receive a
"getaddr" message only on Inbound connection. Ignoring "gettaddr"
requests on Outbound connections can resolve potential privacy issues
(and as was said such request normally do not happen anyway).

@gmaxwell
Copy link
Contributor

gmaxwell commented Dec 8, 2014

Hm. Breaking the symmetry here is odd but may be prudent, resulting in one less (of many) fingerprinting vectors. I'll need to consider some if this is tying our hands or would create other problems.

@laanwj laanwj added the P2P label Dec 8, 2014
@laanwj
Copy link
Member

laanwj commented Dec 8, 2014

This change makes sense from a minimalism point of view. If we don't send "getaddr" to incoming connections, and have no reason to consider doing that, it doesn't have to be handled.

@sipa
Copy link
Member

sipa commented Dec 8, 2014

As we only use explicit 'getaddr' message to get more addresses in case of a nearly-empty addrman, this shouldn't have much impact. ACK

@jgarzik
Copy link
Contributor

jgarzik commented Dec 8, 2014

A nearly-empty addrman is what you have on testnet and other less populated networks. addrman still has some pathological behavior in that area, such as trying the same few addresses over and over again. It would be a shame to increase the pathlogical behavior.

Not completely convinced increasing the level of assemetry here has value from a Sybil perspective, but it might.

@gmaxwell
Copy link
Contributor

gmaxwell commented Dec 8, 2014

@jgarzik yea, but we don't do it towards inbound peers and probably don't want to due to self-selecting sybil risk.

@sipa
Copy link
Member

sipa commented Dec 10, 2014

@jgarzik Between Bitcoin Core clients, this change should have 0 impact.

@jgarzik
Copy link
Contributor

jgarzik commented Dec 10, 2014

Today, yes.

Do we want to cut off this avenue for obtaining addresses in the future?

@gmaxwell
Copy link
Contributor

On reflection, I think it's not that concerning for the future: You're free to try, the other side might not respond.

Plus, we're probably due to create a new address message type (e.g. supports more service information, supports sending pubkeys, supports longer host identifiers (i2p needs 512 bits, tor's upgraded hs will need 256 bits I think)). Another address type could have different rules.

So I think if we regret this change we wouldn't regret it enormously.

@laanwj
Copy link
Member

laanwj commented Jan 8, 2015

Let's move forward with this or close it, @gmaxwell @jgarzik ACK or NACK?

@gmaxwell
Copy link
Contributor

gmaxwell commented Jan 8, 2015

ACK.

@jgarzik
Copy link
Contributor

jgarzik commented Jan 8, 2015

reluctant ut ACK

@@ -3923,7 +3923,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}


else if (strCommand == "getaddr")
else if ((strCommand == "getaddr") && (pfrom->fInbound))
Copy link
Member

Choose a reason for hiding this comment

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

Thinking of it, this really needs a comment in the source code why this asymmetric behavior was introduced. Someone reading the code is bound to wonder why.

@ivanpustogarov ivanpustogarov force-pushed the noreply_getaddr_on_outbound branch from 19d6093 to cb2aa8b Compare February 6, 2015 20:41
The only time when a client sends a "getaddr" message is when he
esatblishes an Outbound connection (see ProcessMessage() in
src/main.cpp).  Another bitcoin client is expected to receive a
"getaddr" message only on Inbound connection. Ignoring "gettaddr"
requests on Outbound connections can resolve potential privacy issues
(and as was said such request normally do not happen anyway).
@ivanpustogarov ivanpustogarov force-pushed the noreply_getaddr_on_outbound branch from cb2aa8b to dca799e Compare February 6, 2015 21:05
@ivanpustogarov
Copy link
Contributor Author

Added a comment in the source code why this asymmetric behavior was introduced.

@sipa
Copy link
Member

sipa commented Mar 1, 2015

re-ACK

@laanwj laanwj merged commit dca799e into bitcoin:master Mar 9, 2015
laanwj added a commit that referenced this pull request Mar 9, 2015
dca799e Ignore getaddr messages on Outbound connections. (Ivan Pustogarov)
@laanwj
Copy link
Member

laanwj commented Mar 9, 2015

Backported to 0.10 as 200f293

laanwj pushed a commit that referenced this pull request Mar 9, 2015
The only time when a client sends a "getaddr" message is when he
esatblishes an Outbound connection (see ProcessMessage() in
src/main.cpp).  Another bitcoin client is expected to receive a
"getaddr" message only on Inbound connection. Ignoring "gettaddr"
requests on Outbound connections can resolve potential privacy issues
(and as was said such request normally do not happen anyway).

Rebased-From: dca799e
Github-Pull: #5442
aistrych added a commit to aistrych/Pink2 that referenced this pull request Jan 16, 2019
reddink pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request May 27, 2020
The only time when a client sends a "getaddr" message is when he
esatblishes an Outbound connection (see ProcessMessage() in
src/main.cpp).  Another bitcoin client is expected to receive a
"getaddr" message only on Inbound connection. Ignoring "gettaddr"
requests on Outbound connections can resolve potential privacy issues
(and as was said such request normally do not happen anyway).

Rebased-From: dca799e
Github-Pull: bitcoin#5442
(cherry picked from commit 200f293)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants