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.

113 lines
2.5 KiB

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