tendermint/peer
Jae Kwon 6f65a9bd4e Not done integrating PEX. 2014-07-06 16:05:47 -07:00
..
upnp Hide internal methods to make GoDoc more user-friendly 2014-07-04 14:29:27 -07:00
README.md Merge branch 'master' of https://github.com/tendermint/tendermint 2014-06-27 17:03:13 -07:00
addrbook.go cleanup 2014-07-05 23:50:06 -07:00
addrbook_test.go cleanup 2014-07-05 23:50:06 -07:00
client.go Not done integrating PEX. 2014-07-06 16:05:47 -07:00
client_test.go cleanup 2014-07-05 23:50:06 -07:00
connection.go cleanup 2014-07-05 23:50:06 -07:00
listener.go cleanup 2014-07-05 23:50:06 -07:00
log.go benchmark works, but could use some improvement. 2014-07-02 16:03:04 -07:00
msg.go beginning to write pex 2014-07-06 00:16:05 -07:00
netaddress.go go fmt 2014-07-01 14:50:24 -07:00
peer.go Not done integrating PEX. 2014-07-06 16:05:47 -07:00
pex.go Not done integrating PEX. 2014-07-06 16:05:47 -07:00
server.go local -> external 2014-07-04 19:29:02 -07:00
util.go go fmt 2014-07-01 14:50:24 -07:00

README.md

Channels

Each peer connection is multiplexed into channels.


Default channel

The default channel is used to communicate state changes, pings, peer exchange, and other automatic internal messages that all P2P protocols would want implemented.

Channel ""
Messages
  • PingMsg/PongMsg
  • PeerExchangeMsg
  • RefreshFilterMsg

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