1

Pretty much the title...I was always under the impression that once the program is deployed it is immutable, however I have recently seen companies changing the logic of their onchain programs after deployment. So my question is, for a deployed onchain program with the instruction/function X that takes parameters Ps and accounts As, what can I modify in Ps and As after deployment?

1 Answer 1

3

You can literally change anything and everything.

Until a program is marked as immutable (which is an irreversible operation), the upgrade authority can make any arbitrary changes to the bytes of the buffer account containing the program's byte-code. They can even point the program to an entirely different buffer account.

This is a significant risk vector and must be accounted for before interacting with any program on mainnet.

But there are operational reasons why this is generally preferable to non-upgradeable programs. As a developer, upgradeable programs allow one to:

  • address bugs and vulnerabilities (this is kind of the big one)
  • keep up to date with CPI'd programs that might have updated
  • re-assign hard-coded accounts

This trust issue can be mitigated by a number of measures, including only interacting with programs:

  • whose developers are not anonymous
  • whose code is open-source
  • whose upgrade authority is behind a multisig, preferably one where transaction proposals must execute after a delay, so that malicious changes can be noticed ahead of time.
1
  • Please mark it with a checkmark if you believe it adequately answers your question.
    – HelmetFace
    Commented Oct 20, 2022 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.