Skip to content

Commit

Permalink
fix(papyrus_network): remove quic_port from NetworkConfig (#2623)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahakShama authored Dec 26, 2024
1 parent 29d16de commit 5895682
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 59 deletions.
10 changes: 0 additions & 10 deletions config/papyrus/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@
"privacy": "Public",
"value": 1000
},
"consensus.network_config.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"privacy": "Public",
"value": 10101
},
"consensus.network_config.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"privacy": "Private",
Expand Down Expand Up @@ -299,11 +294,6 @@
"privacy": "Public",
"value": 1000
},
"network.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"privacy": "Public",
"value": 10001
},
"network.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"privacy": "Private",
Expand Down
15 changes: 0 additions & 15 deletions config/sequencer/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,6 @@
"privacy": "Public",
"value": 1000
},
"consensus_manager_config.consensus_config.network_config.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"privacy": "Public",
"value": 10101
},
"consensus_manager_config.consensus_config.network_config.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"privacy": "Private",
Expand Down Expand Up @@ -919,11 +914,6 @@
"privacy": "Public",
"value": 1000
},
"mempool_p2p_config.network_config.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"privacy": "Public",
"value": 10001
},
"mempool_p2p_config.network_config.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"privacy": "Private",
Expand Down Expand Up @@ -1024,11 +1014,6 @@
"privacy": "Public",
"value": 1000
},
"state_sync_config.network_config.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"privacy": "Public",
"value": 10001
},
"state_sync_config.network_config.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"privacy": "Private",
Expand Down
8 changes: 0 additions & 8 deletions crates/papyrus_network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use validator::Validate;
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Validate)]
pub struct NetworkConfig {
pub tcp_port: u16,
pub quic_port: u16,
#[serde(deserialize_with = "deserialize_seconds_to_duration")]
pub session_timeout: Duration,
#[serde(deserialize_with = "deserialize_seconds_to_duration")]
Expand All @@ -66,12 +65,6 @@ impl SerializeConfig for NetworkConfig {
"The port that the node listens on for incoming tcp connections.",
ParamPrivacyInput::Public,
),
ser_param(
"quic_port",
&self.quic_port,
"The port that the node listens on for incoming quic connections.",
ParamPrivacyInput::Public,
),
ser_param(
"session_timeout",
&self.session_timeout.as_secs(),
Expand Down Expand Up @@ -126,7 +119,6 @@ impl Default for NetworkConfig {
fn default() -> Self {
Self {
tcp_port: 10000,
quic_port: 10001,
session_timeout: Duration::from_secs(120),
idle_connection_timeout: Duration::from_secs(120),
bootstrap_peer_multiaddr: None,
Expand Down
8 changes: 2 additions & 6 deletions crates/papyrus_network/src/network_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ impl NetworkManager {
pub fn new(config: NetworkConfig, node_version: Option<String>) -> Self {
let NetworkConfig {
tcp_port,
quic_port: _,
session_timeout,
idle_connection_timeout,
bootstrap_peer_multiaddr,
Expand All @@ -635,11 +634,8 @@ impl NetworkManager {
peer_manager_config,
} = config;

let listen_addresses = vec![
// TODO: uncomment once quic transpot works.
// format!("/ip4/0.0.0.0/udp/{quic_port}/quic-v1"),
format!("/ip4/0.0.0.0/tcp/{tcp_port}"),
];
// TODO(shahak): Add quic transport.
let listen_addresses = vec![format!("/ip4/0.0.0.0/tcp/{tcp_port}")];

let swarm = build_swarm(listen_addresses, idle_connection_timeout, secret_key, |key| {
mixed_behaviour::MixedBehaviour::new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,6 @@ expression: dumped_default_config
},
"privacy": "Public"
},
"consensus.network_config.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"value": {
"$serde_json::private::Number": "10101"
},
"privacy": "Public"
},
"consensus.network_config.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"value": "",
Expand Down Expand Up @@ -357,13 +350,6 @@ expression: dumped_default_config
},
"privacy": "Public"
},
"network.quic_port": {
"description": "The port that the node listens on for incoming quic connections.",
"value": {
"$serde_json::private::Number": "10001"
},
"privacy": "Public"
},
"network.secret_key": {
"description": "The secret key used for building the peer id. If it's an empty string a random one will be used.",
"value": "",
Expand Down
7 changes: 1 addition & 6 deletions crates/sequencing/papyrus_consensus/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use validator::Validate;
use crate::types::ValidatorId;

const CONSENSUS_TCP_PORT: u16 = 10100;
const CONSENSUS_QUIC_PORT: u16 = 10101;

/// Configuration for consensus.
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Validate)]
Expand Down Expand Up @@ -104,11 +103,7 @@ impl SerializeConfig for ConsensusConfig {

impl Default for ConsensusConfig {
fn default() -> Self {
let network_config = NetworkConfig {
tcp_port: CONSENSUS_TCP_PORT,
quic_port: CONSENSUS_QUIC_PORT,
..Default::default()
};
let network_config = NetworkConfig { tcp_port: CONSENSUS_TCP_PORT, ..Default::default() };
Self {
chain_id: ChainId::Other("0x0".to_string()),
validator_id: ValidatorId::from(DEFAULT_VALIDATOR_ID),
Expand Down

0 comments on commit 5895682

Please sign in to comment.