mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
smol bugfix
This commit is contained in:
@@ -824,7 +824,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
|
|
||||||
let should_remove_lookup = match result {
|
let should_remove_lookup = match result {
|
||||||
BlockPartProcessingResult::Ok(status) => match status {
|
BlockPartProcessingResult::Ok(status) => match status {
|
||||||
AvailabilityProcessingStatus::Imported(hash) => {
|
AvailabilityProcessingStatus::Imported(root) => {
|
||||||
trace!(self.log, "Single block processing succeeded"; "block" => %root);
|
trace!(self.log, "Single block processing succeeded"; "block" => %root);
|
||||||
ShouldRemoveLookup::True
|
ShouldRemoveLookup::True
|
||||||
}
|
}
|
||||||
@@ -931,11 +931,11 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
|
|
||||||
match &result {
|
match &result {
|
||||||
BlockPartProcessingResult::Ok(status) => match status {
|
BlockPartProcessingResult::Ok(status) => match status {
|
||||||
AvailabilityProcessingStatus::Imported(hash) => {
|
AvailabilityProcessingStatus::Imported(block_root) => {
|
||||||
trace!(self.log, "Parent block processing succeeded"; &parent_lookup)
|
trace!(self.log, "Parent block processing succeeded"; &parent_lookup, "block_root" => ?block_root)
|
||||||
}
|
}
|
||||||
AvailabilityProcessingStatus::MissingComponents(_, block_root) => {
|
AvailabilityProcessingStatus::MissingComponents(_, block_root) => {
|
||||||
trace!(self.log, "Parent missing parts, triggering single block lookup "; &parent_lookup)
|
trace!(self.log, "Parent missing parts, triggering single block lookup "; &parent_lookup,"block_root" => ?block_root)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
BlockPartProcessingResult::Err(e) => {
|
BlockPartProcessingResult::Err(e) => {
|
||||||
@@ -1066,11 +1066,11 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
debug!(self.log, "Parent chain processed"; "chain_hash" => %chain_hash, "result" => ?result);
|
debug!(self.log, "Parent chain processed"; "chain_hash" => %chain_hash, "result" => ?result);
|
||||||
match result {
|
match result {
|
||||||
BatchProcessResult::Success { .. } => {
|
BatchProcessResult::Success { .. } => {
|
||||||
if let Some((index, (_, _, req))) = self
|
if let Some((index, (_, _, _))) = self
|
||||||
.single_block_lookups
|
.single_block_lookups
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.find(|(index, (_, _, req))| req.requested_block_root == chain_hash)
|
.find(|(_, (_, _, req))| req.requested_block_root == chain_hash)
|
||||||
{
|
{
|
||||||
if let Some((block_id, blob_id, block_wrapper)) = self
|
if let Some((block_id, blob_id, block_wrapper)) = self
|
||||||
.single_block_lookups
|
.single_block_lookups
|
||||||
@@ -1107,9 +1107,8 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
|||||||
imported_blocks: _,
|
imported_blocks: _,
|
||||||
penalty,
|
penalty,
|
||||||
} => {
|
} => {
|
||||||
//TODO(sean) improve peer scoring to block or blob granularity
|
|
||||||
self.failed_chains.insert(chain_hash);
|
self.failed_chains.insert(chain_hash);
|
||||||
let mut all_peers = request.blob_request_state.used_peers.clone();
|
let mut all_peers = request.block_request_state.used_peers.clone();
|
||||||
all_peers.extend(request.blob_request_state.used_peers);
|
all_peers.extend(request.blob_request_state.used_peers);
|
||||||
for peer_id in all_peers {
|
for peer_id in all_peers {
|
||||||
cx.report_peer(peer_id, penalty, "parent_chain_failure")
|
cx.report_peer(peer_id, penalty, "parent_chain_failure")
|
||||||
|
|||||||
Reference in New Issue
Block a user