UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

55 lines 2.54 kB
import { ChainForkConfig } from "@lodestar/config"; import { IForkChoice, ProtoBlock } from "@lodestar/fork-choice"; import { RootHex } from "@lodestar/types"; import { Logger } from "@lodestar/utils"; import { Metrics } from "../../metrics/metrics.js"; import { IClock } from "../../util/clock.js"; import { SerializedCache } from "../../util/serializedCache.js"; import { CreateFromBidProps, CreateFromBlockProps, PayloadEnvelopeInput } from "../blocks/payloadEnvelopeInput/index.js"; import { ChainEventEmitter } from "../emitter.js"; export type { PayloadEnvelopeInputState } from "../blocks/payloadEnvelopeInput/index.js"; export { PayloadEnvelopeInput } from "../blocks/payloadEnvelopeInput/index.js"; export type SeenPayloadEnvelopeInputModules = { config: ChainForkConfig; clock: IClock; forkChoice: IForkChoice; chainEvents: ChainEventEmitter; signal: AbortSignal; serializedCache: SerializedCache; metrics: Metrics | null; logger?: Logger; }; /** * Cache for tracking PayloadEnvelopeInput instances, keyed by beacon block root. * * Created whenever we have a block because it needs block bid. * Steady state (linear chain, healthy progression): the cache holds ~2 entries — the head * (parent for next-slot production) and its parent (proposer-boost-reorg fallback). It can * transiently hold more during forks, range-sync bursts, or when `prepareNextSlot` skips * ticks; subsequent ticks settle it back. */ export declare class SeenPayloadEnvelopeInput { private readonly config; private readonly clock; private readonly forkChoice; private readonly chainEvents; private readonly signal; private readonly serializedCache; private readonly metrics; private readonly logger?; private payloadInputs; constructor({ config, clock, forkChoice, chainEvents, signal, serializedCache, metrics, logger }: SeenPayloadEnvelopeInputModules); private pruneFinalized; add(props: Omit<CreateFromBlockProps, "daOutOfRange">): PayloadEnvelopeInput; /** * Used at chain initialization to seed the anchor block's PayloadEnvelopeInput from * `state.latestExecutionPayloadBid`. */ addFromBid(props: Omit<CreateFromBidProps, "daOutOfRange">): PayloadEnvelopeInput; get(blockRootHex: RootHex): PayloadEnvelopeInput | undefined; hasPayload(blockRootHex: RootHex): boolean; size(): number; pruneBelowParent(parentBlock: ProtoBlock): void; private evictPayloadInput; } //# sourceMappingURL=seenPayloadEnvelopeInput.d.ts.map