feat(contracts): add governed upgrade manager for deployed contracts - #996
Merged
Hydrax117 merged 3 commits intoAug 31, 2026
Merged
Conversation
Implements a proxy-equivalent upgrade mechanism for Soroban contracts: propose/validate/vote/execute lifecycle with a governance approval threshold, timelock, rollback to the previous approved wasm hash, and a per-contract append-only upgrade history log surfaced via versioned events. Closes Arenax-gaming#969
|
@petahade Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@petahade is attempting to deploy a commit to the paul joseph's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
Adds a new
upgrade-managerSoroban contract that implements a governed, proxy-equivalent upgrade lifecycle for deployed ArenaX contracts. Soroban has nodelegatecall-style proxy — a contract's address stays constant while its wasm implementation can be swapped viaEnv::deployer().update_current_contract_wasm(hash). This contract is the governance layer in front of that primitive.update_current_contract_wasm; other contracts integrate by readingget_approved_wasm_hashand applying it to themselves in their own admin-gatedupgrade()entrypoint.propose_upgrade→vote_upgrade(one vote per governor) → execution requiresapproval_thresholdyes-votes.validate_upgraderecords a validation verdict; execution is blocked until a positive verdict is recorded.rollback_upgraderestores the previously-approved wasm hash for a contract (or re-applies it immediately for the manager's own implementation), with a recorded reason.get_upgrade_historylog, and each lifecycle step emits a versioned event via a newarenax-events::upgrade_managermodule.Also registers the new event namespace in
arenax-events'events_registrylist (lib.rs,events_registry.rs) alongside the existing domains, and addsupgrade-managerto thecontractsworkspace members.See
contracts/upgrade-manager/README.mdfor the full design rationale and an integration example for a target contract's ownupgrade()entrypoint.Test plan
cargo build/cargo testacross thecontractsworkspace (not run in this environment — no Rust toolchain available here)Closes #969