feat: implement upgrade timelock and multisig bypass - #144
Merged
elizabetheonoja-art merged 1 commit intoAug 22, 2026
Merged
Conversation
elizabetheonoja-art
merged commit Aug 22, 2026
5745e6a
into
Utility-Protocol:main
7 of 11 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.
Implement Timelock-Controlled Proxy Upgrade & Multisig Guardian (#128)
Resolves
Closes #128
Description
This pull request implements a timelock-controlled proxy upgrade system to ensure that contract upgrades require a 48-hour review window before execution. It also introduces an emergency bypass path controlled by a guardian multisig, along with storage layout compatibility checks to prevent unsafe upgrades.
Key Features
validate_storage_version_compatibilityto guarantee that skipping the time delay does not skip the critical constraint of preventing storage corruption.init_guardians.Technical Details
UPGRADE_VETO_PERIOD_SECONDSconfigured to precisely 48 hours.DataKeyvariants for Guardian state (Guardians,GuardianThreshold,EmergencyProposal,EmergencyApprovals).propose_emergency_upgradeandapprove_emergency_upgradeexecution logic natively in Soroban.emergency_upgrade_tests.rs.Testing
propose_emergency_upgradecreates an emergency proposal if called by a valid Guardian.approve_emergency_upgradecorrectly accumulates signatures and immediately executesenv.deployer().update_current_contract_wasm()upon hitting the threshold.ContractError::Unauthorizedpanic.cargo test --test emergency_upgrade_teststo validate execution paths.Notes for Reviewers
alloc::formatandTariffOracleClientunresolved types in older tests),cargo teston the full workspace produces errors. However, the changes localized tolib.rsandemergency_upgrade_tests.rscleanly compile undercargo test --no-run --package utility_contracts.