Skip to content

Commit

Permalink
Merge c8ae86e into 483aad7
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Jun 18, 2023
2 parents 483aad7 + c8ae86e commit a32b230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/validator/src/services/attestationDuties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ export class AttestationDutiesService {
* If a reorg dependent root comes at a slot other than last slot of epoch
* just update this.pendingDependentRootByEpoch() and process here
*/
private prepareForNextEpoch = async (slot: Slot): Promise<void> => {
private prepareForNextEpoch = async (slot: Slot, signal: AbortSignal): Promise<void> => {
// only interested in last slot of epoch
if ((slot + 1) % SLOTS_PER_EPOCH !== 0) {
return;
}

// during the 1 / 3 of epoch, last block of epoch may come
await sleep(this.clock.msToSlot(slot + 1 / 3));
await sleep(this.clock.msToSlot(slot + 1 / 3), signal);

const nextEpoch = computeEpochAtSlot(slot) + 1;
const dependentRoot = this.dutiesByIndexByEpoch.get(nextEpoch)?.dependentRoot;
Expand Down

0 comments on commit a32b230

Please sign in to comment.