UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

102 lines 4.17 kB
import { ForkName } from "@lodestar/params"; import { ColumnIndex, RootHex, Slot, ValidatorIndex, deneb, gloas } from "@lodestar/types"; import { VersionedHashes } from "../../../execution/index.js"; import { MissingColumnMeta } from "../blockInput/types.js"; import { AddPayloadEnvelopeProps, ColumnWithSource, CreateFromBidProps, CreateFromBlockProps, SourceMeta } from "./types.js"; export type PayloadEnvelopeInputState = { hasPayload: false; hasAllData: false; hasComputedAllData: false; } | { hasPayload: false; hasAllData: true; hasComputedAllData: boolean; } | { hasPayload: true; hasAllData: false; hasComputedAllData: false; payloadEnvelope: gloas.SignedExecutionPayloadEnvelope; payloadEnvelopeSource: SourceMeta; } | { hasPayload: true; hasAllData: true; hasComputedAllData: boolean; payloadEnvelope: gloas.SignedExecutionPayloadEnvelope; payloadEnvelopeSource: SourceMeta; timeCompleteSec: number; }; /** * Tracks bid + payload envelope + data columns for a Gloas block. * * Created during block import from signedExecutionPayloadBid in block body. * Always has bid (required for creation). * * Completion requires: payload envelope + all sampled columns */ export declare class PayloadEnvelopeInput { readonly blockRootHex: RootHex; readonly slot: Slot; readonly forkName: ForkName; readonly proposerIndex: ValidatorIndex; readonly bid: gloas.ExecutionPayloadBid; readonly versionedHashes: VersionedHashes; readonly daOutOfRange: boolean; private columnsCache; private readonly sampledColumns; private readonly custodyColumns; private timeCreatedSec; private readonly payloadEnvelopeDataPromise; private readonly allDataPromise; private readonly columnsDataPromise; state: PayloadEnvelopeInputState; private constructor(); static createFromBlock(props: CreateFromBlockProps): PayloadEnvelopeInput; /** * Create a `PayloadEnvelopeInput` from a state's `latestExecutionPayloadBid` (the bid * recorded in beacon state for the latest imported block). Used when seeding the cache * for a checkpoint anchor block — we have the bid via state but not the full * SignedBeaconBlock body. */ static createFromBid(props: CreateFromBidProps): PayloadEnvelopeInput; getBid(): gloas.ExecutionPayloadBid; getBuilderIndex(): ValidatorIndex; getBlockHashHex(): RootHex; getBlobKzgCommitments(): deneb.BlobKzgCommitments; addPayloadEnvelope(props: AddPayloadEnvelopeProps): void; addColumn(columnWithSource: ColumnWithSource): boolean; hasColumn(index: ColumnIndex): boolean; getColumn(index: ColumnIndex): gloas.DataColumnSidecar | undefined; getAllColumns(): gloas.DataColumnSidecar[]; getVersionedHashes(): VersionedHashes; hasPayloadEnvelope(): boolean; getPayloadEnvelope(): gloas.SignedExecutionPayloadEnvelope; getPayloadEnvelopeSource(): SourceMeta; getSampledColumns(): gloas.DataColumnSidecar[]; getSampledColumnsWithSource(): ColumnWithSource[]; getCustodyColumns(): gloas.DataColumnSidecar[]; hasAllData(): boolean; /** * Strictly checks missing sampled columns. Does NOT short-circuit on `state.hasAllData`. */ getMissingSampledColumnMeta(): MissingColumnMeta; hasComputedAllData(): boolean; waitForAllData(timeout: number, signal?: AbortSignal): Promise<gloas.DataColumnSidecar[]>; waitForEnvelopeAndAllData(timeout: number, signal?: AbortSignal): Promise<this>; waitForComputedAllData(timeout: number, signal?: AbortSignal): Promise<gloas.DataColumnSidecar[]>; getTimeCreated(): number; getTimeComplete(): number; isComplete(): boolean; waitForData(): Promise<gloas.SignedExecutionPayloadEnvelope>; getSerializedCacheKeys(): object[]; getLogMeta(): { slot: number; blockRoot: string; hasPayload: boolean; hasAllData: boolean; hasComputedAllData: boolean; isComplete: boolean; receivedColumns: number; sampledColumnsCount: number; }; } //# sourceMappingURL=payloadEnvelopeInput.d.ts.map