From 72bb344ce4377015079ae120973b1b512e4fd988 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 14 Mar 2024 22:11:46 +0100 Subject: [PATCH] beacon/types: add beacon header in ChainHeadEvent and change HeadBlock to types.Block --- beacon/blsync/block_sync.go | 6 +++--- beacon/blsync/block_sync_test.go | 2 +- beacon/types/light_sync.go | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/beacon/blsync/block_sync.go b/beacon/blsync/block_sync.go index 0e4109dd3c..c15eb3f0cb 100755 --- a/beacon/blsync/block_sync.go +++ b/beacon/blsync/block_sync.go @@ -17,7 +17,6 @@ package blsync import ( - "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/beacon/light/request" "github.com/ethereum/go-ethereum/beacon/light/sync" "github.com/ethereum/go-ethereum/beacon/types" @@ -137,7 +136,8 @@ func (s *beaconBlockSync) updateEventFeed() { return } s.chainHeadFeed.Send(types.ChainHeadEvent{ - HeadBlock: engine.BlockToExecutableData(execBlock, nil, nil).ExecutionPayload, - Finalized: common.Hash(finality.Finalized.PayloadHeader.BlockHash()), + BeaconHead: head.Header, + Block: execBlock, + Finalized: common.Hash(finality.Finalized.PayloadHeader.BlockHash()), }) } diff --git a/beacon/blsync/block_sync_test.go b/beacon/blsync/block_sync_test.go index a5e9bd3766..554f39999e 100644 --- a/beacon/blsync/block_sync_test.go +++ b/beacon/blsync/block_sync_test.go @@ -62,7 +62,7 @@ func TestBlockSync(t *testing.T) { } select { case event := <-headCh: - headNumber = event.HeadBlock.Number + headNumber = event.Block.NumberU64() default: } if headNumber != expNumber { diff --git a/beacon/types/light_sync.go b/beacon/types/light_sync.go index 6e795df208..62becdb21c 100644 --- a/beacon/types/light_sync.go +++ b/beacon/types/light_sync.go @@ -20,10 +20,10 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/beacon/merkle" "github.com/ethereum/go-ethereum/beacon/params" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" ) // HeadInfo represents an unvalidated new head announcement. @@ -185,6 +185,7 @@ 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 { - HeadBlock *engine.ExecutableData - Finalized common.Hash + BeaconHead Header + Block *types.Block + Finalized common.Hash }