Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Simplify SetGasLimit contract, fixing rollback nonce #122

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions script/deploy/l1/RollbackGasLimit.sol

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@ import {SystemConfig} from "@eth-optimism-bedrock/src/L1/SystemConfig.sol";
import {MultisigBuilder, IMulticall3, IGnosisSafe, Simulation} from "../../universal/MultisigBuilder.sol";
import {Vm} from "forge-std/Vm.sol";

abstract contract SetGasLimitBuilder is MultisigBuilder {
contract SetGasLimit is MultisigBuilder {
address internal SYSTEM_CONFIG_OWNER = vm.envAddress("SYSTEM_CONFIG_OWNER");
address internal L1_SYSTEM_CONFIG = vm.envAddress("L1_SYSTEM_CONFIG_ADDRESS");

/**
* -----------------------------------------------------------
* Virtual Functions
* Implemented Functions
* -----------------------------------------------------------
*/
function _fromGasLimit() internal view virtual returns (uint64);

function _toGasLimit() internal view virtual returns (uint64);
function _fromGasLimit() internal view returns (uint64) {
return uint64(vm.envUint("FROM_GAS_LIMIT"));
}

function _nonceOffset() internal view virtual returns (uint64);
function _toGasLimit() internal view returns (uint64) {
return uint64(vm.envUint("TO_GAS_LIMIT"));
}

/**
* -----------------------------------------------------------
* Implemented Functions
* -----------------------------------------------------------
*/
function _postCheck(Vm.AccountAccess[] memory, Simulation.Payload memory) internal view override {
assert(SystemConfig(L1_SYSTEM_CONFIG).gasLimit() == _toGasLimit());
}
Expand All @@ -45,10 +42,6 @@ abstract contract SetGasLimitBuilder is MultisigBuilder {
return SYSTEM_CONFIG_OWNER;
}

function _getNonce(address safe) internal view override returns (uint256 nonce) {
nonce = IGnosisSafe(safe).nonce() + _nonceOffset();
}

// We need to expect that the gas limit will have been updated previously in our simulation
// Use this override to specifically set the gas limit to the expected update value.
function _simulationOverrides() internal view override returns (Simulation.StateOverride[] memory) {
Expand Down
22 changes: 0 additions & 22 deletions script/deploy/l1/UpgradeGasLimit.sol

This file was deleted.