mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 05:18:30 +00:00
Fix custodial peer assumption on lookup custody requests (#6815)
* Fix custodial peer assumption on lookup custody requests * lint
This commit is contained in:
@@ -153,14 +153,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
pub(crate) fn active_single_lookups(&self) -> Vec<BlockLookupSummary> {
|
||||
self.single_block_lookups
|
||||
.iter()
|
||||
.map(|(id, l)| {
|
||||
(
|
||||
*id,
|
||||
l.block_root(),
|
||||
l.awaiting_parent(),
|
||||
l.all_peers().copied().collect(),
|
||||
)
|
||||
})
|
||||
.map(|(id, l)| (*id, l.block_root(), l.awaiting_parent(), l.all_peers()))
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -283,7 +276,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
.find(|(_, l)| l.block_root() == parent_chain_tip)
|
||||
{
|
||||
cx.send_sync_message(SyncMessage::AddPeersForceRangeSync {
|
||||
peers: lookup.all_peers().copied().collect(),
|
||||
peers: lookup.all_peers(),
|
||||
head_slot: tip_lookup.peek_downloaded_block_slot(),
|
||||
head_root: parent_chain_tip,
|
||||
});
|
||||
@@ -682,7 +675,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
|
||||
lookup.continue_requests(cx)
|
||||
}
|
||||
Action::ParentUnknown { parent_root } => {
|
||||
let peers = lookup.all_peers().copied().collect::<Vec<_>>();
|
||||
let peers = lookup.all_peers();
|
||||
lookup.set_awaiting_parent(parent_root);
|
||||
debug!(self.log, "Marking lookup as awaiting parent"; "id" => lookup.id, "block_root" => ?block_root, "parent_root" => ?parent_root);
|
||||
self.search_parent_of_child(parent_root, block_root, &peers, cx);
|
||||
|
||||
Reference in New Issue
Block a user