Skip to content

Commit

Permalink
Remove invalid terminal block execution scenario (#4076)
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech authored May 27, 2022
1 parent dfa7b98 commit c1ed45d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
1 change: 0 additions & 1 deletion packages/lodestar/src/chain/blocks/verifyBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ export async function verifyBlockStateTransition(
// child block will cause it to replay

case ExecutePayloadStatus.INVALID_BLOCK_HASH:
case ExecutePayloadStatus.INVALID_TERMINAL_BLOCK:
case ExecutePayloadStatus.ELERROR:
case ExecutePayloadStatus.UNAVAILABLE:
throw new BlockError(block, {
Expand Down
8 changes: 0 additions & 8 deletions packages/lodestar/src/executionEngine/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export class ExecutionEngineHttp implements IExecutionEngine {
return {status, latestValidHash: null, validationError: null};

case ExecutePayloadStatus.INVALID_BLOCK_HASH:
case ExecutePayloadStatus.INVALID_TERMINAL_BLOCK:
return {status, latestValidHash: null, validationError: validationError ?? "Malformed block"};

case ExecutePayloadStatus.UNAVAILABLE:
Expand Down Expand Up @@ -249,13 +248,6 @@ export class ExecutionEngineHttp implements IExecutionEngine {
}`
);

case ExecutePayloadStatus.INVALID_TERMINAL_BLOCK:
throw Error(
`Invalid terminal block for ${
payloadAttributes ? "prepare payload" : "forkchoice request"
}, validationError=${validationError ?? ""}`
);

default:
throw Error(`Unknown status ${status}`);
}
Expand Down
11 changes: 2 additions & 9 deletions packages/lodestar/src/executionEngine/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export enum ExecutePayloadStatus {
ACCEPTED = "ACCEPTED",
/** blockHash is invalid */
INVALID_BLOCK_HASH = "INVALID_BLOCK_HASH",
/** invalid terminal block */
INVALID_TERMINAL_BLOCK = "INVALID_TERMINAL_BLOCK",
/** EL error */
ELERROR = "ELERROR",
/** EL unavailable */
Expand All @@ -32,20 +30,15 @@ export type ExecutePayloadResponse =
| {status: ExecutePayloadStatus.VALID; latestValidHash: RootHex; validationError: null}
| {status: ExecutePayloadStatus.INVALID; latestValidHash: RootHex; validationError: string | null}
| {
status:
| ExecutePayloadStatus.INVALID_BLOCK_HASH
| ExecutePayloadStatus.INVALID_TERMINAL_BLOCK
| ExecutePayloadStatus.ELERROR
| ExecutePayloadStatus.UNAVAILABLE;
status: ExecutePayloadStatus.INVALID_BLOCK_HASH | ExecutePayloadStatus.ELERROR | ExecutePayloadStatus.UNAVAILABLE;
latestValidHash: null;
validationError: string;
};

export type ForkChoiceUpdateStatus =
| ExecutePayloadStatus.VALID
| ExecutePayloadStatus.INVALID
| ExecutePayloadStatus.SYNCING
| ExecutePayloadStatus.INVALID_TERMINAL_BLOCK;
| ExecutePayloadStatus.SYNCING;

export type PayloadAttributes = {
timestamp: number;
Expand Down

0 comments on commit c1ed45d

Please sign in to comment.