nonevm-5256: potentially simpler fix#411
Draft
FelixFan1992 wants to merge 4 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the MCMS deployer contract to support reliably releasing an UpgradeCap after any number of package upgrades by introducing a stable “original publish address → cap ID (+ proof type)” mapping stored as a dynamic field on DeployerState. It also adds a one-time backfill entrypoint for legacy DeployerState objects created before this indirection existed, and expands Move tests to cover the new behaviors and regression cases.
Changes:
- Add
OriginalToCapKey/OriginalToCapRecorddynamic-field mapping written duringregister_upgrade_cap, and updaterelease_upgrade_capto resolve caps via that mapping (no longer consultingRegistry). - Add
backfill_upgrade_cap_records(gated by&OwnerCap) to migrate legacy deployer state by populating the dynamic-field mapping. - Expand Move tests (for both
mcmsandfast_mcms) to cover release success across upgrades, legacy failure cases, and backfill success/failure scenarios; regenerate Go bindings to expose the new entrypoint/types.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/mcms/mcms/sources/mcms_deployer.move | Introduces stable original→cap mapping via dynamic fields; updates release logic; adds legacy backfill entrypoint. |
| contracts/mcms/fast_mcms/sources/mcms_deployer.move | Same deployer changes mirrored for fast_mcms. |
| contracts/mcms/mcms/tests/mcms_deployer_test.move | Refactors setup helpers and adds comprehensive tests for release/backfill/upgrade scenarios. |
| contracts/mcms/fast_mcms/tests/mcms_deployer_test.move | Same test expansions mirrored for fast_mcms. |
| bindings/generated/mcms/mcms_deployer/mcms_deployer.go | Regenerates bindings to include backfill_upgrade_cap_records and new structs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Issue ticket number and link
Describe highly relevant files or code snippets that are critical in the review
Are there other PRs that should be merged first?