@@ -78,6 +78,7 @@ pub const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
7878/// proposer. Having a capacity > 1 is an optimization to prevent sync lookup from having re-fetch
7979/// data during moments of unstable network conditions.
8080pub struct DataAvailabilityChecker < T : BeaconChainTypes > {
81+ complete_blob_backfill : bool ,
8182 availability_cache : Arc < DataAvailabilityCheckerInner < T > > ,
8283 slot_clock : T :: SlotClock ,
8384 kzg : Arc < Kzg > ,
@@ -116,6 +117,7 @@ impl<E: EthSpec> Debug for Availability<E> {
116117
117118impl < T : BeaconChainTypes > DataAvailabilityChecker < T > {
118119 pub fn new (
120+ complete_blob_backfill : bool ,
119121 slot_clock : T :: SlotClock ,
120122 kzg : Arc < Kzg > ,
121123 store : BeaconStore < T > ,
@@ -129,6 +131,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
129131 spec. clone ( ) ,
130132 ) ?;
131133 Ok ( Self {
134+ complete_blob_backfill,
132135 availability_cache : Arc :: new ( inner) ,
133136 slot_clock,
134137 kzg,
@@ -518,9 +521,15 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
518521 /// The epoch at which we require a data availability check in block processing.
519522 /// `None` if the `Deneb` fork is disabled.
520523 pub fn data_availability_boundary ( & self ) -> Option < Epoch > {
521- let current_epoch = self . slot_clock . now ( ) ?. epoch ( T :: EthSpec :: slots_per_epoch ( ) ) ;
522- self . spec
523- . min_epoch_data_availability_boundary ( current_epoch)
524+ let fork_epoch = self . spec . deneb_fork_epoch ?;
525+
526+ if self . complete_blob_backfill {
527+ Some ( fork_epoch)
528+ } else {
529+ let current_epoch = self . slot_clock . now ( ) ?. epoch ( T :: EthSpec :: slots_per_epoch ( ) ) ;
530+ self . spec
531+ . min_epoch_data_availability_boundary ( current_epoch)
532+ }
524533 }
525534
526535 /// Returns true if the given epoch lies within the da boundary and false otherwise.
@@ -1076,7 +1085,15 @@ mod test {
10761085 let kzg = get_kzg ( & spec) ;
10771086 let store = Arc :: new ( HotColdDB :: open_ephemeral ( <_ >:: default ( ) , spec. clone ( ) ) . unwrap ( ) ) ;
10781087 let custody_context = Arc :: new ( CustodyContext :: new ( false ) ) ;
1079- DataAvailabilityChecker :: new ( slot_clock, kzg, store, custody_context, spec)
1080- . expect ( "should initialise data availability checker" )
1088+ let complete_blob_backfill = false ;
1089+ DataAvailabilityChecker :: new (
1090+ complete_blob_backfill,
1091+ slot_clock,
1092+ kzg,
1093+ store,
1094+ custody_context,
1095+ spec,
1096+ )
1097+ . expect ( "should initialise data availability checker" )
10811098 }
10821099}
0 commit comments