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 66cd32b commit 712e44a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
51 changes: 51 additions & 0 deletions mod/beacon/blockchain/execution_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,54 @@ func (s *Service[
)
}
}

func (s *Service[
AvailabilityStoreT,
BeaconStateT,
BlobSidecarsT,
DepositStoreT,
]) SendHackFCU(ctx context.Context) error {
st := s.sb.StateFromContext(ctx)

lph, err := st.GetLatestExecutionPayloadHeader()
if err != nil {
return err
}

lbr, err := st.GetLatestBlockHeader()
if err != nil {
return err
}

lbr.StateRoot, err = st.HashTreeRoot()
if err != nil {
return err
}

br, err := lbr.HashTreeRoot()
if err != nil {
return err
}

ss, err := st.GetSlot()
if err != nil {
return err
}

// Ask the builder to send a forkchoice update with attributes.
// This will trigger a new payload to be built.
if _, err = s.lb.RequestPayload(
ctx,
st,
ss,
//#nosec:G701 // won't realistically overflow.
// TODO: clock time properly.
uint64(time.Now().Unix()+1),
br,
lph.GetBlockHash(),
); err != nil {
return err
}

return nil
}
2 changes: 2 additions & 0 deletions mod/runtime/pkg/abci/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,6 @@ type BlockchainService[BlobsSidecarsT ssz.Marshallable] interface {
VerifyPayloadOnBlk(
context.Context, types.BeaconBlock,
) error

SendHackFCU(ctx context.Context) error
}

0 comments on commit 712e44a

Please sign in to comment.