ostracon icon indicating copy to clipboard operation
ostracon copied to clipboard

Separate P2P protocol into Mempool-related and others

Open tnasu opened this issue 2 years ago • 0 comments

Summary

P2P protocol can send/receive atomically all messages for each P2P connection, so it might be good to separate P2P protocol into Mempool-related and others since it can avoid affecting the consensus mechanism. Of course, increasing network costs. In addition, the transaction execution cost in the block is not changed and still remains.

Problem Definition

In high traffic Transactions, it affects the Consensus mechanism because Consensus messages cannot be sent by Mempool-related messages. It means that the Block generation is delayed. Currently, some solutions are implemented. For example, asynchronous receiving is just cut to process receiving time and helps to be able to shorten the sending interval. Sending ratio can send well balanced. But these don't work well in highly biased situations.

See:

  • https://github.com/line/ostracon/blob/v1.0.6/p2p/conn/connection.go#L40
  • https://github.com/line/ostracon/blob/v1.0.6/p2p/conn/connection.go#L86-L87
  • https://github.com/line/ostracon/blob/v1.0.6/p2p/conn/connection.go#L190
  • https://github.com/line/ostracon/blob/v1.0.6/p2p/conn/connection.go#L527-L540
  • https://github.com/line/ostracon/blob/v1.0.6/p2p/conn/connection.go#L652
  • https://github.com/line/ostracon/blob/v1.0.6/p2p/peer.go#L383-L407
  • https://github.com/line/ostracon/blob/v1.0.6/p2p/peer.go#L111-L112
  • https://github.com/line/ostracon/blob/v1.0.6/config/config.go#L570

Proposal

Separate P2P protocol into Mempool-related and others. After that, the Block generation cannot be affected by high traffic Transactions.


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

tnasu avatar Aug 17 '22 06:08 tnasu