Skip to content

Commit

Permalink
bundle execution requests separately from execution payload
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Sep 29, 2024
1 parent 73003e7 commit 7cd91a2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/client/src/rpc/modules/engine/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
)
Expand Down Expand Up @@ -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<PayloadStatusV1> {
const [payload, blobVersionedHashes, parentBeaconBlockRoot] = params
const [payload, blobVersionedHashes, parentBeaconBlockRoot, executionRequests] = params
if (this.config.synchronized) {
this.connectionManager.newPayloadLog()
}
Expand All @@ -361,6 +362,7 @@ export class Engine {
...payload,
// ExecutionPayload only handles undefined
parentBeaconBlockRoot: parentBeaconBlockRoot ?? undefined,
executionRequests: executionRequests ?? undefined,
},
this.chain,
this.chainCache,
Expand Down
13 changes: 12 additions & 1 deletion packages/client/src/rpc/modules/engine/util/getPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit 7cd91a2

Please sign in to comment.