diff --git a/config/papyrus/default_config.json b/config/papyrus/default_config.json index ab7c918c365..9f99bd1b514 100644 --- a/config/papyrus/default_config.json +++ b/config/papyrus/default_config.json @@ -169,11 +169,6 @@ "privacy": "Public", "value": 10100 }, - "consensus.network_topic": { - "description": "The network topic of the consensus.", - "privacy": "Public", - "value": "consensus" - }, "consensus.num_validators": { "description": "The number of validators in the consensus.", "privacy": "Public", diff --git a/config/sequencer/default_config.json b/config/sequencer/default_config.json index b5ee1080f05..c29e2c8d633 100644 --- a/config/sequencer/default_config.json +++ b/config/sequencer/default_config.json @@ -664,11 +664,6 @@ "privacy": "Public", "value": 10100 }, - "consensus_manager_config.consensus_config.network_topic": { - "description": "The network topic of the consensus.", - "privacy": "Public", - "value": "consensus" - }, "consensus_manager_config.consensus_config.num_validators": { "description": "The number of validators in the consensus.", "privacy": "Public", diff --git a/crates/papyrus_node/src/bin/run_consensus.rs b/crates/papyrus_node/src/bin/run_consensus.rs index 62e5959a6bd..554dc5fbd93 100644 --- a/crates/papyrus_node/src/bin/run_consensus.rs +++ b/crates/papyrus_node/src/bin/run_consensus.rs @@ -15,7 +15,7 @@ use papyrus_consensus_orchestrator::papyrus_consensus_context::PapyrusConsensusC use papyrus_network::gossipsub_impl::Topic; use papyrus_network::network_manager::{BroadcastTopicChannels, NetworkManager}; use papyrus_node::bin_utils::build_configs; -use papyrus_node::run::{run, PapyrusResources, PapyrusTaskHandles, NETWORK_TOPIC}; +use papyrus_node::run::{run, PapyrusResources, PapyrusTaskHandles}; use papyrus_p2p_sync::BUFFER_SIZE; use papyrus_protobuf::consensus::{ProposalPart, StreamMessage}; use papyrus_storage::StorageReader; @@ -58,12 +58,10 @@ fn build_consensus( storage_reader: StorageReader, network_manager: &mut NetworkManager, ) -> anyhow::Result>>> { - let network_channels = network_manager.register_broadcast_topic( - Topic::new(consensus_config.network_topic.clone()), - BUFFER_SIZE, - )?; + let network_channels = network_manager + .register_broadcast_topic(Topic::new(consensus_config.vote_topic.clone()), BUFFER_SIZE)?; let proposal_network_channels: BroadcastTopicChannels> = - network_manager.register_broadcast_topic(Topic::new(NETWORK_TOPIC), BUFFER_SIZE)?; + network_manager.register_broadcast_topic(Topic::new(config.proposal_topic), BUFFER_SIZE)?; let BroadcastTopicChannels { broadcasted_messages_receiver: inbound_network_receiver, broadcast_topic_client: outbound_network_sender, diff --git a/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap b/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap index b5470439e85..95907ccffc6 100644 --- a/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap +++ b/crates/papyrus_node/src/config/snapshots/papyrus_node__config__config_test__dump_default_config.snap @@ -201,11 +201,6 @@ expression: dumped_default_config }, "privacy": "Public" }, - "consensus.network_topic": { - "description": "The network topic of the consensus.", - "value": "consensus", - "privacy": "Public" - }, "consensus.num_validators": { "description": "The number of validators in the consensus.", "value": { diff --git a/crates/papyrus_node/src/run.rs b/crates/papyrus_node/src/run.rs index 243c779fae8..e65be87c8dd 100644 --- a/crates/papyrus_node/src/run.rs +++ b/crates/papyrus_node/src/run.rs @@ -54,9 +54,6 @@ const DEFAULT_LEVEL: LevelFilter = LevelFilter::INFO; // TODO: Consider moving to a more general place. const GENESIS_HASH: &str = "0x0"; -// TODO(guyn): move this to the config. -pub const NETWORK_TOPIC: &str = "consensus_proposals"; - // TODO(dvir): add this to config. // Duration between updates to the storage metrics (those in the collect_storage_metrics function). const STORAGE_METRICS_UPDATE_INTERVAL: Duration = Duration::from_secs(10); @@ -191,10 +188,11 @@ fn spawn_consensus( debug!("Consensus configuration: {config:?}"); let network_channels = network_manager - .register_broadcast_topic(Topic::new(config.network_topic.clone()), BUFFER_SIZE)?; + .register_broadcast_topic(Topic::new(config.votes_topic.clone()), BUFFER_SIZE)?; let proposal_network_channels: BroadcastTopicChannels< StreamMessage, - > = network_manager.register_broadcast_topic(Topic::new(NETWORK_TOPIC), BUFFER_SIZE)?; + > = network_manager + .register_broadcast_topic(Topic::new(config.proposals_topic), BUFFER_SIZE)?; let BroadcastTopicChannels { broadcasted_messages_receiver: inbound_network_receiver, broadcast_topic_client: outbound_network_sender, diff --git a/crates/sequencing/papyrus_consensus/src/config.rs b/crates/sequencing/papyrus_consensus/src/config.rs index c4909ba2277..db54f6acc76 100644 --- a/crates/sequencing/papyrus_consensus/src/config.rs +++ b/crates/sequencing/papyrus_consensus/src/config.rs @@ -29,8 +29,6 @@ pub struct ConsensusConfig { pub chain_id: ChainId, /// The validator ID of the node. pub validator_id: ValidatorId, - /// The network topic of the consensus. - pub network_topic: String, /// The height to start the consensus from. pub start_height: BlockNumber, /// The number of validators in the consensus. @@ -70,12 +68,6 @@ impl SerializeConfig for ConsensusConfig { "The validator id of the node.", ParamPrivacyInput::Public, ), - ser_param( - "network_topic", - &self.network_topic, - "The network topic of the consensus.", - ParamPrivacyInput::Public, - ), ser_param( "start_height", &self.start_height, @@ -131,7 +123,6 @@ impl Default for ConsensusConfig { Self { chain_id: ChainId::Other("0x0".to_string()), validator_id: ValidatorId::from(DEFAULT_VALIDATOR_ID), - network_topic: "consensus".to_string(), start_height: BlockNumber::default(), num_validators: 1, consensus_delay: Duration::from_secs(5),