mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Part of - https://github.com/sigp/lighthouse/issues/6258 `RangeBlockComponentsRequest` handles a set of by_range requests. It's quite lose on these requests, not tracking them by ID. We want to implement individual request retries, so we must make `RangeBlockComponentsRequest` aware of its requests IDs. We don't want the result of a prior by_range request to affect the state of a future retry. Lookup sync uses this mechanism. Now `RangeBlockComponentsRequest` tracks: ```rust pub struct RangeBlockComponentsRequest<E: EthSpec> { blocks_request: ByRangeRequest<BlocksByRangeRequestId, Vec<Arc<SignedBeaconBlock<E>>>>, block_data_request: RangeBlockDataRequest<E>, } enum RangeBlockDataRequest<E: EthSpec> { NoData, Blobs(ByRangeRequest<BlobsByRangeRequestId, Vec<Arc<BlobSidecar<E>>>>), DataColumns { requests: HashMap< DataColumnsByRangeRequestId, ByRangeRequest<DataColumnsByRangeRequestId, DataColumnSidecarList<E>>, >, expected_custody_columns: Vec<ColumnIndex>, }, } enum ByRangeRequest<I: PartialEq + std::fmt::Display, T> { Active(I), Complete(T), } ``` I have merged `is_finished` and `Into_responses` into the same function. Otherwise, we need to duplicate the logic to figure out if the requests are done.