You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.9 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
  1. ## Channels
  2. 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.
  3. <hr />
  4. ### Default channel
  5. The default channel is used to communicate state changes, pings, peer exchange, and other automatic internal messages that all P2P protocols would want implemented.
  6. <table>
  7. <tr>
  8. <td><b>Channel</b></td>
  9. <td>""</td>
  10. </tr>
  11. <tr>
  12. <td><b>Filter</b></td>
  13. <td>None<br/>Messages in this channel is not filtered.</td>
  14. </tr>
  15. <tr>
  16. <td><b>Messages</b></td>
  17. <td>
  18. <ul>
  19. <li>PingMsg/PongMsg</li>
  20. <li>PeerExchangeMsg</li>
  21. <li>RefreshFilterMsg</li>
  22. </ul>
  23. </td>
  24. </tr>
  25. </table>
  26. <hr />
  27. ### Block channel
  28. The block channel is used to propagate block or header information to new peers or peers catching up with the blockchain.
  29. <table>
  30. <tr>
  31. <td><b>Channel</b></td>
  32. <td>"block"</td>
  33. </tr>
  34. <tr>
  35. <td><b>Filter</b></td>
  36. <td>
  37. Custom<br/>
  38. 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' &lt;= 'h_h'.
  39. </td>
  40. </tr>
  41. <tr>
  42. <td><b>Messages</b></td>
  43. <td>
  44. <ul>
  45. <li>RequestMsg</li>
  46. <li>BlockMsg</li>
  47. <li>HeaderMsg</li>
  48. </ul>
  49. </td>
  50. </tr>
  51. </table>
  52. <hr />
  53. ### Mempool channel
  54. 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.
  55. <table>
  56. <tr>
  57. <td><b>Channel</b></td>
  58. <td>"mempool"</td>
  59. </tr>
  60. <tr>
  61. <td><b>Filter</b></td>
  62. <td>
  63. Bloom filter (n:10k, p:0.02 -> k:6, m:10KB)<br/>
  64. Each peer's filter has a random nonce that scrambles the message hashes<br/>
  65. The filter & nonce refreshes every new block<br/>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td><b>Messages</b></td>
  70. <td>
  71. <ul>
  72. <li>MempoolTxMsg</li>
  73. </ul>
  74. </td>
  75. </tr>
  76. </table>
  77. <hr />
  78. ### Consensus channel
  79. The consensus channel broadcasts all information used in the rounds of the Tendermint consensus mechanism.
  80. <table>
  81. <tr>
  82. <td><b>Channel</b></td>
  83. <td>"consensus"</td>
  84. </tr>
  85. <tr>
  86. <td><b>Filter</b></td>
  87. <td>
  88. Bitarray filter<br/>
  89. Each validator has a predetermined index in the bitarray<br/>
  90. Refreshes every new consensus round
  91. </td>
  92. </tr>
  93. <tr>
  94. <td><b>Messages</b></td>
  95. <td>
  96. <ul>
  97. <li>ProposalMsg</li>
  98. <li>VoteMsg</li>
  99. <li>NewBlockMsg</li>
  100. </ul>
  101. </td>
  102. </tr>
  103. </table>
  104. ## Resources
  105. * http://www.upnp-hacks.org/upnp.html