Add buffer authority to upgradeable loader (#14482) (#14485)

(cherry picked from commit 58487c6360)

Co-authored-by: Jack May <jack@solana.com>
This commit is contained in:
mergify[bot]
2021-01-08 18:54:11 +00:00
committed by GitHub
parent d5ff64b0d7
commit e5175c843d
9 changed files with 2166 additions and 588 deletions

View File

@@ -92,7 +92,7 @@ pub const SECONDS_PER_YEAR: f64 = 365.25 * 24.0 * 60.0 * 60.0;
pub const MAX_LEADER_SCHEDULE_STAKES: Epoch = 5;
type BankStatusCache = StatusCache<Result<()>>;
#[frozen_abi(digest = "GSPuprru1pomsgvopKG7XRWiXdqdXJdLPkgJ2arPbkXM")]
#[frozen_abi(digest = "MUmkgPsCRrWL2HEsMEvpkWMis35kbBnaEZtrph5P6bk")]
pub type BankSlotDelta = SlotDelta<Result<()>>;
type TransactionAccountRefCells = Vec<Rc<RefCell<Account>>>;
type TransactionAccountDepRefCells = Vec<(Pubkey, RefCell<Account>)>;

View File

@@ -69,6 +69,7 @@ pub fn load_buffer_account<T: Client>(
&bpf_loader_upgradeable::create_buffer(
&from_keypair.pubkey(),
&buffer_pubkey,
Some(&buffer_pubkey),
1.max(
bank_client
.get_minimum_balance_for_rent_exemption(program.len())
@@ -88,6 +89,7 @@ pub fn load_buffer_account<T: Client>(
let message = Message::new(
&[bpf_loader_upgradeable::write(
&buffer_pubkey,
None,
offset,
chunk.to_vec(),
)],
@@ -168,7 +170,7 @@ pub fn set_upgrade_authority<T: Client>(
new_authority_pubkey: Option<&Pubkey>,
) {
let message = Message::new(
&[bpf_loader_upgradeable::set_authority(
&[bpf_loader_upgradeable::set_upgrade_authority(
program_pubkey,
&current_authority_keypair.pubkey(),
new_authority_pubkey,