@@ -418,6 +418,9 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
418418 afterDelayedMessagesRead
419419 );
420420
421+ // we use addSequencerL2BatchImpl for submitting the message
422+ // normally this would also submit a batch spending report but that is skipped if we pass
423+ // an empty call data size, then we submit a separate batch spending report later
421424 (
422425 uint256 seqMessageIndex ,
423426 bytes32 beforeAcc ,
@@ -453,11 +456,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
453456
454457 // submit a batch spending report to refund the entity that produced the blob batch data
455458 uint256 blobBasefee = blobBasefeeReader.getBlobBaseFee ();
456-
457- // TODO: This report the gas spending using the blob basefee, however the actual spending actually involve
458- // 2 parts: 1. data cost priced in blob basefee, 2. tx cost priced in block basefee
459- // We might need to change the batch spending report format so both costs are reported.
460- submitBatchSpendingReport (dataHash, seqMessageIndex, blobBasefee);
459+ submitBatchSpendingReport (dataHash, seqMessageIndex, block .basefee , blobBasefee);
461460 }
462461
463462 function addSequencerL2Batch (
@@ -625,7 +624,8 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
625624 function submitBatchSpendingReport (
626625 bytes32 dataHash ,
627626 uint256 seqMessageIndex ,
628- uint256 gasPrice
627+ uint256 gasPrice ,
628+ uint256 blobBaseFeePrice
629629 ) internal {
630630 bytes memory spendingReportMsg;
631631 address batchPoster = msg .sender ;
@@ -646,12 +646,16 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
646646 uint64 (extraGas)
647647 );
648648 } else {
649+ // when a blob base fee is supplied we include it into the batch spending report
649650 spendingReportMsg = abi.encodePacked (
650651 block .timestamp ,
651652 batchPoster,
652653 dataHash,
653654 seqMessageIndex,
654- gasPrice
655+ gasPrice,
656+ // we add an empty extraGas since the parsing code expects a value here
657+ uint64 (0 ),
658+ blobBaseFeePrice
655659 );
656660 }
657661
@@ -691,7 +695,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
691695 totalDelayedMessagesRead = afterDelayedMessagesRead;
692696
693697 if (calldataLengthPosted > 0 ) {
694- submitBatchSpendingReport (dataHash, seqMessageIndex, block .basefee );
698+ submitBatchSpendingReport (dataHash, seqMessageIndex, block .basefee , 0 );
695699 }
696700 }
697701
0 commit comments