UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

48 lines 1.98 kB
import { ChainForkConfig } from "@lodestar/config"; import { RootHex, SignedBeaconBlock, deneb } from "@lodestar/types"; import { Metrics } from "../../metrics/index.js"; import { BlockInput, GossipedInputType, NullBlockInput } from "../blocks/types.js"; export declare enum BlockInputAvailabilitySource { GOSSIP = "gossip", UNKNOWN_SYNC = "unknown_sync" } type GossipedBlockInput = { type: GossipedInputType.block; signedBlock: SignedBeaconBlock; } | { type: GossipedInputType.blob; blobSidecar: deneb.BlobSidecar; }; /** * For predeneb, SeenGossipBlockInput only tracks and caches block so that we don't need to download known block * roots. From deneb, it serves same purpose plus tracks and caches the live blobs and blocks on the network to * solve data availability for the blockInput. If no block has been seen yet for some already seen blobs, it * responds will null, but on the first block or the consequent blobs it responds with blobs promise till all blobs * become available. * * One can start processing block on blobs promise blockInput response and can await on the promise before * fully importing the block. The blobs promise is gets resolved as soon as all blobs corresponding to that * block are seen by SeenGossipBlockInput */ export declare class SeenGossipBlockInput { private blockInputCache; prune(): void; hasBlock(blockRoot: RootHex): boolean; getGossipBlockInput(config: ChainForkConfig, gossipedInput: GossipedBlockInput, metrics: Metrics | null): { blockInput: BlockInput; blockInputMeta: { pending: GossipedInputType.blob | null; haveBlobs: number; expectedBlobs: number; }; } | { blockInput: NullBlockInput; blockInputMeta: { pending: GossipedInputType.block; haveBlobs: number; expectedBlobs: null; }; }; } export {}; //# sourceMappingURL=seenGossipBlockInput.d.ts.map