Use the mesh_n value from NetworkLoad for PeerScoreSettings (#5013)

* Build `gs_config` and use the `mesh_n` config for `PeerScoreSettings`

* Remove unused imports

* Merge branch 'unstable' into peer-score-settings

# Conflicts:
#	beacon_node/lighthouse_network/src/config.rs
#	beacon_node/lighthouse_network/src/service/gossipsub_scoring_parameters.rs
#	beacon_node/lighthouse_network/src/service/mod.rs
This commit is contained in:
Jimmy Chen
2024-04-12 06:14:15 +10:00
committed by GitHub
parent 7e49f82726
commit d30ba976a1
4 changed files with 19 additions and 40 deletions

View File

@@ -7,7 +7,6 @@ use lighthouse_network::{NetworkConfig, NetworkEvent};
use slog::{debug, error, o, Drain};
use std::sync::Arc;
use std::sync::Weak;
use std::time::Duration;
use tokio::runtime::Runtime;
use types::{
ChainSpec, EnrForkId, Epoch, EthSpec, ForkContext, ForkName, Hash256, MinimalEthSpec, Slot,
@@ -93,12 +92,6 @@ pub fn build_config(mut boot_nodes: Vec<Enr>) -> NetworkConfig {
config.enr_address = (Some(std::net::Ipv4Addr::LOCALHOST), None);
config.boot_nodes_enr.append(&mut boot_nodes);
config.network_dir = path.into_path();
// Reduce gossipsub heartbeat parameters
config.gs_config = gossipsub::ConfigBuilder::from(config.gs_config)
.heartbeat_initial_delay(Duration::from_millis(500))
.heartbeat_interval(Duration::from_millis(500))
.build()
.unwrap();
config
}