|
|
@@ -142,7 +142,7 @@ pub fn instruction_to_nonce_error(
|
|
|
/// maximum permitted size of data: 10 MB
|
|
|
pub const MAX_PERMITTED_DATA_LENGTH: u64 = 10 * 1024 * 1024;
|
|
|
|
|
|
-#[frozen_abi(digest = "2xnDcizcPKKR7b624FeuuPd1zj5bmnkmVsBWgoKPTh4w")]
|
|
|
+#[frozen_abi(digest = "5e22s2kFu9Do77hdcCyxyhuKHD8ThAB6Q6dNaLTCjL5M")]
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, AbiExample, AbiEnumVisitor)]
|
|
|
pub enum SystemInstruction {
|
|
|
/// Create a new account
|
|
|
@@ -307,6 +307,13 @@ pub enum SystemInstruction {
|
|
|
/// Owner to use to derive the funding account address
|
|
|
from_owner: Pubkey,
|
|
|
},
|
|
|
+
|
|
|
+ /// One-time idempotent upgrade of legacy nonce versions in order to bump
|
|
|
+ /// them out of chain blockhash domain.
|
|
|
+ ///
|
|
|
+ /// # Account references
|
|
|
+ /// 0. `[WRITE]` Nonce account
|
|
|
+ UpgradeNonceAccount,
|
|
|
}
|
|
|
|
|
|
pub fn create_account(
|
|
|
@@ -940,6 +947,17 @@ pub fn authorize_nonce_account(
|
|
|
)
|
|
|
}
|
|
|
|
|
|
+/// One-time idempotent upgrade of legacy nonce versions in order to bump
|
|
|
+/// them out of chain blockhash domain.
|
|
|
+pub fn upgrade_nonce_account(nonce_pubkey: Pubkey) -> Instruction {
|
|
|
+ let account_metas = vec![AccountMeta::new(nonce_pubkey, /*is_signer:*/ false)];
|
|
|
+ Instruction::new_with_bincode(
|
|
|
+ system_program::id(),
|
|
|
+ &SystemInstruction::UpgradeNonceAccount,
|
|
|
+ account_metas,
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
#[cfg(test)]
|
|
|
mod tests {
|
|
|
use {
|