From b8cc34abcd53a12db52305c8f83672fb2a62a079 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 24 Feb 2025 15:17:21 +0100 Subject: [PATCH] beacon/blsync: add support for engine_newPayloadV4 with requests list --- beacon/blsync/block_sync.go | 7 ++++--- beacon/blsync/engineclient.go | 5 +++++ beacon/types/light_sync.go | 7 ++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/beacon/blsync/block_sync.go b/beacon/blsync/block_sync.go index ff689a922f..a6252a55f1 100755 --- a/beacon/blsync/block_sync.go +++ b/beacon/blsync/block_sync.go @@ -156,8 +156,9 @@ func (s *beaconBlockSync) updateEventFeed() { return } s.chainHeadFeed.Send(types.ChainHeadEvent{ - BeaconHead: optimistic.Attested.Header, - Block: execBlock, - Finalized: finalizedHash, + BeaconHead: optimistic.Attested.Header, + Block: execBlock, + ExecRequests: headBlock.ExecutionRequestsList(), + Finalized: finalizedHash, }) } diff --git a/beacon/blsync/engineclient.go b/beacon/blsync/engineclient.go index c6569fdbde..f9000a512a 100644 --- a/beacon/blsync/engineclient.go +++ b/beacon/blsync/engineclient.go @@ -100,6 +100,11 @@ func (ec *engineClient) callNewPayload(fork string, event types.ChainHeadEvent) params = []any{execData} ) switch fork { + case "electra": + method = "engine_newPayloadV4" + parentBeaconRoot := event.BeaconHead.ParentRoot + blobHashes := collectBlobHashes(event.Block) + params = append(params, blobHashes, parentBeaconRoot, event.ExecRequests) case "deneb": method = "engine_newPayloadV3" parentBeaconRoot := event.BeaconHead.ParentRoot diff --git a/beacon/types/light_sync.go b/beacon/types/light_sync.go index 3e9b13d0e2..fa6041cf0e 100644 --- a/beacon/types/light_sync.go +++ b/beacon/types/light_sync.go @@ -230,7 +230,8 @@ func (u *FinalityUpdate) Validate() error { // latest accepted head of the beacon chain, along with the hash of the latest // finalized execution block. type ChainHeadEvent struct { - BeaconHead Header - Block *ctypes.Block - Finalized common.Hash + BeaconHead Header + Block *ctypes.Block + ExecRequests [][]byte // execution layer requests (added in Electra) + Finalized common.Hash // latest finalized block hash }