@@ -38,7 +38,7 @@ var _ EngineControl = (*EngineController)(nil)
3838var _ LocalEngineControl = (* EngineController )(nil )
3939
4040type ExecEngine interface {
41- GetPayload (ctx context.Context , payloadId eth.PayloadID ) (* eth.ExecutionPayloadEnvelope , error )
41+ GetPayload (ctx context.Context , payloadInfo eth.PayloadInfo ) (* eth.ExecutionPayloadEnvelope , error )
4242 ForkchoiceUpdate (ctx context.Context , state * eth.ForkchoiceState , attr * eth.PayloadAttributes ) (* eth.ForkchoiceUpdatedResult , error )
4343 NewPayload (ctx context.Context , payload * eth.ExecutionPayload , parentBeaconBlockRoot * common.Hash ) (* eth.PayloadStatusV1 , error )
4444 L2BlockRefByLabel (ctx context.Context , label eth.BlockLabel ) (eth.L2BlockRef , error )
@@ -63,7 +63,7 @@ type EngineController struct {
6363
6464 // Building State
6565 buildingOnto eth.L2BlockRef
66- buildingID eth.PayloadID
66+ buildingInfo eth.PayloadInfo
6767 buildingSafe bool
6868 safeAttrs * AttributesWithParent
6969}
@@ -104,7 +104,7 @@ func (e *EngineController) Finalized() eth.L2BlockRef {
104104}
105105
106106func (e * EngineController ) BuildingPayload () (eth.L2BlockRef , eth.PayloadID , bool ) {
107- return e .buildingOnto , e .buildingID , e .buildingSafe
107+ return e .buildingOnto , e .buildingInfo . ID , e .buildingSafe
108108}
109109
110110func (e * EngineController ) IsEngineSyncing () bool {
@@ -146,8 +146,8 @@ func (e *EngineController) StartPayload(ctx context.Context, parent eth.L2BlockR
146146 if e .IsEngineSyncing () {
147147 return BlockInsertTemporaryErr , fmt .Errorf ("engine is in progess of p2p sync" )
148148 }
149- if e .buildingID != (eth.PayloadID {}) {
150- e .log .Warn ("did not finish previous block building, starting new building now" , "prev_onto" , e .buildingOnto , "prev_payload_id" , e .buildingID , "new_onto" , parent )
149+ if e .buildingInfo != (eth.PayloadInfo {}) {
150+ e .log .Warn ("did not finish previous block building, starting new building now" , "prev_onto" , e .buildingOnto , "prev_payload_id" , e .buildingInfo . ID , "new_onto" , parent )
151151 // TODO(8841): maybe worth it to force-cancel the old payload ID here.
152152 }
153153 fc := eth.ForkchoiceState {
@@ -161,7 +161,7 @@ func (e *EngineController) StartPayload(ctx context.Context, parent eth.L2BlockR
161161 return errTyp , err
162162 }
163163
164- e .buildingID = id
164+ e .buildingInfo = eth. PayloadInfo { ID : id , Timestamp : uint64 ( attrs . attributes . Timestamp )}
165165 e .buildingSafe = updateSafe
166166 e .buildingOnto = parent
167167 if updateSafe {
@@ -172,7 +172,7 @@ func (e *EngineController) StartPayload(ctx context.Context, parent eth.L2BlockR
172172}
173173
174174func (e * EngineController ) ConfirmPayload (ctx context.Context , agossip async.AsyncGossiper , sequencerConductor conductor.SequencerConductor ) (out * eth.ExecutionPayloadEnvelope , errTyp BlockInsertionErrType , err error ) {
175- if e .buildingID == (eth.PayloadID {}) {
175+ if e .buildingInfo == (eth.PayloadInfo {}) {
176176 return nil , BlockInsertPrestateErr , fmt .Errorf ("cannot complete payload building: not currently building a payload" )
177177 }
178178 if e .buildingOnto .Hash != e .unsafeHead .Hash { // E.g. when safe-attributes consolidation fails, it will drop the existing work.
@@ -185,9 +185,9 @@ func (e *EngineController) ConfirmPayload(ctx context.Context, agossip async.Asy
185185 }
186186 // Update the safe head if the payload is built with the last attributes in the batch.
187187 updateSafe := e .buildingSafe && e .safeAttrs != nil && e .safeAttrs .isLastInSpan
188- envelope , errTyp , err := confirmPayload (ctx , e .log , e .engine , fc , e .buildingID , updateSafe , agossip , sequencerConductor )
188+ envelope , errTyp , err := confirmPayload (ctx , e .log , e .engine , fc , e .buildingInfo , updateSafe , agossip , sequencerConductor )
189189 if err != nil {
190- return nil , errTyp , fmt .Errorf ("failed to complete building on top of L2 chain %s, id: %s, error (%d): %w" , e .buildingOnto , e .buildingID , errTyp , err )
190+ return nil , errTyp , fmt .Errorf ("failed to complete building on top of L2 chain %s, id: %s, error (%d): %w" , e .buildingOnto , e .buildingInfo . ID , errTyp , err )
191191 }
192192 ref , err := PayloadToBlockRef (e .rollupCfg , envelope .ExecutionPayload )
193193 if err != nil {
@@ -211,14 +211,14 @@ func (e *EngineController) ConfirmPayload(ctx context.Context, agossip async.Asy
211211}
212212
213213func (e * EngineController ) CancelPayload (ctx context.Context , force bool ) error {
214- if e .buildingID == (eth.PayloadID {}) { // only cancel if there is something to cancel.
214+ if e .buildingInfo == (eth.PayloadInfo {}) { // only cancel if there is something to cancel.
215215 return nil
216216 }
217217 // the building job gets wrapped up as soon as the payload is retrieved, there's no explicit cancel in the Engine API
218- e .log .Error ("cancelling old block sealing job" , "payload" , e .buildingID )
219- _ , err := e .engine .GetPayload (ctx , e .buildingID )
218+ e .log .Error ("cancelling old block sealing job" , "payload" , e .buildingInfo . ID )
219+ _ , err := e .engine .GetPayload (ctx , e .buildingInfo )
220220 if err != nil {
221- e .log .Error ("failed to cancel block building job" , "payload" , e .buildingID , "err" , err )
221+ e .log .Error ("failed to cancel block building job" , "payload" , e .buildingInfo . ID , "err" , err )
222222 if ! force {
223223 return err
224224 }
@@ -228,7 +228,7 @@ func (e *EngineController) CancelPayload(ctx context.Context, force bool) error
228228}
229229
230230func (e * EngineController ) resetBuildingState () {
231- e .buildingID = eth.PayloadID {}
231+ e .buildingInfo = eth.PayloadInfo {}
232232 e .buildingOnto = eth.L2BlockRef {}
233233 e .buildingSafe = false
234234 e .safeAttrs = nil
0 commit comments