UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

26 lines 1.32 kB
import { ChainForkConfig } from "@lodestar/config"; import { ProtoBlock } from "@lodestar/fork-choice"; import { Slot } from "@lodestar/types"; import { IBlockInput } from "../blockInput/types.js"; import { PayloadEnvelopeInput } from "../payloadEnvelopeInput/payloadEnvelopeInput.js"; export type OrphanedPayloadEnvelope = { slot: Slot; payloadEnvelopeInput: PayloadEnvelopeInput; }; export type ChainSegmentResult = { warnings: OrphanedPayloadEnvelope[] | null; }; /** * Assert this chain segment of blocks is linear with slot numbers and hashes, * and that the provided envelopes are consistent with their respective blocks. * * * For each block: * - Verifies parent root + slot linearity * - For gloas: verifies bid.parentBlockHash matches the tracked execution hash; if not, the * previous FULL envelope is treated as orphaned (segment continues as if previous slot was EMPTY) * - If an envelope exists for this slot: verifies it references this block's root * - Advances the tracked execution hash (FULL if envelope present, EMPTY if not) */ export declare function assertLinearChainSegment(config: ChainForkConfig, blocks: IBlockInput[], payloadEnvelopes: Map<Slot, PayloadEnvelopeInput> | null, parentBlock: ProtoBlock | null): ChainSegmentResult; //# sourceMappingURL=chainSegment.d.ts.map