From 08921d5c1df39c329f9ab82447ea939bc61a8784 Mon Sep 17 00:00:00 2001 From: Axel Kingsley Date: Thu, 15 Feb 2024 13:14:19 -0600 Subject: [PATCH] add additional check before emitting log warning (#9564) * add additional check before emitting log warning * Update op-node/rollup/derive/engine_controller.go Co-authored-by: protolambda --------- Co-authored-by: protolambda --- op-node/rollup/derive/engine_controller.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/op-node/rollup/derive/engine_controller.go b/op-node/rollup/derive/engine_controller.go index 67f1ec0bfc63..66f9b63552bb 100644 --- a/op-node/rollup/derive/engine_controller.go +++ b/op-node/rollup/derive/engine_controller.go @@ -176,7 +176,12 @@ func (e *EngineController) ConfirmPayload(ctx context.Context, agossip async.Asy if e.buildingInfo == (eth.PayloadInfo{}) && agossip.Get() == nil { return nil, BlockInsertPrestateErr, fmt.Errorf("cannot complete payload building: not currently building a payload") } - if e.buildingOnto.Hash != e.unsafeHead.Hash { // E.g. when safe-attributes consolidation fails, it will drop the existing work. + if p := agossip.Get(); p != nil && e.buildingOnto == (eth.L2BlockRef{}) { + e.log.Warn("Found reusable payload from async gossiper, and no block was being built. Reusing payload.", + "hash", p.ExecutionPayload.BlockHash, + "number", uint64(p.ExecutionPayload.BlockNumber), + "parent", p.ExecutionPayload.ParentHash) + } else if e.buildingOnto.Hash != e.unsafeHead.Hash { // E.g. when safe-attributes consolidation fails, it will drop the existing work. e.log.Warn("engine is building block that reorgs previous unsafe head", "onto", e.buildingOnto, "unsafe", e.unsafeHead) } fc := eth.ForkchoiceState{