import { ForkName, ForkSeq } from "@lodestar/params"; import { Attestation, CommitteeIndex, Epoch, IndexedAttestation, Root, Slot, ValidatorIndex } from "@lodestar/types"; import { LodestarError } from "@lodestar/utils"; import { CachedBeaconStateAllForks } from "../cache/stateCache.js"; import { EpochShuffling } from "./epochShuffling.js"; /** * Returns the block root which decided the proposer shuffling for the current epoch. This root * can be used to key this proposer shuffling. * * Returns `null` on the one-off scenario where the genesis block decides its own shuffling. * It should be set to the latest block applied to this `state` or the genesis block root. */ export declare function proposerShufflingDecisionRoot(fork: ForkName, state: CachedBeaconStateAllForks): Root | null; /** * Returns the block root which decided the attester shuffling for the given `requestedEpoch`. * This root can be used to key that attester shuffling. * * Returns `null` on the one-off scenario where the genesis block decides its own shuffling. * It should be set to the latest block applied to this `state` or the genesis block root. */ export declare function attesterShufflingDecisionRoot(state: CachedBeaconStateAllForks, requestedEpoch: Epoch): Root | null; export interface AttesterDuty { validatorIndex: ValidatorIndex; committeeIndex: CommitteeIndex; committeeLength: number; committeesAtSlot: number; validatorCommitteeIndex: number; slot: Slot; } export declare function calculateCommitteeAssignments(epochShuffling: EpochShuffling, requestedValidatorIndices: ValidatorIndex[]): Map; /** * Return the indexed attestation corresponding to ``attestation``. */ export declare function getIndexedAttestation(epochShuffling: EpochShuffling, fork: ForkSeq, attestation: Attestation): IndexedAttestation; /** * Return indices of validators who attestested in `attestation` */ export declare function getAttestingIndices(epochShuffling: EpochShuffling, fork: ForkSeq, attestation: Attestation): number[]; /** * Return the beacon committee at slot for index. */ export declare function getBeaconCommittee(epochShuffling: EpochShuffling, slot: Slot, index: CommitteeIndex): Uint32Array; /** * Return a Uint32Array[] representing committees validator indices */ export declare function getBeaconCommittees(epochShuffling: EpochShuffling, slot: Slot, indices: CommitteeIndex[]): Uint32Array[]; export declare enum ShufflingErrorCode { COMMITTEE_INDEX_OUT_OF_RANGE = "SHUFFLING_ERROR_COMMITTEE_INDEX_OUT_OF_RANGE" } type ShufflingErrorType = { code: ShufflingErrorCode.COMMITTEE_INDEX_OUT_OF_RANGE; index: number; maxIndex: number; }; export declare class ShufflingError extends LodestarError { } export {}; //# sourceMappingURL=shuffling.d.ts.map