Commit eba495d2 authored by Blaine Malone's avatar Blaine Malone Committed by GitHub

refactor: Rename OPSM to OPSMProxy for clarity (#11972)

* chore(rename): Rename opsm to opsmProxy

* fix: Go bindings updated for proxy.

* fix: linting

* fix: pr comment nits.
parent 213f7627
......@@ -147,7 +147,7 @@ func TestEndToEndApply(t *testing.T) {
{"SuperchainConfigImpl", st.SuperchainDeployment.SuperchainConfigImplAddress},
{"ProtocolVersionsProxy", st.SuperchainDeployment.ProtocolVersionsProxyAddress},
{"ProtocolVersionsImpl", st.SuperchainDeployment.ProtocolVersionsImplAddress},
{"Opsm", st.ImplementationsDeployment.OpsmAddress},
{"OpsmProxy", st.ImplementationsDeployment.OpsmProxyAddress},
{"DelayedWETHImpl", st.ImplementationsDeployment.DelayedWETHImplAddress},
{"OptimismPortalImpl", st.ImplementationsDeployment.OptimismPortalImplAddress},
{"PreimageOracleSingleton", st.ImplementationsDeployment.PreimageOracleSingletonAddress},
......
......@@ -30,7 +30,7 @@ func (input *DeployImplementationsInput) InputSet() bool {
}
type DeployImplementationsOutput struct {
Opsm common.Address
OpsmProxy common.Address
DelayedWETHImpl common.Address
OptimismPortalImpl common.Address
PreimageOracleSingleton common.Address
......
......@@ -20,7 +20,7 @@ type DeployOPChainInput struct {
BasefeeScalar uint32
BlobBaseFeeScalar uint32
L2ChainId *big.Int
Opsm common.Address
OpsmProxy common.Address
}
func (input *DeployOPChainInput) InputSet() bool {
......
......@@ -77,7 +77,7 @@ func DeployImplementations(ctx context.Context, env *Env, intent *state.Intent,
}
st.ImplementationsDeployment = &state.ImplementationsDeployment{
OpsmAddress: dio.Opsm,
OpsmProxyAddress: dio.OpsmProxy,
DelayedWETHImplAddress: dio.DelayedWETHImpl,
OptimismPortalImplAddress: dio.OptimismPortalImpl,
PreimageOracleSingletonAddress: dio.PreimageOracleSingleton,
......
......@@ -62,7 +62,7 @@ func DeployOPChain(ctx context.Context, env *Env, intent *state.Intent, st *stat
BasefeeScalar: 1368,
BlobBaseFeeScalar: 801949,
L2ChainId: chainID.Big(),
Opsm: st.ImplementationsDeployment.OpsmAddress,
OpsmProxy: st.ImplementationsDeployment.OpsmProxyAddress,
},
)
return err
......
......@@ -65,7 +65,7 @@ type SuperchainDeployment struct {
}
type ImplementationsDeployment struct {
OpsmAddress common.Address `json:"opsmAddress"`
OpsmProxyAddress common.Address `json:"opsmProxyAddress"`
DelayedWETHImplAddress common.Address `json:"delayedWETHImplAddress"`
OptimismPortalImplAddress common.Address `json:"optimismPortalImplAddress"`
PreimageOracleSingletonAddress common.Address `json:"preimageOracleSingletonAddress"`
......
......@@ -206,7 +206,7 @@ func deployL2ToL1(l1Host *script.Host, superCfg *SuperchainConfig, superDeployme
BasefeeScalar: cfg.GasPriceOracleBaseFeeScalar,
BlobBaseFeeScalar: cfg.GasPriceOracleBlobBaseFeeScalar,
L2ChainId: new(big.Int).SetUint64(cfg.L2ChainID),
Opsm: superDeployment.Opsm,
OpsmProxy: superDeployment.OpsmProxy,
})
if err != nil {
return nil, fmt.Errorf("failed to deploy L2 OP chain: %w", err)
......
......@@ -9,7 +9,7 @@ type L1Deployment struct {
}
type Implementations struct {
Opsm common.Address `json:"OPSM"` // not proxied
OpsmProxy common.Address `json:"OPSMProxy"`
DelayedWETHImpl common.Address `json:"DelayedWETHImpl"`
OptimismPortalImpl common.Address `json:"OptimismPortalImpl"`
PreimageOracleSingleton common.Address `json:"PreimageOracleSingleton"`
......
......@@ -155,7 +155,7 @@ contract DeployImplementationsInput is BaseDeployIO {
}
contract DeployImplementationsOutput is BaseDeployIO {
OPStackManager internal _opsm;
OPStackManager internal _opsmProxy;
DelayedWETH internal _delayedWETHImpl;
OptimismPortal2 internal _optimismPortalImpl;
PreimageOracle internal _preimageOracleSingleton;
......@@ -171,7 +171,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
require(_addr != address(0), "DeployImplementationsOutput: cannot set zero address");
// forgefmt: disable-start
if (sel == this.opsm.selector) _opsm = OPStackManager(payable(_addr));
if (sel == this.opsmProxy.selector) _opsmProxy = OPStackManager(payable(_addr));
else if (sel == this.optimismPortalImpl.selector) _optimismPortalImpl = OptimismPortal2(payable(_addr));
else if (sel == this.delayedWETHImpl.selector) _delayedWETHImpl = DelayedWETH(payable(_addr));
else if (sel == this.preimageOracleSingleton.selector) _preimageOracleSingleton = PreimageOracle(_addr);
......@@ -193,7 +193,7 @@ contract DeployImplementationsOutput is BaseDeployIO {
function checkOutput(DeployImplementationsInput) public {
address[] memory addrs = Solarray.addresses(
address(this.opsm()),
address(this.opsmProxy()),
address(this.optimismPortalImpl()),
address(this.delayedWETHImpl()),
address(this.preimageOracleSingleton()),
......@@ -210,10 +210,10 @@ contract DeployImplementationsOutput is BaseDeployIO {
// TODO Also add the assertions for the implementation contracts from ChainAssertions.sol
}
function opsm() public returns (OPStackManager) {
DeployUtils.assertValidContractAddress(address(_opsm));
DeployUtils.assertImplementationSet(address(_opsm));
return _opsm;
function opsmProxy() public returns (OPStackManager) {
DeployUtils.assertValidContractAddress(address(_opsmProxy));
DeployUtils.assertImplementationSet(address(_opsmProxy));
return _opsmProxy;
}
function optimismPortalImpl() public view returns (OptimismPortal2) {
......@@ -400,10 +400,10 @@ contract DeployImplementations is Script {
});
// This call contains a broadcast to deploy OPSM which is proxied.
OPStackManager opsm = createOPSMContract(_dii, _dio, blueprints, release, setters);
OPStackManager opsmProxy = createOPSMContract(_dii, _dio, blueprints, release, setters);
vm.label(address(opsm), "OPStackManager");
_dio.set(_dio.opsm.selector, address(opsm));
vm.label(address(opsmProxy), "OPStackManager");
_dio.set(_dio.opsmProxy.selector, address(opsmProxy));
}
// --- Core Contracts ---
......
......@@ -43,7 +43,7 @@ contract DeployOPChainInput is BaseDeployIO {
uint32 internal _basefeeScalar;
uint32 internal _blobBaseFeeScalar;
uint256 internal _l2ChainId;
OPStackManager internal _opsm;
OPStackManager internal _opsmProxy;
function set(bytes4 _sel, address _addr) public {
require(_addr != address(0), "DeployOPChainInput: cannot set zero address");
......@@ -53,7 +53,7 @@ contract DeployOPChainInput is BaseDeployIO {
else if (_sel == this.unsafeBlockSigner.selector) _unsafeBlockSigner = _addr;
else if (_sel == this.proposer.selector) _proposer = _addr;
else if (_sel == this.challenger.selector) _challenger = _addr;
else if (_sel == this.opsm.selector) _opsm = OPStackManager(_addr);
else if (_sel == this.opsmProxy.selector) _opsmProxy = OPStackManager(_addr);
else revert("DeployOPChainInput: unknown selector");
}
......@@ -122,9 +122,9 @@ contract DeployOPChainInput is BaseDeployIO {
}
// TODO: Check that opsm is proxied and it has an implementation.
function opsm() public view returns (OPStackManager) {
require(address(_opsm) != address(0), "DeployOPChainInput: not set");
return _opsm;
function opsmProxy() public view returns (OPStackManager) {
require(address(_opsmProxy) != address(0), "DeployOPChainInput: not set");
return _opsmProxy;
}
}
......@@ -311,7 +311,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(outputConfig.maximumBaseFee == rConfig.maximumBaseFee, "SC-130");
require(systemConfig.startBlock() == block.number, "SC-140");
require(systemConfig.batchInbox() == _doi.opsm().chainIdToBatchInboxAddress(_doi.l2ChainId()), "SC-150");
require(systemConfig.batchInbox() == _doi.opsmProxy().chainIdToBatchInboxAddress(_doi.l2ChainId()), "SC-150");
require(systemConfig.l1CrossDomainMessenger() == address(l1CrossDomainMessengerProxy()), "SC-160");
require(systemConfig.l1ERC721Bridge() == address(l1ERC721BridgeProxy()), "SC-170");
......@@ -333,7 +333,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(messenger.PORTAL()) == address(optimismPortalProxy()), "L1xDM-30");
require(address(messenger.portal()) == address(optimismPortalProxy()), "L1xDM-40");
require(address(messenger.superchainConfig()) == address(_doi.opsm().superchainConfig()), "L1xDM-50");
require(address(messenger.superchainConfig()) == address(_doi.opsmProxy().superchainConfig()), "L1xDM-50");
bytes32 xdmSenderSlot = vm.load(address(messenger), bytes32(uint256(204)));
require(address(uint160(uint256(xdmSenderSlot))) == Constants.DEFAULT_L2_SENDER, "L1xDM-60");
......@@ -349,7 +349,7 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.messenger()) == address(messenger), "L1SB-20");
require(address(bridge.OTHER_BRIDGE()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-30");
require(address(bridge.otherBridge()) == Predeploys.L2_STANDARD_BRIDGE, "L1SB-40");
require(address(bridge.superchainConfig()) == address(_doi.opsm().superchainConfig()), "L1SB-50");
require(address(bridge.superchainConfig()) == address(_doi.opsmProxy().superchainConfig()), "L1SB-50");
}
function assertValidOptimismMintableERC20Factory(DeployOPChainInput) internal view {
......@@ -371,12 +371,12 @@ contract DeployOPChainOutput is BaseDeployIO {
require(address(bridge.MESSENGER()) == address(l1CrossDomainMessengerProxy()), "LEB-30");
require(address(bridge.messenger()) == address(l1CrossDomainMessengerProxy()), "LEB-40");
require(address(bridge.superchainConfig()) == address(_doi.opsm().superchainConfig()), "LEB-50");
require(address(bridge.superchainConfig()) == address(_doi.opsmProxy().superchainConfig()), "LEB-50");
}
function assertValidOptimismPortal(DeployOPChainInput _doi) internal view {
OptimismPortal2 portal = optimismPortalProxy();
ISuperchainConfig superchainConfig = ISuperchainConfig(address(_doi.opsm().superchainConfig()));
ISuperchainConfig superchainConfig = ISuperchainConfig(address(_doi.opsmProxy().superchainConfig()));
require(address(portal.disputeGameFactory()) == address(disputeGameFactoryProxy()), "OP-10");
require(address(portal.systemConfig()) == address(systemConfigProxy()), "OP-20");
......@@ -411,7 +411,7 @@ contract DeployOPChain is Script {
}
function run(DeployOPChainInput _doi, DeployOPChainOutput _doo) public {
OPStackManager opsm = _doi.opsm();
OPStackManager opsmProxy = _doi.opsmProxy();
OPStackManager.Roles memory roles = OPStackManager.Roles({
opChainProxyAdminOwner: _doi.opChainProxyAdminOwner(),
......@@ -429,7 +429,7 @@ contract DeployOPChain is Script {
});
vm.broadcast(msg.sender);
OPStackManager.DeployOutput memory deployOutput = opsm.deploy(deployInput);
OPStackManager.DeployOutput memory deployOutput = opsmProxy.deploy(deployInput);
vm.label(address(deployOutput.opChainProxyAdmin), "opChainProxyAdmin");
vm.label(address(deployOutput.addressManager), "addressManager");
......
......@@ -115,12 +115,12 @@ contract DeployImplementationsOutput_Test is Test {
}
function test_set_succeeds() public {
Proxy opsmProxy = new Proxy(address(0));
address opsmImpl = address(makeAddr("opsm"));
Proxy proxy = new Proxy(address(0));
address opsmImpl = address(makeAddr("opsmImpl"));
vm.prank(address(0));
opsmProxy.upgradeTo(opsmImpl);
proxy.upgradeTo(opsmImpl);
OPStackManager opsm = OPStackManager(address(opsmProxy));
OPStackManager opsmProxy = OPStackManager(address(proxy));
OptimismPortal2 optimismPortalImpl = OptimismPortal2(payable(makeAddr("optimismPortalImpl")));
DelayedWETH delayedWETHImpl = DelayedWETH(payable(makeAddr("delayedWETHImpl")));
PreimageOracle preimageOracleSingleton = PreimageOracle(makeAddr("preimageOracleSingleton"));
......@@ -146,7 +146,7 @@ contract DeployImplementationsOutput_Test is Test {
vm.etch(address(l1StandardBridgeImpl), hex"01");
vm.etch(address(optimismMintableERC20FactoryImpl), hex"01");
vm.etch(address(disputeGameFactoryImpl), hex"01");
dio.set(dio.opsm.selector, address(opsm));
dio.set(dio.opsmProxy.selector, address(opsmProxy));
dio.set(dio.optimismPortalImpl.selector, address(optimismPortalImpl));
dio.set(dio.delayedWETHImpl.selector, address(delayedWETHImpl));
dio.set(dio.preimageOracleSingleton.selector, address(preimageOracleSingleton));
......@@ -158,7 +158,7 @@ contract DeployImplementationsOutput_Test is Test {
dio.set(dio.optimismMintableERC20FactoryImpl.selector, address(optimismMintableERC20FactoryImpl));
dio.set(dio.disputeGameFactoryImpl.selector, address(disputeGameFactoryImpl));
assertEq(address(opsm), address(dio.opsm()), "50");
assertEq(address(opsmProxy), address(dio.opsmProxy()), "50");
assertEq(address(optimismPortalImpl), address(dio.optimismPortalImpl()), "100");
assertEq(address(delayedWETHImpl), address(dio.delayedWETHImpl()), "200");
assertEq(address(preimageOracleSingleton), address(dio.preimageOracleSingleton()), "300");
......
......@@ -60,7 +60,7 @@ contract DeployOPChainInput_Test is Test {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.opsm.selector, address(opsm));
doi.set(doi.opsmProxy.selector, address(opsm));
// Compare the default inputs to the getter methods.
assertEq(opChainProxyAdminOwner, doi.opChainProxyAdminOwner(), "200");
assertEq(systemConfigOwner, doi.systemConfigOwner(), "300");
......@@ -71,7 +71,7 @@ contract DeployOPChainInput_Test is Test {
assertEq(basefeeScalar, doi.basefeeScalar(), "800");
assertEq(blobBaseFeeScalar, doi.blobBaseFeeScalar(), "900");
assertEq(l2ChainId, doi.l2ChainId(), "1000");
assertEq(address(opsm), address(doi.opsm()), "1100");
assertEq(address(opsm), address(doi.opsmProxy()), "1100");
}
function test_getters_whenNotSet_revert() public {
......@@ -374,7 +374,7 @@ contract DeployOPChain_TestBase is Test {
deployImplementations.run(dii, dio);
// Set the OPStackManager input for DeployOPChain.
opsm = dio.opsm();
opsm = dio.opsmProxy();
}
// See the function of the same name in the `DeployImplementations_Test` contract of
......@@ -409,7 +409,7 @@ contract DeployOPChain_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.opsm.selector, address(opsm)); // Not fuzzed since it must be an actual instance.
doi.set(doi.opsmProxy.selector, address(opsm)); // Not fuzzed since it must be an actual instance.
deployOPChain.run(doi, doo);
......
......@@ -45,7 +45,7 @@ contract OPStackManager_Deploy_Test is DeployOPChain_TestBase {
doi.set(doi.basefeeScalar.selector, basefeeScalar);
doi.set(doi.blobBaseFeeScalar.selector, blobBaseFeeScalar);
doi.set(doi.l2ChainId.selector, l2ChainId);
doi.set(doi.opsm.selector, address(opsm));
doi.set(doi.opsmProxy.selector, address(opsm));
}
// This helper function is used to convert the input struct type defined in DeployOPChain.s.sol
......
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