mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
fix lints
This commit is contained in:
@@ -54,7 +54,6 @@ use lighthouse_network::{
|
|||||||
};
|
};
|
||||||
use logging::TimeLatch;
|
use logging::TimeLatch;
|
||||||
use slog::{crit, debug, error, trace, warn, Logger};
|
use slog::{crit, debug, error, trace, warn, Logger};
|
||||||
use ssz_types::FixedVector;
|
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
@@ -67,10 +66,10 @@ use tokio::sync::mpsc;
|
|||||||
use tokio::sync::mpsc::error::TrySendError;
|
use tokio::sync::mpsc::error::TrySendError;
|
||||||
use types::blob_sidecar::FixedBlobSidecarList;
|
use types::blob_sidecar::FixedBlobSidecarList;
|
||||||
use types::{
|
use types::{
|
||||||
Attestation, AttesterSlashing, BlobSidecar, EthSpec, Hash256, LightClientFinalityUpdate,
|
Attestation, AttesterSlashing, Hash256, LightClientFinalityUpdate, LightClientOptimisticUpdate,
|
||||||
LightClientOptimisticUpdate, ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock,
|
ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedBlobSidecar,
|
||||||
SignedBlobSidecar, SignedBlsToExecutionChange, SignedContributionAndProof, SignedVoluntaryExit,
|
SignedBlsToExecutionChange, SignedContributionAndProof, SignedVoluntaryExit, SubnetId,
|
||||||
SubnetId, SyncCommitteeMessage, SyncSubnetId,
|
SyncCommitteeMessage, SyncSubnetId,
|
||||||
};
|
};
|
||||||
use work_reprocessing_queue::{
|
use work_reprocessing_queue::{
|
||||||
spawn_reprocess_scheduler, QueuedAggregate, QueuedLightClientUpdate, QueuedRpcBlock,
|
spawn_reprocess_scheduler, QueuedAggregate, QueuedLightClientUpdate, QueuedRpcBlock,
|
||||||
|
|||||||
@@ -18,12 +18,11 @@ use beacon_chain::{AvailabilityProcessingStatus, CountUnrealized};
|
|||||||
use lighthouse_network::PeerAction;
|
use lighthouse_network::PeerAction;
|
||||||
use slog::{debug, error, info, warn};
|
use slog::{debug, error, info, warn};
|
||||||
use slot_clock::SlotClock;
|
use slot_clock::SlotClock;
|
||||||
use ssz_types::FixedVector;
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use types::blob_sidecar::FixedBlobSidecarList;
|
use types::blob_sidecar::FixedBlobSidecarList;
|
||||||
use types::{BlobSidecar, Epoch, EthSpec, Hash256, SignedBeaconBlock};
|
use types::{Epoch, Hash256, SignedBeaconBlock};
|
||||||
|
|
||||||
/// Id associated to a batch processing request, either a sync batch or a parent lookup.
|
/// Id associated to a batch processing request, either a sync batch or a parent lookup.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
|
|||||||
@@ -244,12 +244,7 @@ fn test_single_block_lookup_failure() {
|
|||||||
let peer_id = PeerId::random();
|
let peer_id = PeerId::random();
|
||||||
|
|
||||||
// Trigger the request
|
// Trigger the request
|
||||||
bl.search_block(
|
bl.search_block(block_hash, peer_id, PeerShouldHave::BlockAndBlobs, &mut cx);
|
||||||
block_hash,
|
|
||||||
peer_id.clone(),
|
|
||||||
PeerShouldHave::BlockAndBlobs,
|
|
||||||
&mut cx,
|
|
||||||
);
|
|
||||||
let id = rig.expect_block_request();
|
let id = rig.expect_block_request();
|
||||||
|
|
||||||
// The request fails. RPC failures are handled elsewhere so we should not penalize the peer.
|
// The request fails. RPC failures are handled elsewhere so we should not penalize the peer.
|
||||||
@@ -591,7 +586,7 @@ fn test_parent_lookup_too_many_processing_attempts_must_blacklist() {
|
|||||||
let id = dbg!(rig.expect_parent_request());
|
let id = dbg!(rig.expect_parent_request());
|
||||||
assert!(!bl.failed_chains.contains(&block_hash));
|
assert!(!bl.failed_chains.contains(&block_hash));
|
||||||
// send the right parent but fail processing
|
// send the right parent but fail processing
|
||||||
bl.parent_lookup_response(id, peer_id, Some(parent.clone().into()), D, &mut cx);
|
bl.parent_lookup_response(id, peer_id, Some(parent.clone()), D, &mut cx);
|
||||||
bl.parent_block_processed(
|
bl.parent_block_processed(
|
||||||
block_hash,
|
block_hash,
|
||||||
BlockError::InvalidSignature.into(),
|
BlockError::InvalidSignature.into(),
|
||||||
@@ -610,13 +605,13 @@ fn test_parent_lookup_too_many_processing_attempts_must_blacklist() {
|
|||||||
fn test_parent_lookup_too_deep() {
|
fn test_parent_lookup_too_deep() {
|
||||||
let (mut bl, mut cx, mut rig) = TestRig::test_setup(false);
|
let (mut bl, mut cx, mut rig) = TestRig::test_setup(false);
|
||||||
let mut blocks =
|
let mut blocks =
|
||||||
Vec::<SignedBeaconBlock<E>>::with_capacity(parent_lookup::PARENT_DEPTH_TOLERANCE);
|
Vec::<Arc<SignedBeaconBlock<E>>>::with_capacity(parent_lookup::PARENT_DEPTH_TOLERANCE);
|
||||||
while blocks.len() < parent_lookup::PARENT_DEPTH_TOLERANCE {
|
while blocks.len() < parent_lookup::PARENT_DEPTH_TOLERANCE {
|
||||||
let parent = blocks
|
let parent = blocks
|
||||||
.last()
|
.last()
|
||||||
.map(|b| b.canonical_root())
|
.map(|b| b.canonical_root())
|
||||||
.unwrap_or_else(Hash256::random);
|
.unwrap_or_else(Hash256::random);
|
||||||
let block = rig.block_with_parent(parent);
|
let block = Arc::new(rig.block_with_parent(parent));
|
||||||
blocks.push(block);
|
blocks.push(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user