feat(solana): two-step propose/accept for set_access_manager#1014
Merged
mariuszzak merged 2 commits intomariuszzak/upgrade-authority-transferfrom Mar 30, 2026
Merged
Conversation
Replace the one-step set_access_manager with a two-step propose/accept/cancel pattern across ICS07, ICS26, GMP and attestation programs. The accept step requires ADMIN_ROLE on the new AM, proving it is a valid and initialized access manager.
- ICS26 Router: propose/accept/cancel + negative (non-admin) test - ICS07 Tendermint: propose/accept/cancel flow - ICS27 GMP: propose/accept/cancel flow - Attestation: propose/accept/cancel flow
fde1b57 to
5c5db78
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## mariuszzak/upgrade-authority-transfer #1014 +/- ##
======================================================================
Coverage 99.91% 99.91%
======================================================================
Files 27 27
Lines 1123 1123
======================================================================
Hits 1122 1122
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
837ed3e
into
mariuszzak/upgrade-authority-transfer
164 checks passed
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.
Summary
set_access_managerwas a one-step operation — a single admin call could irreversibly repoint a program to a different Access Manager. If the admin accidentally set it to a wrong or nonexistent AM address, the program would become unrecoverable: all future admin-gated calls (including anotherset_access_managerto fix the mistake) would fail becauserequire_adminreads roles from the now-invalid AM.This PR replaces the one-step
set_access_managerwith a two-step propose/accept pattern across all IBC programs (ICS26, ICS07, GMP, attestation):propose_access_manager_transfer— current AM's admin proposes a new AM address (rejects zero-address and self-transfers)accept_access_manager_transfer— the new AM's admin accepts, proving it is valid and operational before the switch takes effectcancel_access_manager_transfer— current AM's admin cancels a pending proposalThe accept step requires
ADMIN_ROLEon the new AM, so the transfer cannot complete unless the target AM is a real, initialized Access Manager with an active admin. This eliminates the risk of bricking a program by pointing it to a bad address.Shared logic via
HasPendingAccessManagertraitEach IBC program's state struct implements a
HasPendingAccessManagertrait. The actual propose/accept/cancel handlers live inaccess-manager/src/helpers.rsand are reused by all four programs, avoiding duplicated validation logic.Programs affected
ics26-router—RouterState.pending_access_managerics07-tendermint—AppState.pending_access_managerics27-gmp—GMPAppState.pending_access_managerattestation—AttestationState.pending_access_manager