This commit is contained in:
Eitan Seri-Levi
2025-02-10 00:37:04 +02:00
parent 30136ad571
commit f790c22123
4 changed files with 14 additions and 8 deletions

View File

@@ -12,9 +12,7 @@ pub fn inclusion_list_duties<T: BeaconChainTypes>(
request_indices: &[u64], request_indices: &[u64],
chain: &BeaconChain<T>, chain: &BeaconChain<T>,
) -> Result<ApiDuties, warp::reject::Rejection> { ) -> Result<ApiDuties, warp::reject::Rejection> {
let current_epoch = chain let current_epoch = chain.epoch().map_err(warp_utils::reject::unhandled_error)?;
.epoch()
.map_err(warp_utils::reject::unhandled_error)?;
// Determine what the current epoch would be if we fast-forward our system clock by // Determine what the current epoch would be if we fast-forward our system clock by
// `MAXIMUM_GOSSIP_CLOCK_DISPARITY`. // `MAXIMUM_GOSSIP_CLOCK_DISPARITY`.

View File

@@ -2674,7 +2674,11 @@ impl ApiTester {
let slot = self.chain.slot().unwrap(); let slot = self.chain.slot().unwrap();
self.harness.extend_to_slot(slot).await; self.harness.extend_to_slot(slot).await;
for validator_indices in self.interesting_validator_indices() { for validator_indices in self.interesting_validator_indices() {
let res = self.client.post_validator_duties_inclusion_list(current_epoch, &validator_indices).await.unwrap(); let res = self
.client
.post_validator_duties_inclusion_list(current_epoch, &validator_indices)
.await
.unwrap();
println!("{:?}", res) println!("{:?}", res)
} }
self self

View File

@@ -339,7 +339,7 @@ impl<T: SlotClock + 'static, E: EthSpec> DutiesService<T, E> {
let epoch = slot.epoch(E::slots_per_epoch()); let epoch = slot.epoch(E::slots_per_epoch());
if !self.spec.is_focil_enabled_for_epoch(epoch) { if !self.spec.is_focil_enabled_for_epoch(epoch) {
return vec![] return vec![];
} }
// Only collect validators that are considered safe in terms of doppelganger protection. // Only collect validators that are considered safe in terms of doppelganger protection.

View File

@@ -113,11 +113,15 @@ impl<T: SlotClock + 'static, E: EthSpec> InclusionListService<T, E> {
/// Spawn a new task that downloads, signs and uploads the inclusion lists to the beacon node. /// Spawn a new task that downloads, signs and uploads the inclusion lists to the beacon node.
// TODO(focil) I don't think we need `slot_duration` here, unless we need to make some calculation // TODO(focil) I don't think we need `slot_duration` here, unless we need to make some calculation
// related to the freeze deadline. // related to the freeze deadline.
fn spawn_inclusion_list_task(&self, _slot_duration: Duration, spec: &ChainSpec) -> Result<(), String> { fn spawn_inclusion_list_task(
&self,
_slot_duration: Duration,
spec: &ChainSpec,
) -> Result<(), String> {
let slot = self.slot_clock.now().ok_or("Failed to read slot clock")?; let slot = self.slot_clock.now().ok_or("Failed to read slot clock")?;
if !spec.is_focil_enabled_for_epoch(slot.epoch(E::slots_per_epoch())) { if !spec.is_focil_enabled_for_epoch(slot.epoch(E::slots_per_epoch())) {
return Ok(()) return Ok(());
} }
// TODO(focil) unused variable // TODO(focil) unused variable