@@ -78,6 +78,7 @@ pub const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
78
78
/// proposer. Having a capacity > 1 is an optimization to prevent sync lookup from having re-fetch
79
79
/// data during moments of unstable network conditions.
80
80
pub struct DataAvailabilityChecker < T : BeaconChainTypes > {
81
+ complete_blob_backfill : bool ,
81
82
availability_cache : Arc < DataAvailabilityCheckerInner < T > > ,
82
83
slot_clock : T :: SlotClock ,
83
84
kzg : Arc < Kzg > ,
@@ -116,6 +117,7 @@ impl<E: EthSpec> Debug for Availability<E> {
116
117
117
118
impl < T : BeaconChainTypes > DataAvailabilityChecker < T > {
118
119
pub fn new (
120
+ complete_blob_backfill : bool ,
119
121
slot_clock : T :: SlotClock ,
120
122
kzg : Arc < Kzg > ,
121
123
store : BeaconStore < T > ,
@@ -129,6 +131,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
129
131
spec. clone ( ) ,
130
132
) ?;
131
133
Ok ( Self {
134
+ complete_blob_backfill,
132
135
availability_cache : Arc :: new ( inner) ,
133
136
slot_clock,
134
137
kzg,
@@ -518,9 +521,15 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
518
521
/// The epoch at which we require a data availability check in block processing.
519
522
/// `None` if the `Deneb` fork is disabled.
520
523
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
+ }
524
533
}
525
534
526
535
/// Returns true if the given epoch lies within the da boundary and false otherwise.
@@ -1076,7 +1085,15 @@ mod test {
1076
1085
let kzg = get_kzg ( & spec) ;
1077
1086
let store = Arc :: new ( HotColdDB :: open_ephemeral ( <_ >:: default ( ) , spec. clone ( ) ) . unwrap ( ) ) ;
1078
1087
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" )
1081
1098
}
1082
1099
}
0 commit comments