mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-01 05:37:05 +00:00
Update Rust Edition to 2024 (#7766)
* #7749 Thanks @dknopik and @michaelsproul for your help!
This commit is contained in:
@@ -14,8 +14,8 @@ use std::sync::Arc;
|
||||
use types::blob_sidecar::FixedBlobSidecarList;
|
||||
use types::{DataColumnSidecarList, SignedBeaconBlock};
|
||||
|
||||
use super::single_block_lookup::{ComponentRequests, DownloadResult};
|
||||
use super::SingleLookupId;
|
||||
use super::single_block_lookup::{ComponentRequests, DownloadResult};
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum ResponseType {
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
//! or consider a lookup complete. These caches are read from the `SyncNetworkContext` and its state
|
||||
//! returned to this module as `LookupRequestResult` variants.
|
||||
|
||||
use self::parent_chain::{compute_parent_chains, NodeChain};
|
||||
use self::parent_chain::{NodeChain, compute_parent_chains};
|
||||
pub use self::single_block_lookup::DownloadResult;
|
||||
use self::single_block_lookup::{LookupRequestError, LookupResult, SingleBlockLookup};
|
||||
use super::manager::{BlockProcessType, BlockProcessingResult, SLOT_IMPORT_TOLERANCE};
|
||||
use super::network_context::{PeerGroup, RpcResponseError, SyncNetworkContext};
|
||||
use crate::metrics;
|
||||
use crate::sync::SyncMessage;
|
||||
use crate::sync::block_lookups::common::ResponseType;
|
||||
use crate::sync::block_lookups::parent_chain::find_oldest_fork_ancestor;
|
||||
use crate::sync::SyncMessage;
|
||||
use beacon_chain::block_verification_types::AsBlock;
|
||||
use beacon_chain::data_availability_checker::{
|
||||
AvailabilityCheckError, AvailabilityCheckErrorCategory,
|
||||
@@ -365,15 +365,14 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
}
|
||||
|
||||
// Ensure that awaiting parent exists, otherwise this lookup won't be able to make progress
|
||||
if let Some(awaiting_parent) = awaiting_parent {
|
||||
if !self
|
||||
if let Some(awaiting_parent) = awaiting_parent
|
||||
&& !self
|
||||
.single_block_lookups
|
||||
.iter()
|
||||
.any(|(_, lookup)| lookup.is_for_block(awaiting_parent))
|
||||
{
|
||||
warn!(block_root = ?awaiting_parent, "Ignoring child lookup parent lookup not found");
|
||||
return false;
|
||||
}
|
||||
{
|
||||
warn!(block_root = ?awaiting_parent, "Ignoring child lookup parent lookup not found");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lookups contain untrusted data, bound the total count of lookups hold in memory to reduce
|
||||
|
||||
@@ -117,7 +117,7 @@ pub(crate) fn find_oldest_fork_ancestor(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{compute_parent_chains, find_oldest_fork_ancestor, Node};
|
||||
use super::{Node, compute_parent_chains, find_oldest_fork_ancestor};
|
||||
use types::{FixedBytesExtended, Hash256};
|
||||
|
||||
fn h(n: u64) -> Hash256 {
|
||||
|
||||
Reference in New Issue
Block a user