@@ -13,10 +13,9 @@ use slog::{debug, Logger};
13
13
use std:: num:: NonZeroUsize ;
14
14
use std:: sync:: Arc ;
15
15
use types:: blob_sidecar:: BlobIdentifier ;
16
- use types:: runtime_var_list:: RuntimeFixedList ;
17
16
use types:: {
18
17
BlobSidecar , ChainSpec , ColumnIndex , DataColumnIdentifier , DataColumnSidecar , Epoch , EthSpec ,
19
- Hash256 , RuntimeVariableList , SignedBeaconBlock ,
18
+ Hash256 , RuntimeFixedVector , RuntimeVariableList , SignedBeaconBlock ,
20
19
} ;
21
20
22
21
/// This represents the components of a partially available block
@@ -28,7 +27,7 @@ use types::{
28
27
#[ derive( Clone ) ]
29
28
pub struct PendingComponents < E : EthSpec > {
30
29
pub block_root : Hash256 ,
31
- pub verified_blobs : RuntimeFixedList < Option < KzgVerifiedBlob < E > > > ,
30
+ pub verified_blobs : RuntimeFixedVector < Option < KzgVerifiedBlob < E > > > ,
32
31
pub verified_data_columns : Vec < KzgVerifiedCustodyDataColumn < E > > ,
33
32
pub executed_block : Option < DietAvailabilityPendingExecutedBlock < E > > ,
34
33
pub reconstruction_started : bool ,
@@ -41,7 +40,7 @@ impl<E: EthSpec> PendingComponents<E> {
41
40
}
42
41
43
42
/// Returns an immutable reference to the fixed vector of cached blobs.
44
- pub fn get_cached_blobs ( & self ) -> & RuntimeFixedList < Option < KzgVerifiedBlob < E > > > {
43
+ pub fn get_cached_blobs ( & self ) -> & RuntimeFixedVector < Option < KzgVerifiedBlob < E > > > {
45
44
& self . verified_blobs
46
45
}
47
46
@@ -62,7 +61,7 @@ impl<E: EthSpec> PendingComponents<E> {
62
61
}
63
62
64
63
/// Returns a mutable reference to the fixed vector of cached blobs.
65
- pub fn get_cached_blobs_mut ( & mut self ) -> & mut RuntimeFixedList < Option < KzgVerifiedBlob < E > > > {
64
+ pub fn get_cached_blobs_mut ( & mut self ) -> & mut RuntimeFixedVector < Option < KzgVerifiedBlob < E > > > {
66
65
& mut self . verified_blobs
67
66
}
68
67
@@ -134,7 +133,7 @@ impl<E: EthSpec> PendingComponents<E> {
134
133
/// Blobs are only inserted if:
135
134
/// 1. The blob entry at the index is empty and no block exists.
136
135
/// 2. The block exists and its commitment matches the blob's commitment.
137
- pub fn merge_blobs ( & mut self , blobs : RuntimeFixedList < Option < KzgVerifiedBlob < E > > > ) {
136
+ pub fn merge_blobs ( & mut self , blobs : RuntimeFixedVector < Option < KzgVerifiedBlob < E > > > ) {
138
137
for ( index, blob) in blobs. iter ( ) . cloned ( ) . enumerate ( ) {
139
138
let Some ( blob) = blob else { continue } ;
140
139
self . merge_single_blob ( index, blob) ;
@@ -236,8 +235,7 @@ impl<E: EthSpec> PendingComponents<E> {
236
235
pub fn empty ( block_root : Hash256 , max_len : usize ) -> Self {
237
236
Self {
238
237
block_root,
239
- // TODO(pawan): just make this a vec potentially
240
- verified_blobs : RuntimeFixedList :: new ( vec ! [ None ; max_len] ) ,
238
+ verified_blobs : RuntimeFixedVector :: new ( vec ! [ None ; max_len] ) ,
241
239
verified_data_columns : vec ! [ ] ,
242
240
executed_block : None ,
243
241
reconstruction_started : false ,
@@ -466,7 +464,7 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
466
464
} ;
467
465
468
466
let mut fixed_blobs =
469
- RuntimeFixedList :: new ( vec ! [ None ; self . spec. max_blobs_per_block( epoch) as usize ] ) ;
467
+ RuntimeFixedVector :: new ( vec ! [ None ; self . spec. max_blobs_per_block( epoch) as usize ] ) ;
470
468
471
469
for blob in kzg_verified_blobs {
472
470
if let Some ( blob_opt) = fixed_blobs. get_mut ( blob. blob_index ( ) as usize ) {
@@ -1169,8 +1167,8 @@ mod pending_components_tests {
1169
1167
1170
1168
type Setup < E > = (
1171
1169
SignedBeaconBlock < E > ,
1172
- RuntimeFixedList < Option < Arc < BlobSidecar < E > > > > ,
1173
- RuntimeFixedList < Option < Arc < BlobSidecar < E > > > > ,
1170
+ RuntimeFixedVector < Option < Arc < BlobSidecar < E > > > > ,
1171
+ RuntimeFixedVector < Option < Arc < BlobSidecar < E > > > > ,
1174
1172
usize ,
1175
1173
) ;
1176
1174
@@ -1180,17 +1178,17 @@ mod pending_components_tests {
1180
1178
let ( block, blobs_vec) =
1181
1179
generate_rand_block_and_blobs :: < E > ( ForkName :: Deneb , NumBlobs :: Random , & mut rng, & spec) ;
1182
1180
let max_len = spec. max_blobs_per_block ( block. epoch ( ) ) as usize ;
1183
- let mut blobs: RuntimeFixedList < Option < Arc < BlobSidecar < E > > > > =
1184
- RuntimeFixedList :: default ( max_len) ;
1181
+ let mut blobs: RuntimeFixedVector < Option < Arc < BlobSidecar < E > > > > =
1182
+ RuntimeFixedVector :: default ( max_len) ;
1185
1183
1186
1184
for blob in blobs_vec {
1187
1185
if let Some ( b) = blobs. get_mut ( blob. index as usize ) {
1188
1186
* b = Some ( Arc :: new ( blob) ) ;
1189
1187
}
1190
1188
}
1191
1189
1192
- let mut invalid_blobs: RuntimeFixedList < Option < Arc < BlobSidecar < E > > > > =
1193
- RuntimeFixedList :: default ( max_len) ;
1190
+ let mut invalid_blobs: RuntimeFixedVector < Option < Arc < BlobSidecar < E > > > > =
1191
+ RuntimeFixedVector :: default ( max_len) ;
1194
1192
for ( index, blob) in blobs. iter ( ) . enumerate ( ) {
1195
1193
if let Some ( invalid_blob) = blob {
1196
1194
let mut blob_copy = invalid_blob. as_ref ( ) . clone ( ) ;
@@ -1204,16 +1202,16 @@ mod pending_components_tests {
1204
1202
1205
1203
type PendingComponentsSetup < E > = (
1206
1204
DietAvailabilityPendingExecutedBlock < E > ,
1207
- RuntimeFixedList < Option < KzgVerifiedBlob < E > > > ,
1208
- RuntimeFixedList < Option < KzgVerifiedBlob < E > > > ,
1205
+ RuntimeFixedVector < Option < KzgVerifiedBlob < E > > > ,
1206
+ RuntimeFixedVector < Option < KzgVerifiedBlob < E > > > ,
1209
1207
) ;
1210
1208
1211
1209
pub fn setup_pending_components (
1212
1210
block : SignedBeaconBlock < E > ,
1213
- valid_blobs : RuntimeFixedList < Option < Arc < BlobSidecar < E > > > > ,
1214
- invalid_blobs : RuntimeFixedList < Option < Arc < BlobSidecar < E > > > > ,
1211
+ valid_blobs : RuntimeFixedVector < Option < Arc < BlobSidecar < E > > > > ,
1212
+ invalid_blobs : RuntimeFixedVector < Option < Arc < BlobSidecar < E > > > > ,
1215
1213
) -> PendingComponentsSetup < E > {
1216
- let blobs = RuntimeFixedList :: new (
1214
+ let blobs = RuntimeFixedVector :: new (
1217
1215
valid_blobs
1218
1216
. iter ( )
1219
1217
. map ( |blob_opt| {
@@ -1223,7 +1221,7 @@ mod pending_components_tests {
1223
1221
} )
1224
1222
. collect :: < Vec < _ > > ( ) ,
1225
1223
) ;
1226
- let invalid_blobs = RuntimeFixedList :: new (
1224
+ let invalid_blobs = RuntimeFixedVector :: new (
1227
1225
invalid_blobs
1228
1226
. iter ( )
1229
1227
. map ( |blob_opt| {
0 commit comments