mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
tons of changes, just tryna compile
This commit is contained in:
@@ -4,7 +4,7 @@ use eth2::types::BlockId as CoreBlockId;
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use types::{BlobsSidecar, Hash256, SignedBeaconBlock, SignedBlindedBeaconBlock, Slot};
|
||||
use types::{BlobSidecar, Hash256, SignedBeaconBlock, SignedBlindedBeaconBlock, Slot};
|
||||
|
||||
/// Wraps `eth2::types::BlockId` and provides a simple way to obtain a block or root for a given
|
||||
/// `BlockId`.
|
||||
@@ -216,13 +216,13 @@ impl BlockId {
|
||||
pub async fn blobs_sidecar<T: BeaconChainTypes>(
|
||||
&self,
|
||||
chain: &BeaconChain<T>,
|
||||
) -> Result<Arc<BlobsSidecar<T::EthSpec>>, warp::Rejection> {
|
||||
) -> Result<Arc<BlobSidecar<T::EthSpec>>, warp::Rejection> {
|
||||
let root = self.root(chain)?.0;
|
||||
let Some(data_availability_boundary) = chain.data_availability_boundary() else {
|
||||
return Err(warp_utils::reject::custom_not_found("Eip4844 fork disabled".into()));
|
||||
};
|
||||
match chain.get_blobs(&root, data_availability_boundary) {
|
||||
Ok(Some(blob)) => Ok(Arc::new(blob)),
|
||||
match chain.get_blobs(&root) {
|
||||
Ok(Some(blob)) => todo!(), // Jimmy's PR will fix this,
|
||||
Ok(None) => Err(warp_utils::reject::custom_not_found(format!(
|
||||
"Blob with block root {} is not in the store",
|
||||
root
|
||||
|
||||
@@ -16,7 +16,7 @@ pub fn build_block_contents<T: BeaconChainTypes, Payload: AbstractExecPayload<T:
|
||||
}
|
||||
ForkName::Eip4844 => {
|
||||
let block_root = &block.canonical_root();
|
||||
if let Some(blob_sidecars) = chain.blob_cache.pop(block_root) {
|
||||
if let Some(blob_sidecars) = chain.proposal_blob_cache.pop(block_root) {
|
||||
let block_and_blobs = BeaconBlockAndBlobSidecars {
|
||||
block,
|
||||
blob_sidecars,
|
||||
|
||||
@@ -67,23 +67,23 @@ pub async fn publish_block<T: BeaconChainTypes>(
|
||||
let delay = get_block_delay_ms(seen_timestamp, block.message(), &chain.slot_clock);
|
||||
metrics::observe_duration(&metrics::HTTP_API_BLOCK_BROADCAST_DELAY_TIMES, delay);
|
||||
|
||||
let available_block = match wrapped_block.into_available_block(block_root, &chain) {
|
||||
Ok(available_block) => available_block,
|
||||
Err(e) => {
|
||||
let msg = format!("{:?}", e);
|
||||
let available_block = match wrapped_block.clone().into_available_block() {
|
||||
Some(available_block) => available_block,
|
||||
None => {
|
||||
error!(
|
||||
log,
|
||||
"Invalid block provided to HTTP API";
|
||||
"reason" => &msg
|
||||
"Invalid block provided to HTTP API unavailable block"; //TODO(sean) probably want a real error here
|
||||
);
|
||||
return Err(warp_utils::reject::broadcast_without_import(msg));
|
||||
return Err(warp_utils::reject::broadcast_without_import(
|
||||
"unavailable block".to_string(),
|
||||
));
|
||||
}
|
||||
};
|
||||
|
||||
match chain
|
||||
.process_block(
|
||||
block_root,
|
||||
available_block.clone(),
|
||||
wrapped_block,
|
||||
CountUnrealized::True,
|
||||
NotifyExecutionLayer::Yes,
|
||||
)
|
||||
@@ -95,14 +95,14 @@ pub async fn publish_block<T: BeaconChainTypes>(
|
||||
"Valid block from HTTP API";
|
||||
"block_delay" => ?delay,
|
||||
"root" => format!("{}", root),
|
||||
"proposer_index" => available_block.message().proposer_index(),
|
||||
"slot" => available_block.slot(),
|
||||
"proposer_index" => available_block.block.message().proposer_index(),
|
||||
"slot" => available_block.block.slot(),
|
||||
);
|
||||
|
||||
// Notify the validator monitor.
|
||||
chain.validator_monitor.read().register_api_block(
|
||||
seen_timestamp,
|
||||
available_block.message(),
|
||||
available_block.block.message(),
|
||||
root,
|
||||
&chain.slot_clock,
|
||||
);
|
||||
@@ -124,7 +124,7 @@ pub async fn publish_block<T: BeaconChainTypes>(
|
||||
"Block was broadcast too late";
|
||||
"msg" => "system may be overloaded, block likely to be orphaned",
|
||||
"delay_ms" => delay.as_millis(),
|
||||
"slot" => available_block.slot(),
|
||||
"slot" => available_block.block.slot(),
|
||||
"root" => ?root,
|
||||
)
|
||||
} else if delay >= delayed_threshold {
|
||||
@@ -133,7 +133,7 @@ pub async fn publish_block<T: BeaconChainTypes>(
|
||||
"Block broadcast was delayed";
|
||||
"msg" => "system may be overloaded, block may be orphaned",
|
||||
"delay_ms" => delay.as_millis(),
|
||||
"slot" => available_block.slot(),
|
||||
"slot" => available_block.block.slot(),
|
||||
"root" => ?root,
|
||||
)
|
||||
}
|
||||
@@ -145,7 +145,7 @@ pub async fn publish_block<T: BeaconChainTypes>(
|
||||
log,
|
||||
"Block from HTTP API already known";
|
||||
"block" => ?block_root,
|
||||
"slot" => available_block.slot(),
|
||||
"slot" => available_block.block.slot(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user