decouple eth2 from store and lighthouse_network (#6680)

- #6452 (partially)


  Remove dependencies on `store` and `lighthouse_network`  from `eth2`. This was achieved as follows:

- depend on `enr` and `multiaddr` directly instead of using `lighthouse_network`'s reexports.
- make `lighthouse_network` responsible for converting between API and internal types.
- in two cases, remove complex internal types and use the generic `serde_json::Value` instead - this is not ideal, but should be fine for now, as this affects two internal non-spec endpoints which are meant for debugging, unstable, and subject to change without notice anyway. Inspired by #6679. The alternative is to move all relevant types to `eth2` or `types` instead - what do you think?
This commit is contained in:
Daniel Knopik
2025-03-14 17:44:48 +01:00
committed by GitHub
parent a6bdc474db
commit 574b204bdb
26 changed files with 190 additions and 246 deletions

View File

@@ -1,7 +1,7 @@
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes};
use eth2::lighthouse::attestation_rewards::{IdealAttestationRewards, TotalAttestationRewards};
use eth2::lighthouse::StandardAttestationRewards;
use eth2::types::ValidatorId;
use eth2::types::{
IdealAttestationRewards, StandardAttestationRewards, TotalAttestationRewards, ValidatorId,
};
use safe_arith::SafeArith;
use serde_utils::quoted_u64::Quoted;
use state_processing::common::base::{self, SqrtTotalActiveBalance};

View File

@@ -1,6 +1,6 @@
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes, StateSkipConfig};
use attesting_indices_base::get_attesting_indices;
use eth2::lighthouse::StandardBlockReward;
use eth2::types::StandardBlockReward;
use safe_arith::SafeArith;
use state_processing::common::attesting_indices_base;
use state_processing::{

View File

@@ -1,6 +1,6 @@
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes};
use eth2::lighthouse::SyncCommitteeReward;
use eth2::types::SyncCommitteeReward;
use safe_arith::SafeArith;
use state_processing::per_block_processing::altair::sync_committee::compute_sync_aggregate_rewards;
use std::collections::HashMap;