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, ValidatorIndex, altair, 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 { 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, IBeaconStateViewNative } from "./interface.js"; /** * Wraps a native binding (the auto-generated JS interface produced by a `.node` * file) and exposes it as a fully-conformant `IBeaconStateViewLatestFork`. * * The binding is typed `IBeaconStateViewNative` — identical to * `IBeaconStateViewLatestFork` except `executionPayloadAvailability` is a raw * `{uint8Array, bitLen}` POJO. The `executionPayloadAvailability` getter lifts * that POJO back to a `BitArray` so beacon-node consumers see no difference from * the TS-side `BeaconStateView`. * * Every getter that returns a value stable for the view's lifetime is cached so * the binding is hit at most once per field per view. Only mutable counters * (`proposerRewards`, `clonedCount`, `clonedCountWithTransferCache`) stay * pass-through. Methods with arguments are pass-through too — caching them * would need a per-arg map and isn't worth it without a hot-path signal. */ export declare class NativeBeaconStateView implements IBeaconStateViewLatestFork { readonly binding: IBeaconStateViewNative; private _forkName; private _forkSeq; private _slot; private _fork; private _epoch; private _genesisTime; private _genesisValidatorsRoot; private _eth1Data; private _latestBlockHeader; private _previousJustifiedCheckpoint; private _currentJustifiedCheckpoint; private _finalizedCheckpoint; private _previousDecisionRoot; private _currentDecisionRoot; private _nextDecisionRoot; private _previousProposers; private _currentProposers; private _nextProposers; private _effectiveBalanceIncrements; private _validatorCount; private _activeValidatorCount; private _createdWithTransferCache; private _currentSyncCommittee; private _nextSyncCommittee; private _previousEpochParticipation; private _currentEpochParticipation; private _currentSyncCommitteeIndexed; private _syncProposerReward; private _latestExecutionPayloadHeader; private _payloadBlockNumber; private _isExecutionStateType; private _isMergeTransitionComplete; private _historicalSummaries; private _pendingPartialWithdrawals; private _pendingConsolidations; private _pendingDeposits; private _pendingDepositsCount; private _pendingPartialWithdrawalsCount; private _pendingConsolidationsCount; private _proposerLookahead; private _executionPayloadAvailability; private _latestBlockHash; private _latestExecutionPayloadBid; private _payloadExpectedWithdrawals; private readonly _getBlockRootAtSlot; private readonly _getBlockRootAtEpoch; private readonly _getStateRootAtSlot; private readonly _getRandaoMix; private readonly _getShufflingAtEpoch; private readonly _getBeaconCommittee; private readonly _getBeaconCommitteeCountPerSlot; private readonly _getShufflingDecisionRoot; private readonly _getBeaconProposer; private readonly _getValidator; private readonly _getBalance; private readonly _getIndexedSyncCommitteeAtEpoch; private readonly _getIndexedSyncCommittee; private readonly _getSingleProof; private readonly _getEpochPTCs; private readonly _getBuilder; private _getPreviousShuffling; private _getCurrentShuffling; private _getNextShuffling; private _getEffectiveBalanceIncrementsZeroInactive; private _getAllValidators; private _getBuildersLength; private _getAllBalances; private _getLatestWeakSubjectivityCheckpointEpoch; private _getFinalizedRootProof; private _computeUnrealizedCheckpoints; private _computeAnchorCheckpoint; private _isStateValidatorsNodesPopulated; private _toValue; private _serialize; private _serializedSize; private _serializeValidators; private _serializedValidatorsSize; private _hashTreeRoot; private _getSyncCommitteesWitness; private _getExpectedWithdrawals; constructor(binding: IBeaconStateViewNative); get executionPayloadAvailability(): BitArray; get forkName(): ForkName; get forkSeq(): ForkSeq; get slot(): Slot; get fork(): Fork; get epoch(): Epoch; 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; 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: Slot): ValidatorIndex; 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 proposerRewards(): RewardCache; computeBlockRewards(block: BeaconBlock, proposerRewards?: RewardCache): Promise; computeAttestationsRewards(validatorIds?: (ValidatorIndex | string)[]): Promise; getLatestWeakSubjectivityCheckpointEpoch(): Epoch; getVoluntaryExitValidity(signedVoluntaryExit: phase0.SignedVoluntaryExit, verifySignature: boolean): VoluntaryExitValidity; isValidVoluntaryExit(signedVoluntaryExit: phase0.SignedVoluntaryExit, verifySignature: boolean): boolean; getFinalizedRootProof(): Uint8Array[]; getSingleProof(gindex: bigint): Uint8Array[]; createMultiProof(descriptor: Uint8Array): CompactMultiProof; computeUnrealizedCheckpoints(): { justifiedCheckpoint: phase0.Checkpoint; finalizedCheckpoint: phase0.Checkpoint; }; computeAnchorCheckpoint(): { checkpoint: phase0.Checkpoint; blockHeader: phase0.BeaconBlockHeader; }; 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(input: ComputeNewStateRootInput, modules: StateTransitionModules): ComputeNewStateRootResult; stateTransition(signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock, options: StateTransitionOpts, modules: StateTransitionModules): IBeaconStateView; processSlots(slot: Slot, opts?: { dontTransferCache?: boolean; }, modules?: StateTransitionModules): IBeaconStateView; get previousEpochParticipation(): Uint8Array; get currentEpochParticipation(): Uint8Array; getPreviousEpochParticipation(validatorIndex: ValidatorIndex): number; getCurrentEpochParticipation(validatorIndex: ValidatorIndex): number; get currentSyncCommittee(): altair.SyncCommittee; get nextSyncCommittee(): altair.SyncCommittee; get currentSyncCommitteeIndexed(): SyncCommitteeCache; get syncProposerReward(): number; getIndexedSyncCommitteeAtEpoch(epoch: Epoch): SyncCommitteeCache; getIndexedSyncCommittee(slot: Slot): SyncCommitteeCache; computeSyncCommitteeRewards(block: BeaconBlock, validatorIds: (ValidatorIndex | string)[]): Promise; getSyncCommitteesWitness(): SyncCommitteeWitness; get latestExecutionPayloadHeader(): ExecutionPayloadHeader; get payloadBlockNumber(): number; get isExecutionStateType(): boolean; get isMergeTransitionComplete(): boolean; isExecutionEnabled(block: BeaconBlock | BlindedBeaconBlock): boolean; get historicalSummaries(): capella.HistoricalSummaries; getExpectedWithdrawals(): { expectedWithdrawals: capella.Withdrawal[]; processedBuilderWithdrawalsCount: number; processedPartialWithdrawalsCount: number; processedBuildersSweepCount: number; processedValidatorSweepCount: number; }; 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 latestExecutionPayloadBid(): ExecutionPayloadBid; get payloadExpectedWithdrawals(): capella.Withdrawal[]; getBuilder(index: BuilderIndex): gloas.Builder; getBuildersLength(): number; canBuilderCoverBid(builderIndex: BuilderIndex, bidAmount: number): boolean; getEpochPTCs(epoch: Epoch): Uint32Array[]; getPayloadTimelinessCommittee(slot: Slot): Uint32Array; getIndicesInPayloadTimelinessCommittee(validatorIndex: ValidatorIndex, slot: Slot): number[]; withParentPayloadApplied(executionRequests: gloas.ExecutionRequests): IBeaconStateViewGloas; } //# sourceMappingURL=nativeBeaconStateView.d.ts.map