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.

114 lines
2.6 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
  1. ## Channels
  2. Each peer connection is multiplexed into channels.
  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>Messages</b></td>
  13. <td>
  14. <ul>
  15. <li>PingMsg/PongMsg</li>
  16. <li>PeerExchangeMsg</li>
  17. <li>RefreshFilterMsg</li>
  18. </ul>
  19. </td>
  20. </tr>
  21. </table>
  22. <hr />
  23. ### Block channel
  24. The block channel is used to propagate block or header information to new peers or peers catching up with the blockchain.
  25. <table>
  26. <tr>
  27. <td><b>Channel</b></td>
  28. <td>"block"</td>
  29. </tr>
  30. <tr>
  31. <td><b>Messages</b></td>
  32. <td>
  33. <ul>
  34. <li>RequestMsg</li>
  35. <li>BlockMsg</li>
  36. <li>HeaderMsg</li>
  37. </ul>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td><b>Notes</b></td>
  42. <td>
  43. 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' &lt;= 'h_h'.
  44. </td>
  45. </tr>
  46. </table>
  47. <hr />
  48. ### Mempool channel
  49. 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.
  50. <table>
  51. <tr>
  52. <td><b>Channel</b></td>
  53. <td>"mempool"</td>
  54. </tr>
  55. <tr>
  56. <td><b>Messages</b></td>
  57. <td>
  58. <ul>
  59. <li>MempoolTxMsg</li>
  60. </ul>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td><b>Notes</b></td>
  65. <td>
  66. Instead of keeping a perfect inventory of what peers have, we use a lossy filter.<br/>
  67. Bloom filter (n:10k, p:0.02 -> k:6, m:10KB)<br/>
  68. Each peer's filter has a random nonce that scrambles the message hashes.<br/>
  69. The filter & nonce refreshes every new block.<br/>
  70. </td>
  71. </tr>
  72. </table>
  73. <hr />
  74. ### Consensus channel
  75. The consensus channel broadcasts all information used in the rounds of the Tendermint consensus mechanism.
  76. <table>
  77. <tr>
  78. <td><b>Channel</b></td>
  79. <td>"consensus"</td>
  80. </tr>
  81. <tr>
  82. <td><b>Messages</b></td>
  83. <td>
  84. <ul>
  85. <li>ProposalMsg</li>
  86. <li>VoteMsg</li>
  87. <li>NewBlockMsg</li>
  88. </ul>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td><b>Notes</b></td>
  93. <td>
  94. How do optimize/balance propagation speed & bandwidth utilization?
  95. </td>
  96. </tr>
  97. </table>
  98. ## Resources
  99. * http://www.upnp-hacks.org/upnp.html