Skip to content

Commit

Permalink
contracts-bedrock: revert changes to OptimismPortal2
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfuturistic committed May 10, 2024
1 parent 2a2c4cc commit 2b22287
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions packages/contracts-bedrock/src/L1/OptimismPortal2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import { AddressAliasHelper } from "src/vendor/AddressAliasHelper.sol";
import { ResourceMetering } from "src/L1/ResourceMetering.sol";
import { ISemver } from "src/universal/ISemver.sol";
import { Constants } from "src/libraries/Constants.sol";
import { L1Block, ConfigType } from "src/L2/L1Block.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";

import "src/libraries/PortalErrors.sol";
import "src/dispute/lib/Types.sol";
Expand Down Expand Up @@ -47,9 +45,6 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
/// @notice The L2 gas limit set when eth is deposited using the receive() function.
uint64 internal constant RECEIVE_DEFAULT_GAS_LIMIT = 100_000;

/// @notice The L2 gas limit for system deposit transactions that are initiated from L1.
uint32 internal constant SYSTEM_DEPOSIT_GAS_LIMIT = 80_000;

/// @notice Address of the L2 account which initiated a withdrawal in this transaction.
/// If the of this variable is the default L2 sender address, then we are NOT inside of
/// a call to finalizeWithdrawalTransaction.
Expand Down Expand Up @@ -521,28 +516,4 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
function numProofSubmitters(bytes32 _withdrawalHash) external view returns (uint256) {
return proofSubmitters[_withdrawalHash].length;
}

/// @notice Sets static configuration options for the L2 system. Only the SystemConfig contract can call this
/// function.
function setConfig(ConfigType _type, bytes memory _value) external {
if (msg.sender != address(systemConfig)) revert Unauthorized();

// Set L2 deposit gas as used without paying burning gas. Ensures that deposits cannot use too much L2 gas.
// This value must be large enough to cover the cost of calling `L1Block.setConfig`.
useGas(SYSTEM_DEPOSIT_GAS_LIMIT);

// Emit the special deposit transaction directly that sets the config in the L1Block predeploy contract.
emit TransactionDeposited(
Constants.DEPOSITOR_ACCOUNT,
Predeploys.L1_BLOCK_ATTRIBUTES,
DEPOSIT_VERSION,
abi.encodePacked(
uint256(0), // mint
uint256(0), // value
uint64(SYSTEM_DEPOSIT_GAS_LIMIT), // gasLimit
false, // isCreation,
abi.encodeCall(L1Block.setConfig, (_type, _value))
)
);
}
}

0 comments on commit 2b22287

Please sign in to comment.