[DEV FEATURE] Deterministic long lived subnets (#3453)

## Issue Addressed

#2847 

## Proposed Changes
Add under a feature flag the required changes to subscribe to long lived subnets in a deterministic way

## Additional Info

There is an additional required change that is actually searching for peers using the prefix, but I find that it's best to make this change in the future
This commit is contained in:
Divma
2022-10-04 10:37:48 +00:00
parent 6a92bf70e4
commit 4926e3967f
7 changed files with 371 additions and 37 deletions

View File

@@ -299,9 +299,13 @@ impl<T: BeaconChainTypes> NetworkService<T> {
)?;
// attestation subnet service
let attestation_service =
AttestationService::new(beacon_chain.clone(), config, &network_log);
let attestation_service = AttestationService::new(
beacon_chain.clone(),
#[cfg(feature = "deterministic_long_lived_attnets")]
network_globals.local_enr().node_id().raw().into(),
config,
&network_log,
);
// sync committee subnet service
let sync_committee_service =
SyncCommitteeService::new(beacon_chain.clone(), config, &network_log);