Skip to content

Commit

Permalink
add additional check before emitting log warning (#9564)
Browse files Browse the repository at this point in the history
* add additional check before emitting log warning

* Update op-node/rollup/derive/engine_controller.go

Co-authored-by: protolambda <proto@protolambda.com>

---------

Co-authored-by: protolambda <proto@protolambda.com>
  • Loading branch information
axelKingsley and protolambda committed Feb 15, 2024
1 parent 308ac94 commit 08921d5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion op-node/rollup/derive/engine_controller.go
Expand Up @@ -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{
Expand Down

0 comments on commit 08921d5

Please sign in to comment.