Skip to content

Commit

Permalink
Update execution optimistic meta
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Apr 27, 2024
1 parent c679daa commit 948dad9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 0 additions & 6 deletions packages/api/src/beacon/routes/beacon/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ export type SignedBlockContents = ValueOf<typeof SignedBlockContentsType>;

export type BlockId = RootHex | Slot | "head" | "genesis" | "finalized" | "justified";

/**
* True if the response references an unverified execution payload. Optimistic information may be invalidated at
* a later time. If the field is not present, assume the False value.
*/
export type ExecutionOptimistic = boolean;

export enum BroadcastValidation {
/*
NOTE: The value `none` is not part of the spec.
Expand Down
11 changes: 8 additions & 3 deletions packages/api/src/utils/codecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {ArrayType, ListBasicType, ListCompositeType, Type, isBasicType, isCompos
import {ForkName} from "@lodestar/params";
import {Root} from "@lodestar/types";
import {fromHex, objectToExpectedCase, toHex} from "@lodestar/utils";
import {ExecutionOptimistic} from "../beacon/routes/beacon/block.js";
import {
GetRequestCodec,
PostRequestCodec,
Expand All @@ -24,10 +23,16 @@ export type EmptyRequest = Record<string, void>;
export type EmptyResponseData = void;

export type EmptyMeta = void;
export type ExecutionOptimisticMeta = {executionOptimistic: ExecutionOptimistic};
export type VersionMeta = {version: ForkName};
export type ExecutionOptimisticMeta = {
/**
* True if the response references an unverified execution payload.
* Optimistic information may be invalidated at a later time.
*/
executionOptimistic: boolean;
};
export type ExecutionOptimisticAndVersionMeta = ExecutionOptimisticMeta & VersionMeta;
export type ExecutionOptimisticAndDependentRootMeta = {executionOptimistic: ExecutionOptimistic; dependentRoot: Root};
export type ExecutionOptimisticAndDependentRootMeta = ExecutionOptimisticMeta & {dependentRoot: Root};

/* eslint-disable @typescript-eslint/no-explicit-any */
export type AnyEndpoint = Endpoint<any, any, any, any, any>;
Expand Down

0 comments on commit 948dad9

Please sign in to comment.