Skip to content

feat: Make FilBeamOperator contract upgradeable - #13

Closed
Chaitu-Tatipamula wants to merge 4 commits into
filbeam:mainfrom
Chaitu-Tatipamula:feat/uups-upgradeable
Closed

feat: Make FilBeamOperator contract upgradeable#13
Chaitu-Tatipamula wants to merge 4 commits into
filbeam:mainfrom
Chaitu-Tatipamula:feat/uups-upgradeable

Conversation

@Chaitu-Tatipamula

Copy link
Copy Markdown
Contributor

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

  • Enable bug fixes and feature additions without redeploying a new contract
  • Preserve state (usage data, ownership, configuration) across upgrades
  • Maintain a stable contract address for integrations

Key Implementation Details

  • Inherits Initializable, Ownable2StepUpgradeable, UUPSUpgradeable
  • initialize() replaces constructor (can only be called once)
  • _disableInitializers() prevents implementation contract initialization
  • _authorizeUpgrade() restricted to owner
  • version() function returns "1.0.0"

Testing

  • 74 tests pass including new upgrade tests:
    • test_CannotInitializeTwice
    • test_CannotInitializeImplementationDirectly
    • test_OnlyOwnerCanUpgrade
    • test_OwnerCanUpgrade
    • test_Version

How to Test

forge build
forge test -vvv

@pyropy pyropy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread script/DeployFilBeamOperator.s.sol
Comment thread src/FilBeamOperator.sol Outdated
Comment thread src/FilBeamOperator.sol Outdated
Comment thread DEPLOYMENT.md Outdated
Comment thread DEPLOYMENT.md Outdated
Comment thread DEPLOYMENT.md Outdated
Comment thread DEPLOYMENT.md Outdated
Comment thread DEPLOYMENT.md Outdated
Comment thread README.md Outdated

@pyropy pyropy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Let's upgrade the documentation before proceeding to merge this.

Comment thread src/FilBeamOperator.sol Outdated
Comment thread README.md Outdated
Comment on lines +55 to +56
uint256 cacheMissRatePerByte, // Rate per byte for cache-miss usage
address filBeamOperatorController // Address authorized to report usage

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/FilBeamOperator.sol
Comment thread DEPLOYMENT.md
Comment thread script/UpgradeFilBeamOperator.s.sol Outdated
@pyropy
pyropy requested review from bajtos and juliangruber January 26, 2026 11:47
Comment thread DEPLOYMENT.md
Comment thread DEPLOYMENT.md
@juliangruber
juliangruber removed their request for review January 28, 2026 08:07
@pyropy

pyropy commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

@juliangruber would you also be able to give this a look?

@bajtos
bajtos removed their request for review March 13, 2026 15:42
@BigLep BigLep added this to FOC Jul 7, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jul 7, 2026
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC Jul 8, 2026
@rjan90
rjan90 removed the request for review from pyropy July 22, 2026 18:31
@rjan90

rjan90 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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.

@rjan90 rjan90 closed this Jul 31, 2026
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to 🎉 Done in FOC Jul 31, 2026
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.

Make FilBeamOperator contract upgradable

4 participants