Commit 08921d5c authored by Axel Kingsley's avatar Axel Kingsley Committed by GitHub

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: default avatarprotolambda <proto@protolambda.com>

---------
Co-authored-by: default avatarprotolambda <proto@protolambda.com>
parent 308ac94c
......@@ -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{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment