Do not absolutely protect local peers; decide group ties based on time. #7438

Merged
merged 2 commits into from Feb 1, 2016

Conversation

Projects
None yet
5 participants
@gmaxwell
Member

gmaxwell commented Jan 28, 2016

[This is the first patch of #7082 broken out targeting 0.12]

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 also corrects a bug the case of tying group size where the code may
fail to select the group with the newest member. Since newest time
is the final selection criteria, failing to break ties on it
on the step before can undermine the final selection.

Tied netgroups are very common.

gmaxwell added some commits Jan 28, 2016

Do not absolutely protect local peers from eviction.
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.
Decide eviction group ties based on time.
This corrects a bug the case of tying group size where the code may
 fail to select the group with the newest member. Since newest time
 is the final selection criteria, failing to break ties on it
 on the step before can undermine the final selection.

Tied netgroups are very common.
@dcousens

This comment has been minimized.

Show comment
Hide comment
@dcousens

dcousens Jan 28, 2016

Contributor

What is HS?

Contributor

dcousens commented Jan 28, 2016

What is HS?

@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Jan 28, 2016

Member

Hidden service.

Member

gmaxwell commented Jan 28, 2016

Hidden service.

@jonasschnelli jonasschnelli added the P2P label Jan 29, 2016

@laanwj laanwj added this to the 0.12.0 milestone Jan 29, 2016

@petertodd

This comment has been minimized.

Show comment
Hide comment
Contributor

petertodd commented Jan 31, 2016

@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Feb 1, 2016

Member

utACK 8e09f91, thanks for doing this on such short notice

Member

laanwj commented Feb 1, 2016

utACK 8e09f91, thanks for doing this on such short notice

@laanwj laanwj merged commit 8e09f91 into bitcoin:0.12 Feb 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Feb 1, 2016

Merge #7438: Do not absolutely protect local peers; decide group ties…
… based on time.


8e09f91 Decide eviction group ties based on time. (Gregory Maxwell)
46dbcd4 Do not absolutely protect local peers from eviction. (Gregory Maxwell)
@laanwj

This comment has been minimized.

Show comment
Hide comment
@laanwj

laanwj Feb 2, 2016

Member

This was cherry-picked into master via 1e05727 and 1e9613a (#7453)

Member

laanwj commented Feb 2, 2016

This was cherry-picked into master via 1e05727 and 1e9613a (#7453)

@str4d str4d referenced this pull request in zcash/zcash Mar 24, 2017

Merged

Tor ephemeral hidden services #2177

@steven-bloom steven-bloom referenced this pull request in bitcoinfibre/bitcoinfibre Nov 29, 2017

Closed

Some instructions required #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment