@@ -184,7 +184,7 @@ pub struct SyncNetworkContext<T: BeaconChainTypes> {
184
184
/// Mapping of active custody column requests for a block root
185
185
custody_by_root_requests : FnvHashMap < CustodyRequester , ActiveCustodyRequest < T > > ,
186
186
187
- /// BlocksByRange requests paired with BlobsByRange
187
+ /// BlocksByRange requests paired with other ByRange requests for data components
188
188
components_by_range_requests :
189
189
FnvHashMap < ComponentsByRangeRequestId , RangeBlockComponentsRequest < T :: EthSpec > > ,
190
190
@@ -241,7 +241,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
241
241
/// Returns the ids of all the requests made to the given peer_id.
242
242
pub fn peer_disconnected ( & mut self , peer_id : & PeerId ) -> Vec < SyncRequestId > {
243
243
// Note: using destructuring pattern without a default case to make sure we don't forget to
244
- // add new request types to the this function. Otherwise, lookup sync can break and lookups
244
+ // add new request types to this function. Otherwise, lookup sync can break and lookups
245
245
// will get stuck if a peer disconnects during an active requests.
246
246
let Self {
247
247
network_send : _,
@@ -398,7 +398,6 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
398
398
( None , None )
399
399
} ;
400
400
401
- // TODO(pawan): this would break if a batch contains multiple epochs
402
401
let expected_blobs = blobs_req_id. is_some ( ) ;
403
402
let info = RangeBlockComponentsRequest :: new (
404
403
expected_blobs,
@@ -449,7 +448,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
449
448
pub fn range_block_component_response (
450
449
& mut self ,
451
450
id : ComponentsByRangeRequestId ,
452
- block_or_blob : RangeBlockComponent < T :: EthSpec > ,
451
+ range_block_component : RangeBlockComponent < T :: EthSpec > ,
453
452
) -> Option < Result < Vec < RpcBlock < T :: EthSpec > > , RpcResponseError > > {
454
453
let Entry :: Occupied ( mut entry) = self . components_by_range_requests . entry ( id) else {
455
454
metrics:: inc_counter_vec ( & metrics:: SYNC_UNKNOWN_NETWORK_REQUESTS , & [ "range_blocks" ] ) ;
@@ -458,7 +457,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
458
457
459
458
if let Err ( e) = {
460
459
let request = entry. get_mut ( ) ;
461
- match block_or_blob {
460
+ match range_block_component {
462
461
RangeBlockComponent :: Block ( resp) => resp. map ( |( blocks, _) | {
463
462
request. add_blocks ( blocks) ;
464
463
} ) ,
@@ -1099,7 +1098,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
1099
1098
id : DataColumnsByRangeRequestId ,
1100
1099
peer_id : PeerId ,
1101
1100
rpc_event : RpcEvent < Arc < DataColumnSidecar < T :: EthSpec > > > ,
1102
- ) -> Option < RpcResponseResult < Vec < Arc < DataColumnSidecar < T :: EthSpec > > > > > {
1101
+ ) -> Option < RpcResponseResult < DataColumnSidecarList < T :: EthSpec > > > {
1103
1102
let resp = self
1104
1103
. data_columns_by_range_requests
1105
1104
. on_response ( id, rpc_event) ;
0 commit comments