tendermint/p2p
Jae Kwon 9464241c02 don't add our listener address into addrbook. 2014-07-17 16:06:34 -07:00
..
upnp package rename peer -> p2p 2014-07-07 20:03:50 -07:00
README.md package rename peer -> p2p 2014-07-07 20:03:50 -07:00
addrbook.go don't add our listener address into addrbook. 2014-07-17 16:06:34 -07:00
addrbook_test.go addrbook cleanup 2014-07-10 02:19:50 -07:00
connection.go cleanup log messages 2014-07-17 16:06:34 -07:00
listener.go switch events, node listens for new peers to ask for new addrs. 2014-07-17 16:06:34 -07:00
log.go replace logger with go-logging 2014-07-14 16:15:13 -07:00
msg.go package rename peer -> p2p 2014-07-07 20:03:50 -07:00
netaddress.go addrbook cleanup 2014-07-10 02:19:50 -07:00
peer.go cleanup log messages 2014-07-17 16:06:34 -07:00
peer_manager.go cleanup log messages 2014-07-17 16:06:34 -07:00
peer_set.go Don't dial dupes 2014-07-15 15:54:33 -07:00
switch.go cleanup log messages 2014-07-17 16:06:34 -07:00
switch_test.go replace logger with go-logging 2014-07-14 16:15:13 -07:00
util.go cleanup 2014-07-09 14:27:32 -07:00

README.md

Channels

Each peer connection is multiplexed into channels.


PEX channel

The PEX channel is used to exchange peer addresses.

Channel "PEX"
Messages
  • pexRequestMsg
  • pexResponseMsg

Block channel

The block channel is used to propagate block or header information to new peers or peers catching up with the blockchain.

Channel "block"
Messages
  • RequestMsg
  • BlockMsg
  • HeaderMsg
Notes Nodes should only advertise having a header or block at height 'h' if it also has all the headers or blocks less than 'h'. Thus for each peer we need only keep track of two integers -- one for the most recent header height 'h_h' and one for the most recent block height 'h_b', where 'h_b' <= 'h_h'.

Mempool channel

The mempool channel is used for broadcasting new transactions that haven't yet entered the blockchain. It uses a lossy bloom filter on either end, but with sufficient fanout and filter nonce updates every new block, all transactions will eventually reach every node.

Channel "mempool"
Messages
  • MempoolTxMsg
Notes Instead of keeping a perfect inventory of what peers have, we use a lossy filter.
Bloom filter (n:10k, p:0.02 -> k:6, m:10KB)
Each peer's filter has a random nonce that scrambles the message hashes.
The filter & nonce refreshes every new block.

Consensus channel

The consensus channel broadcasts all information used in the rounds of the Tendermint consensus mechanism.

Channel "consensus"
Messages
  • ProposalMsg
  • VoteMsg
  • NewBlockMsg
Notes How do optimize/balance propagation speed & bandwidth utilization?

Resources