mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-17 18:58:23 +00:00
Merge branch 'unstable' into gloas-lookup-sync-fixes
This commit is contained in:
@@ -45,9 +45,7 @@ use std::time::Duration;
|
||||
use store::Hash256;
|
||||
use tracing::{debug, error, warn};
|
||||
use types::data::FixedBlobSidecarList;
|
||||
use types::{
|
||||
BlobSidecar, DataColumnSidecar, EthSpec, SignedBeaconBlock, SignedExecutionPayloadEnvelope,
|
||||
};
|
||||
use types::{EthSpec, SignedBeaconBlock, SignedExecutionPayloadEnvelope};
|
||||
|
||||
pub mod parent_chain;
|
||||
mod single_block_lookup;
|
||||
@@ -89,20 +87,18 @@ type PayloadDownloadResponse<E> =
|
||||
|
||||
pub enum BlockComponent<E: EthSpec> {
|
||||
Block(DownloadResult<Arc<SignedBeaconBlock<E>>>),
|
||||
Blob(DownloadResult<Arc<BlobSidecar<E>>>),
|
||||
DataColumn(DownloadResult<Arc<DataColumnSidecar<E>>>),
|
||||
Blob(DownloadResult<Hash256>),
|
||||
DataColumn(DownloadResult<Hash256>),
|
||||
PartialDataColumn(DownloadResult<Hash256>),
|
||||
}
|
||||
|
||||
impl<E: EthSpec> BlockComponent<E> {
|
||||
fn parent_root(&self) -> Hash256 {
|
||||
match self {
|
||||
BlockComponent::Block(block) => block.value.parent_root(),
|
||||
BlockComponent::Blob(blob) => blob.value.block_parent_root(),
|
||||
BlockComponent::DataColumn(column) => match column.value.as_ref() {
|
||||
DataColumnSidecar::Fulu(column) => column.block_parent_root(),
|
||||
// TODO(gloas) we don't have a parent root post gloas, not sure what to do here
|
||||
DataColumnSidecar::Gloas(column) => column.beacon_block_root,
|
||||
},
|
||||
BlockComponent::Blob(parent_root)
|
||||
| BlockComponent::DataColumn(parent_root)
|
||||
| BlockComponent::PartialDataColumn(parent_root) => parent_root.value,
|
||||
}
|
||||
}
|
||||
fn get_type(&self) -> &'static str {
|
||||
@@ -110,6 +106,7 @@ impl<E: EthSpec> BlockComponent<E> {
|
||||
BlockComponent::Block(_) => "block",
|
||||
BlockComponent::Blob(_) => "blob",
|
||||
BlockComponent::DataColumn(_) => "data_column",
|
||||
BlockComponent::PartialDataColumn(_) => "partial_data_column",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user