Use E for EthSpec globally (#5264)

* Use `E` for `EthSpec` globally

* Fix tests

* Merge branch 'unstable' into e-ethspec

* Merge branch 'unstable' into e-ethspec

# Conflicts:
#	beacon_node/execution_layer/src/engine_api.rs
#	beacon_node/execution_layer/src/engine_api/http.rs
#	beacon_node/execution_layer/src/engine_api/json_structures.rs
#	beacon_node/execution_layer/src/test_utils/handle_rpc.rs
#	beacon_node/store/src/partial_beacon_state.rs
#	consensus/types/src/beacon_block.rs
#	consensus/types/src/beacon_block_body.rs
#	consensus/types/src/beacon_state.rs
#	consensus/types/src/config_and_preset.rs
#	consensus/types/src/execution_payload.rs
#	consensus/types/src/execution_payload_header.rs
#	consensus/types/src/light_client_optimistic_update.rs
#	consensus/types/src/payload.rs
#	lcli/src/parse_ssz.rs
This commit is contained in:
Mac L
2024-04-03 02:12:25 +11:00
committed by GitHub
parent f8fdb71f50
commit 969d12dc6f
230 changed files with 2743 additions and 2792 deletions

View File

@@ -52,13 +52,13 @@ use types::{BlobSidecar, ChainSpec, Epoch, EthSpec, Hash256};
/// The blobs are all gossip and kzg verified.
/// The block has completed all verifications except the availability check.
#[derive(Encode, Decode, Clone)]
pub struct PendingComponents<T: EthSpec> {
pub struct PendingComponents<E: EthSpec> {
pub block_root: Hash256,
pub verified_blobs: FixedVector<Option<KzgVerifiedBlob<T>>, T::MaxBlobsPerBlock>,
pub executed_block: Option<DietAvailabilityPendingExecutedBlock<T>>,
pub verified_blobs: FixedVector<Option<KzgVerifiedBlob<E>>, E::MaxBlobsPerBlock>,
pub executed_block: Option<DietAvailabilityPendingExecutedBlock<E>>,
}
impl<T: EthSpec> PendingComponents<T> {
impl<E: EthSpec> PendingComponents<E> {
pub fn empty(block_root: Hash256) -> Self {
Self {
block_root,
@@ -73,11 +73,11 @@ impl<T: EthSpec> PendingComponents<T> {
///
/// WARNING: This function can potentially take a lot of time if the state needs to be
/// reconstructed from disk. Ensure you are not holding any write locks while calling this.
pub fn make_available<R>(self, recover: R) -> Result<Availability<T>, AvailabilityCheckError>
pub fn make_available<R>(self, recover: R) -> Result<Availability<E>, AvailabilityCheckError>
where
R: FnOnce(
DietAvailabilityPendingExecutedBlock<T>,
) -> Result<AvailabilityPendingExecutedBlock<T>, AvailabilityCheckError>,
DietAvailabilityPendingExecutedBlock<E>,
) -> Result<AvailabilityPendingExecutedBlock<E>, AvailabilityCheckError>,
{
let Self {
block_root,
@@ -129,7 +129,7 @@ impl<T: EthSpec> PendingComponents<T> {
kzg_verified_blob
.as_blob()
.slot()
.epoch(T::slots_per_epoch())
.epoch(E::slots_per_epoch())
});
}
}