mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
* Add plumbing for peerdas supernodes (#5050, #5409, #5570, #5966) - add cli option `--subscribe-to-all-data-columns` - add custody subnet count to ENR, only if PeerDAS is scheduled - subscribe to data column topics, only if PeerDAS is scheduled Co-authored-by: Jacob Kaufmann <jacobkaufmann18@gmail.com> * Merge branch 'unstable' into das-supernode * Update CLI docs. * Merge branch 'unstable' into das-supernode * Fix fork epoch comparison with `FAR_FUTURE_EPOCH`. * Merge branch 'unstable' into das-supernode * Hide `--subscribe-all-data-column-subnets` flag and update help. * Fix docs only * Merge branch 'unstable' into das-supernode
This commit is contained in:
@@ -104,6 +104,7 @@ pub struct BeaconChainBuilder<T: BeaconChainTypes> {
|
||||
kzg: Option<Arc<Kzg>>,
|
||||
task_executor: Option<TaskExecutor>,
|
||||
validator_monitor_config: Option<ValidatorMonitorConfig>,
|
||||
import_all_data_columns: bool,
|
||||
}
|
||||
|
||||
impl<TSlotClock, TEth1Backend, E, THotStore, TColdStore>
|
||||
@@ -145,6 +146,7 @@ where
|
||||
kzg: None,
|
||||
task_executor: None,
|
||||
validator_monitor_config: None,
|
||||
import_all_data_columns: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,6 +617,12 @@ where
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets whether to require and import all data columns when importing block.
|
||||
pub fn import_all_data_columns(mut self, import_all_data_columns: bool) -> Self {
|
||||
self.import_all_data_columns = import_all_data_columns;
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the `BeaconChain` event handler backend.
|
||||
///
|
||||
/// For example, provide `ServerSentEventHandler` as a `handler`.
|
||||
@@ -965,8 +973,15 @@ where
|
||||
validator_monitor: RwLock::new(validator_monitor),
|
||||
genesis_backfill_slot,
|
||||
data_availability_checker: Arc::new(
|
||||
DataAvailabilityChecker::new(slot_clock, self.kzg.clone(), store, &log, self.spec)
|
||||
.map_err(|e| format!("Error initializing DataAvailabiltyChecker: {:?}", e))?,
|
||||
DataAvailabilityChecker::new(
|
||||
slot_clock,
|
||||
self.kzg.clone(),
|
||||
store,
|
||||
self.import_all_data_columns,
|
||||
&log,
|
||||
self.spec,
|
||||
)
|
||||
.map_err(|e| format!("Error initializing DataAvailabilityChecker: {:?}", e))?,
|
||||
),
|
||||
kzg: self.kzg.clone(),
|
||||
};
|
||||
|
||||
@@ -95,11 +95,16 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
|
||||
slot_clock: T::SlotClock,
|
||||
kzg: Option<Arc<Kzg>>,
|
||||
store: BeaconStore<T>,
|
||||
import_all_data_columns: bool,
|
||||
log: &Logger,
|
||||
spec: ChainSpec,
|
||||
) -> Result<Self, AvailabilityCheckError> {
|
||||
// TODO(das): support supernode or custom custody requirement
|
||||
let custody_subnet_count = spec.custody_requirement as usize;
|
||||
let custody_subnet_count = if import_all_data_columns {
|
||||
spec.data_column_sidecar_subnet_count as usize
|
||||
} else {
|
||||
spec.custody_requirement as usize
|
||||
};
|
||||
|
||||
let custody_column_count =
|
||||
custody_subnet_count.saturating_mul(spec.data_columns_per_subnet());
|
||||
|
||||
@@ -112,8 +117,8 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
|
||||
Ok(Self {
|
||||
availability_cache: Arc::new(overflow_cache),
|
||||
slot_clock,
|
||||
log: log.clone(),
|
||||
kzg,
|
||||
log: log.clone(),
|
||||
spec,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user