// even if it is an input-error (unknown payload ID), it is temporary, since we will re-attempt the full payload building, not just the retrieval of the payload.
returnnil,BlockInsertTemporaryErr,fmt.Errorf("failed to get execution payload: %w",err)
...
...
@@ -127,12 +148,16 @@ func confirmPayload(ctx context.Context, log log.Logger, eng ExecEngine, fc eth.
iferr:=sanityCheckPayload(payload);err!=nil{
returnnil,BlockInsertPayloadErr,err
}
// begin gossiping as soon as possible
// agossip.Clear() will be called later if an non-temporary error is found, or if the payload is successfully inserted
@@ -150,14 +175,17 @@ func confirmPayload(ctx context.Context, log log.Logger, eng ExecEngine, fc eth.
switchinputErr.Code{
caseeth.InvalidForkchoiceState:
// if we succeed to update the forkchoice pre-payload, but fail post-payload, then it is a payload error
agossip.Clear()
returnnil,BlockInsertPayloadErr,fmt.Errorf("post-block-creation forkchoice update was inconsistent with engine, need reset to resolve: %w",inputErr.Unwrap())
default:
agossip.Clear()
returnnil,BlockInsertPrestateErr,fmt.Errorf("unexpected error code in forkchoice-updated response: %w",err)
}
}else{
returnnil,BlockInsertTemporaryErr,fmt.Errorf("failed to make the new L2 block canonical via forkchoice: %w",err)
// CompleteBuildingBlock takes the current block that is being built, and asks the engine to complete the building, seal the block, and persist it as canonical.
// Warning: the safe and finalized L2 blocks as viewed during the initiation of the block building are reused for completion of the block building.
// The Execution engine should not change the safe and finalized blocks between start and completion of block building.