Commit dd7f0fd2 authored by Maurelian's avatar Maurelian Committed by GitHub

feat: remove enableLegacyContracts (#13562)

* feat: remove enableLegacyContracts

* feat: remove setUseFaultProofs

* feat: Remove useFaultProofs branch in Deploy._run()

* gas snapshot

* feat: remove useFaultProofs
parent e0a34554
...@@ -207,14 +207,12 @@ contract Deploy is Deployer { ...@@ -207,14 +207,12 @@ contract Deploy is Deployer {
// Deploy Current OPChain Contracts // Deploy Current OPChain Contracts
deployOpChain(); deployOpChain();
// Apply modifications for non-standard configurations not supported by the OPCM deployment // Set the respected game type according to the deploy config
if (cfg.useFaultProofs()) { vm.startPrank(ISuperchainConfig(mustGetAddress("SuperchainConfigProxy")).guardian());
vm.startPrank(ISuperchainConfig(mustGetAddress("SuperchainConfigProxy")).guardian()); IOptimismPortal2(mustGetAddress("OptimismPortalProxy")).setRespectedGameType(
IOptimismPortal2(mustGetAddress("OptimismPortalProxy")).setRespectedGameType( GameType.wrap(uint32(cfg.respectedGameType()))
GameType.wrap(uint32(cfg.respectedGameType())) );
); vm.stopPrank();
vm.stopPrank();
}
if (cfg.useCustomGasToken()) { if (cfg.useCustomGasToken()) {
// Reset the systemconfig then reinitialize it with the custom gas token // Reset the systemconfig then reinitialize it with the custom gas token
......
...@@ -78,7 +78,6 @@ contract DeployConfig is Script { ...@@ -78,7 +78,6 @@ contract DeployConfig is Script {
uint256 public proofMaturityDelaySeconds; uint256 public proofMaturityDelaySeconds;
uint256 public disputeGameFinalityDelaySeconds; uint256 public disputeGameFinalityDelaySeconds;
uint256 public respectedGameType; uint256 public respectedGameType;
bool public useFaultProofs;
bool public useAltDA; bool public useAltDA;
string public daCommitmentType; string public daCommitmentType;
uint256 public daChallengeWindow; uint256 public daChallengeWindow;
...@@ -148,7 +147,6 @@ contract DeployConfig is Script { ...@@ -148,7 +147,6 @@ contract DeployConfig is Script {
requiredProtocolVersion = stdJson.readUint(_json, "$.requiredProtocolVersion"); requiredProtocolVersion = stdJson.readUint(_json, "$.requiredProtocolVersion");
recommendedProtocolVersion = stdJson.readUint(_json, "$.recommendedProtocolVersion"); recommendedProtocolVersion = stdJson.readUint(_json, "$.recommendedProtocolVersion");
useFaultProofs = _readOr(_json, "$.useFaultProofs", false);
proofMaturityDelaySeconds = _readOr(_json, "$.proofMaturityDelaySeconds", 0); proofMaturityDelaySeconds = _readOr(_json, "$.proofMaturityDelaySeconds", 0);
disputeGameFinalityDelaySeconds = _readOr(_json, "$.disputeGameFinalityDelaySeconds", 0); disputeGameFinalityDelaySeconds = _readOr(_json, "$.disputeGameFinalityDelaySeconds", 0);
respectedGameType = _readOr(_json, "$.respectedGameType", 0); respectedGameType = _readOr(_json, "$.respectedGameType", 0);
...@@ -222,11 +220,6 @@ contract DeployConfig is Script { ...@@ -222,11 +220,6 @@ contract DeployConfig is Script {
useAltDA = _useAltDA; useAltDA = _useAltDA;
} }
/// @notice Allow the `useFaultProofs` config to be overridden in testing environments
function setUseFaultProofs(bool _useFaultProofs) public {
useFaultProofs = _useFaultProofs;
}
/// @notice Allow the `useInterop` config to be overridden in testing environments /// @notice Allow the `useInterop` config to be overridden in testing environments
function setUseInterop(bool _useInterop) public { function setUseInterop(bool _useInterop) public {
useInterop = _useInterop; useInterop = _useInterop;
......
GasBenchMark_L1BlockInterop_DepositsComplete:test_depositsComplete_benchmark() (gas: 7567) GasBenchMark_L1BlockInterop_DepositsComplete:test_depositsComplete_benchmark() (gas: 7567)
GasBenchMark_L1BlockInterop_DepositsComplete_Warm:test_depositsComplete_benchmark() (gas: 5567) GasBenchMark_L1BlockInterop_DepositsComplete_Warm:test_depositsComplete_benchmark() (gas: 5567)
GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchmark() (gas: 175722) GasBenchMark_L1BlockInterop_SetValuesInterop:test_setL1BlockValuesInterop_benchmark() (gas: 175677)
GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5144) GasBenchMark_L1BlockInterop_SetValuesInterop_Warm:test_setL1BlockValuesInterop_benchmark() (gas: 5099)
GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531) GasBenchMark_L1Block_SetValuesEcotone:test_setL1BlockValuesEcotone_benchmark() (gas: 158531)
GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597) GasBenchMark_L1Block_SetValuesEcotone_Warm:test_setL1BlockValuesEcotone_benchmark() (gas: 7597)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369235) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_0() (gas: 369280)
GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967442) GasBenchMark_L1CrossDomainMessenger:test_sendMessage_benchmark_1() (gas: 2967442)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564429) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_0() (gas: 564429)
GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076577) GasBenchMark_L1StandardBridge_Deposit:test_depositERC20_benchmark_1() (gas: 4076577)
......
...@@ -34,7 +34,6 @@ contract CommonTest is Test, Setup, Events { ...@@ -34,7 +34,6 @@ contract CommonTest is Test, Setup, Events {
FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi")))))); FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi"))))));
bool useAltDAOverride; bool useAltDAOverride;
bool useLegacyContracts;
address customGasToken; address customGasToken;
bool useInteropOverride; bool useInteropOverride;
...@@ -60,10 +59,6 @@ contract CommonTest is Test, Setup, Events { ...@@ -60,10 +59,6 @@ contract CommonTest is Test, Setup, Events {
if (useAltDAOverride) { if (useAltDAOverride) {
deploy.cfg().setUseAltDA(true); deploy.cfg().setUseAltDA(true);
} }
// We default to fault proofs unless explicitly disabled by useLegacyContracts
if (!useLegacyContracts) {
deploy.cfg().setUseFaultProofs(true);
}
if (customGasToken != address(0)) { if (customGasToken != address(0)) {
deploy.cfg().setUseCustomGasToken(customGasToken); deploy.cfg().setUseCustomGasToken(customGasToken);
} }
...@@ -73,7 +68,7 @@ contract CommonTest is Test, Setup, Events { ...@@ -73,7 +68,7 @@ contract CommonTest is Test, Setup, Events {
if (isForkTest()) { if (isForkTest()) {
// Skip any test suite which uses a nonstandard configuration. // Skip any test suite which uses a nonstandard configuration.
if (useAltDAOverride || useLegacyContracts || customGasToken != address(0) || useInteropOverride) { if (useAltDAOverride || customGasToken != address(0) || useInteropOverride) {
vm.skip(true); vm.skip(true);
} }
} else { } else {
...@@ -171,16 +166,6 @@ contract CommonTest is Test, Setup, Events { ...@@ -171,16 +166,6 @@ contract CommonTest is Test, Setup, Events {
emit TransactionDeposited(_from, _to, 0, abi.encodePacked(_mint, _value, _gasLimit, _isCreation, _data)); emit TransactionDeposited(_from, _to, 0, abi.encodePacked(_mint, _value, _gasLimit, _isCreation, _data));
} }
function enableLegacyContracts() public {
// Check if the system has already been deployed, based off of the heuristic that alice and bob have not been
// set by the `setUp` function yet.
if (!(alice == address(0) && bob == address(0))) {
revert("CommonTest: Cannot enable fault proofs after deployment. Consider overriding `setUp`.");
}
useLegacyContracts = true;
}
function enableAltDA() public { function enableAltDA() public {
// Check if the system has already been deployed, based off of the heuristic that alice and bob have not been // Check if the system has already been deployed, based off of the heuristic that alice and bob have not been
// set by the `setUp` function yet. // set by the `setUp` function yet.
......
...@@ -44,7 +44,6 @@ contract Initializer_Test is CommonTest { ...@@ -44,7 +44,6 @@ contract Initializer_Test is CommonTest {
function setUp() public override { function setUp() public override {
super.enableAltDA(); super.enableAltDA();
super.enableLegacyContracts();
super.setUp(); super.setUp();
// Initialize the `contracts` array with the addresses of the contracts to test, the // Initialize the `contracts` array with the addresses of the contracts to test, the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment