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 { IBeaconStateView } from "../stateView/interface.js"; import { EpochShuffling } from "./epochShuffling.js"; /** * Block root that decided the proposer shuffling for `proposalEpoch` (keys that shuffling). * Computed for the requested epoch, not `state.epoch`, so it is correct when `state` is one * epoch off the requested epoch (e.g. serving next-epoch duties from the current state). * * Returns `null` when the decision block is not in the state's past (the genesis block decides * its own shuffling, or it has not been produced yet); caller supplies the fallback. */ export declare function proposerShufflingDecisionRoot(fork: ForkName, state: IBeaconStateView, proposalEpoch: Epoch): 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