Skip to content

Commit

Permalink
fix(mempool_p2p): fix default config values (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahakShama authored Nov 11, 2024
1 parent 1ed9911 commit 11431fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/mempool/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@
"mempool_p2p_config.network_buffer_size": {
"description": "Network buffer size.",
"privacy": "Public",
"value": 0
"value": 10000
},
"mempool_p2p_config.network_config.advertised_multiaddr": {
"description": "The external address other peers see this node. If this is set, the node will not try to find out which addresses it has and will write this address as external instead",
Expand Down
13 changes: 12 additions & 1 deletion crates/mempool_p2p/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use papyrus_network::NetworkConfig;
use serde::{Deserialize, Serialize};
use validator::Validate;

#[derive(Debug, Default, Deserialize, Serialize, Clone, PartialEq, Validate)]
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Validate)]
pub struct MempoolP2pConfig {
#[validate]
pub network_config: NetworkConfig,
Expand All @@ -15,6 +15,17 @@ pub struct MempoolP2pConfig {
pub network_buffer_size: usize,
}

impl Default for MempoolP2pConfig {
fn default() -> Self {
Self {
network_config: NetworkConfig::default(),
// TODO: Consider filling this once the sequencer node has a name.
executable_version: None,
network_buffer_size: 10000,
}
}
}

impl SerializeConfig for MempoolP2pConfig {
fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
vec![
Expand Down

0 comments on commit 11431fa

Please sign in to comment.