Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mempool_p2p): fix default config values #1881

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/mempool/default_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,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
Loading