-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
difficulty:moderategetting-startedIssues that can be tackled if you don't know the internals of libp2p very wellIssues that can be tackled if you don't know the internals of libp2p very wellhelp wantedpriority:importantThe changes needed are critical for libp2p, or are blocking another projectThe changes needed are critical for libp2p, or are blocking another project
Description
Description
See #3078 for tracking issue on backpressure in rust-libp2p in general.
Today EnabledHandler::send_queue can grow unboundedly, where the Gossipsub NetworkBehaviour sends messages faster than the Gossipsub EnabledHandler can process them.
rust-libp2p/protocols/gossipsub/src/handler.rs
Lines 99 to 100 in ecdd0ff
| /// Queue of values that we want to send to the remote. | |
| send_queue: SmallVec<[proto::RPC; 16]>, |
I see two solutions:
- Front or tail drop in
EnabledHandleroncesend_queuereaches a certain size. - Implement backpressure between Gossipsubs
NetworkBehaviourandConnectionHandlerand only forward fromNetworkBehaviourtoConnectionHandlerwhen the latter can handle another message. I.e. drop messages for a specific peer inNetworkBehaviourinstead of as suggested in (1) inConnectionHandler.
Motivation
See #3078. Prevents past failures like #4572.
Requirements
Bound send_queue, i.e. make it impossible for it to grow unboundedly.
Open questions
No response
Are you planning to do it yourself in a pull request ?
No
Metadata
Metadata
Labels
difficulty:moderategetting-startedIssues that can be tackled if you don't know the internals of libp2p very wellIssues that can be tackled if you don't know the internals of libp2p very wellhelp wantedpriority:importantThe changes needed are critical for libp2p, or are blocking another projectThe changes needed are critical for libp2p, or are blocking another project