import { ApiClient } from "@lodestar/api"; import { ChainForkConfig } from "@lodestar/config"; import { BLSSignature, Slot, ValidatorIndex } from "@lodestar/types"; import { Metrics } from "../metrics.js"; import { PubkeyHex } from "../types.js"; import { IClock, LoggerVc } from "../util/index.js"; import { SyncingStatusTracker } from "./syncingStatusTracker.js"; import { ValidatorStore } from "./validatorStore.js"; export type SyncDutySubnet = { pubkey: string; /** Index of validator in validator registry. */ validatorIndex: ValidatorIndex; /** * The indices of the validator in the sync committee. * The same validator can appear multiples in the sync committee. Given how sync messages are constructor, the * validator client only cares in which subnets the validator is in, not the specific index. */ subnets: number[]; }; export type SyncSelectionProof = { /** This value is only set to not null if the proof indicates that the validator is an aggregator. */ selectionProof: BLSSignature | null; /** This value will only be set if validator is part of distributed cluster and only has a key share */ partialSelectionProof?: BLSSignature; subcommitteeIndex: number; }; /** Neatly joins SyncDuty with the locally-generated `selectionProof`. */ export type SyncDutyAndProofs = { duty: SyncDutySubnet; /** * Array because the same validator can appear multiple times in the sync committee. * `routes.validator.SyncDuty` `.validatorSyncCommitteeIndices` is an array for that reason. * SelectionProof signs over slot + index in committee, so the length of `.selectionProofs` equals * `.validatorSyncCommitteeIndices`. */ selectionProofs: SyncSelectionProof[]; }; type SyncCommitteeDutiesServiceOpts = { distributedAggregationSelection?: boolean; }; /** * Validators are part of a static long (~27h) sync committee, and part of static subnets. * However, the isAggregator role changes per slot. */ export declare class SyncCommitteeDutiesService { private readonly config; private readonly logger; private readonly api; private readonly clock; private readonly validatorStore; private readonly opts?; /** Maps a validator public key to their duties for each slot */ private readonly dutiesByIndexByPeriod; constructor(config: ChainForkConfig, logger: LoggerVc, api: ApiClient, clock: IClock, validatorStore: ValidatorStore, syncingStatusTracker: SyncingStatusTracker, metrics: Metrics | null, opts?: SyncCommitteeDutiesServiceOpts | undefined); /** * Returns all `ValidatorDuty` for the given `slot` * * Note: The range of slots a validator has to perform duties is off by one. * The previous slot wording means that if your validator is in a sync committee for a period that runs from slot * 100 to 200,then you would actually produce signatures in slot 99 - 199. * https://github.com/ethereum/consensus-specs/pull/2400 */ getDutiesAtSlot(slot: Slot): Promise; removeDutiesForKey(pubkey: PubkeyHex): void; private runDutiesTasks; private pollSyncCommittees; private pollSyncCommitteesForEpoch; private getSelectionProofs; /** Run at least once per period to prune duties map */ private pruneOldDuties; private runDistributedAggregationSelectionTasks; } export {}; //# sourceMappingURL=syncCommitteeDuties.d.ts.map