Skip to content

Commit

Permalink
fix: update engine_getPayloadBodiesByHashV1 params to pass array (#5957)
Browse files Browse the repository at this point in the history
fix: update  engine_getPayloadBodiesByHashV1 params to pass [] as param[0]

Co-authored-by: Cayman <[email protected]>
  • Loading branch information
matthewkeil and wemeetagain authored Sep 22, 2023
1 parent 24a74d0 commit e17fe6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/beacon-node/src/execution/engine/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
const response = await this.fetchWithRetries<
EngineApiRpcReturnTypes[typeof method],
EngineApiRpcParamTypes[typeof method]
>({method, params: blockHashes});
>({method, params: [blockHashes]});
return response.map(deserializeExecutionPayloadBody);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/execution/engine/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export type EngineApiRpcParamTypes = {
/**
* 1. Array of DATA - Array of block_hash field values of the ExecutionPayload structure
* */
engine_getPayloadBodiesByHashV1: DATA[];
engine_getPayloadBodiesByHashV1: DATA[][];

/**
* 1. start: QUANTITY, 64 bits - Starting block number
Expand Down
8 changes: 5 additions & 3 deletions packages/beacon-node/test/unit/executionEngine/http.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ describe("ExecutionEngine / http", () => {
it("getPayloadBodiesByHash", async () => {
/**
* curl -X GET -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"engine_getPayloadBodiesByHashV1","params":[
"0xb084c10440f05f5a23a55d1d7ebcb1b3892935fb56f23cdc9a7f42c348eed174",
"0xb084c10440f05f5a23a55d1d7ebcb1b3892935fb56f23cdc9a7f42c348eed174",
[
"0xb084c10440f05f5a23a55d1d7ebcb1b3892935fb56f23cdc9a7f42c348eed174",
"0xb084c10440f05f5a23a55d1d7ebcb1b3892935fb56f23cdc9a7f42c348eed174",
]
],"id":67}' http://localhost:8545
*/
const response = {
Expand Down Expand Up @@ -210,7 +212,7 @@ describe("ExecutionEngine / http", () => {
const request = {
jsonrpc: "2.0",
method: "engine_getPayloadBodiesByHashV1",
params: reqBlockHashes,
params: [reqBlockHashes],
};

returnValue = response;
Expand Down

0 comments on commit e17fe6b

Please sign in to comment.