tendermint/p2p
Alexander Simmerl be5d68ea4f p2p: Implement PeerTransport
This is the implementation for the design described in ADR 12[0]. It's
the first step of a larger refactor of the p2p package as tracked in
interface bundling all concerns of low-level connection handling and
isolating the rest of peer lifecycle management from the specifics of
the low-level internet protocols. Even if the swappable implementation
will never be utilised, already the isolation of conn related code in
one place will help with the reasoning about execution path and
addressation of security sensitive issues surfaced through bounty
programs and audits.

We deliberately decided to not have Peer filtering and other management
in the Transport, its sole responsibility is the translation of
connections to Peers, handing those to the caller fully setup. It's the
responsibility of the caller to reject those and or keep track. Peer
filtering will take place in the Switch and can be inspected in a the
following commit.

This changeset additionally is an exercise in clean separation of logic
and other infrastructural concerns like logging and instrumentation. By
leveraging a clean and minimal interface. How this looks can be seen in
a follow-up change.

Design #2069[2]
Refs #2067[3]
Fixes #2047[4]
Fixes #2046[5]

changes:
* describe Transport interface
* implement new default Transport: MultiplexTransport
* test MultiplexTransport with new constraints
* implement ConnSet for concurrent management of net.Conn, synchronous
to PeerSet
* implement and expose duplicate IP filter
* implemnt TransportOption for optional parametirisation

[0] https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-012-peer-transport.md
[1] https://github.com/tendermint/tendermint/issues/2067
[2] https://github.com/tendermint/tendermint/pull/2069
[3] https://github.com/tendermint/tendermint/issues/2067
[4] https://github.com/tendermint/tendermint/issues/2047
[5] https://github.com/tendermint/tendermint/issues/2046
2018-09-18 22:26:43 +02:00
..
conn update secret connection to use a little endian encoded nonce (#2264) 2018-08-28 09:37:38 +04:00
dummy preserve original address and dial it instead of self-reported address (#1994) 2018-07-18 13:23:29 +04:00
pex ignore existing peers in DialPeersAsync (#2327) 2018-09-05 11:52:22 -04:00
trust libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
upnp libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
README.md Revert "delete everything" (includes everything non-go-crypto) 2018-06-20 17:35:30 -07:00
base_reactor.go libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
conn_set.go p2p: Implement PeerTransport 2018-09-18 22:26:43 +02:00
errors.go Revert "delete everything" (includes everything non-go-crypto) 2018-06-20 17:35:30 -07:00
fuzz.go fix import paths 2018-07-01 22:36:49 -04:00
key.go crypto: Remove Ed25519 and Secp256k1 suffix on GenPrivKey 2018-07-20 10:44:21 -07:00
key_test.go fix import paths 2018-07-01 22:36:49 -04:00
listener.go libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
listener_test.go add test 2018-07-02 13:04:34 -04:00
metrics.go Revert "delete everything" (includes everything non-go-crypto) 2018-06-20 17:35:30 -07:00
netaddress.go libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
netaddress_test.go Revert "delete everything" (includes everything non-go-crypto) 2018-06-20 17:35:30 -07:00
node_info.go spec: add missing field to NodeInfoOther (#2426) 2018-09-18 11:28:32 +02:00
peer.go libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
peer_set.go fix nil pointer panic by checking if peer is nil 2018-06-29 16:03:31 +04:00
peer_set_test.go libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) 2018-08-10 09:25:57 +04:00
peer_test.go crypto: Remove Ed25519 and Secp256k1 suffix on GenPrivKey 2018-07-20 10:44:21 -07:00
switch.go ignore existing peers in DialPeersAsync (#2327) 2018-09-05 11:52:22 -04:00
switch_test.go crypto: Remove Ed25519 and Secp256k1 suffix on GenPrivKey 2018-07-20 10:44:21 -07:00
test_util.go rpc: Transform /status result.node_info.other into map (#2417) 2018-09-17 18:39:52 +02:00
transport.go p2p: Implement PeerTransport 2018-09-18 22:26:43 +02:00
transport_test.go p2p: Implement PeerTransport 2018-09-18 22:26:43 +02:00
types.go Revert "delete everything" (includes everything non-go-crypto) 2018-06-20 17:35:30 -07:00
version.go Revert "delete everything" (includes everything non-go-crypto) 2018-06-20 17:35:30 -07:00
wire.go crypto: Refactor to move files out of the top level directory 2018-07-18 08:38:44 -07:00

README.md

p2p

The p2p package provides an abstraction around peer-to-peer communication.

Docs:

  • Connection for details on how connections and multiplexing work
  • Peer for details on peer ID, handshakes, and peer exchange
  • Node for details about different types of nodes and how they should work
  • Pex for details on peer discovery and exchange
  • Config for details on some config option