Skip to content

Commit

Permalink
revert system config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Feb 21, 2024
1 parent 0738ef9 commit 7712c54
Show file tree
Hide file tree
Showing 15 changed files with 154 additions and 313 deletions.
79 changes: 8 additions & 71 deletions op-bindings/bindings/systemconfig.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindings/systemconfig_more.go

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions packages/contracts-bedrock/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 356509)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954694)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 549116)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4061264)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450265)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3496014)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 356552)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2954737)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 549159)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4061135)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_0() (gas: 450308)
GasBenchMark_L1StandardBridge_Deposit:test_depositETH_benchmark_1() (gas: 3496057)
GasBenchMark_L1StandardBridge_Finalize:test_finalizeETHWithdrawal_benchmark() (gas: 59803)
GasBenchMark_L2OutputOracle:test_proposeL2Output_benchmark() (gas: 92951)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68317)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 68970)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark() (gas: 68360)
GasBenchMark_OptimismPortal:test_depositTransaction_benchmark_1() (gas: 69013)
GasBenchMark_OptimismPortal:test_proveWithdrawalTransaction_benchmark() (gas: 155553)
2 changes: 1 addition & 1 deletion packages/contracts-bedrock/invariant-docs/SystemConfig.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `SystemConfig` Invariants

## The gas limit of the `SystemConfig` contract can never be lower than the hard-coded lower bound.
**Test:** [`SystemConfig.t.sol#L69`](../test/invariants/SystemConfig.t.sol#L69)
**Test:** [`SystemConfig.t.sol#L68`](../test/invariants/SystemConfig.t.sol#L68)

5 changes: 1 addition & 4 deletions packages/contracts-bedrock/scripts/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,7 @@ contract Deploy is Deployer {
l1StandardBridge: mustGetAddress("L1StandardBridgeProxy"),
l2OutputOracle: mustGetAddress("L2OutputOracleProxy"),
optimismPortal: mustGetAddress("OptimismPortalProxy"),
optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy"),
dataAvailabilityChallenge: cfg.usePlasma()
? mustGetAddress("DataAvailabilityChallengeProxy")
: address(0)
optimismMintableERC20Factory: mustGetAddress("OptimismMintableERC20FactoryProxy")
})
)
)
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"sourceCodeHash": "0xd6a894e371c2c7182b5960c507491f81c3775dda0efedd29475f7c30ca07b004"
},
"src/L1/SystemConfig.sol": {
"initCodeHash": "0xa4110f3b21dfeb93a2dced4ac33235bd133ab0d25a8028ad4a6e3ab9a7f0a5d0",
"sourceCodeHash": "0xeeb63131af612f26ae7b1c4e89ec0847fb3cbdc5d224bb61092389209e3697f7"
"initCodeHash": "0xa14bfe090e923acbacb361d9aa60e0d56fc1dff158ddbd1dc221a5380679f37f",
"sourceCodeHash": "0x58d078f2f352ccb9001afe8245f4655b47ed0227189ede9ef56523b2193059bd"
},
"src/L2/BaseFeeVault.sol": {
"initCodeHash": "0x2744d34573be83206d1b75d049d18a7bb37f9058e68c0803e5008c46b0dc2474",
Expand Down
31 changes: 0 additions & 31 deletions packages/contracts-bedrock/snapshots/abi/SystemConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "DATA_AVAILABILITY_CHALLENGE_SLOT",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "L1_CROSS_DOMAIN_MESSENGER_SLOT",
Expand Down Expand Up @@ -173,19 +160,6 @@
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "dataAvailabilityChallenge",
"outputs": [
{
"internalType": "address",
"name": "addr_",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "gasLimit",
Expand Down Expand Up @@ -304,11 +278,6 @@
"internalType": "address",
"name": "optimismMintableERC20Factory",
"type": "address"
},
{
"internalType": "address",
"name": "dataAvailabilityChallenge",
"type": "address"
}
],
"internalType": "struct SystemConfig.Addresses",
Expand Down
288 changes: 123 additions & 165 deletions packages/contracts-bedrock/snapshots/state-diff/Kontrol-Deploy.json

Large diffs are not rendered by default.

14 changes: 1 addition & 13 deletions packages/contracts-bedrock/src/L1/SystemConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ contract SystemConfig is OwnableUpgradeable, ISemver {
address l2OutputOracle;
address optimismPortal;
address optimismMintableERC20Factory;
address dataAvailabilityChallenge;
}

/// @notice Version identifier, used for upgrades.
Expand Down Expand Up @@ -70,10 +69,6 @@ contract SystemConfig is OwnableUpgradeable, ISemver {
bytes32 public constant OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT =
bytes32(uint256(keccak256("systemconfig.optimismmintableerc20factory")) - 1);

/// @notice Storage slot that the DataAvailabilityChallenge address is stored at.
bytes32 public constant DATA_AVAILABILITY_CHALLENGE_SLOT =
bytes32(uint256(keccak256("systemconfig.dataavailabilitychallenge")) - 1);

/// @notice Storage slot that the batch inbox address is stored at.
bytes32 public constant BATCH_INBOX_SLOT = bytes32(uint256(keccak256("systemconfig.batchinbox")) - 1);

Expand Down Expand Up @@ -138,8 +133,7 @@ contract SystemConfig is OwnableUpgradeable, ISemver {
l1StandardBridge: address(0),
l2OutputOracle: address(0),
optimismPortal: address(0),
optimismMintableERC20Factory: address(0),
dataAvailabilityChallenge: address(0)
optimismMintableERC20Factory: address(0)
})
});
}
Expand Down Expand Up @@ -186,7 +180,6 @@ contract SystemConfig is OwnableUpgradeable, ISemver {
Storage.setAddress(L2_OUTPUT_ORACLE_SLOT, _addresses.l2OutputOracle);
Storage.setAddress(OPTIMISM_PORTAL_SLOT, _addresses.optimismPortal);
Storage.setAddress(OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT, _addresses.optimismMintableERC20Factory);
Storage.setAddress(DATA_AVAILABILITY_CHALLENGE_SLOT, _addresses.dataAvailabilityChallenge);

_setStartBlock();

Expand Down Expand Up @@ -242,11 +235,6 @@ contract SystemConfig is OwnableUpgradeable, ISemver {
addr_ = Storage.getAddress(OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT);
}

/// @notice Getter for the DataAvailabilityChallenge address.
function dataAvailabilityChallenge() external view returns (address addr_) {
addr_ = Storage.getAddress(DATA_AVAILABILITY_CHALLENGE_SLOT);
}

/// @notice Getter for the BatchInbox address.
function batchInbox() external view returns (address addr_) {
addr_ = Storage.getAddress(BATCH_INBOX_SLOT);
Expand Down
9 changes: 3 additions & 6 deletions packages/contracts-bedrock/test/L1/SystemConfig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ contract SystemConfig_Initialize_TestFail is SystemConfig_Initialize_Test {
l1StandardBridge: address(0),
l2OutputOracle: address(0),
optimismPortal: address(0),
optimismMintableERC20Factory: address(0),
dataAvailabilityChallenge: address(0)
optimismMintableERC20Factory: address(0)
})
});
}
Expand Down Expand Up @@ -158,8 +157,7 @@ contract SystemConfig_Initialize_TestFail is SystemConfig_Initialize_Test {
l1StandardBridge: address(0),
l2OutputOracle: address(0),
optimismPortal: address(0),
optimismMintableERC20Factory: address(0),
dataAvailabilityChallenge: address(0)
optimismMintableERC20Factory: address(0)
})
});
assertEq(systemConfig.startBlock(), block.number);
Expand Down Expand Up @@ -189,8 +187,7 @@ contract SystemConfig_Initialize_TestFail is SystemConfig_Initialize_Test {
l1StandardBridge: address(0),
l2OutputOracle: address(0),
optimismPortal: address(0),
optimismMintableERC20Factory: address(0),
dataAvailabilityChallenge: address(0)
optimismMintableERC20Factory: address(0)
})
});
assertEq(systemConfig.startBlock(), 1);
Expand Down
2 changes: 0 additions & 2 deletions packages/contracts-bedrock/test/Specs.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ contract Specification_Test is CommonTest {
_addSpec({ _name: "SystemConfig", _sel: _getSel("l2OutputOracle()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("optimismPortal()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("optimismMintableERC20Factory()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("dataAvailabilityChallenge()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("batchInbox()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("startBlock()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("L1_CROSS_DOMAIN_MESSENGER_SLOT()") });
Expand All @@ -372,7 +371,6 @@ contract Specification_Test is CommonTest {
_addSpec({ _name: "SystemConfig", _sel: _getSel("L2_OUTPUT_ORACLE_SLOT()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("OPTIMISM_PORTAL_SLOT()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("OPTIMISM_MINTABLE_ERC20_FACTORY_SLOT()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("DATA_AVAILABILITY_CHALLENGE_SLOT()") });
_addSpec({ _name: "SystemConfig", _sel: _getSel("BATCH_INBOX_SLOT()") });

// ProxyAdmin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ contract SystemConfig_GasLimitLowerBound_Invariant is Test {
l1StandardBridge: address(0),
l2OutputOracle: address(0),
optimismPortal: address(0),
optimismMintableERC20Factory: address(0),
dataAvailabilityChallenge: address(0)
optimismMintableERC20Factory: address(0)
})
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract DeploymentSummary is DeploymentSummaryCode {
address internal constant safeSingletonAddress = 0x90193C961A926261B756D1E5bb255e67ff9498A1;
address internal constant superchainConfigAddress = 0x068E44eB31e111028c41598E4535be7468674D0A;
address internal constant superchainConfigProxyAddress = 0xDEb1E9a6Be7Baf84208BB6E10aC9F9bbE1D70809;
address internal constant systemConfigAddress = 0x7377723976628d66bE659f425f7917C06de098ce;
address internal constant systemConfigAddress = 0xffbA8944650e26653823658d76A122946F27e2f2;
address internal constant systemConfigProxyAddress = 0x1c23A6d89F95ef3148BCDA8E242cAb145bf9c0E4;
address internal constant systemOwnerSafeAddress = 0x2601573C28B77dea6C8B73385c25024A28a00C3F;

Expand Down Expand Up @@ -281,7 +281,7 @@ contract DeploymentSummary is DeploymentSummaryCode {
value = hex"0000000000000000000000000000000000000000000000000000000000000003";
vm.store(systemOwnerSafeAddress, slot, value);
slot = hex"360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
value = hex"0000000000000000000000007377723976628d66be659f425f7917c06de098ce";
value = hex"000000000000000000000000ffba8944650e26653823658d76a122946f27e2f2";
vm.store(systemConfigProxyAddress, slot, value);
slot = hex"0000000000000000000000000000000000000000000000000000000000000000";
value = hex"0000000000000000000000000000000000000000000000000000000000000001";
Expand Down
Loading

0 comments on commit 7712c54

Please sign in to comment.