Skip to content

Conversation

@guibescos
Copy link
Contributor

@guibescos guibescos commented Nov 22, 2022

In check_is_upgrade_authority_for_program we make sure that the signer of the instruction is the upgrade authority of the program. To do this we use two accounts owned by bpf-upgradable-loader :

  • program_account : this is the account with address program_id . It contains the address of programdata_account
  • programdata_account : this account contains the code of the program and the upgrade authority.

Previously I would get the address of programdata_account from program_account. However I realized that I can get the address without deserializing program_account because it is a PDA with seed program_id.

I am trying to get rid of bincode in upg_permissions. This change will reduce the footprint of bincode because we no longer need to deserialize program_account

@guibescos guibescos marked this pull request as ready for review November 22, 2022 16:19
@guibescos guibescos changed the title Update authority check to use PDA Update program upgrade authority check to use PDA Nov 22, 2022
@guibescos guibescos merged commit 895eb59 into main Nov 23, 2022
@guibescos guibescos deleted the update-authority-check branch November 23, 2022 20:05
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.

3 participants