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

feat:l2 proxy admin #233

Merged
merged 7 commits into from
Feb 7, 2025
Merged

Conversation

0xiamflux
Copy link

Closes OPT-635

@0xiamflux 0xiamflux requested review from gotzenx and agusduha January 29, 2025 17:57
@0xiamflux 0xiamflux self-assigned this Jan 29, 2025
Copy link

linear bot commented Jan 29, 2025

@0xOneTony 0xOneTony self-requested a review February 3, 2025 17:08
Copy link
Member

@agusduha agusduha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that there are missing changes at L2Genesis, the L2ProxyAdmin is not being deployed right now as far as i can see (maybe im wrong) and we don't have a test to be sure about it.

Also the L2Genesis.s.sol has an owner slot override when deploying the admin that should not be there anymore

// Constants
import { Constants } from "src/libraries/Constants.sol";

contract L2ProxyAdmin_Test is Test {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only problem im seeing here is that we are not really testing the the L2ProxyAdmin is integrated

For this we usually use CommonTest that setups the L2

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed these issues here and here.

0xOneTony
0xOneTony previously approved these changes Feb 6, 2025
Copy link
Member

@0xOneTony 0xOneTony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

address impl = _setImplementationCode(Predeploys.PROXY_ADMIN);

bytes32 _ownerSlot = bytes32(0);

// there is no initialize() function, so we just set the storage manually.
vm.store(Predeploys.PROXY_ADMIN, _ownerSlot, bytes32(uint256(uint160(cfg.proxyAdminOwner()))));
// update the proxy to not be uninitialized (although not standard initialize pattern)
vm.store(impl, _ownerSlot, bytes32(uint256(uint160(cfg.proxyAdminOwner()))));
_setImplementationCode(Predeploys.PROXY_ADMIN);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good! The old PR initialized the slot with a dead address tho, are we sure there is no risk having the slot not initialized?

@0xiamflux 0xiamflux merged commit c21d224 into sc-feat/standard-l2-genesis Feb 7, 2025
2 checks passed
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.

3 participants