Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): reduce block messages with many connections #6602

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base_layer/core/src/base_node/service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ async fn handle_outbound_block(
exclude_peers: Vec<NodeId>,
) -> Result<(), CommsInterfaceError> {
let result = outbound_message_service
.flood(
.propagate(
NodeDestination::Unknown,
OutboundEncryption::ClearText,
exclude_peers,
Expand Down
1 change: 1 addition & 0 deletions comms/dht/examples/memory_net/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ pub async fn do_network_wide_propagation(nodes: &mut [TestNode], origin_node_ind
OutboundEncryption::ClearText,
vec![msg.source_peer.node_id.clone()],
OutboundDomainMessage::new(&0i32, public_msg),
"Memory net example".to_string(),
)
.await
.unwrap();
Expand Down
1 change: 1 addition & 0 deletions comms/dht/examples/propagation_stress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ async fn prompt(node: &CommsNode, dht: &Dht) -> anyhow::Result<()> {
// Don't send directly to peer
vec![opts.peer.node_id.clone()],
msg,
"Example stress".to_string(),
)
.await?
},
Expand Down
2 changes: 1 addition & 1 deletion comms/dht/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Default for DhtConfig {
num_neighbouring_nodes: 8,
num_random_nodes: 4,
minimize_connections: false,
propagation_factor: 4,
propagation_factor: 20,
broadcast_factor: 8,
outbound_buffer_size: 20,
saf: Default::default(),
Expand Down
2 changes: 2 additions & 0 deletions comms/dht/src/outbound/requester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,14 @@ impl OutboundMessageRequester {
encryption: OutboundEncryption,
exclude_peers: Vec<NodeId>,
message: OutboundDomainMessage<T>,
source_info: String,
) -> Result<MessageSendStates, DhtOutboundError>
where
T: prost::Message,
{
self.send_message(
SendMessageParams::new()
.with_debug_info(source_info)
.propagate(destination.clone(), exclude_peers)
.with_encryption(encryption)
.with_destination(destination)
Expand Down
2 changes: 2 additions & 0 deletions comms/dht/tests/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ async fn test_dht_propagate_dedup() {
OutboundEncryption::encrypt_for(node_D.node_identity().public_key().clone()),
vec![],
out_msg,
String::new(),
)
.await
.unwrap();
Expand Down Expand Up @@ -655,6 +656,7 @@ async fn test_dht_repropagate() {
OutboundEncryption::ClearText,
vec![],
out_msg.clone(),
String::new(),
)
.await
.unwrap();
Expand Down
Loading