Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix: not spam every node, increase subnet ids to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberb committed Apr 12, 2024
1 parent 8e777c9 commit a4032bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions crates/topos-certificate-spammer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,18 @@ pub async fn run(
// Dispatch certs in this batch
for cert in batch {
// Randomly choose target tce node for every certificate from related source_subnet_id connection list
// let target_node_connection = &target_node_connections[&cert.source_subnet_id]
// [rand::random::<usize>() % target_nodes.len()];
for target_node_connection in &target_node_connections[&cert.source_subnet_id] {
info!(
"Dispatching {cert:?} to target node {}",
target_node_connection.address
);
dispatch(cert.clone(), target_node_connection)
.instrument(Span::current())
.with_current_context()
.await;
}
let target_node_connection = &target_node_connections[&cert.source_subnet_id]
[rand::random::<usize>() % target_nodes.len()];
// for target_node_connection in &target_node_connections[&cert.source_subnet_id] {
// info!(
// "Dispatching {cert:?} to target node {}",
// target_node_connection.address
// );
dispatch(cert.clone(), target_node_connection)
.instrument(Span::current())
.with_current_context()
.await;
// }
}
}
.instrument(span)
Expand Down
2 changes: 1 addition & 1 deletion crates/topos/src/components/regtest/commands/spam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct Spam {
#[arg(
long,
env = "TOPOS_NETWORK_SPAMMER_NUMBER_OF_SUBNETS",
default_value = "10"
default_value = "100"
)]
pub nb_subnets: u8,
/// Number of batches to generate before finishing execution.
Expand Down

0 comments on commit a4032bb

Please sign in to comment.