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

fix(protocol): support multicall context in DelegateOwner #17631

Closed
wants to merge 1 commit into from

Conversation

adaki2004
Copy link
Contributor

In DelegateOwner we have the setAdmin function, which works as expected if we call it in a "normal", but currently does not support multicall3 way of calling itself.

So in case of this scenario for example:

onMessageInvocation (through the bridge) by calling aggregate3 on multicall3, to perform 2 inner transactions:

  • one of them is to set this DelegateOwner's admin address to a new value
  • the other is to call an owned contract to perform a upgrade

So the path of calling would be this:
Bridge -> DelegateOwner -> Multicall -> 1. DelegateOwner (setAdmin)
-> 2. Another contract to upgrade the impl contract.

The problem with the 1st path is, that the msg.sender in setAdmin, will be DelegateOwner contract address - in this multicall3 way.

Copy link

fix(protocol): support multicall context in DelegateOwner

Generated at commit: 21d770ddd0a3b22939cbf39588d645f0e1f53fa0

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
8
42
54
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@adaki2004
Copy link
Contributor Author

@Brechtpd @dantaik
Honestly i dont think it is a good idea to "multicall" into SELF into DelegateOwner -> Cause it requires changes into the code, as it is currently not supported.

DelegateOwner + Multicall can work for other contracts (without modification) but not into self - without changes. Given the fact, that DelegateOwner itself has only 1-2 functions, i dont think it shall be a test case:


onMessageInvocation (through the bridge) by calling aggregate3 on multicall3, to perform 2 inner transactions:

    one of them is to set this DelegateOwner's admin address to a new value
    the other is to call an owned contract to perform a upgrade

If you agree, i'd close this PR and not bother with multicall into self (DelegateOwner).

@dantaik
Copy link
Contributor

dantaik commented Jun 20, 2024

@adaki2004 Thank you for identiying an issue with setAdmin. I prefer a fix in this PR: https://github.com/taikoxyz/taiko-mono/pull/17633/files with some design simplicity. Now only onMessageInvocation is the function that shall be called by local admin or a remote owner. All other functions must be called inside onMessageInvocation.

@adaki2004 adaki2004 closed this Jun 20, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants