mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-26 01:03:40 +00:00
Improve single-node testnet support and Arc NetworkConfig/ChainSpec (#6396)
* Arc ChainSpec and NetworkConfig * Fix release tests * Fix lint * Merge remote-tracking branch 'origin/unstable' into single-node-testnet
This commit is contained in:
@@ -166,7 +166,7 @@ impl<E: EthSpec> Network<E> {
|
||||
&config,
|
||||
&ctx.enr_fork_id,
|
||||
&log,
|
||||
ctx.chain_spec,
|
||||
&ctx.chain_spec,
|
||||
)?;
|
||||
// Construct the metadata
|
||||
let custody_subnet_count = if ctx.chain_spec.is_peer_das_scheduled() {
|
||||
@@ -186,6 +186,7 @@ impl<E: EthSpec> Network<E> {
|
||||
trusted_peers,
|
||||
config.disable_peer_scoring,
|
||||
&log,
|
||||
config.clone(),
|
||||
ctx.chain_spec.clone(),
|
||||
);
|
||||
Arc::new(globals)
|
||||
@@ -209,7 +210,7 @@ impl<E: EthSpec> Network<E> {
|
||||
E::slots_per_epoch(),
|
||||
);
|
||||
|
||||
let score_settings = PeerScoreSettings::new(ctx.chain_spec, gs_config.mesh_n());
|
||||
let score_settings = PeerScoreSettings::new(&ctx.chain_spec, gs_config.mesh_n());
|
||||
|
||||
let gossip_cache = {
|
||||
let slot_duration = std::time::Duration::from_secs(ctx.chain_spec.seconds_per_slot);
|
||||
@@ -346,7 +347,7 @@ impl<E: EthSpec> Network<E> {
|
||||
&config,
|
||||
network_globals.clone(),
|
||||
&log,
|
||||
ctx.chain_spec,
|
||||
&ctx.chain_spec,
|
||||
)
|
||||
.await?;
|
||||
// start searching for peers
|
||||
|
||||
@@ -30,10 +30,10 @@ pub const MAX_CONNECTIONS_PER_PEER: u32 = 1;
|
||||
pub const METADATA_FILENAME: &str = "metadata";
|
||||
|
||||
pub struct Context<'a> {
|
||||
pub config: &'a NetworkConfig,
|
||||
pub config: Arc<NetworkConfig>,
|
||||
pub enr_fork_id: EnrForkId,
|
||||
pub fork_context: Arc<ForkContext>,
|
||||
pub chain_spec: &'a ChainSpec,
|
||||
pub chain_spec: Arc<ChainSpec>,
|
||||
pub libp2p_registry: Option<&'a mut Registry>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user