diff --git a/README.md b/README.md index 398ccfb63..822df3e00 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ TenderMint - proof of concept + +* **[peer](https://github.com/tendermint/tendermint/blob/master/peer):** P2P networking stack. Designed to be extensible. +* **[merkle](https://github.com/tendermint/tendermint/blob/master/merkle):** Immutable Persistent Merkle-ized AVL+ Tree, used primarily for keeping track of mutable state like account balances. +* **[crypto](https://github.com/tendermint/tendermint/blob/master/crypto):** Includes cgo bindings of ed25519. + +### Status + +* Still implementing peer/* +* Ed25519 bindings *complete* +* merkle/* *complete* diff --git a/peer/README.md b/peer/README.md index 766b5c5c0..ee6da1677 100644 --- a/peer/README.md +++ b/peer/README.md @@ -1,38 +1,116 @@ -## Channel "" - -Filter: None - -Messages: -* RefreshFilterMsg -* PeerExchangeMsg - - -## Channel "block" - -Filter: Custom filter. - -Messages: -* BlockMsg -* HeaderMsg - - -## Channel "mempool" - -Filter: Bloom filter (n:10k, p:0.02 -> k:6, m:10KB) - -FilterRefresh: Every new block. - -Messages: -* MempoolTxMsg - - -## Channel "consensus" - -Filter: Bitarray filter - -FilterRefresh: Every new block. - -Messages: -* ProposalMsg -* VoteMsg -* NewBlockMsg +## 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""
FilterNone
Messages in this channel is not filtered.
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"
Filter + Custom
+ 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 this filter 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'. +
Messages +
    +
  • RequestMsg
  • +
  • BlockMsg
  • +
  • HeaderMsg
  • +
+
+
+ +### 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"
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
+
Messages +
    +
  • MempoolTxMsg
  • +
+
+
+ +### Consensus channel + +The consensus channel broadcasts all information used in the rounds of the Tendermint consensus mechanism. + + + + + + + + + + + + + + +
Channel"consensus"
Filter + Bitarray filter
+ Each validator has a predetermined index in teh bitarray
+ Refreshes every new consensus round +
Messages +
    +
  • ProposalMsg
  • +
  • VoteMsg
  • +
  • NewBlockMsg
  • +
+