Skip to content

Commit

Permalink
fix: convert getStateV2 response to Buffer without memory copy
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Apr 18, 2024
1 parent 252fd2f commit 733881c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/api/src/beacon/server/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function getRoutes(config: ChainForkConfig, api: ServerApi<Api>): ServerR
const version = config.getForkName(slot);
void res.header("Eth-Consensus-Version", version);
// Fastify 3.x.x will automatically add header `Content-Type: application/octet-stream` if Buffer
return Buffer.from(response);
return Buffer.from(response.buffer, response.byteOffset, response.byteLength);
} else {
void res.header("Eth-Consensus-Version", response.version);
return returnTypes.getStateV2.toJson(response);
Expand Down

0 comments on commit 733881c

Please sign in to comment.