diff --git a/crates/sc-subspace-chain-specs/res/chain-spec-raw-devnet.json b/crates/sc-subspace-chain-specs/res/chain-spec-raw-devnet.json index 1228c778eb..011b33895e 100644 --- a/crates/sc-subspace-chain-specs/res/chain-spec-raw-devnet.json +++ b/crates/sc-subspace-chain-specs/res/chain-spec-raw-devnet.json @@ -17,7 +17,7 @@ "properties": { "domainsBootstrapNodes": {}, "dsnBootstrapNodes": [ - "/dns/bootstrap-0.devnet.subspace.network/udp/30533/quic-v1/p2p/12D3KooWJgLU8DmkXwBpQtHgSURFfJ4f2SyuNVBgVY96aDJsDWFK" + "/dns/bootstrap-0.devnet.subspace.network/tcp/30533/p2p/12D3KooWJgLU8DmkXwBpQtHgSURFfJ4f2SyuNVBgVY96aDJsDWFK" ], "potExternalEntropy": null, "ss58Format": 2254, diff --git a/crates/sc-subspace-chain-specs/res/chain-spec-raw-gemini-3h.json b/crates/sc-subspace-chain-specs/res/chain-spec-raw-gemini-3h.json index 286aa4d1e6..c1bcb0ca83 100644 --- a/crates/sc-subspace-chain-specs/res/chain-spec-raw-gemini-3h.json +++ b/crates/sc-subspace-chain-specs/res/chain-spec-raw-gemini-3h.json @@ -28,8 +28,6 @@ ] }, "dsnBootstrapNodes": [ - "/dns/bootstrap-0.gemini-3h.subspace.network/udp/30533/quic-v1/p2p/12D3KooWK7NuL4S6aEdy5gELnvhCGo6EyrWVARnBy7W4AJTVkaF1", - "/dns/bootstrap-1.gemini-3h.subspace.network/udp/30533/quic-v1/p2p/12D3KooWQK33n2raSXzjH8JyqbFtczBmbwZiK9Tpicdw3rveJesj", "/dns/bootstrap-0.gemini-3h.subspace.network/tcp/30533/p2p/12D3KooWK7NuL4S6aEdy5gELnvhCGo6EyrWVARnBy7W4AJTVkaF1", "/dns/bootstrap-1.gemini-3h.subspace.network/tcp/30533/p2p/12D3KooWQK33n2raSXzjH8JyqbFtczBmbwZiK9Tpicdw3rveJesj" ], diff --git a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs index 7239248a15..0cac32dc7b 100644 --- a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs +++ b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs @@ -286,16 +286,10 @@ struct DsnArgs { /// Multiaddr to listen on for subspace networking, for instance `/ip4/0.0.0.0/tcp/0`, /// multiple are supported. #[arg(long, default_values_t = [ - Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) - .with(Protocol::Udp(30533)) - .with(Protocol::QuicV1), - Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) - .with(Protocol::Udp(30533)) - .with(Protocol::QuicV1), - Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) - .with(Protocol::Tcp(30533)), - Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) - .with(Protocol::Tcp(30533)) + Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) + .with(Protocol::Tcp(30533)), + Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) + .with(Protocol::Tcp(30533)) ])] listen_on: Vec, /// Determines whether we allow keeping non-global (private, shared, loopback..) addresses in diff --git a/crates/subspace-farmer/src/bin/subspace-farmer/main.rs b/crates/subspace-farmer/src/bin/subspace-farmer/main.rs index d65d9a70a8..2f368efd1f 100644 --- a/crates/subspace-farmer/src/bin/subspace-farmer/main.rs +++ b/crates/subspace-farmer/src/bin/subspace-farmer/main.rs @@ -4,8 +4,8 @@ mod commands; mod utils; use clap::Parser; +use std::fs; use std::path::PathBuf; -use std::{env, fs}; use subspace_farmer::single_disk_farm::SingleDiskFarm; use subspace_proof_of_space::chia::ChiaTable; use tracing::info; @@ -61,11 +61,6 @@ enum Command { #[tokio::main] async fn main() -> anyhow::Result<()> { - // TODO: This is a hack to work around https://github.com/quinn-rs/quinn/issues/1750, should be - // removed once fixed upstream - if env::var("RUST_LOG").is_err() { - env::set_var("RUST_LOG", "info,quinn_udp=error"); - } tracing_subscriber::registry() .with( fmt::layer() diff --git a/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs b/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs index ca2fc3c653..c7aa659c4e 100644 --- a/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs +++ b/crates/subspace-malicious-operator/src/bin/subspace-malicious-operator.rs @@ -183,14 +183,9 @@ fn main() -> Result<(), Error> { DsnConfig { keypair, network_path: consensus_chain_config.base_path.path().join("network"), - listen_on: vec![ - "/ip4/0.0.0.0/udp/30433/quic-v1" - .parse::() - .expect("Manual setting"), - "/ip4/0.0.0.0/tcp/30433" - .parse::() - .expect("Manual setting"), - ], + listen_on: vec!["/ip4/0.0.0.0/tcp/30433" + .parse::() + .expect("Manual setting")], bootstrap_nodes: dsn_bootstrap_nodes, reserved_peers: vec![], allow_non_global_addresses_in_dht: false, diff --git a/crates/subspace-networking/Cargo.toml b/crates/subspace-networking/Cargo.toml index e2a9084a83..08a23380d6 100644 --- a/crates/subspace-networking/Cargo.toml +++ b/crates/subspace-networking/Cargo.toml @@ -64,7 +64,6 @@ features = [ "noise", "ping", "plaintext", - "quic", "request-response", "serde", "tcp", diff --git a/crates/subspace-networking/src/behavior/persistent_parameters.rs b/crates/subspace-networking/src/behavior/persistent_parameters.rs index 5f4e62680b..43fd1293d6 100644 --- a/crates/subspace-networking/src/behavior/persistent_parameters.rs +++ b/crates/subspace-networking/src/behavior/persistent_parameters.rs @@ -500,7 +500,7 @@ impl KnownPeersManager { fn single_peer_encoded_address_size() -> usize { let multiaddr = Multiaddr::from_str( - "/ip4/127.0.0.1/udp/1234/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp", + "/ip4/127.0.0.1/tcp/1234/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp", ) .expect("Valid multiaddr; qed"); // Use multiaddr size that is 3x larger than typical, should be enough for most practical diff --git a/crates/subspace-networking/src/bin/subspace-bootstrap-node/main.rs b/crates/subspace-networking/src/bin/subspace-bootstrap-node/main.rs index 35cf9447b5..61bbe61e19 100644 --- a/crates/subspace-networking/src/bin/subspace-bootstrap-node/main.rs +++ b/crates/subspace-networking/src/bin/subspace-bootstrap-node/main.rs @@ -46,12 +46,6 @@ enum Command { keypair: String, /// Multiaddr to listen on for subspace networking, multiple are supported #[arg(long, default_values_t = [ - Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) - .with(Protocol::Udp(0)) - .with(Protocol::QuicV1), - Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) - .with(Protocol::Udp(0)) - .with(Protocol::QuicV1), Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) .with(Protocol::Tcp(0)), Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) diff --git a/crates/subspace-networking/src/constructor.rs b/crates/subspace-networking/src/constructor.rs index 55a7c45e0e..db5c6cec0f 100644 --- a/crates/subspace-networking/src/constructor.rs +++ b/crates/subspace-networking/src/constructor.rs @@ -539,24 +539,10 @@ where let addr_string = addr.to_string(); // Listen on random port if specified is already occupied - match addr.pop() { - Some(Protocol::Tcp(_port)) => { - info!( - "Failed to listen on {addr_string} ({error}), falling back to random port" - ); - addr.push(Protocol::Tcp(0)); - swarm.listen_on(addr)?; - } - Some(Protocol::Udp(_port)) => { - info!( - "Failed to listen on {addr_string} ({error}), falling back to random port" - ); - addr.push(Protocol::Udp(0)); - swarm.listen_on(addr)?; - } - _ => { - // Do not care about other protocols - } + if let Some(Protocol::Tcp(_port)) = addr.pop() { + info!("Failed to listen on {addr_string} ({error}), falling back to random port"); + addr.push(Protocol::Tcp(0)); + swarm.listen_on(addr)?; } } } diff --git a/crates/subspace-networking/src/constructor/transport.rs b/crates/subspace-networking/src/constructor/transport.rs index afb1e69c22..c0ca4c715d 100644 --- a/crates/subspace-networking/src/constructor/transport.rs +++ b/crates/subspace-networking/src/constructor/transport.rs @@ -1,12 +1,9 @@ use crate::constructor::temporary_bans::TemporaryBans; -use futures::future::Either; use libp2p::core::multiaddr::{Multiaddr, Protocol}; use libp2p::core::muxing::StreamMuxerBox; use libp2p::core::transport::{Boxed, ListenerId, TransportError, TransportEvent}; use libp2p::core::Transport; use libp2p::dns::tokio::Transport as TokioTransport; -use libp2p::quic::tokio::Transport as QuicTransport; -use libp2p::quic::Config as QuicConfig; use libp2p::tcp::tokio::Transport as TokioTcpTransport; use libp2p::tcp::Config as GenTcpConfig; use libp2p::yamux::Config as YamuxConfig; @@ -49,25 +46,7 @@ pub(super) fn build_transport( .boxed() }; - let mut quic_config = QuicConfig::new(keypair); - if cfg!(windows) { - quic_config = quic_config.disable_path_mtu_discovery(); - } - - let quic = QuicTransport::new(quic_config) - .map(|(peer_id, muxer), _| (peer_id, StreamMuxerBox::new(muxer))); - - let wrapped_quic = - CustomTransportWrapper::new(quic, allow_non_global_addresses_in_dht, temporary_bans); - - let quic_tcp = wrapped_quic - .or_transport(tcp_upgraded) - .map(|either, _| match either { - Either::Left((peer_id, muxer)) => (peer_id, muxer), - Either::Right((peer_id, muxer)) => (peer_id, muxer), - }); - - Ok(TokioTransport::system(quic_tcp)?.boxed()) + Ok(TokioTransport::system(tcp_upgraded)?.boxed()) } #[derive(Debug, Clone)] diff --git a/crates/subspace-networking/src/protocols/autonat_wrapper.rs b/crates/subspace-networking/src/protocols/autonat_wrapper.rs index 0af6f1e822..4041c2cb30 100644 --- a/crates/subspace-networking/src/protocols/autonat_wrapper.rs +++ b/crates/subspace-networking/src/protocols/autonat_wrapper.rs @@ -49,7 +49,6 @@ impl Behaviour { fn address_corresponds_to_listening_addresses(&self, addr: &Multiaddr) -> bool { let Some(candidate_protocol) = addr.iter().find_map(|protocol| match protocol { - udp @ Protocol::Udp(_) => Some(udp), tcp @ Protocol::Tcp(_) => Some(tcp), _ => None, }) else { diff --git a/crates/subspace-node/src/commands/run/consensus.rs b/crates/subspace-node/src/commands/run/consensus.rs index dec69ba3a2..ca1b19395c 100644 --- a/crates/subspace-node/src/commands/run/consensus.rs +++ b/crates/subspace-node/src/commands/run/consensus.rs @@ -118,12 +118,6 @@ struct DsnOptions { /// Where local DSN node will listen for incoming connections. // TODO: Add more DSN-related parameters #[arg(long, default_values_t = [ - Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) - .with(Protocol::Udp(30433)) - .with(Protocol::QuicV1), - Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) - .with(Protocol::Udp(30433)) - .with(Protocol::QuicV1), Multiaddr::from(IpAddr::V4(Ipv4Addr::UNSPECIFIED)) .with(Protocol::Tcp(30433)), Multiaddr::from(IpAddr::V6(Ipv6Addr::UNSPECIFIED)) diff --git a/crates/subspace-node/src/commands/shared.rs b/crates/subspace-node/src/commands/shared.rs index 0d34ec31f2..10b88c24b1 100644 --- a/crates/subspace-node/src/commands/shared.rs +++ b/crates/subspace-node/src/commands/shared.rs @@ -6,7 +6,6 @@ use sp_core::sr25519::Pair; use sp_core::Pair as PairT; use sp_domains::KEY_TYPE; use sp_keystore::Keystore; -use std::env; use std::path::PathBuf; use tracing_subscriber::filter::LevelFilter; use tracing_subscriber::prelude::*; @@ -59,11 +58,6 @@ pub(super) struct InitLoggerResult { } pub(super) fn init_logger() -> InitLoggerResult { - // TODO: This is a hack to work around https://github.com/quinn-rs/quinn/issues/1750, should be - // removed once fixed upstream - if env::var("RUST_LOG").is_err() { - env::set_var("RUST_LOG", "info,quinn_udp=error"); - } // TODO: Workaround for https://github.com/tokio-rs/tracing/issues/2214, also on // Windows terminal doesn't support the same colors as bash does let enable_color = if cfg!(windows) { diff --git a/docs/farming.md b/docs/farming.md index bb75a48eeb..07808854bb 100644 --- a/docs/farming.md +++ b/docs/farming.md @@ -25,11 +25,11 @@ Install [Polkadot.js extension](https://polkadot.js.org/extension/) into your br The address of your account will be necessary at the last step. ## Required ports -Currently, TCP and UDP ports `30333`, `30433` and `30533` need to be exposed for node and farmer to work properly. +Currently, TCP ports `30333`, `30433` and `30533` need to be exposed for node and farmer to work properly. -If you have a server with no firewall, there is nothing to be done, but otherwise make sure to open TCP and UDP ports `30333`, `30433` and `30533` for incoming connections. +If you have a server with no firewall, there is nothing to be done, but otherwise make sure to open TCP ports `30333`, `30433` and `30533` for incoming connections. -On the desktop side if you have a router in front of your computer, you'll need to forward TCP and UDP ports `30333`, `30433` and `30533` to the machine on which your node is running (how this is done varied from router to router, but there is always a feature like this, ask [on the forum](https://forum.subspace.network/) if you have questions). +On the desktop side if you have a router in front of your computer, you'll need to forward TCP ports `30333`, `30433` and `30533` to the machine on which your node is running (how this is done varied from router to router, but there is always a feature like this, ask [on the forum](https://forum.subspace.network/) if you have questions). If you're connected directly without any router, then again nothing needs to be done in such case. ## 🖼️ Windows Instructions @@ -204,9 +204,7 @@ services: ports: # If port 30333 or 30433 is already occupied by another Substrate-based node, replace all # occurrences of `30333` or `30433` in this file with another value - - "0.0.0.0:30333:30333/udp" - "0.0.0.0:30333:30333/tcp" - - "0.0.0.0:30433:30433/udp" - "0.0.0.0:30433:30433/tcp" restart: unless-stopped command: [ @@ -214,7 +212,6 @@ services: "--chain", "gemini-3h", "--base-path", "/var/subspace", "--listen-on", "/ip4/0.0.0.0/tcp/30333", - "--dsn-listen-on", "/ip4/0.0.0.0/udp/30433/quic-v1", "--dsn-listen-on", "/ip4/0.0.0.0/tcp/30433", "--rpc-listen-on", "0.0.0.0:9944", "--rpc-cors", "all", @@ -245,13 +242,11 @@ services: ports: # If port 30533 is already occupied by something else, replace all # occurrences of `30533` in this file with another value - - "0.0.0.0:30533:30533/udp" - "0.0.0.0:30533:30533/tcp" restart: unless-stopped command: [ "farm", "--node-rpc-url", "ws://node:9944", - "--listen-on", "/ip4/0.0.0.0/udp/30533/quic-v1", "--listen-on", "/ip4/0.0.0.0/tcp/30533", # Replace `WALLET_ADDRESS` with your Polkadot.js wallet address "--reward-address", "WALLET_ADDRESS",