From 7cd91a261df372536eb6b19a70be8151fa998140 Mon Sep 17 00:00:00 2001 From: harkamal Date: Sun, 29 Sep 2024 19:27:52 +0530 Subject: [PATCH] bundle execution requests separately from execution payload --- packages/client/src/rpc/modules/engine/engine.ts | 8 +++++--- .../src/rpc/modules/engine/util/getPayload.ts | 13 ++++++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/client/src/rpc/modules/engine/engine.ts b/packages/client/src/rpc/modules/engine/engine.ts index 47d9abe161..ed6d09f109 100644 --- a/packages/client/src/rpc/modules/engine/engine.ts +++ b/packages/client/src/rpc/modules/engine/engine.ts @@ -212,8 +212,9 @@ export class Engine { [validators.object(executionPayloadV4FieldValidators)], [validators.array(validators.bytes32)], [validators.bytes32], + [validators.array(validators.hex)], ], - ['executionPayload', 'blobVersionedHashes', 'parentBeaconBlockRoot'], + ['executionPayload', 'blobVersionedHashes', 'parentBeaconBlockRoot', 'executionRequests'], ), ([payload], response) => this.connectionManager.lastNewPayload({ payload, response }), ) @@ -337,9 +338,9 @@ export class Engine { * 3. validationError: String|null - validation error message */ private async newPayload( - params: [ExecutionPayload, (Bytes32[] | null)?, (Bytes32 | null)?], + params: [ExecutionPayload, (Bytes32[] | null)?, (Bytes32 | null)?, (PrefixedHexString[] | null)?], ): Promise { - const [payload, blobVersionedHashes, parentBeaconBlockRoot] = params + const [payload, blobVersionedHashes, parentBeaconBlockRoot, executionRequests] = params if (this.config.synchronized) { this.connectionManager.newPayloadLog() } @@ -361,6 +362,7 @@ export class Engine { ...payload, // ExecutionPayload only handles undefined parentBeaconBlockRoot: parentBeaconBlockRoot ?? undefined, + executionRequests: executionRequests ?? undefined, }, this.chain, this.chainCache, diff --git a/packages/client/src/rpc/modules/engine/util/getPayload.ts b/packages/client/src/rpc/modules/engine/util/getPayload.ts index cc7b674af8..cae5de8694 100644 --- a/packages/client/src/rpc/modules/engine/util/getPayload.ts +++ b/packages/client/src/rpc/modules/engine/util/getPayload.ts @@ -13,10 +13,21 @@ export const blockToExecutionPayload = (block: Block, value: bigint, bundle?: Bl if (executionPayload.parentBeaconBlockRoot !== undefined) { delete executionPayload.parentBeaconBlockRoot } + const { executionRequests } = executionPayload + if (executionPayload.executionRequests !== undefined) { + delete executionPayload.executionRequests + } + const blobsBundle: BlobsBundleV1 | undefined = bundle ? bundle : undefined // ethereumjs does not provide any transaction censoring detection (yet) to suggest // overriding builder/mev-boost blocks const shouldOverrideBuilder = false - return { executionPayload, blockValue: bigIntToHex(value), blobsBundle, shouldOverrideBuilder } + return { + executionPayload, + executionRequests, + blockValue: bigIntToHex(value), + blobsBundle, + shouldOverrideBuilder, + } }