Skip to content

feat: Implement Protocol Upgradeability & Governance-Controlled Upgrade Framework (SC-034) - #323

Open
akansmafengadamu wants to merge 1 commit into
DigiNodes:mainfrom
akansmafengadamu:feat/sc-034-upgrade-governance-framework
Open

feat: Implement Protocol Upgradeability & Governance-Controlled Upgrade Framework (SC-034)#323
akansmafengadamu wants to merge 1 commit into
DigiNodes:mainfrom
akansmafengadamu:feat/sc-034-upgrade-governance-framework

Conversation

@akansmafengadamu

Copy link
Copy Markdown

Summary

Implements the complete Protocol Upgradeability & Governance-Controlled Upgrade Framework as specified in SC-034. This establishes a secure, transparent, and auditable upgrade architecture for the TruthBounty protocol.

Changes

New Contracts (contracts/upgrade/)

  • IUpgradeController.sol - Interface for the full upgrade lifecycle
  • UpgradeController.sol - Governance-controlled upgrade lifecycle manager with Standard/Emergency/Rollback types, configurable timelocks, execution windows, storage validation integration, and role-based access
  • IVersionRegistry.sol - Interface for canonical version history
  • VersionRegistry.sol - Maintains immutable record of every deployed version with semantic versioning
  • StorageCompatibilityValidator.sol - Validates storage layout compatibility before upgrades
  • ProtocolUpgradeable.sol - Abstract UUPS base contract for upgradeable protocol contracts

New Tests (test/upgrade/)

  • UpgradeController.t.sol - 18 unit tests covering propose, schedule, execute, cancel, rollback, emergency, access control, pause, and timelock enforcement
  • VersionRegistry.t.sol - 14 unit tests covering registration, status updates, active tracking, and errors
  • UpgradeIntegration.t.sol - 10 integration tests covering full lifecycle, storage validation, and rollback flow

Architecture

Follows the existing UUPS proxy pattern. Integrates with GovernanceController and GovernanceOwnable. Uses OpenZeppelin 5.x. Compiled with Solidity ^0.8.28.

Closes #314

…de framework (SC-034)

Implements the complete upgrade lifecycle management system:
- UpgradeController: governance-controlled upgrade propose->schedule->execute pipeline
- VersionRegistry: canonical version history with semantic versioning
- StorageCompatibilityValidator: automated storage layout validation
- ProtocolUpgradeable: abstract UUPS base for upgradeable protocol contracts
- Comprehensive Foundry tests for all upgrade components

Closes DigiNodes#314
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.

SC-034 — Implement Protocol Upgradeability & Governance-Controlled Upgrade Framework

1 participant