import { CompactMultiProof } from "@chainsafe/persistent-merkle-tree"; import { BitArray, ByteViews } from "@chainsafe/ssz"; import { ForkName, ForkSeq } from "@lodestar/params"; import { BeaconBlock, BeaconState, BlindedBeaconBlock, BuilderIndex, Bytes32, CommitteeIndex, Epoch, ExecutionPayloadBid, ExecutionPayloadHeader, Root, RootHex, SignedBeaconBlock, SignedBlindedBeaconBlock, Slot, SyncCommittee, ValidatorIndex, capella, electra, fulu, gloas, phase0, rewards } from "@lodestar/types"; import { Checkpoint, Fork } from "@lodestar/types/phase0"; import { VoluntaryExitValidity } from "../block/processVoluntaryExit.js"; import { EffectiveBalanceIncrements } from "../cache/effectiveBalanceIncrements.js"; import { RewardCache } from "../cache/rewardCache.js"; import { CachedBeaconStateAllForks } from "../cache/stateCache.js"; import { SyncCommitteeCache } from "../cache/syncCommitteeCache.js"; import { SyncCommitteeWitness } from "../lightClient/types.js"; import { StateTransitionModules, StateTransitionOpts } from "../stateTransition.js"; import { EpochShuffling } from "../util/epochShuffling.js"; import { PreVerifyBuilderDepositsResult } from "../util/preVerifyBuilderDeposits.js"; import { ComputeNewStateRootInput, ComputeNewStateRootResult, IBeaconStateView, IBeaconStateViewGloas, IBeaconStateViewLatestFork } from "./interface.js"; export declare class BeaconStateView implements IBeaconStateViewLatestFork { readonly cachedState: CachedBeaconStateAllForks; private readonly config; private _fork; private _latestBlockHeader; private _currentSyncCommittee; private _nextSyncCommittee; private _previousEpochParticipation; private _currentEpochParticipation; private _latestExecutionPayloadHeader; private _historicalSummaries; private _pendingPartialWithdrawals; private _pendingConsolidations; private _pendingDeposits; private _proposerLookahead; private _executionPayloadAvailability; private _latestExecutionPayloadBid; private _payloadExpectedWithdrawals; constructor(cachedState: CachedBeaconStateAllForks); get forkName(): ForkName; get forkSeq(): ForkSeq; get slot(): number; get fork(): Fork; get epoch(): number; get genesisTime(): number; get genesisValidatorsRoot(): Root; get eth1Data(): phase0.Eth1Data; get latestBlockHeader(): phase0.BeaconBlockHeader; get previousJustifiedCheckpoint(): Checkpoint; get currentJustifiedCheckpoint(): Checkpoint; get finalizedCheckpoint(): Checkpoint; getBlockRootAtSlot(slot: Slot): Root; getBlockRootAtEpoch(epoch: Epoch): Root; getStateRootAtSlot(slot: Slot): Root; getRandaoMix(epoch: Epoch): Bytes32; get previousEpochParticipation(): Uint8Array; get currentEpochParticipation(): Uint8Array; getPreviousEpochParticipation(validatorIndex: ValidatorIndex): number; getCurrentEpochParticipation(validatorIndex: ValidatorIndex): number; get latestExecutionPayloadHeader(): ExecutionPayloadHeader; /** * The execution block number of the most recently included payload. * Named payloadBlockNumber (not latestBlockNumber) to mirror ExecutionPayloadHeader.blockNumber pre-gloas. * Only available from bellatrix through fulu — not tracked on BeaconState in gloas+ (EIP-7732). */ get payloadBlockNumber(): number; get historicalSummaries(): capella.HistoricalSummaries; get pendingDeposits(): electra.PendingDeposits; get pendingDepositsCount(): number; get pendingPartialWithdrawals(): electra.PendingPartialWithdrawals; get pendingPartialWithdrawalsCount(): number; get pendingConsolidations(): electra.PendingConsolidations; get pendingConsolidationsCount(): number; get proposerLookahead(): fulu.ProposerLookahead; preVerifyBuilderDepositsPreGloas(maxBuilderDeposits: number, maxDurationMs: number): PreVerifyBuilderDepositsResult; clearPreGloasBuilderDepositCache(): void; get latestBlockHash(): Bytes32; get executionPayloadAvailability(): BitArray; get latestExecutionPayloadBid(): ExecutionPayloadBid; get payloadExpectedWithdrawals(): capella.Withdrawal[]; getBuilder(index: BuilderIndex): gloas.Builder; getBuildersLength(): number; canBuilderCoverBid(builderIndex: BuilderIndex, bidAmount: number): boolean; /** * Return the PTCs for an epoch */ getEpochPTCs(epoch: Epoch): Uint32Array[]; /** * Return the PTC for a slot in the previous, current or next epoch */ getPayloadTimelinessCommittee(slot: Slot): Uint32Array; /** * Return all positions of the validator in the PTC committee for the given slot. * * `compute_ptc` samples by effective balance and may place the same validator at multiple * positions, so a validator can have more than one index. Returns an empty array if the * validator is not in the PTC for the given slot. * * Spec: gloas/fork-choice.md#new-on_payload_attestation_message */ getIndicesInPayloadTimelinessCommittee(validatorIndex: ValidatorIndex, slot: Slot): number[]; getShufflingAtEpoch(epoch: Epoch): EpochShuffling; getBeaconCommittee(slot: Slot, index: CommitteeIndex): Uint32Array; getBeaconCommitteeCountPerSlot(epoch: Epoch): number; get previousDecisionRoot(): RootHex; get currentDecisionRoot(): RootHex; get nextDecisionRoot(): RootHex; getShufflingDecisionRoot(epoch: Epoch): RootHex; getPreviousShuffling(): EpochShuffling; getCurrentShuffling(): EpochShuffling; getNextShuffling(): EpochShuffling; get previousProposers(): ValidatorIndex[] | null; get currentProposers(): ValidatorIndex[]; get nextProposers(): ValidatorIndex[]; getBeaconProposer(slot: number): ValidatorIndex; computeAnchorCheckpoint(): { checkpoint: phase0.Checkpoint; blockHeader: phase0.BeaconBlockHeader; }; get currentSyncCommittee(): SyncCommittee; get nextSyncCommittee(): SyncCommittee; get currentSyncCommitteeIndexed(): SyncCommitteeCache; get syncProposerReward(): number; getIndexedSyncCommittee(slot: Slot): SyncCommitteeCache; getIndexedSyncCommitteeAtEpoch(epoch: Epoch): SyncCommitteeCache; get effectiveBalanceIncrements(): EffectiveBalanceIncrements; getEffectiveBalanceIncrementsZeroInactive(): EffectiveBalanceIncrements; getBalance(index: number): number; getValidator(index: ValidatorIndex): phase0.Validator; getValidatorsByStatus(statuses: Set, currentEpoch: Epoch): phase0.Validator[]; get validatorCount(): number; get activeValidatorCount(): number; getAllValidators(): phase0.Validator[]; getAllBalances(): number[]; get isExecutionStateType(): boolean; isExecutionEnabled(block: BeaconBlock | BlindedBeaconBlock): boolean; get isMergeTransitionComplete(): boolean; getExpectedWithdrawals(): { expectedWithdrawals: capella.Withdrawal[]; processedBuilderWithdrawalsCount: number; processedPartialWithdrawalsCount: number; processedBuildersSweepCount: number; processedValidatorSweepCount: number; }; get proposerRewards(): RewardCache; computeBlockRewards(block: BeaconBlock, proposerRewards?: RewardCache): Promise; computeAttestationsRewards(validatorIds?: (ValidatorIndex | string)[]): Promise; computeSyncCommitteeRewards(block: BeaconBlock, validatorIds: (ValidatorIndex | string)[]): Promise; getLatestWeakSubjectivityCheckpointEpoch(): Epoch; getVoluntaryExitValidity(signedVoluntaryExit: phase0.SignedVoluntaryExit, verifySignature?: boolean): VoluntaryExitValidity; isValidVoluntaryExit(signedVoluntaryExit: phase0.SignedVoluntaryExit, verifySignature: boolean): boolean; getFinalizedRootProof(): Uint8Array[]; getSyncCommitteesWitness(): SyncCommitteeWitness; getSingleProof(gindex: bigint): Uint8Array[]; createMultiProof(descriptor: Uint8Array): CompactMultiProof; computeUnrealizedCheckpoints(): { justifiedCheckpoint: phase0.Checkpoint; finalizedCheckpoint: phase0.Checkpoint; }; get clonedCount(): number; get clonedCountWithTransferCache(): number; get createdWithTransferCache(): boolean; isStateValidatorsNodesPopulated(): boolean; loadOtherState(stateBytes: Uint8Array, seedValidatorsBytes?: Uint8Array, opts?: { preloadValidatorsAndBalances?: boolean; }): IBeaconStateView; toValue(): BeaconState; serialize(): Uint8Array; serializedSize(): number; serializeToBytes(output: ByteViews, offset: number): number; serializeValidators(): Uint8Array; serializedValidatorsSize(): number; serializeValidatorsToBytes(output: ByteViews, offset: number): number; hashTreeRoot(): Uint8Array; computeNewStateRoot({ block }: ComputeNewStateRootInput, modules: StateTransitionModules): ComputeNewStateRootResult; stateTransition(signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock, options: StateTransitionOpts, { metrics, validatorMonitor }: StateTransitionModules): IBeaconStateView; processSlots(slot: Slot, opts?: { dontTransferCache?: boolean; }, modules?: StateTransitionModules): IBeaconStateView; /** * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.5/specs/gloas/validator.md#executionpayload */ withParentPayloadApplied(executionRequests: gloas.ExecutionRequests): IBeaconStateViewGloas; } //# sourceMappingURL=beaconStateView.d.ts.map