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

@@ -18,7 +18,7 @@ use ssz_types::BitVector;
use state_processing::{
per_block_processing::errors::AttestationValidationError, per_slot_processing,
};
use std::sync::LazyLock;
use std::sync::{Arc, LazyLock};
use tree_hash::TreeHash;
use types::{
signed_aggregate_and_proof::SignedAggregateAndProofRefMut,
@@ -47,6 +47,7 @@ fn get_harness(validator_count: usize) -> BeaconChainHarness<EphemeralHarnessTyp
// A kind-of arbitrary number that ensures that _some_ validators are aggregators, but
// not all.
spec.target_aggregators_per_committee = 4;
let spec = Arc::new(spec);
let harness = BeaconChainHarness::builder(MainnetEthSpec)
.spec(spec)
@@ -68,11 +69,12 @@ fn get_harness(validator_count: usize) -> BeaconChainHarness<EphemeralHarnessTyp
/// all genesis validators start with BLS withdrawal credentials.
fn get_harness_capella_spec(
validator_count: usize,
) -> (BeaconChainHarness<EphemeralHarnessType<E>>, ChainSpec) {
) -> (BeaconChainHarness<EphemeralHarnessType<E>>, Arc<ChainSpec>) {
let mut spec = E::default_spec();
spec.altair_fork_epoch = Some(Epoch::new(0));
spec.bellatrix_fork_epoch = Some(Epoch::new(0));
spec.capella_fork_epoch = Some(Epoch::new(CAPELLA_FORK_EPOCH as u64));
let spec = Arc::new(spec);
let validator_keypairs = KEYPAIRS[0..validator_count].to_vec();
let genesis_state = interop_genesis_state(