Skip to content

fix lock release rebalancer cap function - #471

Merged
FelixFan1992 merged 4 commits into
developfrom
rebalancer-cap
Jul 27, 2026
Merged

fix lock release rebalancer cap function#471
FelixFan1992 merged 4 commits into
developfrom
rebalancer-cap

Conversation

@FelixFan1992

Copy link
Copy Markdown
Collaborator

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?

..

@FelixFan1992
FelixFan1992 marked this pull request as ready for review July 27, 2026 16:03
@FelixFan1992
FelixFan1992 requested a review from a team as a code owner July 27, 2026 16:03
@FelixFan1992
FelixFan1992 requested a review from Copilot July 27, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes mcms_destroy_rebalancer_cap in the Lock/Release token pool so MCMS can renounce rebalancer control by clearing the active rebalancer_cap_id before deleting the MCMS-held RebalancerCap, leaving the pool with no active rebalancer.

Changes:

  • Update mcms_destroy_rebalancer_cap to clear state.rebalancer_cap_id (to the zero sentinel) before deleting the MCMS-held rebalancer cap.
  • Add a #[test_only] helper to check whether the MCMS cap currently contains a rebalancer cap.
  • Add tests covering successful cap destruction, failure when no cap exists, and re-taking rebalancer control after destruction.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
contracts/ccip/ccip_token_pools/lock_release_token_pool/sources/lock_release_token_pool.move Adjusts MCMS rebalancer-cap destruction flow to clear active rebalancer ID before deleting the cap; adds a test-only helper.
contracts/ccip/ccip_token_pools/lock_release_token_pool/tests/lock_release_token_pool_mcms_cap_test.move Adds encoding helper + new tests for destroying and re-taking MCMS rebalancer control.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +693 to +694
let RebalancerCap<T> { id } = rebalancer_cap;
object::delete(id);
@FelixFan1992
FelixFan1992 merged commit 6115edd into develop Jul 27, 2026
99 of 103 checks passed
@FelixFan1992
FelixFan1992 deleted the rebalancer-cap branch July 27, 2026 19:04
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