Fix deployment slot for upgraded programs (#30902)
This commit is contained in:
parent
0df28f6d51
commit
cbf70430a5
|
@ -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);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue