diff --git a/peer/README.md b/peer/README.md index 392dfa2cb..ee6da1677 100644 --- a/peer/README.md +++ b/peer/README.md @@ -1,25 +1,43 @@ -## Channel "" +## Channels + +Each peer connection is multiplexed into channels. Each channel can optionally have an associated filter which determines whether the peer already knows of the message. The system is designed to be easily extensible for various applications. +
+ +### 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""
FilterNoneNone
Messages in this channel is not filtered.
MessageMessages
    -
  • RefreshFilterMsg
  • +
  • PingMsg/PongMsg
  • PeerExchangeMsg
  • +
  • RefreshFilterMsg
+
+### Block channel -## Channel "block" +The block channel is used to propagate block or header information to new peers or peers catching up with the blockchain. + + + +
Channel"block"
Filter @@ -38,16 +56,23 @@
+
+### Mempool channel -## Channel "mempool" +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. + + + + @@ -59,14 +84,22 @@
Channel"mempool"
Filter Bloom filter (n:10k, p:0.02 -> k:6, m:10KB)
- Refreshes every new block + 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" + + + + @@ -81,7 +114,3 @@
Channel"consensus"
Filter Bitarray filter
+ Each validator has a predetermined index in teh bitarray
Refreshes every new consensus round
- - - -