// PreparePayloadAttributes prepares a PayloadAttributes template that is ready to build a L2 block with deposits only, on top of the given l2Parent, with the given epoch as L1 origin.
// The template defaults to NoTxPool=true, and no sequencer transactions: the caller has to modify the template to add transactions,
// by setting NoTxPool=false as sequencer, or by appending batch transactions as verifier.
// The severity of the error is returned; a crit=false error means there was a temporary issue, like a failed RPC or time-out.
// A crit=true error means the input arguments are inconsistent or invalid.
// Check if we need to advance an epoch & update local state
ifl2SafeHead.L1Origin!=batch.Epoch(){
aq.log.Info("advancing epoch in the attributes queue","l2SafeHead",l2SafeHead,"l2SafeHead_origin",l2SafeHead.L1Origin,"batch_timestamp",batch.Timestamp,"batch_epoch",batch.Epoch())
returnl2Head,nil,fmt.Errorf("cannot create new block with L1 origin %s (parent %s) on top of L1 origin %s",l1Origin,l1Origin.ParentID(),l2Head.L1Origin)
returnl2Head,nil,fmt.Errorf("cannot create new block with L1 origin %s (parent %s) on top of L1 origin %s",l1Origin,l1Origin.ParentID(),l2Head.L1Origin)