From 3a460be02741b44f3613b7abaa91488fb829fd10 Mon Sep 17 00:00:00 2001 From: itsdevbear Date: Tue, 28 May 2024 16:35:07 -0400 Subject: [PATCH] bet --- mod/beacon/blockchain/execution_engine.go | 72 ++++++++++------------- mod/beacon/validator/service.go | 2 +- 2 files changed, 33 insertions(+), 41 deletions(-) diff --git a/mod/beacon/blockchain/execution_engine.go b/mod/beacon/blockchain/execution_engine.go index f710aeec93..137e08e4ee 100644 --- a/mod/beacon/blockchain/execution_engine.go +++ b/mod/beacon/blockchain/execution_engine.go @@ -25,44 +25,36 @@ package blockchain -import ( - "context" +// // sendFCU sends a forkchoice update to the execution client. +// // It sets the head and finalizes the latest. +// func (s *Service[ +// AvailabilityStoreT, +// BeaconStateT, +// BlobSidecarsT, +// DepositStoreT, +// ]) sendFCU( +// ctx context.Context, +// st BeaconStateT, +// slot math.Slot, +// headEth1Hash common.ExecutionHash, +// ) error { +// lph, err := st.GetLatestExecutionPayloadHeader() +// if err != nil { +// return err +// } +// eth1BlockHash := lph.GetBlockHash() - engineprimitives "github.com/berachain/beacon-kit/mod/engine-primitives/pkg/engine-primitives" - "github.com/berachain/beacon-kit/mod/primitives/pkg/common" - "github.com/berachain/beacon-kit/mod/primitives/pkg/math" -) - -// sendFCU sends a forkchoice update to the execution client. -// It sets the head and finalizes the latest. -func (s *Service[ - AvailabilityStoreT, - BeaconStateT, - BlobSidecarsT, - DepositStoreT, -]) sendFCU( - ctx context.Context, - st BeaconStateT, - slot math.Slot, - headEth1Hash common.ExecutionHash, -) error { - lph, err := st.GetLatestExecutionPayloadHeader() - if err != nil { - return err - } - eth1BlockHash := lph.GetBlockHash() - - _, _, err = s.ee.NotifyForkchoiceUpdate( - ctx, - engineprimitives.BuildForkchoiceUpdateRequest( - &engineprimitives.ForkchoiceStateV1{ - HeadBlockHash: headEth1Hash, - SafeBlockHash: eth1BlockHash, - FinalizedBlockHash: eth1BlockHash, - }, - nil, - s.cs.ActiveForkVersionForSlot(slot), - ), - ) - return err -} +// _, _, err = s.ee.NotifyForkchoiceUpdate( +// ctx, +// engineprimitives.BuildForkchoiceUpdateRequest( +// &engineprimitives.ForkchoiceStateV1{ +// HeadBlockHash: headEth1Hash, +// SafeBlockHash: eth1BlockHash, +// FinalizedBlockHash: eth1BlockHash, +// }, +// nil, +// s.cs.ActiveForkVersionForSlot(slot), +// ), +// ) +// return err +// } diff --git a/mod/beacon/validator/service.go b/mod/beacon/validator/service.go index 73becf52d7..b29de192ac 100644 --- a/mod/beacon/validator/service.go +++ b/mod/beacon/validator/service.go @@ -341,7 +341,7 @@ func (s *Service[BeaconStateT, BlobSidecarsT]) VerifyIncomingBlock( return err } - if _, err := s.localPayloadBuilder.RequestPayload( + if _, err = s.localPayloadBuilder.RequestPayload( ctx, st, blk.GetSlot()+1,