Skip to content

Commit

Permalink
Fix deployment slot for upgraded programs (#30902)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 authored Mar 27, 2023
1 parent 0df28f6 commit cbf7043
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ fn process_loader_upgradeable_instruction(
);
return Err(InstructionError::InsufficientFunds);
}
let deployment_slot = if let UpgradeableLoaderState::ProgramData {
if let UpgradeableLoaderState::ProgramData {
slot,
upgrade_authority_address,
} = programdata.get_state()?
Expand All @@ -961,7 +961,6 @@ fn process_loader_upgradeable_instruction(
ic_logger_msg!(log_collector, "Upgrade authority did not sign");
return Err(InstructionError::MissingRequiredSignature);
}
slot
} else {
ic_logger_msg!(log_collector, "Invalid ProgramData account");
return Err(InstructionError::InvalidAccountData);
Expand All @@ -978,7 +977,7 @@ fn process_loader_upgradeable_instruction(
new_program_id,
program_id,
UpgradeableLoaderState::size_of_program().saturating_add(programdata_len),
deployment_slot,
clock.slot,
{
drop(buffer);
},
Expand Down

0 comments on commit cbf7043

Please sign in to comment.