feat: add announcePlannedUpgrade flow for ServiceProviderRegistry#356
Merged
wjmelements merged 4 commits intoFilOzone:mainfrom Nov 26, 2025
Merged
Conversation
6244630 to
277127f
Compare
277127f to
e915931
Compare
wjmelements
requested changes
Nov 26, 2025
8da6ef3 to
9994318
Compare
- made nextUpgrade public removed the getter - reverted the one-step process only have the 2 step mechanism - some fixes in scripts
9994318 to
fa8092c
Compare
wjmelements
approved these changes
Nov 26, 2025
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
This PR covers the
ServiceProviderRegistryside of FS #355 by adopting theannouncePlannedUpgradepattern already used byFilecoinWarmStorageService. PDPVerifier changes are implemented in a separate PR inpdpand are not included here.Changes
ServiceProviderRegistry contract
PlannedUpgradestruct andnextUpgradestorage fieldUpgradeAnnounced(PlannedUpgrade)eventannouncePlannedUpgrade(PlannedUpgrade plannedUpgrade)— owner-only, validates code size andafterEpoch > block.number, stores the plan and emitsUpgradeAnnouncedgetNextUpgrade() returns (address nextImplementation, uint96 afterEpoch)— exposes the planned upgrade via the proxy_authorizeUpgrade(address newImplementation)to:newImplementation == nextUpgrade.nextImplementationblock.number >= nextUpgrade.afterEpochmigrate(string newVersion)to:public onlyProxy onlyOwner reinitializer(2)ContractUpgraded(newVersion, ERC1967Utils.getImplementation())Upgrade scripts
tools/announce-planned-upgrade-registry.shServiceProviderRegistryproxy usingannouncePlannedUpgrade((address,uint96))tools/upgrade-registry.shgetNextUpgrade()from the registry proxyafterEpochupgradeToAndCall(address,bytes)withmigrate(string)and the desired version(
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc)Tests
ServiceProviderRegistryTestto cover:testAnnouncePlannedUpgrade— happy-path announce and gated upgrade flowtestAnnouncePlannedUpgradeOnlyOwner— only the owner can announcetestAnnouncePlannedUpgradeInvalidImplementation— revert on non-contract implementationtestAnnouncePlannedUpgradeInvalidEpoch— revert whenafterEpoch <= block.numbertestOnlyOwnerCanUpgrade— validates that:Closes : #355