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 Aug 2, 2024
1 parent db5c515 commit 35f0510
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 @@ -199,7 +199,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 @@ -220,7 +220,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 @@ -395,7 +395,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),
engine_getClientVersionV1: this.getClientVersionV1.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 @@ -85,7 +85,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 @@ -104,7 +104,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 35f0510

Please sign in to comment.