Skip to content

Commit

Permalink
resolving small nits
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-de-leon-cll committed Feb 7, 2024
1 parent 61796eb commit e841c8a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion contracts/gas-snapshots/l2ep.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ArbitrumSequencerUptimeFeed_UpdateStatus:test_IgnoreOutOfOrderUpdates() (gas: 98
ArbitrumSequencerUptimeFeed_UpdateStatus:test_RevertIfNotL2CrossDomainMessengerAddr() (gas: 15234)
ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndNoTimeChange() (gas: 113208)
ArbitrumSequencerUptimeFeed_UpdateStatus:test_UpdateStatusWhenStatusChangeAndTimeChange() (gas: 113268)
ArbitrumValidator_Validate:test_PostSequencerOffline() (gas: 69035)
ArbitrumValidator_Validate:test_PostSequencerOffline() (gas: 69058)
OptimismCrossDomainForwarder_AcceptL1Ownership:test_CallableByPendingL1Owner() (gas: 46884)
OptimismCrossDomainForwarder_AcceptL1Ownership:test_NotCallableByNonPendingOwners() (gas: 22152)
OptimismCrossDomainForwarder_Constructor:test_InitialState() (gas: 18258)
Expand Down
6 changes: 3 additions & 3 deletions contracts/src/v0.8/l2ep/dev/GasLimitValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {Validator} from "./Validator.sol";
abstract contract GasLimitValidator is Validator {
uint32 internal s_gasLimit;

/// @notice emitted when gas cost to spend on L2 is updated
/// @notice emitted when gas limit on L2 is updated
/// @param gasLimit updated gas cost
event GasLimitUpdated(uint32 gasLimit);

/// @param l1CrossDomainMessengerAddress address the L1CrossDomainMessenger contract address
/// @param l2UptimeFeedAddr the address of the ScrollSequencerUptimeFeed contract address
/// @param l2UptimeFeedAddr the address of the UptimeFeed contract address
/// @param gasLimit the gasLimit to use for sending a message from L1 to L2
constructor(
address l1CrossDomainMessengerAddress,
Expand All @@ -21,7 +21,7 @@ abstract contract GasLimitValidator is Validator {
s_gasLimit = gasLimit;
}

/// @notice sets the new gas cost to spend when sending cross chain message
/// @notice sets the new gas limit when sending cross chain message
/// @param gasLimit the updated gas cost
function setGasLimit(uint32 gasLimit) external onlyOwner {
s_gasLimit = gasLimit;
Expand Down
20 changes: 10 additions & 10 deletions contracts/src/v0.8/l2ep/dev/arbitrum/ArbitrumValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ contract ArbitrumValidator is Validator {

/// Config for L1 -> L2 Arbitrum retryable ticket message
struct GasConfig {
uint256 maxGas; //
uint256 gasPriceBid; //
uint256 baseFee; // Will use block.baseFee if set to 0
address gasPriceL1FeedAddr; //
address gasPriceL1FeedAddr; // ─╮
uint96 maxGas; // ──────────────╯
}

/// Helper Variable(s)
Expand Down Expand Up @@ -77,7 +77,7 @@ contract ArbitrumValidator is Validator {
address l1CrossDomainMessengerAddress,
address l2UptimeFeedAddr,
address configACAddr,
uint256 maxGas,
uint96 maxGas,
uint256 gasPriceBid,
uint256 baseFee,
address gasPriceL1FeedAddr,
Expand Down Expand Up @@ -145,11 +145,11 @@ contract ArbitrumValidator is Validator {
id = IArbitrumDelayedInbox(L1_CROSS_DOMAIN_MESSENGER_ADDRESS).createRetryableTicketNoRefundAliasRewrite{
value: l1PaymentValue
}(
ARBSYS_ADDR, /// target
amount, /// L2 call value (requested)
ARBSYS_ADDR, // target
amount, // L2 call value (requested)
maxSubmissionCost,
refundAddr, /// excessFeeRefundAddress
refundAddr, /// callValueRefundAddress
refundAddr, // excessFeeRefundAddress
refundAddr, // callValueRefundAddress
maxGas,
gasPriceBid,
message
Expand All @@ -175,7 +175,7 @@ contract ArbitrumValidator is Validator {
/// @param gasPriceBid maximum L2 gas price to pay
/// @param gasPriceL1FeedAddr address of the L1 gas price feed (used to approximate Arbitrum retryable ticket submission cost)
function setGasConfig(
uint256 maxGas,
uint96 maxGas,
uint256 gasPriceBid,
uint256 baseFee,
address gasPriceL1FeedAddr
Expand Down Expand Up @@ -249,14 +249,14 @@ contract ArbitrumValidator is Validator {
}

/// @notice internal method that stores the gas configuration
function _setGasConfig(uint256 maxGas, uint256 gasPriceBid, uint256 baseFee, address gasPriceL1FeedAddr) internal {
function _setGasConfig(uint96 maxGas, uint256 gasPriceBid, uint256 baseFee, address gasPriceL1FeedAddr) internal {
// solhint-disable-next-line custom-errors
require(maxGas > 0, "Max gas is zero");
// solhint-disable-next-line custom-errors
require(gasPriceBid > 0, "Gas price bid is zero");
// solhint-disable-next-line custom-errors
require(gasPriceL1FeedAddr != address(0), "Gas price Aggregator is zero address");
s_gasConfig = GasConfig(maxGas, gasPriceBid, baseFee, gasPriceL1FeedAddr);
s_gasConfig = GasConfig(gasPriceBid, baseFee, gasPriceL1FeedAddr, maxGas);
emit GasConfigSet(maxGas, gasPriceBid, gasPriceL1FeedAddr);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract ArbitrumValidatorTest is L2EPTest {
address internal constant L2_SEQ_STATUS_RECORDER_ADDRESS = 0x491B1dDA0A8fa069bbC1125133A975BF4e85a91b;
uint256 internal constant GAS_PRICE_BID = 1000000;
uint256 internal constant BASE_FEE = 14000000000;
uint256 internal constant MAX_GAS = 1000000;
uint96 internal constant MAX_GAS = 1000000;

/// L2EP contracts
AccessControllerInterface internal s_accessController;
Expand Down

0 comments on commit e841c8a

Please sign in to comment.