returnfmt.Errorf("cannot build new L2 block with L1 origin %s (parent L1 %s) on current L2 head %s with L1 origin %s",l1Origin,l1Origin.ParentHash,l2Head,l2Head.L1Origin)
returnfmt.Errorf("cannot build new L2 block with L1 origin %s (parent L1 %s) on current L2 head %s with L1 origin %s",l1Origin,l1Origin.ParentHash,l2Head,l2Head.L1Origin)
}
}
d.log.Info("creating new block","parent",l2Head,"l1Origin",l1Origin)
d.log.Info("creating new block","parent",l2Head,"l1Origin",l1Origin)
ifd.buildingID!=(eth.PayloadID{}){// This may happen when we decide to build a different block in response to a reorg. Or when previous block building failed.
d.log.Warn("did not finish previous block building, starting new building now","prev_onto",d.buildingOnto,"prev_payload_id",d.buildingID,"new_onto",l2Head)
require.GreaterOrEqual(t,l2Head.Time,l1Times[l2Head.L1Origin],"the L2 time >= the L1 time")
require.Less(t,l2Head.Time-l1Times[l2Head.L1Origin],uint64(100),"The L1 origin time is close to the L2 time")
require.Less(t,clockTime.Sub(time.Unix(int64(l2Head.Time),0)).Abs(),2*time.Second,"L2 time is accurate, within 2 seconds of wallclock")
require.Greater(t,engControl.avgBuildingTime(),time.Second,"With 2 second block time and 1 second error backoff and healthy-on-average errors, building time should at least be a second")
require.Greater(t,engControl.avgTxsPerBlock(),3.0,"We expect at least 1 system tx per block, but with a mocked 0-10 txs we expect an higher avg")
s.log.Error("Sequenced payload cannot be transformed into valid L2 block reference","err",err)
returnfmt.Errorf("sequenced payload cannot be transformed into valid L2 block reference: %w",err)
}
// Update our L2 head block based on the new unsafe block we just generated.
s.derivation.SetUnsafeHead(newUnsafeL2Head)
s.log.Info("Sequenced new l2 block","l2_unsafe",newUnsafeL2Head,"l1_origin",newUnsafeL2Head.L1Origin,"txs",len(payload.Transactions),"time",newUnsafeL2Head.Time)