Skip to content

Commit

Permalink
fix: increase gossip message size limit to 128k (#1186)
Browse files Browse the repository at this point in the history
Description
---
fix: increase gossip message size limit to 128k

Motivation and Context
---
Some transactions being propagated were bigger than 64k (previous limit)

How Has This Been Tested?
---
tariswap test

What process can a PR reviewer use to test or verify this change?
---
tariswap test

Breaking Changes
---

- [x] None
- [ ] Requires data directory to be deleted
- [ ] Other - Please specify
  • Loading branch information
sdbondi authored Oct 24, 2024
1 parent 35f69f5 commit d1d0d88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions networking/swarm/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ where

// Gossipsub
let gossipsub_config = gossipsub::ConfigBuilder::default()
.max_transmit_size(config.gossip_sub_max_message_size)
.validation_mode(gossipsub::ValidationMode::Strict) // This sets the kind of message validation. The default is Strict (enforce message signing)
.validate_messages()
.message_id_fn(get_message_id) // content-address messages. No two messages of the same content will be propagated.
Expand Down
3 changes: 3 additions & 0 deletions networking/swarm/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub struct Config {
pub relay_circuit_limits: RelayCircuitLimits,
pub relay_reservation_limits: RelayReservationLimits,
pub identify_interval: Duration,
pub gossip_sub_max_message_size: usize,
}

impl Default for Config {
Expand All @@ -39,6 +40,8 @@ impl Default for Config {
relay_reservation_limits: RelayReservationLimits::default(),
// This is the default for identify
identify_interval: Duration::from_secs(5 * 60),
// 128k, double the libp2p default
gossip_sub_max_message_size: 128 * 1024,
}
}
}
Expand Down

0 comments on commit d1d0d88

Please sign in to comment.