beacon/blsync: add support for engine_newPayloadV4 with requests list
This commit is contained in:
parent
757b32842e
commit
8f94c09680
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue