Files
pezkuwi-subxt/substrate/client/network/test/Cargo.toml
T
Aaro Altonen 4240490d1d 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 <>
2023-03-30 11:59:58 +00:00

41 lines
1.8 KiB
TOML

[package]
description = "Integration tests for Substrate network protocol"
name = "sc-network-test"
version = "0.8.0"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"
publish = false
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
tokio = "1.22.0"
async-trait = "0.1.57"
futures = "0.3.21"
futures-timer = "3.0.1"
libp2p = "0.50.0"
log = "0.4.17"
parking_lot = "0.12.1"
rand = "0.8.5"
sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" }
sc-client-api = { version = "4.0.0-dev", path = "../../api" }
sc-consensus = { version = "0.10.0-dev", path = "../../consensus/common" }
sc-network = { version = "0.10.0-dev", path = "../" }
sc-network-common = { version = "0.10.0-dev", path = "../common" }
sc-utils = { version = "4.0.0-dev", path = "../../utils" }
sc-network-light = { version = "0.10.0-dev", path = "../light" }
sc-network-sync = { version = "0.10.0-dev", path = "../sync" }
sc-service = { version = "0.10.0-dev", default-features = false, features = ["test-helpers"], path = "../../service" }
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" }
sp-core = { version = "7.0.0", path = "../../../primitives/core" }
sp-runtime = { version = "7.0.0", path = "../../../primitives/runtime" }
sp-tracing = { version = "6.0.0", path = "../../../primitives/tracing" }
substrate-test-runtime = { version = "2.0.0", path = "../../../test-utils/runtime" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }