Skip to content

Commit

Permalink
chore: rename to CalldataChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Oct 8, 2024
1 parent 13036a6 commit 779c837
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/bridge/AbsInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import "./IInboxBase.sol";
import "./ISequencerInbox.sol";
import "./IBridge.sol";
import "../libraries/AddressAliasHelper.sol";
import "../libraries/CallerChecker.sol";
import "../libraries/CalldataChecker.sol";
import "../libraries/DelegateCallAware.sol";
import {
L1MessageType_submitRetryableTx,
Expand Down Expand Up @@ -140,7 +140,7 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
bytes calldata messageData
) external whenNotPaused onlyAllowed returns (uint256) {
if (_chainIdChanged()) revert L1Forked();
if (!CallerChecker.isCalldataSameAsTx()) revert CalldataNotSameAsTx();
if (!CalldataChecker.isCalldataSameAsTx()) revert CalldataNotSameAsTx();
if (messageData.length > maxDataSize) revert DataTooLarge(messageData.length, maxDataSize);
uint256 msgNum = _deliverToBridge(L2_MSG, msg.sender, keccak256(messageData), 0);
emit InboxMessageDeliveredFromOrigin(msgNum);
Expand Down
8 changes: 4 additions & 4 deletions src/bridge/SequencerInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import "../rollup/IRollupLogic.sol";
import "./Messages.sol";
import "../precompiles/ArbGasInfo.sol";
import "../precompiles/ArbSys.sol";
import "../libraries/CallerChecker.sol";
import "../libraries/CalldataChecker.sol";
import "../libraries/IReader4844.sol";

import "../libraries/DelegateCallAware.sol";
Expand Down Expand Up @@ -335,7 +335,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
uint256 prevMessageCount,
uint256 newMessageCount
) external refundsGas(gasRefunder, IReader4844(address(0))) {
if (!CallerChecker.isCalldataSameAsTx()) revert CalldataNotSameAsTx();
if (!CalldataChecker.isCalldataSameAsTx()) revert CalldataNotSameAsTx();
if (!isBatchPoster[msg.sender]) revert NotBatchPoster();
if (isDelayProofRequired(afterDelayedMessagesRead)) revert DelayProofRequired();

Expand Down Expand Up @@ -388,7 +388,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
uint256 newMessageCount,
DelayProof calldata delayProof
) external refundsGas(gasRefunder, IReader4844(address(0))) {
if (!CallerChecker.isCalldataSameAsTx()) revert CalldataNotSameAsTx();
if (!CalldataChecker.isCalldataSameAsTx()) revert CalldataNotSameAsTx();
if (!isBatchPoster[msg.sender]) revert NotBatchPoster();
if (!isDelayBufferable) revert NotDelayBufferable();

Expand Down Expand Up @@ -438,7 +438,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
// 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
// such that one cannot "double-claim" batch posting refund in the same tx
if (CallerChecker.isCalldataSameAsTx() && !isUsingFeeToken) {
if (CalldataChecker.isCalldataSameAsTx() && !isUsingFeeToken) {
submitBatchSpendingReport(dataHash, seqMessageIndex, block.basefee, blobGas);
}
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/libraries/GasRefundEnabled.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pragma solidity ^0.8.0;

import "./IReader4844.sol";
import "./IGasRefunder.sol";
import "../libraries/CallerChecker.sol";
import "../libraries/CalldataChecker.sol";

abstract contract GasRefundEnabled {
uint256 internal immutable gasPerBlob = 2 ** 17;
Expand All @@ -25,7 +25,7 @@ abstract contract GasRefundEnabled {
startGasLeft += calldataWords * 6 + (calldataWords ** 2) / 512;
// if triggered in a contract call, the spender may be overrefunded by appending dummy data to the call
// so we check if it is a top level call, which would mean the sender paid calldata as part of tx.input
if (!CallerChecker.isCalldataSameAsTx()) {
if (!CalldataChecker.isCalldataSameAsTx()) {
// We can't be sure if this calldata came from the top level tx,
// so to be safe we tell the gas refunder there was no calldata.
calldataSize = 0;
Expand Down

0 comments on commit 779c837

Please sign in to comment.