Skip to content

Commit

Permalink
parametrize enabling gossip and enable for both validator and fullnode
Browse files Browse the repository at this point in the history
  • Loading branch information
lanvidr committed Jun 10, 2022
1 parent e6b9ca7 commit d847570
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions crates/sui-config/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ impl<R: ::rand::RngCore + ::rand::CryptoRng> ConfigBuilder<R> {
json_rpc_address: utils::available_local_socket_address(),
consensus_config: Some(consensus_config),
enable_event_processing: false,
enable_gossip: true,
genesis: crate::node::Genesis::new(genesis.clone()),
}
})
Expand Down
3 changes: 3 additions & 0 deletions crates/sui-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ pub struct NodeConfig {
#[serde(default)]
pub enable_event_processing: bool,

#[serde(default)]
pub enable_gossip: bool,

pub genesis: Genesis,
}

Expand Down
1 change: 1 addition & 0 deletions crates/sui-config/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ impl NetworkConfig {
json_rpc_address: utils::available_local_socket_address(),
consensus_config: None,
enable_event_processing: true,
enable_gossip: true,
genesis: validator_config.genesis.clone(),
}
}
Expand Down
6 changes: 2 additions & 4 deletions crates/sui-core/src/authority_active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,8 @@ where
let active = Arc::new(self);

let gossip_locals = active;
let gossip_join = tokio::task::spawn(async move {
tokio::task::spawn(async move {
gossip_process(&gossip_locals, degree).await;
});

gossip_join
})
}
}
6 changes: 3 additions & 3 deletions crates/sui-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ impl SuiNode {
.await,
);

let gossip_handle = if config.consensus_config().is_some() {
None
} else {
let gossip_handle = if config.enable_gossip {
let mut net_config = mysten_network::config::Config::new();
net_config.connect_timeout = Some(Duration::from_secs(5));
net_config.request_timeout = Some(Duration::from_secs(5));
Expand All @@ -104,6 +102,8 @@ impl SuiNode {
)
.await;
Some(handle)
} else {
None
};

let batch_subsystem_handle = {
Expand Down

0 comments on commit d847570

Please sign in to comment.