Fix deployment slot for upgraded programs (#30902)

This commit is contained in:
Pankaj Garg 2023-03-27 06:48:26 -07:00 committed by GitHub
parent 0df28f6d51
commit cbf70430a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -936,7 +936,7 @@ fn process_loader_upgradeable_instruction(
); );
return Err(InstructionError::InsufficientFunds); return Err(InstructionError::InsufficientFunds);
} }
let deployment_slot = if let UpgradeableLoaderState::ProgramData { if let UpgradeableLoaderState::ProgramData {
slot, slot,
upgrade_authority_address, upgrade_authority_address,
} = programdata.get_state()? } = programdata.get_state()?
@ -961,7 +961,6 @@ fn process_loader_upgradeable_instruction(
ic_logger_msg!(log_collector, "Upgrade authority did not sign"); ic_logger_msg!(log_collector, "Upgrade authority did not sign");
return Err(InstructionError::MissingRequiredSignature); return Err(InstructionError::MissingRequiredSignature);
} }
slot
} else { } else {
ic_logger_msg!(log_collector, "Invalid ProgramData account"); ic_logger_msg!(log_collector, "Invalid ProgramData account");
return Err(InstructionError::InvalidAccountData); return Err(InstructionError::InvalidAccountData);
@ -978,7 +977,7 @@ fn process_loader_upgradeable_instruction(
new_program_id, new_program_id,
program_id, program_id,
UpgradeableLoaderState::size_of_program().saturating_add(programdata_len), UpgradeableLoaderState::size_of_program().saturating_add(programdata_len),
deployment_slot, clock.slot,
{ {
drop(buffer); drop(buffer);
}, },