Skip to content

Commit

Permalink
fix: unsigned p2p messages
Browse files Browse the repository at this point in the history
  • Loading branch information
BastienFaivre committed Jan 29, 2025
1 parent 07b0a45 commit 9e4d17a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions benchmark/code/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use libp2p::{
gossipsub::{self, IdentTopic},
identity::Keypair,
swarm::{behaviour::toggle::Toggle, NetworkBehaviour},
PeerId,
};
use prometheus_client::registry::Registry;

Expand Down Expand Up @@ -43,7 +44,9 @@ impl Behaviour {
let dog = if let Protocol::Dog = config.benchmark.protocol {
Toggle::from(Some(
libp2p_dog::Behaviour::new_with_metrics(
libp2p_dog::TransactionAuthenticity::Signed(key.clone()),
libp2p_dog::TransactionAuthenticity::Author(PeerId::from_public_key(
&key.public(),
)),
libp2p_dog::ConfigBuilder::default()
.target_redundancy(config.benchmark.redundancy)
.redundancy_delta_percent(config.benchmark.redundancy_delta)
Expand All @@ -53,6 +56,7 @@ impl Behaviour {
.max_transmit_size(MAX_TRANSMIT_SIZE)
.connection_handler_publish_duration(Duration::from_secs(10))
.connection_handler_forward_duration(Duration::from_secs(10))
.validation_mode(libp2p_dog::ValidationMode::None)
.build()
.expect("Failed to build dog config"),
registry,
Expand All @@ -66,11 +70,12 @@ impl Behaviour {
let gossipsub = if let Protocol::Gossipsub = config.benchmark.protocol {
Toggle::from({
let mut behaviour = gossipsub::Behaviour::new_with_metrics(
gossipsub::MessageAuthenticity::Signed(key.clone()),
gossipsub::MessageAuthenticity::Author(PeerId::from_public_key(&key.public())),
gossipsub::ConfigBuilder::default()
.max_transmit_size(MAX_TRANSMIT_SIZE)
.publish_queue_duration(Duration::from_secs(10))
.forward_queue_duration(Duration::from_secs(10))
.validation_mode(gossipsub::ValidationMode::None)
.build()
.expect("Failed to build gossipsub config"),
registry,
Expand Down

0 comments on commit 9e4d17a

Please sign in to comment.