cargo fmt
This commit is contained in:
parent
8d45e48775
commit
c0dc42ea07
@ -12,6 +12,7 @@ use crate::block_verification::{
|
|||||||
signature_verify_chain_segment, BlockError, ExecutionPendingBlock, GossipVerifiedBlock,
|
signature_verify_chain_segment, BlockError, ExecutionPendingBlock, GossipVerifiedBlock,
|
||||||
IntoExecutionPendingBlock, PayloadVerificationOutcome, POS_PANDA_BANNER,
|
IntoExecutionPendingBlock, PayloadVerificationOutcome, POS_PANDA_BANNER,
|
||||||
};
|
};
|
||||||
|
pub use crate::canonical_head::{CanonicalHead, CanonicalHeadRwLock};
|
||||||
use crate::chain_config::ChainConfig;
|
use crate::chain_config::ChainConfig;
|
||||||
use crate::early_attester_cache::EarlyAttesterCache;
|
use crate::early_attester_cache::EarlyAttesterCache;
|
||||||
use crate::errors::{BeaconChainError as Error, BlockProductionError};
|
use crate::errors::{BeaconChainError as Error, BlockProductionError};
|
||||||
@ -57,6 +58,7 @@ use eth2::types::{EventKind, SseBlock, SyncDuty};
|
|||||||
use execution_layer::{
|
use execution_layer::{
|
||||||
BuilderParams, ChainHealth, ExecutionLayer, FailedCondition, PayloadAttributes, PayloadStatus,
|
BuilderParams, ChainHealth, ExecutionLayer, FailedCondition, PayloadAttributes, PayloadStatus,
|
||||||
};
|
};
|
||||||
|
pub use fork_choice::CountUnrealized;
|
||||||
use fork_choice::{
|
use fork_choice::{
|
||||||
AttestationFromBlock, ExecutionStatus, ForkChoice, ForkchoiceUpdateParameters,
|
AttestationFromBlock, ExecutionStatus, ForkChoice, ForkchoiceUpdateParameters,
|
||||||
InvalidationOperation, PayloadVerificationStatus, ResetPayloadStatuses,
|
InvalidationOperation, PayloadVerificationStatus, ResetPayloadStatuses,
|
||||||
@ -98,8 +100,6 @@ use task_executor::{ShutdownReason, TaskExecutor};
|
|||||||
use tree_hash::TreeHash;
|
use tree_hash::TreeHash;
|
||||||
use types::beacon_state::CloneConfig;
|
use types::beacon_state::CloneConfig;
|
||||||
use types::*;
|
use types::*;
|
||||||
pub use crate::canonical_head::{CanonicalHead, CanonicalHeadRwLock};
|
|
||||||
pub use fork_choice::CountUnrealized;
|
|
||||||
|
|
||||||
pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;
|
pub type ForkChoiceError = fork_choice::Error<crate::ForkChoiceStoreError>;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ use sensitive_url::SensitiveUrl;
|
|||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use types::{EthSpec};
|
use types::EthSpec;
|
||||||
|
|
||||||
pub use deposit_log::{DepositLog, Log};
|
pub use deposit_log::{DepositLog, Log};
|
||||||
pub use reqwest::Client;
|
pub use reqwest::Client;
|
||||||
|
@ -21,8 +21,8 @@ use tokio_util::{
|
|||||||
compat::{Compat, FuturesAsyncReadCompatExt},
|
compat::{Compat, FuturesAsyncReadCompatExt},
|
||||||
};
|
};
|
||||||
use types::{
|
use types::{
|
||||||
BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockMerge, EthSpec,
|
BeaconBlock, BeaconBlockAltair, BeaconBlockBase, BeaconBlockMerge, EthSpec, ForkContext,
|
||||||
ForkContext, ForkName, Hash256, MainnetEthSpec, Signature, SignedBeaconBlock,
|
ForkName, Hash256, MainnetEthSpec, Signature, SignedBeaconBlock,
|
||||||
};
|
};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
|
@ -16,9 +16,9 @@ use crate::types::{
|
|||||||
subnet_from_topic_hash, GossipEncoding, GossipKind, GossipTopic, SnappyTransform, Subnet,
|
subnet_from_topic_hash, GossipEncoding, GossipKind, GossipTopic, SnappyTransform, Subnet,
|
||||||
SubnetDiscovery,
|
SubnetDiscovery,
|
||||||
};
|
};
|
||||||
|
use crate::EnrExt;
|
||||||
use crate::Eth2Enr;
|
use crate::Eth2Enr;
|
||||||
use crate::{error, metrics, Enr, NetworkGlobals, PubsubMessage, TopicHash};
|
use crate::{error, metrics, Enr, NetworkGlobals, PubsubMessage, TopicHash};
|
||||||
use crate::{EnrExt};
|
|
||||||
use api_types::{PeerRequestId, Request, RequestId, Response};
|
use api_types::{PeerRequestId, Request, RequestId, Response};
|
||||||
use futures::stream::StreamExt;
|
use futures::stream::StreamExt;
|
||||||
use gossipsub_scoring_parameters::{lighthouse_gossip_thresholds, PeerScoreSettings};
|
use gossipsub_scoring_parameters::{lighthouse_gossip_thresholds, PeerScoreSettings};
|
||||||
@ -35,7 +35,7 @@ use libp2p::swarm::{ConnectionLimits, Swarm, SwarmBuilder, SwarmEvent};
|
|||||||
use libp2p::PeerId;
|
use libp2p::PeerId;
|
||||||
use slog::{crit, debug, info, o, trace, warn};
|
use slog::{crit, debug, info, o, trace, warn};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::{PathBuf};
|
use std::path::PathBuf;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::{
|
use std::{
|
||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
|
@ -60,13 +60,13 @@ use std::task::Context;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use std::{cmp, collections::HashSet};
|
use std::{cmp, collections::HashSet};
|
||||||
use task_executor::TaskExecutor;
|
use task_executor::TaskExecutor;
|
||||||
use tokio::sync::{mpsc};
|
use tokio::sync::mpsc;
|
||||||
use types::{
|
|
||||||
Attestation, AttesterSlashing, Hash256, ProposerSlashing,
|
|
||||||
SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit,
|
|
||||||
SubnetId, SyncCommitteeMessage, SyncSubnetId,
|
|
||||||
};
|
|
||||||
use types::signed_blobs_sidecar::SignedBlobsSidecar;
|
use types::signed_blobs_sidecar::SignedBlobsSidecar;
|
||||||
|
use types::{
|
||||||
|
Attestation, AttesterSlashing, Hash256, ProposerSlashing, SignedAggregateAndProof,
|
||||||
|
SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit, SubnetId,
|
||||||
|
SyncCommitteeMessage, SyncSubnetId,
|
||||||
|
};
|
||||||
use work_reprocessing_queue::{
|
use work_reprocessing_queue::{
|
||||||
spawn_reprocess_scheduler, QueuedAggregate, QueuedRpcBlock, QueuedUnaggregate, ReadyWork,
|
spawn_reprocess_scheduler, QueuedAggregate, QueuedRpcBlock, QueuedUnaggregate, ReadyWork,
|
||||||
};
|
};
|
||||||
@ -788,7 +788,7 @@ pub enum Work<T: BeaconChainTypes> {
|
|||||||
peer_id: PeerId,
|
peer_id: PeerId,
|
||||||
request_id: PeerRequestId,
|
request_id: PeerRequestId,
|
||||||
request: BlobsByRangeRequest,
|
request: BlobsByRangeRequest,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: BeaconChainTypes> Work<T> {
|
impl<T: BeaconChainTypes> Work<T> {
|
||||||
@ -812,7 +812,7 @@ impl<T: BeaconChainTypes> Work<T> {
|
|||||||
Work::Status { .. } => STATUS_PROCESSING,
|
Work::Status { .. } => STATUS_PROCESSING,
|
||||||
Work::BlocksByRangeRequest { .. } => BLOCKS_BY_RANGE_REQUEST,
|
Work::BlocksByRangeRequest { .. } => BLOCKS_BY_RANGE_REQUEST,
|
||||||
Work::BlocksByRootsRequest { .. } => BLOCKS_BY_ROOTS_REQUEST,
|
Work::BlocksByRootsRequest { .. } => BLOCKS_BY_ROOTS_REQUEST,
|
||||||
Work::BlobsByRangeRequest {..} => BLOBS_BY_RANGE_REQUEST,
|
Work::BlobsByRangeRequest { .. } => BLOBS_BY_RANGE_REQUEST,
|
||||||
Work::UnknownBlockAttestation { .. } => UNKNOWN_BLOCK_ATTESTATION,
|
Work::UnknownBlockAttestation { .. } => UNKNOWN_BLOCK_ATTESTATION,
|
||||||
Work::UnknownBlockAggregate { .. } => UNKNOWN_BLOCK_AGGREGATE,
|
Work::UnknownBlockAggregate { .. } => UNKNOWN_BLOCK_AGGREGATE,
|
||||||
}
|
}
|
||||||
@ -1693,7 +1693,7 @@ impl<T: BeaconChainTypes> BeaconProcessor<T> {
|
|||||||
Work::BlobsByRangeRequest {
|
Work::BlobsByRangeRequest {
|
||||||
peer_id,
|
peer_id,
|
||||||
request_id,
|
request_id,
|
||||||
request
|
request,
|
||||||
} => task_spawner.spawn_blocking_with_manual_send_idle(move |send_idle_on_drop| {
|
} => task_spawner.spawn_blocking_with_manual_send_idle(move |send_idle_on_drop| {
|
||||||
worker.handle_blobs_by_range_request(
|
worker.handle_blobs_by_range_request(
|
||||||
sub_executor,
|
sub_executor,
|
||||||
|
@ -17,12 +17,12 @@ use std::sync::Arc;
|
|||||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||||
use store::hot_cold_store::HotColdDBError;
|
use store::hot_cold_store::HotColdDBError;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use types::{
|
|
||||||
Attestation, AttesterSlashing, EthSpec, Hash256, IndexedAttestation,
|
|
||||||
ProposerSlashing, SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof,
|
|
||||||
SignedVoluntaryExit, Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId,
|
|
||||||
};
|
|
||||||
use types::signed_blobs_sidecar::SignedBlobsSidecar;
|
use types::signed_blobs_sidecar::SignedBlobsSidecar;
|
||||||
|
use types::{
|
||||||
|
Attestation, AttesterSlashing, EthSpec, Hash256, IndexedAttestation, ProposerSlashing,
|
||||||
|
SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit,
|
||||||
|
Slot, SubnetId, SyncCommitteeMessage, SyncSubnetId,
|
||||||
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
super::work_reprocessing_queue::{
|
super::work_reprocessing_queue::{
|
||||||
@ -959,31 +959,31 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
Ok(block_root) => {
|
Ok(block_root) => {
|
||||||
metrics::inc_counter(&metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_IMPORTED_TOTAL);
|
metrics::inc_counter(&metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_IMPORTED_TOTAL);
|
||||||
|
|
||||||
if reprocess_tx
|
if reprocess_tx
|
||||||
.try_send(ReprocessQueueMessage::BlockImported(block_root))
|
.try_send(ReprocessQueueMessage::BlockImported(block_root))
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
error!(
|
error!(
|
||||||
self.log,
|
self.log,
|
||||||
"Failed to inform block import";
|
"Failed to inform block import";
|
||||||
"source" => "gossip",
|
"source" => "gossip",
|
||||||
"block_root" => ?block_root,
|
"block_root" => ?block_root,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!(
|
debug!(
|
||||||
self.log,
|
self.log,
|
||||||
"Gossipsub block processed";
|
"Gossipsub block processed";
|
||||||
"block" => ?block_root,
|
"block" => ?block_root,
|
||||||
"peer_id" => %peer_id
|
"peer_id" => %peer_id
|
||||||
);
|
);
|
||||||
|
|
||||||
self.chain.recompute_head_at_current_slot().await;
|
self.chain.recompute_head_at_current_slot().await;
|
||||||
}
|
}
|
||||||
Err(BlockError::ParentUnknown { .. }) => {
|
Err(BlockError::ParentUnknown { .. }) => {
|
||||||
// Inform the sync manager to find parents for this block
|
// Inform the sync manager to find parents for this block
|
||||||
// This should not occur. It should be checked by `should_forward_block`
|
// This should not occur. It should be checked by `should_forward_block`
|
||||||
error!(
|
error!(
|
||||||
self.log,
|
self.log,
|
||||||
"Block with unknown parent attempted to be processed";
|
"Block with unknown parent attempted to be processed";
|
||||||
"peer_id" => %peer_id
|
"peer_id" => %peer_id
|
||||||
@ -996,28 +996,28 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
"Failed to verify execution payload";
|
"Failed to verify execution payload";
|
||||||
"error" => %e
|
"error" => %e
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
other => {
|
other => {
|
||||||
debug!(
|
debug!(
|
||||||
self.log,
|
self.log,
|
||||||
"Invalid gossip beacon block";
|
"Invalid gossip beacon block";
|
||||||
"outcome" => ?other,
|
"outcome" => ?other,
|
||||||
"block root" => ?block_root,
|
"block root" => ?block_root,
|
||||||
"block slot" => block.slot()
|
"block slot" => block.slot()
|
||||||
);
|
);
|
||||||
self.gossip_penalize_peer(
|
self.gossip_penalize_peer(
|
||||||
peer_id,
|
peer_id,
|
||||||
PeerAction::MidToleranceError,
|
PeerAction::MidToleranceError,
|
||||||
"bad_gossip_block_ssz",
|
"bad_gossip_block_ssz",
|
||||||
);
|
);
|
||||||
trace!(
|
trace!(
|
||||||
self.log,
|
self.log,
|
||||||
"Invalid gossip beacon block ssz";
|
"Invalid gossip beacon block ssz";
|
||||||
"ssz" => format_args!("0x{}", hex::encode(block.as_ssz_bytes())),
|
"ssz" => format_args!("0x{}", hex::encode(block.as_ssz_bytes())),
|
||||||
);
|
);
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
pub fn process_gossip_voluntary_exit(
|
pub fn process_gossip_voluntary_exit(
|
||||||
self,
|
self,
|
||||||
|
@ -4,9 +4,9 @@ use crate::status::ToStatusMessage;
|
|||||||
use crate::sync::SyncMessage;
|
use crate::sync::SyncMessage;
|
||||||
use beacon_chain::{BeaconChainError, BeaconChainTypes, HistoricalBlockError, WhenSlotSkipped};
|
use beacon_chain::{BeaconChainError, BeaconChainTypes, HistoricalBlockError, WhenSlotSkipped};
|
||||||
use itertools::process_results;
|
use itertools::process_results;
|
||||||
|
use lighthouse_network::rpc::methods::{BlobsByRangeRequest, MAX_REQUEST_BLOBS_SIDECARS};
|
||||||
use lighthouse_network::rpc::StatusMessage;
|
use lighthouse_network::rpc::StatusMessage;
|
||||||
use lighthouse_network::rpc::*;
|
use lighthouse_network::rpc::*;
|
||||||
use lighthouse_network::rpc::methods::{BlobsByRangeRequest, MAX_REQUEST_BLOBS_SIDECARS};
|
|
||||||
use lighthouse_network::{PeerId, PeerRequestId, ReportSource, Response, SyncInfo};
|
use lighthouse_network::{PeerId, PeerRequestId, ReportSource, Response, SyncInfo};
|
||||||
use slog::{debug, error};
|
use slog::{debug, error};
|
||||||
use slot_clock::SlotClock;
|
use slot_clock::SlotClock;
|
||||||
@ -384,141 +384,141 @@ impl<T: BeaconChainTypes> Worker<T> {
|
|||||||
mut req: BlobsByRangeRequest,
|
mut req: BlobsByRangeRequest,
|
||||||
) {
|
) {
|
||||||
debug!(self.log, "Received BlobsByRange Request";
|
debug!(self.log, "Received BlobsByRange Request";
|
||||||
"peer_id" => %peer_id,
|
"peer_id" => %peer_id,
|
||||||
"count" => req.count,
|
"count" => req.count,
|
||||||
"start_slot" => req.start_slot,
|
"start_slot" => req.start_slot,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Should not send more than max request blocks
|
// Should not send more than max request blocks
|
||||||
if req.count > MAX_REQUEST_BLOBS_SIDECARS {
|
if req.count > MAX_REQUEST_BLOBS_SIDECARS {
|
||||||
req.count = MAX_REQUEST_BLOBS_SIDECARS;
|
req.count = MAX_REQUEST_BLOBS_SIDECARS;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME(sean) create the blobs iter
|
//FIXME(sean) create the blobs iter
|
||||||
|
|
||||||
// let forwards_block_root_iter = match self
|
// let forwards_block_root_iter = match self
|
||||||
// .chain
|
// .chain
|
||||||
// .forwards_iter_block_roots(Slot::from(req.start_slot))
|
// .forwards_iter_block_roots(Slot::from(req.start_slot))
|
||||||
// {
|
// {
|
||||||
// Ok(iter) => iter,
|
// Ok(iter) => iter,
|
||||||
// Err(BeaconChainError::HistoricalBlockError(
|
// Err(BeaconChainError::HistoricalBlockError(
|
||||||
// HistoricalBlockError::BlockOutOfRange {
|
// HistoricalBlockError::BlockOutOfRange {
|
||||||
// slot,
|
// slot,
|
||||||
// oldest_block_slot,
|
// oldest_block_slot,
|
||||||
// },
|
// },
|
||||||
// )) => {
|
// )) => {
|
||||||
// debug!(self.log, "Range request failed during backfill"; "requested_slot" => slot, "oldest_known_slot" => oldest_block_slot);
|
// debug!(self.log, "Range request failed during backfill"; "requested_slot" => slot, "oldest_known_slot" => oldest_block_slot);
|
||||||
// return self.send_error_response(
|
// return self.send_error_response(
|
||||||
// peer_id,
|
// peer_id,
|
||||||
// RPCResponseErrorCode::ResourceUnavailable,
|
// RPCResponseErrorCode::ResourceUnavailable,
|
||||||
// "Backfilling".into(),
|
// "Backfilling".into(),
|
||||||
// request_id,
|
// request_id,
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
// Err(e) => return error!(self.log, "Unable to obtain root iter"; "error" => ?e),
|
// Err(e) => return error!(self.log, "Unable to obtain root iter"; "error" => ?e),
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// // Pick out the required blocks, ignoring skip-slots.
|
// // Pick out the required blocks, ignoring skip-slots.
|
||||||
// let mut last_block_root = None;
|
// let mut last_block_root = None;
|
||||||
// let maybe_block_roots = process_results(forwards_block_root_iter, |iter| {
|
// let maybe_block_roots = process_results(forwards_block_root_iter, |iter| {
|
||||||
// iter.take_while(|(_, slot)| slot.as_u64() < req.start_slot.saturating_add(req.count))
|
// iter.take_while(|(_, slot)| slot.as_u64() < req.start_slot.saturating_add(req.count))
|
||||||
// // map skip slots to None
|
// // map skip slots to None
|
||||||
// .map(|(root, _)| {
|
// .map(|(root, _)| {
|
||||||
// let result = if Some(root) == last_block_root {
|
// let result = if Some(root) == last_block_root {
|
||||||
// None
|
// None
|
||||||
// } else {
|
// } else {
|
||||||
// Some(root)
|
// Some(root)
|
||||||
// };
|
// };
|
||||||
// last_block_root = Some(root);
|
// last_block_root = Some(root);
|
||||||
// result
|
// result
|
||||||
// })
|
// })
|
||||||
// .collect::<Vec<Option<Hash256>>>()
|
// .collect::<Vec<Option<Hash256>>>()
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// let block_roots = match maybe_block_roots {
|
// let block_roots = match maybe_block_roots {
|
||||||
// Ok(block_roots) => block_roots,
|
// Ok(block_roots) => block_roots,
|
||||||
// Err(e) => return error!(self.log, "Error during iteration over blocks"; "error" => ?e),
|
// Err(e) => return error!(self.log, "Error during iteration over blocks"; "error" => ?e),
|
||||||
// };
|
// };
|
||||||
//
|
//
|
||||||
// // remove all skip slots
|
// // remove all skip slots
|
||||||
// let block_roots = block_roots.into_iter().flatten().collect::<Vec<_>>();
|
// let block_roots = block_roots.into_iter().flatten().collect::<Vec<_>>();
|
||||||
//
|
//
|
||||||
// // Fetching blocks is async because it may have to hit the execution layer for payloads.
|
// // Fetching blocks is async because it may have to hit the execution layer for payloads.
|
||||||
// executor.spawn(
|
// executor.spawn(
|
||||||
// async move {
|
// async move {
|
||||||
// let mut blocks_sent = 0;
|
// let mut blocks_sent = 0;
|
||||||
// let mut send_response = true;
|
// let mut send_response = true;
|
||||||
//
|
//
|
||||||
// for root in block_roots {
|
// for root in block_roots {
|
||||||
// match self.chain.store.get_blobs(&root) {
|
// match self.chain.store.get_blobs(&root) {
|
||||||
// Ok(Some(blob)) => {
|
// Ok(Some(blob)) => {
|
||||||
// blocks_sent += 1;
|
// blocks_sent += 1;
|
||||||
// self.send_network_message(NetworkMessage::SendResponse {
|
// self.send_network_message(NetworkMessage::SendResponse {
|
||||||
// peer_id,
|
// peer_id,
|
||||||
// response: Response::BlobsByRange(Some(Arc::new(VariableList::new(vec![blob.message]).unwrap()))),
|
// response: Response::BlobsByRange(Some(Arc::new(VariableList::new(vec![blob.message]).unwrap()))),
|
||||||
// id: request_id,
|
// id: request_id,
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
// Ok(None) => {
|
// Ok(None) => {
|
||||||
// error!(
|
// error!(
|
||||||
// self.log,
|
// self.log,
|
||||||
// "Blob in the chain is not in the store";
|
// "Blob in the chain is not in the store";
|
||||||
// "request_root" => ?root
|
// "request_root" => ?root
|
||||||
// );
|
// );
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// Err(e) => {
|
// Err(e) => {
|
||||||
// error!(
|
// error!(
|
||||||
// self.log,
|
// self.log,
|
||||||
// "Error fetching block for peer";
|
// "Error fetching block for peer";
|
||||||
// "block_root" => ?root,
|
// "block_root" => ?root,
|
||||||
// "error" => ?e
|
// "error" => ?e
|
||||||
// );
|
// );
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// let current_slot = self
|
// let current_slot = self
|
||||||
// .chain
|
// .chain
|
||||||
// .slot()
|
// .slot()
|
||||||
// .unwrap_or_else(|_| self.chain.slot_clock.genesis_slot());
|
// .unwrap_or_else(|_| self.chain.slot_clock.genesis_slot());
|
||||||
//
|
//
|
||||||
// if blocks_sent < (req.count as usize) {
|
// if blocks_sent < (req.count as usize) {
|
||||||
// debug!(
|
// debug!(
|
||||||
// self.log,
|
// self.log,
|
||||||
// "BlocksByRange Response processed";
|
// "BlocksByRange Response processed";
|
||||||
// "peer" => %peer_id,
|
// "peer" => %peer_id,
|
||||||
// "msg" => "Failed to return all requested blocks",
|
// "msg" => "Failed to return all requested blocks",
|
||||||
// "start_slot" => req.start_slot,
|
// "start_slot" => req.start_slot,
|
||||||
// "current_slot" => current_slot,
|
// "current_slot" => current_slot,
|
||||||
// "requested" => req.count,
|
// "requested" => req.count,
|
||||||
// "returned" => blocks_sent
|
// "returned" => blocks_sent
|
||||||
// );
|
// );
|
||||||
// } else {
|
// } else {
|
||||||
// debug!(
|
// debug!(
|
||||||
// self.log,
|
// self.log,
|
||||||
// "BlocksByRange Response processed";
|
// "BlocksByRange Response processed";
|
||||||
// "peer" => %peer_id,
|
// "peer" => %peer_id,
|
||||||
// "start_slot" => req.start_slot,
|
// "start_slot" => req.start_slot,
|
||||||
// "current_slot" => current_slot,
|
// "current_slot" => current_slot,
|
||||||
// "requested" => req.count,
|
// "requested" => req.count,
|
||||||
// "returned" => blocks_sent
|
// "returned" => blocks_sent
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// if send_response {
|
// if send_response {
|
||||||
// // send the stream terminator
|
// // send the stream terminator
|
||||||
// self.send_network_message(NetworkMessage::SendResponse {
|
// self.send_network_message(NetworkMessage::SendResponse {
|
||||||
// peer_id,
|
// peer_id,
|
||||||
// response: Response::BlobsByRange(None),
|
// response: Response::BlobsByRange(None),
|
||||||
// id: request_id,
|
// id: request_id,
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// drop(send_on_drop);
|
// drop(send_on_drop);
|
||||||
// },
|
// },
|
||||||
// "load_blocks_by_range_blocks",
|
// "load_blocks_by_range_blocks",
|
||||||
// );
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@ use crate::status::status_message;
|
|||||||
use crate::sync::manager::RequestId as SyncId;
|
use crate::sync::manager::RequestId as SyncId;
|
||||||
use crate::sync::SyncMessage;
|
use crate::sync::SyncMessage;
|
||||||
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
use beacon_chain::{BeaconChain, BeaconChainTypes};
|
||||||
use lighthouse_network::rpc::*;
|
|
||||||
use lighthouse_network::rpc::methods::BlobsByRangeRequest;
|
use lighthouse_network::rpc::methods::BlobsByRangeRequest;
|
||||||
|
use lighthouse_network::rpc::*;
|
||||||
use lighthouse_network::{
|
use lighthouse_network::{
|
||||||
Client, MessageId, NetworkGlobals, PeerId, PeerRequestId, Request, Response,
|
Client, MessageId, NetworkGlobals, PeerId, PeerRequestId, Request, Response,
|
||||||
};
|
};
|
||||||
@ -17,12 +17,12 @@ use std::sync::Arc;
|
|||||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||||
use store::SyncCommitteeMessage;
|
use store::SyncCommitteeMessage;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
use types::signed_blobs_sidecar::SignedBlobsSidecar;
|
||||||
use types::{
|
use types::{
|
||||||
Attestation, AttesterSlashing, BlobsSidecar, EthSpec, ProposerSlashing,
|
Attestation, AttesterSlashing, BlobsSidecar, EthSpec, ProposerSlashing,
|
||||||
SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit,
|
SignedAggregateAndProof, SignedBeaconBlock, SignedContributionAndProof, SignedVoluntaryExit,
|
||||||
SubnetId, SyncSubnetId,
|
SubnetId, SyncSubnetId,
|
||||||
};
|
};
|
||||||
use types::signed_blobs_sidecar::SignedBlobsSidecar;
|
|
||||||
|
|
||||||
/// Processes validated messages from the network. It relays necessary data to the syncing thread
|
/// Processes validated messages from the network. It relays necessary data to the syncing thread
|
||||||
/// and processes blocks from the pubsub network.
|
/// and processes blocks from the pubsub network.
|
||||||
|
@ -593,7 +593,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
|||||||
.parent_chain_processed(chain_hash, result, &mut self.network),
|
.parent_chain_processed(chain_hash, result, &mut self.network),
|
||||||
},
|
},
|
||||||
//FIXME(sean)
|
//FIXME(sean)
|
||||||
SyncMessage::RpcBlob { .. } => todo!()
|
SyncMessage::RpcBlob { .. } => todo!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use crate::bls_field_element::BlsFieldElement;
|
use crate::bls_field_element::BlsFieldElement;
|
||||||
use crate::test_utils::RngCore;
|
use crate::test_utils::RngCore;
|
||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use crate::{EthSpec};
|
use crate::EthSpec;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz::{Decode, DecodeError, Encode};
|
use ssz::{Decode, DecodeError, Encode};
|
||||||
use ssz_types::VariableList;
|
use ssz_types::VariableList;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::{Uint256};
|
use crate::Uint256;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use ssz::{Decode, DecodeError, Encode};
|
use ssz::{Decode, DecodeError, Encode};
|
||||||
use tree_hash::{PackedEncoding, TreeHash};
|
use tree_hash::{PackedEncoding, TreeHash};
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
use crate::{
|
use crate::{test_utils::TestRandom, *};
|
||||||
test_utils::TestRandom, *,
|
|
||||||
};
|
|
||||||
use derivative::Derivative;
|
use derivative::Derivative;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use ssz::Encode;
|
use ssz::Encode;
|
||||||
|
Loading…
Reference in New Issue
Block a user