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

We must delegate call to OPCM from superchain-ops #571

Closed
Tracked by #396
blmalone opened this issue Feb 10, 2025 · 7 comments
Closed
Tracked by #396

We must delegate call to OPCM from superchain-ops #571

blmalone opened this issue Feb 10, 2025 · 7 comments

Comments

@blmalone
Copy link
Contributor

This involves using @maurelian's new MultiCall3DelegateCall contract.

As part of the superchain-ops improvements, we must provide the ability to swap in different MultiCall3 contracts based on whether the task is using OPCM or not.

@maurelian
Copy link
Contributor

FWIW the contract itself should be here on Sepolia and Mainnet: 0x95b259eae68ba96edB128eF853fFbDffe47D2Db0

@blmalone
Copy link
Contributor Author

blmalone commented Feb 10, 2025

When creating a template it can either be a series of calls or delegate calls.

OPCM is basically on onchain script so we want to delegate call directly to that from the safe.

We would want a user level option to choose to delegate call or call.

UX Ideas:

  • Recall that the upgrade function is function upgrade(OpChainConfig[] memory _opChainConfigs) this means that we will no longer be looping over L2 chains.

Larger question, who do we organize the UX here.

We need to include the absolute prestate for each chain if we're using OPCM: https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OPContractsManager.sol#L121 - this would be in the config.toml file.

Every OPCM upgrade looks a little different. It will always have the system config, proxy admin address but the struct might be larger.

Target address is an input. If it's specified, then that's who you delegate call to. If it's not specified then use the normal multicall3 address.

@blmalone
Copy link
Contributor Author

There are other functions on OPCM that we will want to delegate call to in the future.

Two types of calls for superchain-ops 2.0:

  • Loop over each chain and make calls
  • Delegate call to our onchain OPCM (opcm loops - technically you can look by having an array of 1)

Maybe get rid of looping in OPCM. This might be more consistent with what we already have.

@ElliotFriedman
Copy link
Contributor

ElliotFriedman commented Feb 11, 2025

Seems like this contract is going to make things more complex for upgrading using OPCM:

https://sepolia.etherscan.io/address/0x95b259eae68ba96edB128eF853fFbDffe47D2Db0#code

it only allows delegatecalls, so now we wrap a safe delegatecall to the multicall3delegatecall, which then delegatecalls the new OPCM contract.

safe -> delegatecalls multicall3delegatecall -> delegatecalls OPCM

seems like it would be simpler and easier to reason about if we just delegatecalled straight from the safe into the OPCM contract.

Maybe I'm missing something here though and we have to make a delegatecall to the multicall3delegatecall contract.

@ElliotFriedman
Copy link
Contributor

I thought about it a bit more. If we can make a single delegatecall from the multisig to the OPCM contract with all of the parameters bundled up in a single call, then we can just delegatecall OPCM directly.

If we need to make multiple delegate calls to OPCM, then we need to use the multicall3delegatecall contract.

@maurelian
Copy link
Contributor

maurelian commented Feb 14, 2025

We don't have to use multicall3delegatecall but we needed a way to make a delegatecall from the Safe while still leveraging all of the existing infrastructure in the superchain-ops repo infrastructure for signing and reading the input.json tx bundles.

However we handle that within the new ops repo paradigm is fine with me.

@blmalone
Copy link
Contributor Author

Closed by: #606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants