Skip to content

Commit

Permalink
feat: update engineapi endpoints to v4 (#6747)
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Jun 25, 2024
1 parent aaca7a7 commit c1286d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/beacon-node/src/execution/engine/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
): Promise<ExecutePayloadResponse> {
const method =
ForkSeq[fork] >= ForkSeq.electra
? "engine_newPayloadV6110"
? "engine_newPayloadV4"
: ForkSeq[fork] >= ForkSeq.deneb
? "engine_newPayloadV3"
: ForkSeq[fork] >= ForkSeq.capella
Expand All @@ -198,7 +198,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
const serializedVersionedHashes = serializeVersionedHashes(versionedHashes);
const parentBeaconBlockRoot = serializeBeaconBlockRoot(parentBlockRoot);

const method = ForkSeq[fork] >= ForkSeq.electra ? "engine_newPayloadV6110" : "engine_newPayloadV3";
const method = ForkSeq[fork] >= ForkSeq.electra ? "engine_newPayloadV4" : "engine_newPayloadV3";
engineRequest = {
method,
params: [serializedExecutionPayload, serializedVersionedHashes, parentBeaconBlockRoot],
Expand Down Expand Up @@ -373,7 +373,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
}> {
const method =
ForkSeq[fork] >= ForkSeq.electra
? "engine_getPayloadV6110"
? "engine_getPayloadV4"
: ForkSeq[fork] >= ForkSeq.deneb
? "engine_getPayloadV3"
: ForkSeq[fork] >= ForkSeq.capella
Expand Down
4 changes: 2 additions & 2 deletions packages/beacon-node/src/execution/engine/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
engine_newPayloadV1: this.notifyNewPayload.bind(this),
engine_newPayloadV2: this.notifyNewPayload.bind(this),
engine_newPayloadV3: this.notifyNewPayload.bind(this),
engine_newPayloadV6110: this.notifyNewPayload.bind(this),
engine_newPayloadV4: this.notifyNewPayload.bind(this),
engine_forkchoiceUpdatedV1: this.notifyForkchoiceUpdate.bind(this),
engine_forkchoiceUpdatedV2: this.notifyForkchoiceUpdate.bind(this),
engine_forkchoiceUpdatedV3: this.notifyForkchoiceUpdate.bind(this),
engine_getPayloadV1: this.getPayload.bind(this),
engine_getPayloadV2: this.getPayload.bind(this),
engine_getPayloadV3: this.getPayload.bind(this),
engine_getPayloadV6110: this.getPayload.bind(this),
engine_getPayloadV4: this.getPayload.bind(this),
engine_getPayloadBodiesByHashV1: this.getPayloadBodiesByHash.bind(this),
engine_getPayloadBodiesByRangeV1: this.getPayloadBodiesByRange.bind(this),
};
Expand Down
8 changes: 4 additions & 4 deletions packages/beacon-node/src/execution/engine/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type EngineApiRpcParamTypes = {
engine_newPayloadV1: [ExecutionPayloadRpc];
engine_newPayloadV2: [ExecutionPayloadRpc];
engine_newPayloadV3: [ExecutionPayloadRpc, VersionedHashesRpc, DATA];
engine_newPayloadV6110: [ExecutionPayloadRpc, VersionedHashesRpc, DATA];
engine_newPayloadV4: [ExecutionPayloadRpc, VersionedHashesRpc, DATA];
/**
* 1. Object - Payload validity status with respect to the consensus rules:
* - blockHash: DATA, 32 Bytes - block hash value of the payload
Expand All @@ -52,7 +52,7 @@ export type EngineApiRpcParamTypes = {
engine_getPayloadV1: [QUANTITY];
engine_getPayloadV2: [QUANTITY];
engine_getPayloadV3: [QUANTITY];
engine_getPayloadV6110: [QUANTITY];
engine_getPayloadV4: [QUANTITY];

/**
* 1. Array of DATA - Array of block_hash field values of the ExecutionPayload structure
Expand Down Expand Up @@ -80,7 +80,7 @@ export type EngineApiRpcReturnTypes = {
engine_newPayloadV1: PayloadStatus;
engine_newPayloadV2: PayloadStatus;
engine_newPayloadV3: PayloadStatus;
engine_newPayloadV6110: PayloadStatus;
engine_newPayloadV4: PayloadStatus;
engine_forkchoiceUpdatedV1: {
payloadStatus: PayloadStatus;
payloadId: QUANTITY | null;
Expand All @@ -99,7 +99,7 @@ export type EngineApiRpcReturnTypes = {
engine_getPayloadV1: ExecutionPayloadRpc;
engine_getPayloadV2: ExecutionPayloadResponse;
engine_getPayloadV3: ExecutionPayloadResponse;
engine_getPayloadV6110: ExecutionPayloadResponse;
engine_getPayloadV4: ExecutionPayloadResponse;

engine_getPayloadBodiesByHashV1: (ExecutionPayloadBodyRpc | null)[];

Expand Down

0 comments on commit c1286d3

Please sign in to comment.