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:
Michael Sproul
2024-09-24 10:16:18 +10:00
committed by GitHub
parent d84df5799c
commit 1447eeb40b
66 changed files with 340 additions and 250 deletions

View File

@@ -28,7 +28,7 @@ use lighthouse_network::service::api_types::{
SyncRequestId,
};
use lighthouse_network::types::SyncState;
use lighthouse_network::{NetworkGlobals, Request};
use lighthouse_network::{NetworkConfig, NetworkGlobals, Request};
use slog::info;
use slot_clock::{ManualSlotClock, SlotClock, TestingSlotClock};
use store::MemoryStore;
@@ -116,7 +116,7 @@ impl TestRig {
// Initialise a new beacon chain
let harness = BeaconChainHarness::<EphemeralHarnessType<E>>::builder(E)
.spec(spec)
.spec(Arc::new(spec))
.logger(log.clone())
.deterministic_keypairs(1)
.fresh_ephemeral_store()
@@ -132,9 +132,11 @@ impl TestRig {
let (network_tx, network_rx) = mpsc::unbounded_channel();
// TODO(das): make the generation of the ENR use the deterministic rng to have consistent
// column assignments
let network_config = Arc::new(NetworkConfig::default());
let globals = Arc::new(NetworkGlobals::new_test_globals(
Vec::new(),
&log,
network_config,
chain.spec.clone(),
));
let (beacon_processor, beacon_processor_rx) = NetworkBeaconProcessor::null_for_testing(