feat: Make FilBeamOperator contract upgradeable - #13
Conversation
pyropy
left a comment
There was a problem hiding this comment.
Great start! 👏🏻
I believe we're missing two very important things:
- Deployment script that upgrade the old contract without deploying a new proxy
- State view contract (I'm not sure if this is needed with UUPS contract but I've seen that you have mentioned it in the docs).
It is very important to us NOT to lose on-chain state during upgrades as that could potentially cause loss for both FilBeam and storage providers.
…ntation improvements
7704faf to
d7434fc
Compare
pyropy
left a comment
There was a problem hiding this comment.
Great work! Let's upgrade the documentation before proceeding to merge this.
| uint256 cacheMissRatePerByte, // Rate per byte for cache-miss usage | ||
| address filBeamOperatorController // Address authorized to report usage |
There was a problem hiding this comment.
| uint256 cacheMissRatePerByte, // Rate per byte for cache-miss usage | |
| address filBeamOperatorController // Address authorized to report usage | |
| uint256 cacheMissRatePerByte // Rate per byte for cache-miss usage |
filBeamOperatorController is removed from the initialize method.
There was a problem hiding this comment.
you mean filBeamOperatorController is the only thing kept in initialize method! the addresses and the rates were the ones moved to constructor to be immutable
|
@juliangruber would you also be able to give this a look? |
|
Thanks for the PR. Unfortunately, we’ll need to close it for now. We can revisit, clean it up, and reopen it when there’s sufficient bandwidth and FilBeam is prioritized again. |
Description
This PR implements the UUPS (Universal Upgradeable Proxy Standard) proxy pattern for the FilBeamOperator contract, enabling safe contract upgrades while preserving all state.
Closes #3
Motivation
Key Implementation Details
Initializable,Ownable2StepUpgradeable,UUPSUpgradeableinitialize()replaces constructor (can only be called once)_disableInitializers()prevents implementation contract initialization_authorizeUpgrade()restricted to ownerversion()function returns"1.0.0"Testing
test_CannotInitializeTwicetest_CannotInitializeImplementationDirectlytest_OnlyOwnerCanUpgradetest_OwnerCanUpgradetest_VersionHow to Test
forge build forge test -vvv