From 749a45695fbed3ebe28a2c873e222a3c2e7bc2f0 Mon Sep 17 00:00:00 2001 From: tersec Date: Tue, 9 Apr 2024 10:44:03 +0000 Subject: [PATCH] support engine_newPayloadV4 (#6188) --- beacon_chain/el/el_manager.nim | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/beacon_chain/el/el_manager.nim b/beacon_chain/el/el_manager.nim index ed4f939941..687b2be11b 100644 --- a/beacon_chain/el/el_manager.nim +++ b/beacon_chain/el/el_manager.nim @@ -1048,6 +1048,15 @@ proc sendNewPayloadToSingleEL(connection: ELConnection, return await rpcClient.engine_newPayloadV3( payload, versioned_hashes, parent_beacon_block_root) +proc sendNewPayloadToSingleEL(connection: ELConnection, + payload: engine_api.ExecutionPayloadV4, + versioned_hashes: seq[engine_api.VersionedHash], + parent_beacon_block_root: FixedBytes[32]): + Future[PayloadStatusV1] {.async.} = + let rpcClient = await connection.connectedRpcClient() + return await rpcClient.engine_newPayloadV4( + payload, versioned_hashes, parent_beacon_block_root) + type StatusRelation = enum newStatusIsPreferable @@ -1147,7 +1156,8 @@ proc sendNewPayload*(m: ELManager, blck: SomeForkyBeaconBlock): payload = blck.body.execution_payload.asEngineExecutionPayload requests = m.elConnections.mapIt: let req = - when payload is engine_api.ExecutionPayloadV3: + when payload is engine_api.ExecutionPayloadV3 or + payload is engine_api.ExecutionPayloadV4: # https://github.com/ethereum/consensus-specs/blob/v1.4.0-alpha.1/specs/deneb/beacon-chain.md#process_execution_payload # Verify the execution payload is valid # [Modified in Deneb] Pass `versioned_hashes` to Execution Engine @@ -1160,9 +1170,6 @@ proc sendNewPayload*(m: ELManager, blck: SomeForkyBeaconBlock): elif payload is engine_api.ExecutionPayloadV1 or payload is engine_api.ExecutionPayloadV2: sendNewPayloadToSingleEL(it, payload) - elif payload is engine_api.ExecutionPayloadV4: - debugRaiseAssert "similar to V3 case, check for details" - default(Future[PayloadStatusV1]) else: static: doAssert false trackEngineApiRequest(it, req, "newPayload", startTime, deadline)