Tendermint: mempool: locally-defined maxMsgSize and stopping peers

Created on 4 Sep 2020  路  1Comment  路  Source: tendermint/tendermint

Problem definition

While working on https://github.com/tendermint/tendermint/pull/5321, I saw that we're stopping the peer if it sends us a message bigger than maxMsgSize.

maxMsgSize = MaxBatchBytes + proto overhead
maxMsgSize = 10MB + 4 bytes

Because MaxBatchBytes is a config parameter (defined locally and not agreed by all nodes), peers can break the connection with our node if we increase this parameter and send them bigger messages.

Proposals

  1. Adaptive flow control (similar to TCP): try bigger size, then smaller, then smaller until the node accepts the msg.
  2. Learn about other nodes limits (during handshake) and send them smaller messages (according to their limits)
p2p proposal

Most helpful comment

I prefer specifying it in the handshake; why guess when we can know?

>All comments

I prefer specifying it in the handshake; why guess when we can know?

Was this page helpful?
0 / 5 - 0 ratings