track information about peer source

This commit is contained in:
realbigsean
2023-05-02 12:28:32 -04:00
parent 8edefb7e0d
commit 56b2365e17
5 changed files with 1081 additions and 751 deletions

View File

@@ -34,7 +34,7 @@
//! search for the block and subsequently search for parents if needed.
use super::backfill_sync::{BackFillSync, ProcessResult, SyncStart};
use super::block_lookups::{BlockLookups, PeerShouldHave};
use super::block_lookups::{BlockLookups, PeerSource};
use super::network_context::{BlockOrBlob, SyncNetworkContext};
use super::peer_sync_info::{remote_sync_type, PeerSyncType};
use super::range_sync::{RangeSync, RangeSyncType, EPOCHS_PER_BATCH};
@@ -700,8 +700,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
if self.synced_and_connected(&peer_id) {
self.block_lookups.search_block(
block_hash,
peer_id,
PeerShouldHave::BlockAndBlobs,
PeerSource::Attestation(peer_id),
&mut self.network,
);
}
@@ -719,8 +718,7 @@ impl<T: BeaconChainTypes> SyncManager<T> {
} else {
self.block_lookups.search_block(
block_hash,
peer_id,
PeerShouldHave::Neither,
PeerSource::Gossip(peer_id),
&mut self.network,
)
}