Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support/use engine_newPayloadV4 in BN #6188

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions beacon_chain/el/el_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
Loading