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

@@ -107,7 +107,7 @@ pub enum RequestId {
#[derive(Debug)]
/// A message that can be sent to the sync manager thread.
pub enum SyncMessage<T: EthSpec> {
pub enum SyncMessage<E: EthSpec> {
/// A useful peer has been discovered.
AddPeer(PeerId, SyncInfo),
@@ -115,7 +115,7 @@ pub enum SyncMessage<T: EthSpec> {
RpcBlock {
request_id: RequestId,
peer_id: PeerId,
beacon_block: Option<Arc<SignedBeaconBlock<T>>>,
beacon_block: Option<Arc<SignedBeaconBlock<E>>>,
seen_timestamp: Duration,
},
@@ -123,15 +123,15 @@ pub enum SyncMessage<T: EthSpec> {
RpcBlob {
request_id: RequestId,
peer_id: PeerId,
blob_sidecar: Option<Arc<BlobSidecar<T>>>,
blob_sidecar: Option<Arc<BlobSidecar<E>>>,
seen_timestamp: Duration,
},
/// A block with an unknown parent has been received.
UnknownParentBlock(PeerId, RpcBlock<T>, Hash256),
UnknownParentBlock(PeerId, RpcBlock<E>, Hash256),
/// A blob with an unknown parent has been received.
UnknownParentBlob(PeerId, Arc<BlobSidecar<T>>),
UnknownParentBlob(PeerId, Arc<BlobSidecar<E>>),
/// A peer has sent an attestation that references a block that is unknown. This triggers the
/// manager to attempt to find the block matching the unknown hash.
@@ -156,7 +156,7 @@ pub enum SyncMessage<T: EthSpec> {
/// Block processed
BlockComponentProcessed {
process_type: BlockProcessType,
result: BlockProcessingResult<T>,
result: BlockProcessingResult<E>,
},
}
@@ -169,9 +169,9 @@ pub enum BlockProcessType {
}
#[derive(Debug)]
pub enum BlockProcessingResult<T: EthSpec> {
pub enum BlockProcessingResult<E: EthSpec> {
Ok(AvailabilityProcessingStatus),
Err(BlockError<T>),
Err(BlockError<E>),
Ignored,
}
@@ -1077,10 +1077,10 @@ impl<T: BeaconChainTypes> SyncManager<T> {
}
}
impl<T: EthSpec> From<Result<AvailabilityProcessingStatus, BlockError<T>>>
for BlockProcessingResult<T>
impl<E: EthSpec> From<Result<AvailabilityProcessingStatus, BlockError<E>>>
for BlockProcessingResult<E>
{
fn from(result: Result<AvailabilityProcessingStatus, BlockError<T>>) -> Self {
fn from(result: Result<AvailabilityProcessingStatus, BlockError<E>>) -> Self {
match result {
Ok(status) => BlockProcessingResult::Ok(status),
Err(e) => BlockProcessingResult::Err(e),
@@ -1088,8 +1088,8 @@ impl<T: EthSpec> From<Result<AvailabilityProcessingStatus, BlockError<T>>>
}
}
impl<T: EthSpec> From<BlockError<T>> for BlockProcessingResult<T> {
fn from(e: BlockError<T>) -> Self {
impl<E: EthSpec> From<BlockError<E>> for BlockProcessingResult<E> {
fn from(e: BlockError<E>) -> Self {
BlockProcessingResult::Err(e)
}
}