mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
fix compile
This commit is contained in:
@@ -151,7 +151,6 @@ pub fn validate_blob_sidecar_for_gossip<T: BeaconChainTypes>(
|
|||||||
) -> Result<GossipVerifiedBlob<T::EthSpec>, BlobError<T::EthSpec>> {
|
) -> Result<GossipVerifiedBlob<T::EthSpec>, BlobError<T::EthSpec>> {
|
||||||
let blob_slot = signed_blob_sidecar.message.slot;
|
let blob_slot = signed_blob_sidecar.message.slot;
|
||||||
let blob_index = signed_blob_sidecar.message.index;
|
let blob_index = signed_blob_sidecar.message.index;
|
||||||
let block_root = signed_blob_sidecar.message.block_root;
|
|
||||||
let block_parent_root = signed_blob_sidecar.message.block_parent_root;
|
let block_parent_root = signed_blob_sidecar.message.block_parent_root;
|
||||||
let blob_proposer_index = signed_blob_sidecar.message.proposer_index;
|
let blob_proposer_index = signed_blob_sidecar.message.proposer_index;
|
||||||
|
|
||||||
|
|||||||
@@ -151,9 +151,7 @@ impl<T: EthSpec, S: SlotClock> DataAvailabilityChecker<T, S> {
|
|||||||
.get(block_root)
|
.get(block_root)
|
||||||
.map_or(vec![], |cache| {
|
.map_or(vec![], |cache| {
|
||||||
if let Some(block) = cache.executed_block.as_ref() {
|
if let Some(block) = cache.executed_block.as_ref() {
|
||||||
block.get_filtered_blob_ids(|i, blob_root| {
|
block.get_filtered_blob_ids(|i, _| cache.verified_blobs.get(i).is_none())
|
||||||
cache.verified_blobs.get(i).is_none()
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
let mut blob_ids = Vec::with_capacity(T::max_blobs_per_block());
|
let mut blob_ids = Vec::with_capacity(T::max_blobs_per_block());
|
||||||
for i in 0..T::max_blobs_per_block() {
|
for i in 0..T::max_blobs_per_block() {
|
||||||
|
|||||||
@@ -1079,7 +1079,6 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
);
|
);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
_ => todo!(), //TODO(sean)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
Option<Arc<BlobSidecar<T::EthSpec>>>,
|
Option<Arc<BlobSidecar<T::EthSpec>>>,
|
||||||
<<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxBlobsPerBlock,
|
<<T as BeaconChainTypes>::EthSpec as EthSpec>::MaxBlobsPerBlock,
|
||||||
>,
|
>,
|
||||||
seen_timestamp: Duration,
|
_seen_timestamp: Duration,
|
||||||
process_type: BlockProcessType,
|
process_type: BlockProcessType,
|
||||||
) {
|
) {
|
||||||
let Some(slot) = blobs.iter().find_map(|blob|{
|
let Some(slot) = blobs.iter().find_map(|blob|{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use lru_cache::LRUTimeCache;
|
|||||||
use slog::{debug, error, trace, warn, Logger};
|
use slog::{debug, error, trace, warn, Logger};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use ssz_types::FixedVector;
|
use ssz_types::FixedVector;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::HashMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use store::Hash256;
|
use store::Hash256;
|
||||||
@@ -26,7 +26,6 @@ use crate::beacon_processor::{ChainSegmentProcessId, WorkEvent};
|
|||||||
use crate::metrics;
|
use crate::metrics;
|
||||||
use crate::sync::block_lookups::single_block_lookup::LookupVerifyError;
|
use crate::sync::block_lookups::single_block_lookup::LookupVerifyError;
|
||||||
|
|
||||||
mod hg5e3wdtrfqa;
|
|
||||||
mod parent_lookup;
|
mod parent_lookup;
|
||||||
mod single_block_lookup;
|
mod single_block_lookup;
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -122,7 +121,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
if self
|
if self
|
||||||
.single_block_lookups
|
.single_block_lookups
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.any(|(block_id, blob_id, single_block_request)| {
|
.any(|(_, _, single_block_request)| {
|
||||||
if single_block_request.requested_block_root == hash {
|
if single_block_request.requested_block_root == hash {
|
||||||
single_block_request.block_request_state.add_peer(&peer_id);
|
single_block_request.block_request_state.add_peer(&peer_id);
|
||||||
single_block_request.blob_request_state.add_peer(&peer_id);
|
single_block_request.blob_request_state.add_peer(&peer_id);
|
||||||
@@ -283,7 +282,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
// is complete before processing the block.
|
// is complete before processing the block.
|
||||||
if let Err(e) = request_ref.add_block(root, block) {
|
if let Err(e) = request_ref.add_block(root, block) {
|
||||||
Self::handle_block_lookup_verify_error(
|
Self::handle_block_lookup_verify_error(
|
||||||
id,
|
|
||||||
peer_id,
|
peer_id,
|
||||||
cx,
|
cx,
|
||||||
request_id_ref,
|
request_id_ref,
|
||||||
@@ -307,8 +305,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(None) => false,
|
Ok(None) => false,
|
||||||
Err(e) => Self::handle_blob_lookup_verify_error(
|
Err(e) => Self::handle_block_lookup_verify_error(
|
||||||
id,
|
|
||||||
peer_id,
|
peer_id,
|
||||||
cx,
|
cx,
|
||||||
request_id_ref,
|
request_id_ref,
|
||||||
@@ -353,7 +350,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
// is complete before processing the block.
|
// is complete before processing the block.
|
||||||
if let Err(e) = request_ref.add_blobs(block_root, blobs) {
|
if let Err(e) = request_ref.add_blobs(block_root, blobs) {
|
||||||
Self::handle_blob_lookup_verify_error(
|
Self::handle_blob_lookup_verify_error(
|
||||||
id,
|
|
||||||
peer_id,
|
peer_id,
|
||||||
cx,
|
cx,
|
||||||
request_id_ref,
|
request_id_ref,
|
||||||
@@ -378,7 +374,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
}
|
}
|
||||||
Ok(None) => false,
|
Ok(None) => false,
|
||||||
Err(e) => Self::handle_blob_lookup_verify_error(
|
Err(e) => Self::handle_blob_lookup_verify_error(
|
||||||
id,
|
|
||||||
peer_id,
|
peer_id,
|
||||||
cx,
|
cx,
|
||||||
request_id_ref,
|
request_id_ref,
|
||||||
@@ -401,7 +396,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
|
|
||||||
//TODO(sean) reduce duplicate code
|
//TODO(sean) reduce duplicate code
|
||||||
fn handle_block_lookup_verify_error(
|
fn handle_block_lookup_verify_error(
|
||||||
id: Id,
|
|
||||||
peer_id: PeerId,
|
peer_id: PeerId,
|
||||||
cx: &mut SyncNetworkContext<T>,
|
cx: &mut SyncNetworkContext<T>,
|
||||||
request_id_ref: &mut Id,
|
request_id_ref: &mut Id,
|
||||||
@@ -436,7 +430,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_blob_lookup_verify_error(
|
fn handle_blob_lookup_verify_error(
|
||||||
id: Id,
|
|
||||||
peer_id: PeerId,
|
peer_id: PeerId,
|
||||||
cx: &mut SyncNetworkContext<T>,
|
cx: &mut SyncNetworkContext<T>,
|
||||||
request_id_ref: &mut Id,
|
request_id_ref: &mut Id,
|
||||||
@@ -512,7 +505,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
(triggered_parent_request, id_ref, req)
|
(triggered_parent_request, id_ref, req)
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
if matches!(StreamTerminator::False, stream_terminator) {
|
if matches!(stream_terminator, StreamTerminator::False,) {
|
||||||
debug!(
|
debug!(
|
||||||
self.log,
|
self.log,
|
||||||
"Block returned for single block lookup not present";
|
"Block returned for single block lookup not present";
|
||||||
@@ -803,7 +796,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
cx: &mut SyncNetworkContext<T>,
|
cx: &mut SyncNetworkContext<T>,
|
||||||
error: RPCError,
|
error: RPCError,
|
||||||
) {
|
) {
|
||||||
// check if there's a pending blob response when deciding whether to drop
|
//TODO(sean) check if there's a pending blob response when deciding whether to drop?
|
||||||
|
|
||||||
if let Some(pos) = self
|
if let Some(pos) = self
|
||||||
.parent_lookups
|
.parent_lookups
|
||||||
|
|||||||
@@ -7,16 +7,13 @@ use crate::sync::{
|
|||||||
};
|
};
|
||||||
use beacon_chain::blob_verification::AsBlock;
|
use beacon_chain::blob_verification::AsBlock;
|
||||||
use beacon_chain::blob_verification::BlockWrapper;
|
use beacon_chain::blob_verification::BlockWrapper;
|
||||||
use beacon_chain::data_availability_checker::AvailabilityCheckError;
|
|
||||||
use beacon_chain::data_availability_checker::DataAvailabilityChecker;
|
use beacon_chain::data_availability_checker::DataAvailabilityChecker;
|
||||||
use beacon_chain::BeaconChainTypes;
|
use beacon_chain::BeaconChainTypes;
|
||||||
use lighthouse_network::PeerId;
|
use lighthouse_network::PeerId;
|
||||||
use ssz_types::FixedVector;
|
use ssz_types::FixedVector;
|
||||||
use std::iter;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use store::Hash256;
|
use store::Hash256;
|
||||||
use strum::IntoStaticStr;
|
use strum::IntoStaticStr;
|
||||||
use types::blob_sidecar::BlobIdentifier;
|
|
||||||
use types::{BlobSidecar, EthSpec, SignedBeaconBlock};
|
use types::{BlobSidecar, EthSpec, SignedBeaconBlock};
|
||||||
|
|
||||||
/// How many attempts we try to find a parent of a block before we give up trying.
|
/// How many attempts we try to find a parent of a block before we give up trying.
|
||||||
|
|||||||
@@ -1917,7 +1917,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
|
|||||||
&& last_pruned_epoch.as_u64() + self.get_config().epochs_per_blob_prune
|
&& last_pruned_epoch.as_u64() + self.get_config().epochs_per_blob_prune
|
||||||
> end_epoch.as_u64()
|
> end_epoch.as_u64()
|
||||||
{
|
{
|
||||||
info!(self.log, "Blobs sidecars are pruned");
|
debug!(self.log, "Blobs sidecars are pruned");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user