Page MenuHomePhabricator

Add 2 outbound block-relay-only connections
ClosedPublic

Authored by deadalnix on Jun 7 2020, 01:08.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCce6365f59234: Add 2 outbound block-relay-only connections
Summary

Transaction relay is primarily optimized for balancing redundancy/robustness
with bandwidth minimization -- as a result transaction relay leaks information
that adversaries can use to infer the network topology.

Network topology is better kept private for (at least) two reasons:

(a) Knowledge of the network graph can make it easier to find the source IP of
a given transaction.

(b) Knowledge of the network graph could be used to split a target node or
nodes from the honest network (eg by knowing which peers to attack in order to
achieve a network split).

We can eliminate the risks of (b) by separating block relay from transaction
relay; inferring network connectivity from the relay of blocks/block headers is
much more expensive for an adversary.

After this commit, bitcoind will make 2 additional outbound connections that
are only used for block relay. (In the future, we might consider rotating our
transaction-relay peers to help limit the effects of (a).)

This is a partial backport of Core PR15759 : https://github.com/bitcoin/bitcoin/pull/15759/commits/3a5e885306ea954d7eccdc11502e91a51dab8ec6

Depends on D6424 and D6452

Test Plan
ninja all check-all

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

majcosta requested changes to this revision.Jun 7 2020, 22:16
majcosta added a subscriber: majcosta.
majcosta added inline comments.
src/net.cpp
1879 ↗(On Diff #21025)

int(xxx) or static_cast<int>(xxx), unless we'd rather not take ownership of that line, in which case, nvm

src/net.h
169 ↗(On Diff #21025)
459 ↗(On Diff #21025)

ditto

This revision now requires changes to proceed.Jun 7 2020, 22:16

rebase on top of D6436 and change cast

This revision is now accepted and ready to land.Jun 8 2020, 15:09