Skip to content

extend program buffer on upgrade if necessary #24

@2501babe

Description

@2501babe

apologies if i missed an option for this, this is my first time using squads other than voting, but i didnt see anything concerning this in the v4 ui or the docs

presently it seems the "upgrade program" flow does not check if programdata is large enough to accomodate the source buffer youre upgrading from. the steps i took were:

  • create and write buffer on cli under my own authority
  • reassign authority to our multisig
  • squads ui: developers -> programs -> my program -> add upgrade
  • votes collected -> execute -> fails

simulation results:

> Program logged: "Instruction: ExecuteTransaction"
> Program invoked: BPF Upgradeable Loader
  > ProgramData account not large enough
  > Program returned error: "account data too small for instruction"
> Program consumed: 23756 of 1399850 compute units
> Program returned error: "account data too small for instruction"

i didnt think to simulate beforehand unfortunately. i see i can use the tx builder to create custom transactions via base64, so (edit: today i learned ExtendProgram is actually permissionless) im not blocked and should be able to manage the upgrade on my own. but it could be a nice feature addition if the ui fetched the buffer and programdata sizes and prepended an UpgradeableLoaderInstruction::ExtendProgram instruction when building the upgrade transaction if necessary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions