UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

77 lines 3.45 kB
import { RootHex, Slot } from "@lodestar/types"; import { SignedExecutionPayloadEnvelope } from "@lodestar/types/gloas"; import { IBlockInput } from "../chain/blocks/blockInput/index.js"; import { PayloadEnvelopeInput } from "../chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js"; export declare enum PendingBlockType { /** * We got a block root (from a gossip attestation, for exxample) but we don't have the block in forkchoice. */ UNKNOWN_BLOCK_ROOT = "UnknownBlockRoot", /** * During gossip time, we may get a block but the parent root is unknown (not in forkchoice). */ UNKNOWN_PARENT = "unknown_parent", /** * During gossip we wait for a set amount of time to receive the complete block input but if it does not * arrive in time we turn to req/resp to pull the remainder so that it can be processed */ INCOMPLETE_BLOCK_INPUT = "IncompleteBlockInput", UNKNOWN_DATA = "unknown_data" } export declare enum PendingBlockInputStatus { pending = "pending", fetching = "fetching", downloaded = "downloaded", processing = "processing" } export declare enum PendingPayloadInputStatus { pending = "pending", fetching = "fetching", waitingForBlock = "waiting_for_block", downloaded = "downloaded", processing = "processing" } export type PendingBlockInput = { status: PendingBlockInputStatus; blockInput: IBlockInput; timeAddedSec: number; timeSyncedSec?: number; peerIdStrings: Set<string>; }; export type PendingRootHex = { status: PendingBlockInputStatus.pending | PendingBlockInputStatus.fetching; rootHex: RootHex; timeAddedSec: number; timeSyncedSec?: number; peerIdStrings: Set<string>; }; export type BlockInputSyncCacheItem = PendingBlockInput | PendingRootHex; export type PendingPayloadInput = { status: PendingPayloadInputStatus.pending | PendingPayloadInputStatus.fetching | PendingPayloadInputStatus.downloaded | PendingPayloadInputStatus.processing; payloadInput: PayloadEnvelopeInput; timeAddedSec: number; timeSyncedSec?: number; peerIdStrings: Set<string>; }; export type PendingPayloadRootHex = { status: PendingPayloadInputStatus.pending | PendingPayloadInputStatus.fetching; rootHex: RootHex; timeAddedSec: number; timeSyncedSec?: number; peerIdStrings: Set<string>; }; export type PendingPayloadEnvelope = { status: PendingPayloadInputStatus.waitingForBlock; envelope: SignedExecutionPayloadEnvelope; timeAddedSec: number; peerIdStrings: Set<string>; }; export type PayloadSyncCacheItem = PendingPayloadInput | PendingPayloadRootHex | PendingPayloadEnvelope; export declare function isPendingBlockInput(pending: BlockInputSyncCacheItem): pending is PendingBlockInput; export declare function isPendingPayloadInput(pending: PayloadSyncCacheItem): pending is PendingPayloadInput; export declare function isPendingPayloadEnvelope(pending: PayloadSyncCacheItem): pending is PendingPayloadEnvelope; export declare function getBlockInputSyncCacheItemRootHex(block: BlockInputSyncCacheItem): RootHex; export declare function getBlockInputSyncCacheItemSlot(block: BlockInputSyncCacheItem): Slot | string; export declare function getPayloadSyncCacheItemRootHex(payload: PayloadSyncCacheItem): RootHex; export declare function getPayloadSyncCacheItemSlot(payload: PayloadSyncCacheItem): Slot | string; //# sourceMappingURL=types.d.ts.map