-
- Downloads
Attempt to relieve pressure on `mpsc_network_worker` (#13725)
* Attempt to relieve pressure on `mpsc_network_worker` `SyncingEngine` interacting with `NetworkWorker` can put a lot of strain on the channel if the number of inbound connections is high. This is because `SyncingEngine` is notified of each inbound substream which it then can either accept or reject and this causes a lot of message exchange on the already busy channel. Use a direct channel pair between `Protocol` and `SyncingEngine` to exchange notification events. It is a temporary change to alleviate the problems caused by syncing being an independent protocol and the fix will be removed once `NotificationService` is implemented. * Apply review comments * fixes * trigger ci * Fix tests Verify that both peers have a connection now that the validation goes through `SyncingEngine`. Depending on how the tasks are scheduled, one of them might not have the peer registered in `SyncingEngine` at which point the test won't make any progress because block announcement received from an unknown peer is discarded. Move polling of `ChainSync` at the end of the function so that if a block announcement causes a block request to be sent, that can be sent in the same call to `SyncingEngine::poll()`. --------- Co-authored-by: parity-processbot <>
Showing
- Cargo.lock 1 addition, 0 deletionsCargo.lock
- client/network/src/config.rs 10 additions, 1 deletionclient/network/src/config.rs
- client/network/src/event.rs 45 additions, 2 deletionsclient/network/src/event.rs
- client/network/src/lib.rs 3 additions, 3 deletionsclient/network/src/lib.rs
- client/network/src/protocol.rs 90 additions, 18 deletionsclient/network/src/protocol.rs
- client/network/src/service.rs 4 additions, 2 deletionsclient/network/src/service.rs
- client/network/sync/src/engine.rs 87 additions, 110 deletionsclient/network/sync/src/engine.rs
- client/network/test/Cargo.toml 1 addition, 0 deletionsclient/network/test/Cargo.toml
- client/network/test/src/lib.rs 7 additions, 5 deletionsclient/network/test/src/lib.rs
- client/network/test/src/service.rs 4 additions, 2 deletionsclient/network/test/src/service.rs
- client/network/test/src/sync.rs 1 addition, 1 deletionclient/network/test/src/sync.rs
- client/service/src/builder.rs 6 additions, 7 deletionsclient/service/src/builder.rs
Loading
Please register or sign in to comment