@@ -381,31 +381,35 @@ func TxsToTxsData(txs types.Transactions) []*types.TransactionData {
381381 v , r , s := tx .RawSignatureValues ()
382382
383383 nonce := tx .Nonce ()
384+ var from common.Address
384385
385386 // We need QueueIndex in `NewBatchHeader`. However, `TransactionData`
386387 // does not have this field. Since `L1MessageTx` do not have a nonce,
387388 // we reuse this field for storing the queue index.
388389 if msg := tx .AsL1MessageTx (); msg != nil {
389390 nonce = msg .QueueIndex
391+ from = msg .Sender
390392 }
391393
392394 txsData [i ] = & types.TransactionData {
393- Type : tx .Type (),
394- TxHash : tx .Hash ().String (),
395- Nonce : nonce ,
396- ChainId : (* hexutil .Big )(tx .ChainId ()),
397- Gas : tx .Gas (),
398- GasPrice : (* hexutil .Big )(tx .GasPrice ()),
399- GasTipCap : (* hexutil .Big )(tx .GasTipCap ()),
400- GasFeeCap : (* hexutil .Big )(tx .GasFeeCap ()),
401- To : tx .To (),
402- Value : (* hexutil .Big )(tx .Value ()),
403- Data : hexutil .Encode (tx .Data ()),
404- IsCreate : tx .To () == nil ,
405- AccessList : tx .AccessList (),
406- V : (* hexutil .Big )(v ),
407- R : (* hexutil .Big )(r ),
408- S : (* hexutil .Big )(s ),
395+ Type : tx .Type (),
396+ TxHash : tx .Hash ().String (),
397+ Nonce : nonce ,
398+ ChainId : (* hexutil .Big )(tx .ChainId ()),
399+ Gas : tx .Gas (),
400+ GasPrice : (* hexutil .Big )(tx .GasPrice ()),
401+ GasTipCap : (* hexutil .Big )(tx .GasTipCap ()),
402+ GasFeeCap : (* hexutil .Big )(tx .GasFeeCap ()),
403+ From : from ,
404+ To : tx .To (),
405+ Value : (* hexutil .Big )(tx .Value ()),
406+ Data : hexutil .Encode (tx .Data ()),
407+ IsCreate : tx .To () == nil ,
408+ AccessList : tx .AccessList (),
409+ AuthorizationList : tx .SetCodeAuthorizations (),
410+ V : (* hexutil .Big )(v ),
411+ R : (* hexutil .Big )(r ),
412+ S : (* hexutil .Big )(s ),
409413 }
410414 }
411415 return txsData
@@ -796,18 +800,9 @@ func MessageQueueV2ApplyL1MessagesFromBlocks(initialQueueHash common.Hash, block
796800 continue
797801 }
798802
799- data , err := hexutil . Decode (txData . Data )
803+ l1Message , err := l1MessageFromTxData (txData )
800804 if err != nil {
801- return common.Hash {}, fmt .Errorf ("failed to decode txData.Data: data=%v, err=%w" , txData .Data , err )
802- }
803-
804- l1Message := & types.L1MessageTx {
805- QueueIndex : txData .Nonce ,
806- Gas : txData .Gas ,
807- To : txData .To ,
808- Value : txData .Value .ToInt (),
809- Data : data ,
810- Sender : txData .From ,
805+ return common.Hash {}, fmt .Errorf ("failed to decode L1 message from tx data: %w" , err )
811806 }
812807
813808 rollingHash = messageQueueV2ApplyL1Message (rollingHash , l1Message )
@@ -817,6 +812,22 @@ func MessageQueueV2ApplyL1MessagesFromBlocks(initialQueueHash common.Hash, block
817812 return rollingHash , nil
818813}
819814
815+ func l1MessageFromTxData (txData * types.TransactionData ) (* types.L1MessageTx , error ) {
816+ data , err := hexutil .Decode (txData .Data )
817+ if err != nil {
818+ return nil , fmt .Errorf ("failed to decode txData.Data: data=%v, err=%w" , txData .Data , err )
819+ }
820+
821+ return & types.L1MessageTx {
822+ QueueIndex : txData .Nonce ,
823+ Gas : txData .Gas ,
824+ To : txData .To ,
825+ Value : txData .Value .ToInt (),
826+ Data : data ,
827+ Sender : txData .From ,
828+ }, nil
829+ }
830+
820831func MessageQueueV2ApplyL1Messages (initialQueueHash common.Hash , messages []* types.L1MessageTx ) common.Hash {
821832 rollingHash := initialQueueHash
822833 for _ , message := range messages {
0 commit comments