From 1d449bbb2e811c76c012d67d57e43e596331816a Mon Sep 17 00:00:00 2001 From: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:44:02 +0300 Subject: [PATCH 1/3] BACKPORT-CONFLICT --- Cargo.lock | 251 +++++++++++++++++- Cargo.toml | 8 +- .../src/lib.rs | 13 + .../relay-chain-minimal-node/src/lib.rs | 9 +- .../polkadot-omni-node/lib/src/common/spec.rs | 6 +- .../polkadot-omni-node/lib/src/nodes/mod.rs | 7 +- cumulus/test/service/src/lib.rs | 32 ++- cumulus/test/service/src/main.rs | 7 +- polkadot/node/metrics/src/tests.rs | 4 +- polkadot/node/service/src/lib.rs | 23 +- polkadot/node/test/service/src/lib.rs | 63 +++-- .../node/test/service/tests/build-blocks.rs | 4 +- .../node/test/service/tests/call-function.rs | 2 +- .../adder/collator/tests/integration.rs | 8 +- .../undying/collator/tests/integration.rs | 8 +- prdoc/pr_8461.prdoc | 29 ++ substrate/bin/node/cli/src/service.rs | 2 +- .../client/cli/src/params/network_params.rs | 13 +- substrate/client/network/src/config.rs | 19 +- .../src/litep2p/shim/request_response/mod.rs | 2 +- substrate/client/service/src/lib.rs | 2 +- templates/minimal/node/src/command.rs | 2 +- templates/solochain/node/src/command.rs | 2 +- 23 files changed, 402 insertions(+), 114 deletions(-) create mode 100644 prdoc/pr_8461.prdoc diff --git a/Cargo.lock b/Cargo.lock index 798a66bedfaa0..dab53515aeec2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3894,6 +3894,21 @@ dependencies = [ "itertools 0.10.5", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -6842,6 +6857,19 @@ dependencies = [ "sp-staking", ] +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.58.0", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -7273,6 +7301,31 @@ dependencies = [ "url", ] +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna 1.0.3", + "ipnet", + "once_cell", + "rand 0.9.0", + "ring 0.17.8", + "thiserror 2.0.12", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "hickory-resolver" version = "0.24.2" @@ -7281,7 +7334,7 @@ checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" dependencies = [ "cfg-if", "futures-util", - "hickory-proto", + "hickory-proto 0.24.1", "ipconfig", "lru-cache", "once_cell", @@ -7294,6 +7347,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "hickory-resolver" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto 0.25.2", + "ipconfig", + "moka", + "once_cell", + "parking_lot 0.12.3", + "rand 0.9.0", + "resolv-conf", + "smallvec", + "thiserror 2.0.12", + "tokio", + "tracing", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -8969,6 +9043,10 @@ checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" dependencies = [ "async-trait", "futures", +<<<<<<< HEAD +======= + "hickory-resolver 0.24.2", +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) "libp2p-core", "libp2p-identity", "log", @@ -9055,6 +9133,10 @@ checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" dependencies = [ "data-encoding", "futures", +<<<<<<< HEAD +======= + "hickory-proto 0.24.1", +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) "if-watch", "libp2p-core", "libp2p-identity", @@ -9304,6 +9386,10 @@ dependencies = [ "log", "thiserror 1.0.65", "yamux 0.12.1", +<<<<<<< HEAD +======= + "yamux 0.13.5", +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) ] [[package]] @@ -9470,9 +9556,9 @@ checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "litep2p" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71056c23c896bb0e18113b2d2f1989be95135e6bdeedb0b757422ee21a073eb" +checksum = "14fb10e63363204b89d91e1292df83322fd9de5d7fa76c3d5c78ddc2f8f3efa9" dependencies = [ "async-trait", "bs58", @@ -9481,7 +9567,7 @@ dependencies = [ "ed25519-dalek", "futures", "futures-timer", - "hickory-resolver", + "hickory-resolver 0.25.2", "indexmap 2.9.0", "libc", "mockall 0.13.1", @@ -9510,7 +9596,7 @@ dependencies = [ "url", "x25519-dalek", "x509-parser 0.17.0", - "yamux 0.13.4", + "yamux 0.13.5", "yasna", "zeroize", ] @@ -9541,6 +9627,19 @@ dependencies = [ "value-bag", ] +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lru" version = "0.11.0" @@ -9988,6 +10087,25 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "moka" +version = "0.12.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "loom", + "parking_lot 0.12.3", + "portable-atomic", + "rustc_version 0.4.0", + "smallvec", + "tagptr", + "thiserror 1.0.65", + "uuid", +] + [[package]] name = "multi-stash" version = "0.2.0" @@ -10703,9 +10821,19 @@ dependencies = [ [[package]] name = "once_cell" +<<<<<<< HEAD version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +======= +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "critical-section", + "portable-atomic", +] +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) [[package]] name = "oorandom" @@ -16637,9 +16765,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "portpicker" @@ -24519,6 +24647,25 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + +[[package]] +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) name = "tap" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -26763,6 +26910,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.51.1" @@ -26782,6 +26939,80 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.98", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2 1.0.95", + "quote 1.0.40", + "syn 2.0.98", +] + +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) name = "windows-sys" version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -27347,16 +27578,16 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.4" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17610762a1207ee816c6fadc29220904753648aba0a9ed61c7b8336e80a559c4" +checksum = "3da1acad1c2dc53f0dde419115a38bd8221d8c3e47ae9aeceaf453266d29307e" dependencies = [ "futures", "log", "nohash-hasher", "parking_lot 0.12.3", "pin-project", - "rand 0.8.5", + "rand 0.9.0", "static_assertions", "web-time", ] diff --git a/Cargo.toml b/Cargo.toml index 43b91d02742a6..36d5e4916b11a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -846,7 +846,7 @@ linked-hash-map = { version = "0.5.4" } linked_hash_set = { version = "0.1.4" } linregress = { version = "0.5.1" } lite-json = { version = "0.2.0", default-features = false } -litep2p = { version = "0.9.4", features = ["websocket"] } +litep2p = { version = "0.9.5", features = ["websocket"] } log = { version = "0.4.22", default-features = false } macro_magic = { version = "0.5.1" } maplit = { version = "1.0.2" } @@ -882,7 +882,7 @@ num-format = { version = "0.4.3" } num-rational = { version = "0.4.1" } num-traits = { version = "0.2.17", default-features = false } num_cpus = { version = "1.13.1" } -once_cell = { version = "1.19.0" } +once_cell = { version = "1.21.3" } orchestra = { version = "0.4.0", default-features = false } pallet-alliance = { path = "substrate/frame/alliance", default-features = false, version = "38.1.0" } pallet-asset-conversion = { path = "substrate/frame/asset-conversion", default-features = false, version = "21.1.0" } @@ -1334,7 +1334,11 @@ tikv-jemalloc-ctl = { version = "0.5.0" } tikv-jemallocator = { version = "0.5.0" } time = { version = "0.3" } tiny-keccak = { version = "2.0.2" } +<<<<<<< HEAD tokio = { version = "1.40.0", default-features = false } +======= +tokio = { version = "1.45.0", default-features = false } +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) tokio-retry = { version = "0.3.0" } tokio-stream = { version = "0.1.14" } tokio-test = { version = "0.4.4" } diff --git a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs index f29e7f3ed7c7c..c4f049a5593ab 100644 --- a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs +++ b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs @@ -383,7 +383,20 @@ fn build_polkadot_full_node( }, )?; +<<<<<<< HEAD Ok((relay_chain_full_node, maybe_collator_key)) +======= + let (relay_chain_full_node, paranode_req_receiver) = match config.network.network_backend { + NetworkBackendType::Libp2p => build_polkadot_with_paranode_protocol::< + sc_network::NetworkWorker<_, _>, + >(config, new_full_params)?, + NetworkBackendType::Litep2p => build_polkadot_with_paranode_protocol::< + sc_network::Litep2pNetworkBackend, + >(config, new_full_params)?, + }; + + Ok((relay_chain_full_node, maybe_collator_key, paranode_req_receiver)) +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) } /// Builds a relay chain interface by constructing a full relay chain node diff --git a/cumulus/client/relay-chain-minimal-node/src/lib.rs b/cumulus/client/relay-chain-minimal-node/src/lib.rs index 3386fd9160cdd..a3d858ea40c92 100644 --- a/cumulus/client/relay-chain-minimal-node/src/lib.rs +++ b/cumulus/client/relay-chain-minimal-node/src/lib.rs @@ -30,7 +30,7 @@ use polkadot_node_network_protocol::{ use polkadot_core_primitives::{Block as RelayBlock, Hash as RelayHash}; use polkadot_node_subsystem_util::metrics::prometheus::Registry; use polkadot_primitives::CollatorPair; -use polkadot_service::{overseer::OverseerGenArgs, IdentifyNetworkBackend, IsParachainNode}; +use polkadot_service::{overseer::OverseerGenArgs, IsParachainNode}; use sc_authority_discovery::Service as AuthorityDiscoveryService; use sc_network::{ @@ -97,12 +97,7 @@ async fn build_interface( ) -> RelayChainResult<(Arc<(dyn RelayChainInterface + 'static)>, Option)> { let collator_pair = CollatorPair::generate().0; let blockchain_rpc_client = Arc::new(BlockChainRpcClient::new(client.clone())); - - // If the network backend is unspecified, use the default for the given chain. - let default_backend = polkadot_config.chain_spec.network_backend(); - let network_backend = polkadot_config.network.network_backend.unwrap_or(default_backend); - - let collator_node = match network_backend { + let collator_node = match polkadot_config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => new_minimal_relay_chain::>( polkadot_config, diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 6b9e3f422aa59..8397cb778dcf4 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -31,7 +31,6 @@ use cumulus_client_service::{ use cumulus_primitives_core::{BlockT, ParaId}; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; use parachains_common::Hash; -use polkadot_cli::service::IdentifyNetworkBackend; use polkadot_primitives::CollatorPair; use prometheus_endpoint::Registry; use sc_consensus::DefaultImportQueue; @@ -384,10 +383,7 @@ where hwbench: Option, node_extra_args: NodeExtraArgs, ) -> Pin>>> { - // If the network backend is unspecified, use the default for the given chain. - let default_backend = parachain_config.chain_spec.network_backend(); - let network_backend = parachain_config.network.network_backend.unwrap_or(default_backend); - match network_backend { + match parachain_config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => ::start_node::>( parachain_config, diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs b/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs index 6a9fbadcc2b69..ddf5e198ef683 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/mod.rs @@ -20,7 +20,6 @@ mod manual_seal; use crate::common::spec::{DynNodeSpec, NodeSpec as NodeSpecT}; use cumulus_primitives_core::ParaId; use manual_seal::ManualSealNode; -use polkadot_cli::service::IdentifyNetworkBackend; use sc_service::{Configuration, TaskManager}; /// The current node version for cumulus official binaries, which takes the basic @@ -53,11 +52,7 @@ where block_time: u64, ) -> sc_service::error::Result { let node = ManualSealNode::::new(); - - // If the network backend is unspecified, use the default for the given chain. - let default_backend = config.chain_spec.network_backend(); - let network_backend = config.network.network_backend.unwrap_or(default_backend); - match network_backend { + match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => node.start_node::>(config, para_id, block_time), sc_network::config::NetworkBackendType::Litep2p => diff --git a/cumulus/test/service/src/lib.rs b/cumulus/test/service/src/lib.rs index 6b50cee05b116..419bfd95eca59 100644 --- a/cumulus/test/service/src/lib.rs +++ b/cumulus/test/service/src/lib.rs @@ -69,7 +69,7 @@ use frame_system_rpc_runtime_api::AccountNonceApi; use polkadot_node_subsystem::{errors::RecoveryError, messages::AvailabilityRecoveryMessage}; use polkadot_overseer::Handle as OverseerHandle; use polkadot_primitives::{CandidateHash, CollatorPair, Hash as PHash, PersistedValidationData}; -use polkadot_service::{IdentifyNetworkBackend, ProvideRuntimeApi}; +use polkadot_service::ProvideRuntimeApi; use sc_consensus::ImportQueue; use sc_network::{ config::{FullNetworkConfiguration, TransportConfig}, @@ -760,13 +760,8 @@ impl TestNodeBuilder { relay_chain_config.network.node_name = format!("{} (relay chain)", relay_chain_config.network.node_name); - let multiaddr = parachain_config.network.listen_addresses[0].clone(); - - // If the network backend is unspecified, use the default for the given chain. - let default_backend = relay_chain_config.chain_spec.network_backend(); - let network_backend = relay_chain_config.network.network_backend.unwrap_or(default_backend); let (task_manager, client, network, rpc_handlers, transaction_pool, backend) = - match network_backend { + match relay_chain_config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => start_node_impl::<_, sc_network::NetworkWorker<_, _>>( parachain_config, @@ -801,6 +796,7 @@ impl TestNodeBuilder { .expect("could not create Cumulus test service"), }; let peer_id = network.local_peer_id(); + let multiaddr = polkadot_test_service::get_listen_address(network.clone()).await; let addr = MultiaddrWithPeerId { multiaddr, peer_id }; TestNode { task_manager, client, network, addr, rpc_handlers, transaction_pool, backend } @@ -809,10 +805,13 @@ impl TestNodeBuilder { /// Create a Cumulus `Configuration`. /// -/// By default an in-memory socket will be used, therefore you need to provide nodes if you want the -/// node to be connected to other nodes. If `nodes_exclusive` is `true`, the node will only connect -/// to the given `nodes` and not to any other node. The `storage_update_func` can be used to make -/// adjustments to the runtime genesis. +/// By default a TCP socket will be used, therefore you need to provide nodes if you want the +/// node to be connected to other nodes. +/// +/// If `nodes_exclusive` is `true`, the node will only connect to the given `nodes` and not to any +/// other node. +/// +/// The `storage_update_func` can be used to make adjustments to the runtime genesis. pub fn node_config( storage_update_func: impl Fn(), tokio_handle: tokio::runtime::Handle, @@ -855,11 +854,10 @@ pub fn node_config( network_config.allow_non_globals_in_dht = true; - network_config - .listen_addresses - .push(multiaddr::Protocol::Memory(rand::random()).into()); - - network_config.transport = TransportConfig::MemoryOnly; + let addr: multiaddr::Multiaddr = "/ip4/127.0.0.1/tcp/0".parse().expect("valid address; qed"); + network_config.listen_addresses.push(addr.clone()); + network_config.transport = + TransportConfig::Normal { enable_mdns: false, allow_private_ip: true }; Ok(Configuration { impl_name: "cumulus-test-node".to_string(), @@ -1044,6 +1042,6 @@ pub fn run_relay_chain_validator_node( workers_path.pop(); tokio_handle.block_on(async move { - polkadot_test_service::run_validator_node(config, Some(workers_path)) + polkadot_test_service::run_validator_node(config, Some(workers_path)).await }) } diff --git a/cumulus/test/service/src/main.rs b/cumulus/test/service/src/main.rs index df331577af5f0..62eed081a4cbd 100644 --- a/cumulus/test/service/src/main.rs +++ b/cumulus/test/service/src/main.rs @@ -21,7 +21,6 @@ use std::sync::Arc; use cli::{RelayChainCli, Subcommand, TestCollatorCli}; use cumulus_primitives_core::relay_chain::CollatorPair; use cumulus_test_service::{chain_spec, new_partial, AnnounceBlockFn}; -use polkadot_service::IdentifyNetworkBackend; use sc_cli::{CliConfiguration, SubstrateCli}; use sp_core::Pair; @@ -103,14 +102,18 @@ fn main() -> Result<(), sc_cli::Error> { cumulus_test_service::Consensus::Null }) .unwrap_or(cumulus_test_service::Consensus::Aura); +<<<<<<< HEAD // If the network backend is unspecified, use the default for the given chain. let default_backend = relay_chain_config.chain_spec.network_backend(); let network_backend = relay_chain_config.network.network_backend.unwrap_or(default_backend); +======= + let use_slot_based_collator = cli.authoring == AuthoringPolicy::SlotBased; +>>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) let (mut task_manager, _, _, _, _, _) = tokio_runtime .block_on(async move { - match network_backend { + match relay_chain_config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => cumulus_test_service::start_node_impl::< _, diff --git a/polkadot/node/metrics/src/tests.rs b/polkadot/node/metrics/src/tests.rs index 4760138058eb7..1d472c4df6a15 100644 --- a/polkadot/node/metrics/src/tests.rs +++ b/polkadot/node/metrics/src/tests.rs @@ -45,13 +45,13 @@ async fn runtime_can_publish_metrics() { builder.init().expect("Failed to set up the logger"); // Start validator Alice. - let alice = run_validator_node(alice_config, None); + let alice = run_validator_node(alice_config, None).await; let bob_config = node_config(|| {}, tokio::runtime::Handle::current(), Bob, vec![alice.addr.clone()], true); // Start validator Bob. - let _bob = run_validator_node(bob_config, None); + let _bob = run_validator_node(bob_config, None).await; // Wait for Alice to see two finalized blocks. alice.wait_for_finalized_blocks(2).await; diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index dae21d5fa68b7..70fd60d987b6e 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -327,23 +327,6 @@ impl IdentifyVariant for Box { } } -/// A trait to identify the network backend based on the chain spec. -pub trait IdentifyNetworkBackend { - /// Returns the default network backend. - fn network_backend(&self) -> sc_network::config::NetworkBackendType; -} - -impl IdentifyNetworkBackend for Box { - fn network_backend(&self) -> sc_network::config::NetworkBackendType { - // By default litep2p is enabled only on Kusama. - if self.is_kusama() { - sc_network::config::NetworkBackendType::Litep2p - } else { - sc_network::config::NetworkBackendType::Libp2p - } - } -} - #[cfg(feature = "full-node")] pub fn open_database(db_source: &DatabaseSource) -> Result, Error> { let parachains_db = match db_source { @@ -1456,11 +1439,7 @@ pub fn build_full( capacity }); - // If the network backend is unspecified, use the default for the given chain. - let default_backend = config.chain_spec.network_backend(); - let network_backend = config.network.network_backend.unwrap_or(default_backend); - - match network_backend { + match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => new_full::<_, sc_network::NetworkWorker>(config, params), sc_network::config::NetworkBackendType::Litep2p => diff --git a/polkadot/node/test/service/src/lib.rs b/polkadot/node/test/service/src/lib.rs index 68c9c1e920cfa..6e4fd7215da4f 100644 --- a/polkadot/node/test/service/src/lib.rs +++ b/polkadot/node/test/service/src/lib.rs @@ -29,8 +29,7 @@ use polkadot_primitives::{Balance, CollatorPair, HeadData, Id as ParaId, Validat use polkadot_runtime_common::BlockHashCount; use polkadot_runtime_parachains::paras::{ParaGenesisArgs, ParaKind}; use polkadot_service::{ - Error, FullClient, IdentifyNetworkBackend, IsParachainNode, NewFull, OverseerGen, - PrometheusConfig, + Error, FullClient, IsParachainNode, NewFull, OverseerGen, PrometheusConfig, }; use polkadot_test_runtime::{ ParasCall, ParasSudoWrapperCall, Runtime, SignedPayload, SudoCall, TxExtension, @@ -41,7 +40,9 @@ use sc_chain_spec::ChainSpec; use sc_client_api::BlockchainEvents; use sc_network::{ config::{NetworkConfiguration, TransportConfig}, - multiaddr, NetworkStateInfo, + multiaddr, + service::traits::NetworkService, + NetworkStateInfo, }; use sc_service::{ config::{ @@ -81,11 +82,7 @@ pub fn new_full( ) -> Result { let workers_path = Some(workers_path.unwrap_or_else(get_relative_workers_path_for_test)); - // If the network backend is unspecified, use the default for the given chain. - let default_backend = config.chain_spec.network_backend(); - let network_backend = config.network.network_backend.unwrap_or(default_backend); - - match network_backend { + match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => polkadot_service::new_full::<_, sc_network::NetworkWorker<_, _>>( config, @@ -153,7 +150,7 @@ pub fn test_prometheus_config(port: u16) -> PrometheusConfig { /// Create a Polkadot `Configuration`. /// -/// By default an in-memory socket will be used, therefore you need to provide boot +/// By default a TCP socket will be used, therefore you need to provide boot /// nodes if you want the future node to be connected to other nodes. /// /// The `storage_update_func` function will be executed in an externalities provided environment @@ -186,12 +183,13 @@ pub fn node_config( network_config.allow_non_globals_in_dht = true; - let addr: multiaddr::Multiaddr = multiaddr::Protocol::Memory(rand::random()).into(); + // Libp2p needs to know the local address on which it should listen for incoming connections, + // while Litep2p will use `/ip4/127.0.0.1/tcp/0` by default. + let addr: multiaddr::Multiaddr = "/ip4/127.0.0.1/tcp/0".parse().expect("valid address; qed"); network_config.listen_addresses.push(addr.clone()); - network_config.public_addresses.push(addr); - - network_config.transport = TransportConfig::MemoryOnly; + network_config.transport = + TransportConfig::Normal { enable_mdns: false, allow_private_ip: true }; Configuration { impl_name: "polkadot-test-node".to_string(), @@ -243,12 +241,40 @@ pub fn node_config( } } +/// Get the listen multiaddr from the network service. +/// +/// The address is used to connect to the node. +pub async fn get_listen_address(network: Arc) -> sc_network::Multiaddr { + loop { + // Litep2p provides instantly the listen address of the TCP protocol and + // ditched the `/0` port used by the `node_config` function. + // + // Libp2p backend needs to be polled in a separate tokio task a few times + // before the listen address is available. The address is made available + // through the `SwarmEvent::NewListenAddr` event. + let listen_addresses = network.listen_addresses(); + + // The network backend must produce a valid TCP port. + match listen_addresses.into_iter().find(|addr| { + addr.iter().any(|protocol| match protocol { + multiaddr::Protocol::Tcp(port) => port > 0, + _ => false, + }) + }) { + Some(multiaddr) => return multiaddr, + None => { + tokio::time::sleep(std::time::Duration::from_millis(500)).await; + continue; + }, + } + } +} + /// Run a test validator node that uses the test runtime and specified `config`. -pub fn run_validator_node( +pub async fn run_validator_node( config: Configuration, worker_program_path: Option, ) -> PolkadotTestNode { - let multiaddr = config.network.listen_addresses[0].clone(); let NewFull { task_manager, client, network, rpc_handlers, overseer_handle, .. } = new_full( config, IsParachainNode::No, @@ -259,6 +285,8 @@ pub fn run_validator_node( let overseer_handle = overseer_handle.expect("test node must have an overseer handle"); let peer_id = network.local_peer_id(); + let multiaddr = get_listen_address(network).await; + let addr = MultiaddrWithPeerId { multiaddr, peer_id }; PolkadotTestNode { task_manager, client, overseer_handle, addr, rpc_handlers } @@ -276,7 +304,7 @@ pub fn run_validator_node( /// /// The collator functionality still needs to be registered at the node! This can be done using /// [`PolkadotTestNode::register_collator`]. -pub fn run_collator_node( +pub async fn run_collator_node( tokio_handle: tokio::runtime::Handle, key: Sr25519Keyring, storage_update_func: impl Fn(), @@ -284,7 +312,6 @@ pub fn run_collator_node( collator_pair: CollatorPair, ) -> PolkadotTestNode { let config = node_config(storage_update_func, tokio_handle, key, boot_nodes, false); - let multiaddr = config.network.listen_addresses[0].clone(); let NewFull { task_manager, client, network, rpc_handlers, overseer_handle, .. } = new_full( config, IsParachainNode::Collator(collator_pair), @@ -295,6 +322,8 @@ pub fn run_collator_node( let overseer_handle = overseer_handle.expect("test node must have an overseer handle"); let peer_id = network.local_peer_id(); + + let multiaddr = get_listen_address(network).await; let addr = MultiaddrWithPeerId { multiaddr, peer_id }; PolkadotTestNode { task_manager, client, overseer_handle, addr, rpc_handlers } diff --git a/polkadot/node/test/service/tests/build-blocks.rs b/polkadot/node/test/service/tests/build-blocks.rs index d5c6ab0b5ba66..07940d8e4f6a7 100644 --- a/polkadot/node/test/service/tests/build-blocks.rs +++ b/polkadot/node/test/service/tests/build-blocks.rs @@ -30,7 +30,7 @@ async fn ensure_test_service_build_blocks() { Vec::new(), true, ); - let mut alice = run_validator_node(alice_config, None); + let mut alice = run_validator_node(alice_config, None).await; let bob_config = node_config( || {}, @@ -39,7 +39,7 @@ async fn ensure_test_service_build_blocks() { vec![alice.addr.clone()], true, ); - let mut bob = run_validator_node(bob_config, None); + let mut bob = run_validator_node(bob_config, None).await; { let t1 = future::join(alice.wait_for_blocks(3), bob.wait_for_blocks(3)).fuse(); diff --git a/polkadot/node/test/service/tests/call-function.rs b/polkadot/node/test/service/tests/call-function.rs index 39d162eb37697..693288c675d59 100644 --- a/polkadot/node/test/service/tests/call-function.rs +++ b/polkadot/node/test/service/tests/call-function.rs @@ -22,7 +22,7 @@ async fn call_function_actually_work() { let alice_config = node_config(|| {}, tokio::runtime::Handle::current(), Alice, Vec::new(), true); - let alice = run_validator_node(alice_config, None); + let alice = run_validator_node(alice_config, None).await; let function = polkadot_test_runtime::RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { diff --git a/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs b/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs index 85abf8bf36b97..f461e5420cff1 100644 --- a/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs +++ b/polkadot/parachain/test-parachains/adder/collator/tests/integration.rs @@ -44,7 +44,8 @@ async fn collating_using_adder_collator() { workers_path.pop(); // start alice - let alice = polkadot_test_service::run_validator_node(alice_config, Some(workers_path.clone())); + let alice = + polkadot_test_service::run_validator_node(alice_config, Some(workers_path.clone())).await; let bob_config = polkadot_test_service::node_config( || {}, @@ -55,7 +56,7 @@ async fn collating_using_adder_collator() { ); // start bob - let bob = polkadot_test_service::run_validator_node(bob_config, Some(workers_path)); + let bob = polkadot_test_service::run_validator_node(bob_config, Some(workers_path)).await; let collator = test_parachain_adder_collator::Collator::new(); @@ -72,7 +73,8 @@ async fn collating_using_adder_collator() { || {}, vec![alice.addr.clone(), bob.addr.clone()], collator.collator_key(), - ); + ) + .await; charlie .register_collator( diff --git a/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs b/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs index 8be535b9bb4cc..fa0ccce3fe34b 100644 --- a/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs +++ b/polkadot/parachain/test-parachains/undying/collator/tests/integration.rs @@ -43,7 +43,8 @@ async fn collating_using_undying_collator() { workers_path.pop(); // start alice - let alice = polkadot_test_service::run_validator_node(alice_config, Some(workers_path.clone())); + let alice = + polkadot_test_service::run_validator_node(alice_config, Some(workers_path.clone())).await; let bob_config = polkadot_test_service::node_config( || {}, @@ -54,7 +55,7 @@ async fn collating_using_undying_collator() { ); // start bob - let bob = polkadot_test_service::run_validator_node(bob_config, Some(workers_path)); + let bob = polkadot_test_service::run_validator_node(bob_config, Some(workers_path)).await; let collator = test_parachain_undying_collator::Collator::new(1_000, 1); @@ -71,7 +72,8 @@ async fn collating_using_undying_collator() { || {}, vec![alice.addr.clone(), bob.addr.clone()], collator.collator_key(), - ); + ) + .await; charlie .register_collator( diff --git a/prdoc/pr_8461.prdoc b/prdoc/pr_8461.prdoc new file mode 100644 index 0000000000000..49663422035de --- /dev/null +++ b/prdoc/pr_8461.prdoc @@ -0,0 +1,29 @@ +title: Use litep2p as the default network backend + +doc: + - audience: [Node Dev, Node Operator] + description: | + This PR makes the litep2p backend the default backend. + Litep2p is a lightweight alternative to libp2p, that is designed to be more + efficient and easier to use. At the same time, litep2p brings performance + improvements and reduces the CPU usage significantly. + Libp2p is the old network backend, that may still be used for compatibility + reasons until the whole ecosystem is migrated to litep2p. + +crates: + - name: sc-network + bump: minor + - name: sc-cli + bump: patch + - name: sc-network-types + bump: minor + - name: polkadot-service + bump: minor + - name: sc-offchain + bump: patch + - name: cumulus-relay-chain-minimal-node + bump: patch + - name: cumulus-relay-chain-inprocess-interface + bump: patch + - name: polkadot-omni-node-lib + bump: patch diff --git a/substrate/bin/node/cli/src/service.rs b/substrate/bin/node/cli/src/service.rs index 78ebddb3f9cc9..008cac4ef8a88 100644 --- a/substrate/bin/node/cli/src/service.rs +++ b/substrate/bin/node/cli/src/service.rs @@ -817,7 +817,7 @@ pub fn new_full(config: Configuration, cli: Cli) -> Result { let task_manager = new_full_base::>( config, diff --git a/substrate/client/cli/src/params/network_params.rs b/substrate/client/cli/src/params/network_params.rs index 695894272df63..5931839265b27 100644 --- a/substrate/client/cli/src/params/network_params.rs +++ b/substrate/client/cli/src/params/network_params.rs @@ -172,16 +172,21 @@ pub struct NetworkParams { /// Network backend used for P2P networking. /// - /// litep2p network backend is considered experimental and isn't as stable as the libp2p - /// network backend. + /// Litep2p is a lightweight alternative to libp2p, that is designed to be more + /// efficient and easier to use. At the same time, litep2p brings performance + /// improvements and reduces the CPU usage significantly. + /// + /// Libp2p is the old network backend, that may still be used for compatibility + /// reasons until the whole ecosystem is migrated to litep2p. #[arg( long, value_enum, value_name = "NETWORK_BACKEND", + default_value_t = NetworkBackendType::Litep2p, ignore_case = true, verbatim_doc_comment )] - pub network_backend: Option, + pub network_backend: NetworkBackendType, } impl NetworkParams { @@ -277,7 +282,7 @@ impl NetworkParams { yamux_window_size: None, ipfs_server: self.ipfs_server, sync_mode: self.sync.into(), - network_backend: self.network_backend.map(Into::into), + network_backend: self.network_backend.into(), } } } diff --git a/substrate/client/network/src/config.rs b/substrate/client/network/src/config.rs index 71780004fd9c3..217ed60a0dad1 100644 --- a/substrate/client/network/src/config.rs +++ b/substrate/client/network/src/config.rs @@ -672,7 +672,7 @@ pub struct NetworkConfiguration { pub yamux_window_size: Option, /// Networking backend used for P2P communication. - pub network_backend: Option, + pub network_backend: NetworkBackendType, } impl NetworkConfiguration { @@ -705,7 +705,7 @@ impl NetworkConfiguration { .expect("value is a constant; constant is non-zero; qed."), yamux_window_size: None, ipfs_server: false, - network_backend: None, + network_backend: NetworkBackendType::Litep2p, } } @@ -933,12 +933,19 @@ impl> FullNetworkConfig /// Network backend type. #[derive(Debug, Clone, Default, Copy)] pub enum NetworkBackendType { - /// Use libp2p for P2P networking. - #[default] - Libp2p, - /// Use litep2p for P2P networking. + /// + /// This is the preferred option for Substrate-based chains. + #[default] Litep2p, + + /// Use libp2p for P2P networking. + /// + /// The libp2p is still used for compatibility reasons until the + /// ecosystem switches entirely to litep2p. The backend will enter + /// a "best-effort" maintenance mode, where only critical issues will + /// get fixed. If you are unsure, please use `NetworkBackendType::Litep2p`. + Libp2p, } #[cfg(test)] diff --git a/substrate/client/network/src/litep2p/shim/request_response/mod.rs b/substrate/client/network/src/litep2p/shim/request_response/mod.rs index 690d5a31e6ad6..d30fdfdc3650f 100644 --- a/substrate/client/network/src/litep2p/shim/request_response/mod.rs +++ b/substrate/client/network/src/litep2p/shim/request_response/mod.rs @@ -433,7 +433,7 @@ impl RequestResponseProtocol { Some(sender) => { log::debug!( target: LOG_TARGET, - "{}: failed to negotiate protocol with {:?}, try fallback request: ({})", + "{}: failed to negotiate protocol with {:?}. Trying the fallback protocol ({})", self.protocol, peer, protocol, diff --git a/substrate/client/service/src/lib.rs b/substrate/client/service/src/lib.rs index ee4f4e7622e74..8fd58a4de05d8 100644 --- a/substrate/client/service/src/lib.rs +++ b/substrate/client/service/src/lib.rs @@ -522,7 +522,7 @@ where let uxt = match Decode::decode(&mut &encoded[..]) { Ok(uxt) => uxt, Err(e) => { - debug!("Transaction invalid: {:?}", e); + debug!(target: sc_transaction_pool::LOG_TARGET, "Transaction invalid: {:?}", e); return Box::pin(futures::future::ready(TransactionImport::Bad)) }, }; diff --git a/templates/minimal/node/src/command.rs b/templates/minimal/node/src/command.rs index ca2cc1804f130..5cb0694d98282 100644 --- a/templates/minimal/node/src/command.rs +++ b/templates/minimal/node/src/command.rs @@ -117,7 +117,7 @@ pub fn run() -> sc_cli::Result<()> { None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - match config.network.network_backend.unwrap_or_default() { + match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => service::new_full::>(config, cli.consensus) .map_err(sc_cli::Error::Service), diff --git a/templates/solochain/node/src/command.rs b/templates/solochain/node/src/command.rs index 54540db7c2426..1c23e395ede93 100644 --- a/templates/solochain/node/src/command.rs +++ b/templates/solochain/node/src/command.rs @@ -178,7 +178,7 @@ pub fn run() -> sc_cli::Result<()> { None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - match config.network.network_backend.unwrap_or_default() { + match config.network.network_backend { sc_network::config::NetworkBackendType::Libp2p => service::new_full::< sc_network::NetworkWorker< solochain_template_runtime::opaque::Block, From 3eb97e26c5665309bd87a0e0f186d86fdf8f8f1e Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Wed, 4 Jun 2025 11:27:38 +0000 Subject: [PATCH 2/3] cargo: Fix conflicts Signed-off-by: Alexandru Vasile --- Cargo.lock | 195 +++++++----------- Cargo.toml | 4 - .../src/lib.rs | 13 -- 3 files changed, 74 insertions(+), 138 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dab53515aeec2..506c9ac70b559 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3902,10 +3902,11 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crossbeam-channel" -version = "0.5.15" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ + "cfg-if", "crossbeam-utils", ] @@ -6859,15 +6860,16 @@ dependencies = [ [[package]] name = "generator" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +checksum = "d18470a76cb7f8ff746cf1f7470914f900252ec36bbc40b569d74b1258446827" dependencies = [ + "cc", "cfg-if", "libc", "log", "rustversion", - "windows 0.58.0", + "windows 0.61.1", ] [[package]] @@ -7277,30 +7279,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" -[[package]] -name = "hickory-proto" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.6.0", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand 0.8.5", - "thiserror 1.0.65", - "tinyvec", - "tokio", - "tracing", - "url", -] - [[package]] name = "hickory-proto" version = "0.25.2" @@ -7310,7 +7288,7 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.6.0", "futures-channel", "futures-io", "futures-util", @@ -7318,7 +7296,7 @@ dependencies = [ "ipnet", "once_cell", "rand 0.9.0", - "ring 0.17.8", + "ring 0.17.7", "thiserror 2.0.12", "tinyvec", "tokio", @@ -7326,27 +7304,6 @@ dependencies = [ "url", ] -[[package]] -name = "hickory-resolver" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" -dependencies = [ - "cfg-if", - "futures-util", - "hickory-proto 0.24.1", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot 0.12.3", - "rand 0.8.5", - "resolv-conf", - "smallvec", - "thiserror 1.0.65", - "tokio", - "tracing", -] - [[package]] name = "hickory-resolver" version = "0.25.2" @@ -7355,7 +7312,7 @@ checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" dependencies = [ "cfg-if", "futures-util", - "hickory-proto 0.25.2", + "hickory-proto", "ipconfig", "moka", "once_cell", @@ -7536,7 +7493,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.5.9", "tokio", "tower-service", "tracing", @@ -9043,10 +9000,6 @@ checksum = "e6a18db73084b4da2871438f6239fef35190b05023de7656e877c18a00541a3b" dependencies = [ "async-trait", "futures", -<<<<<<< HEAD -======= - "hickory-resolver 0.24.2", ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) "libp2p-core", "libp2p-identity", "log", @@ -9133,10 +9086,6 @@ checksum = "42a2567c305232f5ef54185e9604579a894fd0674819402bb0ac0246da82f52a" dependencies = [ "data-encoding", "futures", -<<<<<<< HEAD -======= - "hickory-proto 0.24.1", ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) "if-watch", "libp2p-core", "libp2p-identity", @@ -9386,10 +9335,6 @@ dependencies = [ "log", "thiserror 1.0.65", "yamux 0.12.1", -<<<<<<< HEAD -======= - "yamux 0.13.5", ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) ] [[package]] @@ -9567,7 +9512,7 @@ dependencies = [ "ed25519-dalek", "futures", "futures-timer", - "hickory-resolver 0.25.2", + "hickory-resolver", "indexmap 2.9.0", "libc", "mockall 0.13.1", @@ -9637,7 +9582,7 @@ dependencies = [ "generator", "scoped-tls", "tracing", - "tracing-subscriber", + "tracing-subscriber 0.3.18", ] [[package]] @@ -10821,11 +10766,6 @@ dependencies = [ [[package]] name = "once_cell" -<<<<<<< HEAD -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -======= version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" @@ -10833,7 +10773,6 @@ dependencies = [ "critical-section", "portable-atomic", ] ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) [[package]] name = "oorandom" @@ -24646,18 +24585,6 @@ dependencies = [ "libc", ] -[[package]] -<<<<<<< HEAD -======= -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tagptr" version = "0.2.0" @@ -24665,7 +24592,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) name = "tap" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -26912,12 +26838,24 @@ dependencies = [ [[package]] name = "windows" -version = "0.58.0" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", ] [[package]] @@ -26939,80 +26877,86 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -======= name = "windows-core" -version = "0.58.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement", "windows-interface", + "windows-link", "windows-result", "windows-strings", - "windows-targets 0.52.6", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link", + "windows-threading", ] [[package]] name = "windows-implement" -version = "0.58.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.98", + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.87", ] [[package]] name = "windows-interface" -version = "0.58.0" +version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ - "proc-macro2 1.0.95", - "quote 1.0.40", - "syn 2.0.98", + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.87", ] [[package]] name = "windows-link" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] -name = "windows-registry" +name = "windows-numerics" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-result", - "windows-strings", - "windows-targets 0.52.6", + "windows-core 0.61.2", + "windows-link", ] [[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-result", - "windows-targets 0.52.6", + "windows-link", ] [[package]] ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) name = "windows-sys" version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -27094,6 +27038,15 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" diff --git a/Cargo.toml b/Cargo.toml index 36d5e4916b11a..aa0e6b3ad2825 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1334,11 +1334,7 @@ tikv-jemalloc-ctl = { version = "0.5.0" } tikv-jemallocator = { version = "0.5.0" } time = { version = "0.3" } tiny-keccak = { version = "2.0.2" } -<<<<<<< HEAD -tokio = { version = "1.40.0", default-features = false } -======= tokio = { version = "1.45.0", default-features = false } ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) tokio-retry = { version = "0.3.0" } tokio-stream = { version = "0.1.14" } tokio-test = { version = "0.4.4" } diff --git a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs index c4f049a5593ab..f29e7f3ed7c7c 100644 --- a/cumulus/client/relay-chain-inprocess-interface/src/lib.rs +++ b/cumulus/client/relay-chain-inprocess-interface/src/lib.rs @@ -383,20 +383,7 @@ fn build_polkadot_full_node( }, )?; -<<<<<<< HEAD Ok((relay_chain_full_node, maybe_collator_key)) -======= - let (relay_chain_full_node, paranode_req_receiver) = match config.network.network_backend { - NetworkBackendType::Libp2p => build_polkadot_with_paranode_protocol::< - sc_network::NetworkWorker<_, _>, - >(config, new_full_params)?, - NetworkBackendType::Litep2p => build_polkadot_with_paranode_protocol::< - sc_network::Litep2pNetworkBackend, - >(config, new_full_params)?, - }; - - Ok((relay_chain_full_node, maybe_collator_key, paranode_req_receiver)) ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) } /// Builds a relay chain interface by constructing a full relay chain node From 92f4757a6340692c39cfc50c12af94231891b48a Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Thu, 5 Jun 2025 10:17:43 +0000 Subject: [PATCH 3/3] cumulus/test: Adjust conflict Signed-off-by: Alexandru Vasile --- cumulus/test/service/src/main.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cumulus/test/service/src/main.rs b/cumulus/test/service/src/main.rs index 62eed081a4cbd..caa672e611f7c 100644 --- a/cumulus/test/service/src/main.rs +++ b/cumulus/test/service/src/main.rs @@ -102,15 +102,7 @@ fn main() -> Result<(), sc_cli::Error> { cumulus_test_service::Consensus::Null }) .unwrap_or(cumulus_test_service::Consensus::Aura); -<<<<<<< HEAD - - // If the network backend is unspecified, use the default for the given chain. - let default_backend = relay_chain_config.chain_spec.network_backend(); - let network_backend = - relay_chain_config.network.network_backend.unwrap_or(default_backend); -======= - let use_slot_based_collator = cli.authoring == AuthoringPolicy::SlotBased; ->>>>>>> f6d18b73 (client/net: Use litep2p as the default network backend (#8461)) + let (mut task_manager, _, _, _, _, _) = tokio_runtime .block_on(async move { match relay_chain_config.network.network_backend {