Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed May 28, 2024
1 parent 2746f6e commit 3a460be
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 41 deletions.
72 changes: 32 additions & 40 deletions mod/beacon/blockchain/execution_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// }
2 changes: 1 addition & 1 deletion mod/beacon/validator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3a460be

Please sign in to comment.