Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PlasmaPower committed Jun 20, 2023
1 parent 2836554 commit 1b10711
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -392,18 +392,28 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
// this msg isn't included in the current sequencer batch, but instead added to
// the delayed messages queue that is yet to be included
address batchPoster = msg.sender;
bytes memory spendingReportMsg = abi.encodePacked(
block.timestamp,
batchPoster,
dataHash,
seqMessageIndex,
block.basefee
);
bytes memory spendingReportMsg;
if (hostChainIsArbitrum) {
// Include extra gas for the host chain's L1 gas charging
uint256 l1Fees = ArbGasInfo(address(0x6c)).getCurrentTxL1GasFees();
uint64 extraGas = uint64(l1Fees / block.basefee);
spendingReportMsg = abi.encodePacked(spendingReportMsg, extraGas);
uint256 extraGas = l1Fees / block.basefee;
require(extraGas <= type(uint64).max, "L1_GAS_NOT_UINT64");
spendingReportMsg = abi.encodePacked(
block.timestamp,
batchPoster,
dataHash,
seqMessageIndex,
block.basefee,
uint64(extraGas)
);
} else {
spendingReportMsg = abi.encodePacked(
block.timestamp,
batchPoster,
dataHash,
seqMessageIndex,
block.basefee
);
}
uint256 msgNum = bridge.submitBatchSpendingReport(
batchPoster,
Expand Down

0 comments on commit 1b10711

Please sign in to comment.