Skip to content

Commit

Permalink
docs: improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Oct 8, 2024
1 parent 29b9bec commit 45adc02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
if (hostChainIsArbitrum) revert DataBlobsNotSupported();

// submit a batch spending report to refund the entity that produced the blob batch data
// same as using calldata, we only submit spending report if the caller is the origin of the tx
// same as using calldata, we only submit spending report if the caller is the origin and is codeless
// such that one cannot "double-claim" batch posting refund in the same tx
if (CallerChecker.isCallerCodelessOrigin() && !isUsingFeeToken) {
submitBatchSpendingReport(dataHash, seqMessageIndex, block.basefee, blobGas);
Expand All @@ -449,15 +449,15 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
uint256 afterDelayedMessagesRead,
uint256 prevMessageCount,
uint256 newMessageCount,
bool isFromOrigin
bool isFromCodelessOrigin
) internal {
(bytes32 dataHash, IBridge.TimeBounds memory timeBounds) =
formCallDataHash(data, afterDelayedMessagesRead);
(uint256 seqMessageIndex, bytes32 beforeAcc, bytes32 delayedAcc, bytes32 afterAcc) =
addSequencerL2BatchImpl(
dataHash,
afterDelayedMessagesRead,
isFromOrigin ? data.length : 0,
isFromCodelessOrigin ? data.length : 0,
prevMessageCount,
newMessageCount
);
Expand All @@ -474,12 +474,12 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
delayedAcc,
totalDelayedMessagesRead,
timeBounds,
isFromOrigin
isFromCodelessOrigin
? IBridge.BatchDataLocation.TxInput
: IBridge.BatchDataLocation.SeparateBatchEvent
);

if (!isFromOrigin) {
if (!isFromCodelessOrigin) {
emit SequencerBatchData(seqMessageIndex, data);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/libraries/CallerChecker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pragma solidity ^0.8.0;

library CallerChecker {
/**
* @notice A EIP-7702 safe check to ensure the caller is a codeless origin
* @return bool true if the caller is a codeless origin, false otherwise
* @dev If the caller is a codeless origin, then the calldata is guaranteed to be available in the transaction
* @notice A EIP-7702 safe check to ensure the caller is the origin and is codeless
* @return bool true if the caller is the origin and is codeless, false otherwise
* @dev If the caller is the origin and is codeless, then msg.data is guaranteed to be same as tx.data
* It also mean the caller would not be able to call a contract multiple times with the same transaction
*/
function isCallerCodelessOrigin() internal view returns (bool) {
Expand Down

0 comments on commit 45adc02

Please sign in to comment.