@@ -2,7 +2,7 @@ use std::sync::Arc;
2
2
3
3
use libp2p:: swarm:: ConnectionId ;
4
4
use types:: {
5
- BlobSidecar , DataColumnSidecar , EthSpec , Hash256 , LightClientBootstrap ,
5
+ BlobSidecar , DataColumnSidecar , Epoch , EthSpec , Hash256 , LightClientBootstrap ,
6
6
LightClientFinalityUpdate , LightClientOptimisticUpdate , LightClientUpdate , SignedBeaconBlock ,
7
7
} ;
8
8
@@ -31,8 +31,12 @@ pub enum SyncRequestId {
31
31
SingleBlob { id : SingleLookupReqId } ,
32
32
/// Request searching for a set of data columns given a hash and list of column indices.
33
33
DataColumnsByRoot ( DataColumnsByRootRequestId ) ,
34
- /// Range request that is composed by both a block range request and a blob range request.
35
- RangeBlockAndBlobs { id : Id } ,
34
+ /// Blocks by range request
35
+ BlocksByRange ( BlocksByRangeRequestId ) ,
36
+ /// Blobs by range request
37
+ BlobsByRange ( BlobsByRangeRequestId ) ,
38
+ /// Data columns by range request
39
+ DataColumnsByRange ( DataColumnsByRangeRequestId ) ,
36
40
}
37
41
38
42
/// Request ID for data_columns_by_root requests. Block lookups do not issue this request directly.
@@ -43,12 +47,60 @@ pub struct DataColumnsByRootRequestId {
43
47
pub requester : DataColumnsByRootRequester ,
44
48
}
45
49
50
+ #[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
51
+ pub struct BlocksByRangeRequestId {
52
+ /// Id to identify this attempt at a blocks_by_range request for `parent_request_id`
53
+ pub id : Id ,
54
+ /// The Id of the overall By Range request for block components.
55
+ pub parent_request_id : ComponentsByRangeRequestId ,
56
+ }
57
+
58
+ #[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
59
+ pub struct BlobsByRangeRequestId {
60
+ /// Id to identify this attempt at a blobs_by_range request for `parent_request_id`
61
+ pub id : Id ,
62
+ /// The Id of the overall By Range request for block components.
63
+ pub parent_request_id : ComponentsByRangeRequestId ,
64
+ }
65
+
66
+ #[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
67
+ pub struct DataColumnsByRangeRequestId {
68
+ /// Id to identify this attempt at a data_columns_by_range request for `parent_request_id`
69
+ pub id : Id ,
70
+ /// The Id of the overall By Range request for block components.
71
+ pub parent_request_id : ComponentsByRangeRequestId ,
72
+ }
73
+
74
+ /// Block components by range request for range sync. Includes an ID for downstream consumers to
75
+ /// handle retries and tie all their sub requests together.
76
+ #[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
77
+ pub struct ComponentsByRangeRequestId {
78
+ /// Each `RangeRequestId` may request the same data in a later retry. This Id identifies the
79
+ /// current attempt.
80
+ pub id : Id ,
81
+ /// What sync component is issuing a components by range request and expecting data back
82
+ pub requester : RangeRequestId ,
83
+ }
84
+
85
+ /// Range sync chain or backfill batch
86
+ #[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
87
+ pub enum RangeRequestId {
88
+ RangeSync { chain_id : Id , batch_id : Epoch } ,
89
+ BackfillSync { batch_id : Epoch } ,
90
+ }
91
+
46
92
#[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
47
93
pub enum DataColumnsByRootRequester {
48
94
Sampling ( SamplingId ) ,
49
95
Custody ( CustodyId ) ,
50
96
}
51
97
98
+ #[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
99
+ pub enum RangeRequester {
100
+ RangeSync { chain_id : u64 , batch_id : Epoch } ,
101
+ BackfillSync { batch_id : Epoch } ,
102
+ }
103
+
52
104
#[ derive( Debug , Hash , PartialEq , Eq , Clone , Copy ) ]
53
105
pub struct SamplingId {
54
106
pub id : SamplingRequester ,
0 commit comments