Browse Source

spec/reactors/mempool: batch txs per peer (#155)

* spec/reactors/mempool: batch txs per peer

Refs https://github.com/tendermint/tendermint/issues/625

* update
pull/7804/head
Anton Kaliaev 4 years ago
committed by GitHub
parent
commit
6c95c3f250
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 14 deletions
  1. +5
    -14
      spec/reactors/mempool/messages.md
  2. +5
    -0
      spec/reactors/mempool/reactor.md

+ 5
- 14
spec/reactors/mempool/messages.md View File

@ -2,25 +2,16 @@
## P2P Messages
There is currently only one message that Mempool broadcasts
and receives over the p2p gossip network (via the reactor):
`TxMessage`
There is currently only one message that Mempool broadcasts and receives over
the p2p gossip network (via the reactor): `TxsMessage`
```go
// TxMessage is a MempoolMessage containing a transaction.
type TxMessage struct {
Tx types.Tx
// TxsMessage is a MempoolMessage containing a list of transactions.
type TxsMessage struct {
Txs []types.Tx
}
```
TxMessage is go-amino encoded and prepended with `0x1` as a
"type byte". This is followed by a go-amino encoded byte-slice.
Prefix of 40=0x28 byte tx is: `0x010128...` followed by
the actual 40-byte tx. Prefix of 350=0x015e byte tx is:
`0x0102015e...` followed by the actual 350 byte tx.
(Please see the [go-amino repo](https://github.com/tendermint/go-amino#an-interface-example) for more information)
## RPC Messages
Mempool exposes `CheckTx([]byte)` over the RPC interface.


+ 5
- 0
spec/reactors/mempool/reactor.md View File

@ -13,6 +13,11 @@ for details.
Sending incorrectly encoded data or data exceeding `maxMsgSize` will result
in stopping the peer.
`maxMsgSize` equals `MaxBatchBytes` (10MB) + 4 (proto overhead).
`MaxBatchBytes` is a mempool config parameter -> defined locally. The reactor
sends transactions to the connected peers in batches. The maximum size of one
batch is `MaxBatchBytes`.
The mempool will not send a tx back to any peer which it received it from.
The reactor assigns an `uint16` number for each peer and maintains a map from


Loading…
Cancel
Save