Skip to content

Commit

Permalink
fix(code): Use more reasonable history_gossip and history_length
Browse files Browse the repository at this point in the history
…config params for GossipSub
  • Loading branch information
romac committed Jun 28, 2024
1 parent 642c982 commit 47a83aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions code/crates/gossip-consensus/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Behaviour {
pub identify: identify::Behaviour,
pub gossipsub: gossipsub::Behaviour,
}

fn message_id(message: &gossipsub::Message) -> gossipsub::MessageId {
let hash = blake3::hash(&message.data);
gossipsub::MessageId::from(hash.as_bytes().to_vec())
Expand All @@ -28,12 +29,12 @@ fn gossipsub_config() -> gossipsub::Config {
.opportunistic_graft_ticks(3)
.heartbeat_interval(Duration::from_secs(1))
.validation_mode(gossipsub::ValidationMode::Strict)
.history_gossip(50)
.history_gossip(3)
.history_length(5)
.mesh_n_high(12)
.mesh_n_low(4)
.mesh_outbound_min(2)
.mesh_n(6)
.history_length(500)
.message_id_fn(message_id)
.build()
.unwrap()
Expand Down
4 changes: 2 additions & 2 deletions code/crates/gossip-mempool/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ fn gossipsub_config() -> gossipsub::Config {
.opportunistic_graft_ticks(3)
.heartbeat_interval(Duration::from_secs(1))
.validation_mode(gossipsub::ValidationMode::Strict)
.history_gossip(50)
.history_gossip(3)
.history_length(5)
.mesh_n_high(12)
.mesh_n_low(4)
.mesh_outbound_min(2)
.mesh_n(6)
.history_length(500)
.message_id_fn(message_id)
.build()
.unwrap()
Expand Down

0 comments on commit 47a83aa

Please sign in to comment.