Skip to content

Conversation

gmaxwell
Copy link
Contributor

With automatic tor HS support in place we should probably not be providing
absolute protection for local peers, since HS inbound could be used to
attack pretty easily. Instead, this counts on the latency metric inside
AttemptToEvictConnection to privilege actually local peers.

This change also makes eviction generally more aggressive by making it
willing to evict the unprotected peer in a netgroup, if the new
connection comes from a netgroup where we have no unprotected peers.

It also makes sure that in the case of tying group size to select the
group with the newest member, since newest time is the final selection
criteria.

The third commit protects four peers that most recently sent us a valid
transaction to our memory pool. This metric is costly for attackers to
control since it requires sending acceptable transactions, and an
attacker which is blocking transactions is inherently disadvantaged for this
criteria.

@pstratem
Copy link
Contributor

concept ACK

@pstratem
Copy link
Contributor

I would split this into two commits:

  • removing the protection for localhost and adding the youngest member criteria
  • another adding the more aggressive disconnect based on peer groups

@gmaxwell
Copy link
Contributor Author

@pstratem Okay, I split it up and also added protection for tx relayers.

I wanted to get something in that distinguishes good onion peers from bad; ultimately I want to add peer POW to this, but thats a non-trivial amount of work. So right now TXs are at least something.

It would be good to add blocks too, though that block addition pipeline makes it a little hard to avoid crediting people from sending duplicate blocks.

With automatic tor HS support in place we should probably not be providing
 absolute protection for local peers, since HS inbound could be used to
 attack pretty easily.  Instead, this counts on the latency metric inside
 AttemptToEvictConnection to privilege actually local peers.

This makes sure that in the case of tying group size to select the group
 with the newest member, since newest time is the final selection
 criteria.
This makes eviction generally more aggressive by making it willing
 to evict the last unprotected peer in a netgroup if the new
 connection comes from a netgroup where we have no unprotected peers.
@gmaxwell gmaxwell added the P2P label Nov 24, 2015
This protects four peers that most recently sent us a valid transaction
 to our memory pool.  This metric is costly for attackers to control
 since it requires sending acceptable transactions, and an attacker
 which is blocking transactions is inherently disadvantaged for this
 criteria.
@petertodd
Copy link
Contributor

Concept ACK

Will look at code after rebase.

@laanwj
Copy link
Member

laanwj commented Feb 1, 2016

As #7438 was merged into 0.12, this needs to go in before 0.13, otherwise there will be a regression
(no longer true as of #7453)

@maflcko
Copy link
Member

maflcko commented Mar 25, 2016

Needs rebase if still relevant. (c.f. #7453)

@gmaxwell gmaxwell closed this May 20, 2016
@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