Skip to content

Commit 80d3598

Browse files
committed
Fix merge issues
1 parent 4157c84 commit 80d3598

File tree

3 files changed

+21
-32
lines changed

3 files changed

+21
-32
lines changed

beacon_node/lighthouse_network/src/service/api_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub struct ComponentsByRangeRequestId {
8585
/// Range sync chain or backfill batch
8686
#[derive(Debug, Hash, PartialEq, Eq, Clone, Copy)]
8787
pub enum RangeRequestId {
88-
RangeSync { chain_id: u64, batch_id: Epoch },
88+
RangeSync { chain_id: Id, batch_id: Epoch },
8989
BackfillSync { batch_id: Epoch },
9090
}
9191

beacon_node/network/src/sync/network_context.rs

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
263263
execution_engine_state: _,
264264
network_beacon_processor: _,
265265
chain: _,
266+
fork_context: _,
266267
log: _,
267268
} = self;
268269

@@ -382,26 +383,15 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
382383
if matches!(batch_type, ByRangeRequestType::BlocksAndColumns) {
383384
let column_indexes = self.network_globals().sampling_columns.clone();
384385

385-
for (peer_id, columns_by_range_request) in
386-
self.make_columns_by_range_requests(request, &column_indexes)?
387-
{
388-
requested_peers.push(peer_id);
389-
390-
debug!(
391-
self.log,
392-
"Sending DataColumnsByRange requests";
393-
"method" => "DataColumnsByRange",
394-
"count" => columns_by_range_request.count,
395-
"epoch" => epoch,
396-
"columns" => ?columns_by_range_request.columns,
397-
"peer" => %peer_id,
398-
"id" => id,
399-
);
400-
401-
self.send_network_msg(NetworkMessage::SendRequest {
402-
peer_id,
403-
request: RequestType::DataColumnsByRange(columns_by_range_request),
404-
request_id: AppRequestId::Sync(SyncRequestId::RangeBlockAndBlobs { id }),
386+
let data_column_requests = self
387+
.make_columns_by_range_requests(request, &column_indexes)?
388+
.into_iter()
389+
.map(|(peer_id, columns_by_range_request)| {
390+
self.send_data_columns_by_range_request(
391+
peer_id,
392+
columns_by_range_request,
393+
id,
394+
)
405395
})
406396
.collect::<Result<Vec<_>, _>>()?;
407397

beacon_node/network/src/sync/tests/range.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use lighthouse_network::rpc::methods::{
1212
};
1313
use lighthouse_network::rpc::{RequestType, StatusMessage};
1414
use lighthouse_network::service::api_types::{
15-
AppRequestId, BlobsByRangeRequestId, BlocksByRangeRequestId, SyncRequestId,
15+
AppRequestId, BlobsByRangeRequestId, BlocksByRangeRequestId, DataColumnsByRangeRequestId,
16+
SyncRequestId,
1617
};
1718
use lighthouse_network::{PeerId, SyncInfo};
1819
use std::time::Duration;
@@ -30,8 +31,8 @@ pub(crate) enum DataSidecars<E: EthSpec> {
3031

3132
enum ByRangeDataRequestIds {
3233
PreDeneb,
33-
PrePeerDAS(Id, PeerId),
34-
PostPeerDAS(Vec<(Id, PeerId)>),
34+
PrePeerDAS(BlobsByRangeRequestId, PeerId),
35+
PostPeerDAS(Vec<(DataColumnsByRangeRequestId, PeerId)>),
3536
}
3637

3738
/// Sync tests are usually written in the form:
@@ -152,10 +153,8 @@ impl TestRig {
152153

153154
fn find_blocks_by_range_request(
154155
&mut self,
155-
target_peer_id: &PeerId,
156-
) -> (BlocksByRangeRequestId, Option<BlobsByRangeRequestId>) {
157156
request_filter: RequestFilter,
158-
) -> ((Id, PeerId), ByRangeDataRequestIds) {
157+
) -> ((BlocksByRangeRequestId, PeerId), ByRangeDataRequestIds) {
159158
let filter_f = |peer: PeerId, start_slot: u64| {
160159
if let Some(expected_epoch) = request_filter.epoch {
161160
let epoch = Slot::new(start_slot).epoch(E::slots_per_epoch()).as_u64();
@@ -194,7 +193,7 @@ impl TestRig {
194193
RequestType::DataColumnsByRange(DataColumnsByRangeRequest {
195194
start_slot, ..
196195
}),
197-
request_id: AppRequestId::Sync(SyncRequestId::RangeBlockAndBlobs { id }),
196+
request_id: AppRequestId::Sync(SyncRequestId::DataColumnsByRange(id)),
198197
} if filter_f(*peer_id, *start_slot) => Some((*id, *peer_id)),
199198
_ => None,
200199
}) {
@@ -243,10 +242,10 @@ impl TestRig {
243242
ByRangeDataRequestIds::PrePeerDAS(id, peer_id) => {
244243
// Complete the request with a single stream termination
245244
self.log(&format!(
246-
"Completing BlobsByRange request {id} with empty stream"
245+
"Completing BlobsByRange request {id:?} with empty stream"
247246
));
248247
self.send_sync_message(SyncMessage::RpcBlob {
249-
request_id: SyncRequestId::BlobsByRange(blobs_req_id),
248+
request_id: SyncRequestId::BlobsByRange(id),
250249
peer_id,
251250
blob_sidecar: None,
252251
seen_timestamp: D,
@@ -256,10 +255,10 @@ impl TestRig {
256255
// Complete the request with a single stream termination
257256
for (id, peer_id) in data_column_req_ids {
258257
self.log(&format!(
259-
"Completing DataColumnsByRange request {id} with empty stream"
258+
"Completing DataColumnsByRange request {id:?} with empty stream"
260259
));
261260
self.send_sync_message(SyncMessage::RpcDataColumn {
262-
request_id: SyncRequestId::DataColumnsByRange( id ),
261+
request_id: SyncRequestId::DataColumnsByRange(id),
263262
peer_id,
264263
data_column: None,
265264
seen_timestamp: D,

0 commit comments

Comments
 (0)