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: core deploy apply admin proxy ownership fixes #4767

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

xeno097
Copy link
Contributor

@xeno097 xeno097 commented Oct 25, 2024

Description

This PR updates the hyperlane core init, hyperlane core deploy and hyperlane core apply commands to allow a user to change ownership of the mailbox ProxyAdmin contract by setting a value in the config.

Drive-by changes

  • deduped randomAddress test util implementations across the sdk, 'infra' and cli package
  • added anvil1 to the run-e2e-test.sh script to test hyperlane core commands in isolation
  • implemented the proxyAdminOwnershipUpdateTxs to deduplicate proxy admin ownership tx data generation

Related issues

Backward compatibility

  • Yes

Testing

  • Manual
  • e2e

NOTE:

xeno097 and others added 28 commits October 21, 2024 16:22
…min field to allow deploy overrides and checks
…e an already existing proxy admi ncontract for deployments
…ents and admin proxy ownership transfer in warp apply
Co-authored-by: Paul Balaji <10051819+paulbalaji@users.noreply.github.com>
…nfig defines owners fro the mailbox proxy admin adn ica router and use those values intead of the signer
…to xeno/core-deploy-apply-admin-proxy-ownership-fixes
…yperlane-xyz/hyperlane-monorepo into xeno/core-deploy-apply-admin-proxy-ownership-fixes
…to xeno/core-deploy-apply-admin-proxy-ownership-fixes
…yperlane-xyz/hyperlane-monorepo into xeno/core-deploy-apply-admin-proxy-ownership-fixes
Copy link

changeset-bot bot commented Oct 25, 2024

🦋 Changeset detected

Latest commit: 7798c00

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@hyperlane-xyz/infra Minor
@hyperlane-xyz/cli Minor
@hyperlane-xyz/sdk Minor
@hyperlane-xyz/helloworld Minor
@hyperlane-xyz/widgets Minor
@hyperlane-xyz/ccip-server Minor
@hyperlane-xyz/github-proxy Minor
@hyperlane-xyz/utils Minor
@hyperlane-xyz/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Base automatically changed from xeno/warp-deploy-apply-ownership-fixes to main November 1, 2024 16:04
Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.27%. Comparing base (4c0605d) to head (7798c00).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4767   +/-   ##
=======================================
  Coverage   74.27%   74.27%           
=======================================
  Files         101      101           
  Lines        1481     1481           
  Branches      192      192           
=======================================
  Hits         1100     1100           
  Misses        360      360           
  Partials       21       21           
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 77.77% <ø> (ø)
isms 77.77% <ø> (ø)
token 89.01% <ø> (ø)
middlewares 77.58% <ø> (ø)

Copy link
Contributor

@ltyu ltyu left a comment

Choose a reason for hiding this comment

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

e2e test failing in CI. it might be related to using anvil1, which is used by foundry-test.

typescript/sdk/src/core/EvmCoreReader.ts Outdated Show resolved Hide resolved
typescript/sdk/src/core/EvmCoreModule.ts Outdated Show resolved Hide resolved
typescript/sdk/src/deploy/proxy.ts Outdated Show resolved Hide resolved
typescript/sdk/src/deploy/proxy.ts Outdated Show resolved Hide resolved
Comment on lines +12 to +14
// This field is set as optional because the old core config
// did not have it and we want to maintain backward compatibility
proxyAdmin: DeployedOwnableSchema.optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

define "old core config" - out of 140ish chains with a mailbox in registry, 134 have a proxyAdmin

Copy link
Contributor Author

@xeno097 xeno097 Nov 4, 2024

Choose a reason for hiding this comment

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

For example, if someone uses an old config file where the proxyAdmin field was not defined because it was generated with an old version of the CLI, Example:

  • Deploy core contracts with old cli
  • Update the CLI to the new version that adds this field
  • Try to read the core deployment config. If the field is set as required in the schema this will fail

Copy link
Contributor

Choose a reason for hiding this comment

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

I see - wonder if it's ok to just make it a breaking change that we demand the proxyAdmin now and if an old version doesn't have it then that's on the user

wdyt @ltyu?

Copy link
Contributor Author

@xeno097 xeno097 Nov 5, 2024

Choose a reason for hiding this comment

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

Technically it shouldn't be a problem because worst case scenario the user can just core read to 'update' the config to the latest version but it is an inconvenience anyways because the first time the CLI will fail and the fix is not that obvious. deferring to @ltyu for his thoughts. Maybe we should consider versioning configs in the future to avoid breaking changes and allows conversion from an old config file to a new one

typescript/sdk/src/core/EvmCoreModule.ts Outdated Show resolved Hide resolved
typescript/cli/scripts/run-e2e-test.sh Outdated Show resolved Hide resolved
typescript/cli/src/tests/commands/core.ts Show resolved Hide resolved
Comment on lines +12 to +14
// This field is set as optional because the old core config
// did not have it and we want to maintain backward compatibility
proxyAdmin: DeployedOwnableSchema.optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I see - wonder if it's ok to just make it a breaking change that we demand the proxyAdmin now and if an old version doesn't have it then that's on the user

wdyt @ltyu?

typescript/sdk/src/token/EvmERC20WarpModule.ts Outdated Show resolved Hide resolved
typescript/sdk/src/core/EvmCoreModule.ts Outdated Show resolved Hide resolved
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.

feat(cli,sdk): core commands support changing proxy admin ownership
3 participants