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.

27 lines
1.2 KiB

  1. # Mempool Reactor
  2. ## Channels
  3. See [this issue](https://github.com/tendermint/tendermint/issues/1503)
  4. Mempool maintains a cache of the last 10000 transactions to prevent
  5. replaying old transactions (plus transactions coming from other
  6. validators, who are continually exchanging transactions). Read [Replay
  7. Protection](https://github.com/tendermint/tendermint/blob/8cdaa7f515a9d366bbc9f0aff2a263a1a6392ead/docs/app-dev/app-development.md#replay-protection)
  8. for details.
  9. Sending incorrectly encoded data or data exceeding `maxMsgSize` will result
  10. in stopping the peer.
  11. `maxMsgSize` equals `MaxBatchBytes` (10MB) + 4 (proto overhead).
  12. `MaxBatchBytes` is a mempool config parameter -> defined locally. The reactor
  13. sends transactions to the connected peers in batches. The maximum size of one
  14. batch is `MaxBatchBytes`.
  15. The mempool will not send a tx back to any peer which it received it from.
  16. The reactor assigns an `uint16` number for each peer and maintains a map from
  17. p2p.ID to `uint16`. Each mempool transaction carries a list of all the senders
  18. (`[]uint16`). The list is updated every time mempool receives a transaction it
  19. is already seen. `uint16` assumes that a node will never have over 65535 active
  20. peers (0 is reserved for unknown source - e.g. RPC).