@@ -418,6 +418,9 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
418
418
afterDelayedMessagesRead
419
419
);
420
420
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
421
424
(
422
425
uint256 seqMessageIndex ,
423
426
bytes32 beforeAcc ,
@@ -453,11 +456,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
453
456
454
457
// submit a batch spending report to refund the entity that produced the blob batch data
455
458
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);
461
460
}
462
461
463
462
function addSequencerL2Batch (
@@ -625,7 +624,8 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
625
624
function submitBatchSpendingReport (
626
625
bytes32 dataHash ,
627
626
uint256 seqMessageIndex ,
628
- uint256 gasPrice
627
+ uint256 gasPrice ,
628
+ uint256 blobBaseFeePrice
629
629
) internal {
630
630
bytes memory spendingReportMsg;
631
631
address batchPoster = msg .sender ;
@@ -646,12 +646,16 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
646
646
uint64 (extraGas)
647
647
);
648
648
} else {
649
+ // when a blob base fee is supplied we include it into the batch spending report
649
650
spendingReportMsg = abi.encodePacked (
650
651
block .timestamp ,
651
652
batchPoster,
652
653
dataHash,
653
654
seqMessageIndex,
654
- gasPrice
655
+ gasPrice,
656
+ // we add an empty extraGas since the parsing code expects a value here
657
+ uint64 (0 ),
658
+ blobBaseFeePrice
655
659
);
656
660
}
657
661
@@ -691,7 +695,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
691
695
totalDelayedMessagesRead = afterDelayedMessagesRead;
692
696
693
697
if (calldataLengthPosted > 0 ) {
694
- submitBatchSpendingReport (dataHash, seqMessageIndex, block .basefee );
698
+ submitBatchSpendingReport (dataHash, seqMessageIndex, block .basefee , 0 );
695
699
}
696
700
}
697
701
0 commit comments