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

Safety checks after performing a delegate call #596

Closed
Tracked by #396
blmalone opened this issue Feb 13, 2025 · 2 comments
Closed
Tracked by #396

Safety checks after performing a delegate call #596

blmalone opened this issue Feb 13, 2025 · 2 comments
Assignees

Comments

@blmalone
Copy link
Contributor

A new feature in superchain-ops 2.0 is enabling the parent multisig to delegatecall to a contract. Our initial use case involves OPCM. Instead of using Multicall3.sol for batching actions, we are switching to Multicall3Delegatecall.sol, which performs a delegatecall to OPCM.

Why use delegatecall?
The primary reason is to prevent any state changes in OPCM when executing functions. Allowing state modifications in OPCM could lead to non-deterministic behavior for chains integrating with OPCM in the future.

Security precautions to detect unwanted behavior early
By using delegatecall from the upgrade-controller, we introduce a risk: state changes on the upgrade-controller contract itself, which must be avoided at all costs.

To mitigate this, I propose that superchain-ops’ simulation step includes a post-execution check to verify that no state changes occurred in both the upgrade-controller contract and OPCM.

@blmalone blmalone self-assigned this Feb 13, 2025
@maurelian
Copy link
Contributor

Agree we definitely need to enforce this property. FWIW we have always been delegatecalling to Multicall3, so this is not entirely new, but it does add more risk since the OPCM logic is more complex and will change overtime.

I think this could be fairly easily done in checkStateDiff(), since the only diff should be the nonce.

@ElliotFriedman
Copy link
Contributor

ElliotFriedman commented Feb 14, 2025

New PR is up to add the checkStateDiff function #602

The OPCM template PR can implement this functionality.

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