@@ -35,7 +35,7 @@ use crate::epoch_cache::EpochCache;
3535use crate :: historical_summary:: HistoricalSummary ;
3636pub use eth_spec:: * ;
3737pub use iter:: BlockRootsIter ;
38- pub use milhouse:: { interface:: Interface , List as VList , List , Vector as FixedVector } ;
38+ pub use milhouse:: { interface:: Interface , List , Vector } ;
3939
4040#[ macro_use]
4141mod committee_cache;
@@ -51,8 +51,8 @@ mod tests;
5151pub const CACHED_EPOCHS : usize = 3 ;
5252const MAX_RANDOM_BYTE : u64 = ( 1 << 8 ) - 1 ;
5353
54- pub type Validators < T > = VList < Validator , <T as EthSpec >:: ValidatorRegistryLimit > ;
55- pub type Balances < T > = VList < u64 , <T as EthSpec >:: ValidatorRegistryLimit > ;
54+ pub type Validators < T > = List < Validator , <T as EthSpec >:: ValidatorRegistryLimit > ;
55+ pub type Balances < T > = List < u64 , <T as EthSpec >:: ValidatorRegistryLimit > ;
5656
5757#[ derive( Debug , PartialEq , Clone ) ]
5858pub enum Error {
@@ -328,60 +328,60 @@ where
328328 #[ metastruct( exclude_from( tree_lists) ) ]
329329 pub latest_block_header : BeaconBlockHeader ,
330330 #[ test_random( default ) ]
331- pub block_roots : FixedVector < Hash256 , T :: SlotsPerHistoricalRoot > ,
331+ pub block_roots : Vector < Hash256 , T :: SlotsPerHistoricalRoot > ,
332332 #[ test_random( default ) ]
333- pub state_roots : FixedVector < Hash256 , T :: SlotsPerHistoricalRoot > ,
333+ pub state_roots : Vector < Hash256 , T :: SlotsPerHistoricalRoot > ,
334334 // Frozen in Capella, replaced by historical_summaries
335335 #[ test_random( default ) ]
336- pub historical_roots : VList < Hash256 , T :: HistoricalRootsLimit > ,
336+ pub historical_roots : List < Hash256 , T :: HistoricalRootsLimit > ,
337337
338338 // Ethereum 1.0 chain data
339339 #[ metastruct( exclude_from( tree_lists) ) ]
340340 pub eth1_data : Eth1Data ,
341341 #[ test_random( default ) ]
342342 // FIXME(sproul): excluded due to `rebase_on` issue
343343 #[ metastruct( exclude_from( tree_lists) ) ]
344- pub eth1_data_votes : VList < Eth1Data , T :: SlotsPerEth1VotingPeriod > ,
344+ pub eth1_data_votes : List < Eth1Data , T :: SlotsPerEth1VotingPeriod > ,
345345 #[ superstruct( getter( copy) ) ]
346346 #[ metastruct( exclude_from( tree_lists) ) ]
347347 #[ serde( with = "serde_utils::quoted_u64" ) ]
348348 pub eth1_deposit_index : u64 ,
349349
350350 // Registry
351351 #[ test_random( default ) ]
352- pub validators : VList < GenericValidator , T :: ValidatorRegistryLimit > ,
352+ pub validators : List < GenericValidator , T :: ValidatorRegistryLimit > ,
353353 #[ serde( with = "ssz_types::serde_utils::quoted_u64_var_list" ) ]
354354 #[ compare_fields( as_iter) ]
355355 #[ test_random( default ) ]
356- pub balances : VList < u64 , T :: ValidatorRegistryLimit > ,
356+ pub balances : List < u64 , T :: ValidatorRegistryLimit > ,
357357
358358 // Randomness
359359 #[ test_random( default ) ]
360- pub randao_mixes : FixedVector < Hash256 , T :: EpochsPerHistoricalVector > ,
360+ pub randao_mixes : Vector < Hash256 , T :: EpochsPerHistoricalVector > ,
361361
362362 // Slashings
363363 #[ test_random( default ) ]
364364 #[ serde( with = "ssz_types::serde_utils::quoted_u64_fixed_vec" ) ]
365- pub slashings : FixedVector < u64 , T :: EpochsPerSlashingsVector > ,
365+ pub slashings : Vector < u64 , T :: EpochsPerSlashingsVector > ,
366366
367367 // Attestations (genesis fork only)
368368 // FIXME(sproul): excluded from tree lists due to ResetListDiff
369369 #[ superstruct( only( Base ) ) ]
370370 #[ test_random( default ) ]
371371 #[ metastruct( exclude_from( tree_lists) ) ]
372- pub previous_epoch_attestations : VList < PendingAttestation < T > , T :: MaxPendingAttestations > ,
372+ pub previous_epoch_attestations : List < PendingAttestation < T > , T :: MaxPendingAttestations > ,
373373 #[ superstruct( only( Base ) ) ]
374374 #[ test_random( default ) ]
375375 #[ metastruct( exclude_from( tree_lists) ) ]
376- pub current_epoch_attestations : VList < PendingAttestation < T > , T :: MaxPendingAttestations > ,
376+ pub current_epoch_attestations : List < PendingAttestation < T > , T :: MaxPendingAttestations > ,
377377
378378 // Participation (Altair and later)
379379 #[ superstruct( only( Altair , Merge , Capella , Deneb ) ) ]
380380 #[ test_random( default ) ]
381- pub previous_epoch_participation : VList < ParticipationFlags , T :: ValidatorRegistryLimit > ,
381+ pub previous_epoch_participation : List < ParticipationFlags , T :: ValidatorRegistryLimit > ,
382382 #[ superstruct( only( Altair , Merge , Capella , Deneb ) ) ]
383383 #[ test_random( default ) ]
384- pub current_epoch_participation : VList < ParticipationFlags , T :: ValidatorRegistryLimit > ,
384+ pub current_epoch_participation : List < ParticipationFlags , T :: ValidatorRegistryLimit > ,
385385
386386 // Finality
387387 #[ test_random( default ) ]
@@ -401,7 +401,7 @@ where
401401 #[ serde( with = "ssz_types::serde_utils::quoted_u64_var_list" ) ]
402402 #[ superstruct( only( Altair , Merge , Capella , Deneb ) ) ]
403403 #[ test_random( default ) ]
404- pub inactivity_scores : VList < u64 , T :: ValidatorRegistryLimit > ,
404+ pub inactivity_scores : List < u64 , T :: ValidatorRegistryLimit > ,
405405
406406 // Light-client sync committees
407407 #[ superstruct( only( Altair , Merge , Capella , Deneb ) ) ]
@@ -443,7 +443,7 @@ where
443443 // Deep history valid from Capella onwards.
444444 #[ superstruct( only( Capella , Deneb ) ) ]
445445 #[ test_random( default ) ]
446- pub historical_summaries : VList < HistoricalSummary , T :: HistoricalRootsLimit > ,
446+ pub historical_summaries : List < HistoricalSummary , T :: HistoricalRootsLimit > ,
447447
448448 // Caching (not in the spec)
449449 #[ serde( skip_serializing, skip_deserializing) ]
@@ -510,28 +510,28 @@ impl<T: EthSpec> BeaconState<T> {
510510
511511 // History
512512 latest_block_header : BeaconBlock :: < T > :: empty ( spec) . temporary_block_header ( ) ,
513- block_roots : FixedVector :: default ( ) ,
514- state_roots : FixedVector :: default ( ) ,
515- historical_roots : VList :: default ( ) ,
513+ block_roots : Vector :: default ( ) ,
514+ state_roots : Vector :: default ( ) ,
515+ historical_roots : List :: default ( ) ,
516516
517517 // Eth1
518518 eth1_data,
519- eth1_data_votes : VList :: default ( ) ,
519+ eth1_data_votes : List :: default ( ) ,
520520 eth1_deposit_index : 0 ,
521521
522522 // Validator registry
523- validators : VList :: default ( ) , // Set later.
524- balances : VList :: default ( ) , // Set later.
523+ validators : List :: default ( ) , // Set later.
524+ balances : List :: default ( ) , // Set later.
525525
526526 // Randomness
527- randao_mixes : FixedVector :: default ( ) ,
527+ randao_mixes : Vector :: default ( ) ,
528528
529529 // Slashings
530- slashings : FixedVector :: default ( ) ,
530+ slashings : Vector :: default ( ) ,
531531
532532 // Attestations
533- previous_epoch_attestations : VList :: default ( ) ,
534- current_epoch_attestations : VList :: default ( ) ,
533+ previous_epoch_attestations : List :: default ( ) ,
534+ current_epoch_attestations : List :: default ( ) ,
535535
536536 // Finality
537537 justification_bits : BitVector :: new ( ) ,
@@ -1169,7 +1169,7 @@ impl<T: EthSpec> BeaconState<T> {
11691169
11701170 /// Fill `randao_mixes` with
11711171 pub fn fill_randao_mixes_with ( & mut self , index_root : Hash256 ) -> Result < ( ) , Error > {
1172- * self . randao_mixes_mut ( ) = FixedVector :: from_elem ( index_root) ?;
1172+ * self . randao_mixes_mut ( ) = Vector :: from_elem ( index_root) ?;
11731173 Ok ( ( ) )
11741174 }
11751175
@@ -1303,7 +1303,7 @@ impl<T: EthSpec> BeaconState<T> {
13031303 }
13041304
13051305 /// Get a reference to the entire `slashings` vector.
1306- pub fn get_all_slashings ( & self ) -> & FixedVector < u64 , T :: EpochsPerSlashingsVector > {
1306+ pub fn get_all_slashings ( & self ) -> & Vector < u64 , T :: EpochsPerSlashingsVector > {
13071307 self . slashings ( )
13081308 }
13091309
@@ -1370,9 +1370,9 @@ impl<T: EthSpec> BeaconState<T> {
13701370 (
13711371 & mut Validators < T > ,
13721372 & mut Balances < T > ,
1373- & VList < ParticipationFlags , T :: ValidatorRegistryLimit > ,
1374- & VList < ParticipationFlags , T :: ValidatorRegistryLimit > ,
1375- & mut VList < u64 , T :: ValidatorRegistryLimit > ,
1373+ & List < ParticipationFlags , T :: ValidatorRegistryLimit > ,
1374+ & List < ParticipationFlags , T :: ValidatorRegistryLimit > ,
1375+ & mut List < u64 , T :: ValidatorRegistryLimit > ,
13761376 & mut ProgressiveBalancesCache ,
13771377 & mut ExitCache ,
13781378 & mut EpochCache ,
@@ -1677,7 +1677,7 @@ impl<T: EthSpec> BeaconState<T> {
16771677 epoch : Epoch ,
16781678 previous_epoch : Epoch ,
16791679 current_epoch : Epoch ,
1680- ) -> Result < & mut VList < ParticipationFlags , T :: ValidatorRegistryLimit > , Error > {
1680+ ) -> Result < & mut List < ParticipationFlags , T :: ValidatorRegistryLimit > , Error > {
16811681 if epoch == current_epoch {
16821682 match self {
16831683 BeaconState :: Base ( _) => Err ( BeaconStateError :: IncorrectStateVariant ) ,
@@ -1928,19 +1928,19 @@ impl<T: EthSpec> BeaconState<T> {
19281928 || self . slashings ( ) . has_pending_updates ( )
19291929 || self
19301930 . previous_epoch_attestations ( )
1931- . map_or ( false , VList :: has_pending_updates)
1931+ . map_or ( false , List :: has_pending_updates)
19321932 || self
19331933 . current_epoch_attestations ( )
1934- . map_or ( false , VList :: has_pending_updates)
1934+ . map_or ( false , List :: has_pending_updates)
19351935 || self
19361936 . previous_epoch_participation ( )
1937- . map_or ( false , VList :: has_pending_updates)
1937+ . map_or ( false , List :: has_pending_updates)
19381938 || self
19391939 . current_epoch_participation ( )
1940- . map_or ( false , VList :: has_pending_updates)
1940+ . map_or ( false , List :: has_pending_updates)
19411941 || self
19421942 . inactivity_scores ( )
1943- . map_or ( false , VList :: has_pending_updates)
1943+ . map_or ( false , List :: has_pending_updates)
19441944 }
19451945
19461946 /// Completely drops the `progressive_balances_cache` cache, replacing it with a new, empty cache.
0 commit comments