diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index 74fb71f39ecb7b..b26c2e74e230ff 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -216,6 +216,9 @@ fn execute_transactions( .collect() } +#[cfg(feature = "sbf_rust")] +const LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST: u32 = 64 * 1024 * 1024; + #[test] #[cfg(any(feature = "sbf_c", feature = "sbf_rust"))] fn test_program_sbf_sanity() { @@ -2755,7 +2758,18 @@ fn test_program_sbf_realloc() { instruction.accounts[0].is_writable = false; assert_eq!( bank_client - .send_and_confirm_message(signer, Message::new(&[instruction], Some(&mint_pubkey),),) + .send_and_confirm_message( + signer, + Message::new( + &[ + instruction, + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], + Some(&mint_pubkey), + ), + ) .unwrap_err() .unwrap(), TransactionError::InstructionError(0, InstructionError::ReadonlyDataModified) @@ -2767,7 +2781,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc(&program_id, &pubkey, usize::MAX, &mut bump)], + &[ + realloc(&program_id, &pubkey, usize::MAX, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ), ) @@ -2781,7 +2800,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc(&program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2794,12 +2818,17 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc_extend_and_undo( - &program_id, - &pubkey, - MAX_PERMITTED_DATA_INCREASE, - &mut bump, - )], + &[ + realloc_extend_and_undo( + &program_id, + &pubkey, + MAX_PERMITTED_DATA_INCREASE, + &mut bump, + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2813,12 +2842,17 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc_extend_and_undo( - &program_id, - &pubkey, - MAX_PERMITTED_DATA_INCREASE + 1, - &mut bump, - )], + &[ + realloc_extend_and_undo( + &program_id, + &pubkey, + MAX_PERMITTED_DATA_INCREASE + 1, + &mut bump, + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ), ) @@ -2833,12 +2867,17 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc( - &program_id, - &pubkey, - MAX_PERMITTED_DATA_INCREASE + 1, - &mut bump - )], + &[ + realloc( + &program_id, + &pubkey, + MAX_PERMITTED_DATA_INCREASE + 1, + &mut bump + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ), ) @@ -2854,13 +2893,18 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc_extend_and_fill( - &program_id, - &pubkey, - MAX_PERMITTED_DATA_INCREASE, - 1, - &mut bump, - )], + &[ + realloc_extend_and_fill( + &program_id, + &pubkey, + MAX_PERMITTED_DATA_INCREASE, + 1, + &mut bump, + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2878,12 +2922,17 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc_extend( - &program_id, - &pubkey, - MAX_PERMITTED_DATA_INCREASE, - &mut bump - )], + &[ + realloc_extend( + &program_id, + &pubkey, + MAX_PERMITTED_DATA_INCREASE, + &mut bump + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -2897,7 +2946,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc(&program_id, &pubkey, 6, &mut bump)], + &[ + realloc(&program_id, &pubkey, 6, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2911,11 +2965,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[extend_and_write_u64( - &program_id, - &pubkey, - 0x1122334455667788, - )], + &[ + extend_and_write_u64(&program_id, &pubkey, 0x1122334455667788), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2929,7 +2984,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc(&program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2942,11 +3002,16 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - program_id, - &[REALLOC_AND_ASSIGN], - vec![AccountMeta::new(pubkey, false)], - )], + &[ + Instruction::new_with_bytes( + program_id, + &[REALLOC_AND_ASSIGN], + vec![AccountMeta::new(pubkey, false)], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -2962,7 +3027,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc(&program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ), ) @@ -2977,14 +3047,19 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( &[&mint_keypair, &keypair], Message::new( - &[Instruction::new_with_bytes( - program_id, - &[REALLOC_AND_ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM], - vec![ - AccountMeta::new(pubkey, true), - AccountMeta::new(solana_sdk::system_program::id(), false), - ], - )], + &[ + Instruction::new_with_bytes( + program_id, + &[REALLOC_AND_ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM], + vec![ + AccountMeta::new(pubkey, true), + AccountMeta::new(solana_sdk::system_program::id(), false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -2998,14 +3073,19 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( &[&mint_keypair, &keypair], Message::new( - &[Instruction::new_with_bytes( - program_id, - &[ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM_AND_REALLOC], - vec![ - AccountMeta::new(pubkey, true), - AccountMeta::new(solana_sdk::system_program::id(), false), - ], - )], + &[ + Instruction::new_with_bytes( + program_id, + &[ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM_AND_REALLOC], + vec![ + AccountMeta::new(pubkey, true), + AccountMeta::new(solana_sdk::system_program::id(), false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3020,7 +3100,12 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( signer, Message::new( - &[realloc(&program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3033,11 +3118,16 @@ fn test_program_sbf_realloc() { .send_and_confirm_message( &[&mint_keypair, &keypair], Message::new( - &[Instruction::new_with_bytes( - program_id, - &[ZERO_INIT], - vec![AccountMeta::new(pubkey, true)], - )], + &[ + Instruction::new_with_bytes( + program_id, + &[ZERO_INIT], + vec![AccountMeta::new(pubkey, true)], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3095,14 +3185,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_ZERO_RO], - vec![ - AccountMeta::new_readonly(pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_ZERO_RO], + vec![ + AccountMeta::new_readonly(pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3118,7 +3213,12 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[realloc(&realloc_program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&realloc_program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3134,14 +3234,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_MAX_PLUS_ONE], - vec![ - AccountMeta::new(pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_MAX_PLUS_ONE], + vec![ + AccountMeta::new(pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3156,14 +3261,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_MAX_TWICE], - vec![ - AccountMeta::new(pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_MAX_TWICE], + vec![ + AccountMeta::new(pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3177,7 +3287,12 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[realloc(&realloc_program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&realloc_program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3192,14 +3307,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_AND_ASSIGN], - vec![ - AccountMeta::new(pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_AND_ASSIGN], + vec![ + AccountMeta::new(pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3215,7 +3335,12 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[realloc(&realloc_program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&realloc_program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3230,15 +3355,20 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( &[&mint_keypair, &keypair], Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_AND_ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM], - vec![ - AccountMeta::new(pubkey, true), - AccountMeta::new_readonly(realloc_program_id, false), - AccountMeta::new_readonly(solana_sdk::system_program::id(), false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_AND_ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM], + vec![ + AccountMeta::new(pubkey, true), + AccountMeta::new_readonly(realloc_program_id, false), + AccountMeta::new_readonly(solana_sdk::system_program::id(), false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3252,15 +3382,20 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( &[&mint_keypair, &keypair], Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM_AND_REALLOC], - vec![ - AccountMeta::new(pubkey, true), - AccountMeta::new_readonly(realloc_program_id, false), - AccountMeta::new_readonly(solana_sdk::system_program::id(), false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_ASSIGN_TO_SELF_VIA_SYSTEM_PROGRAM_AND_REALLOC], + vec![ + AccountMeta::new(pubkey, true), + AccountMeta::new_readonly(realloc_program_id, false), + AccountMeta::new_readonly(solana_sdk::system_program::id(), false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3275,7 +3410,12 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[realloc(&realloc_program_id, &pubkey, 0, &mut bump)], + &[ + realloc(&realloc_program_id, &pubkey, 0, &mut bump), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3290,14 +3430,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_INVOKE_CHECK], - vec![ - AccountMeta::new(invoke_pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_INVOKE_CHECK], + vec![ + AccountMeta::new(invoke_pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3324,16 +3469,21 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( &[&mint_keypair, &new_keypair], Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &instruction_data, - vec![ - AccountMeta::new(mint_pubkey, true), - AccountMeta::new(new_pubkey, true), - AccountMeta::new(solana_sdk::system_program::id(), false), - AccountMeta::new_readonly(realloc_invoke_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &instruction_data, + vec![ + AccountMeta::new(mint_pubkey, true), + AccountMeta::new(new_pubkey, true), + AccountMeta::new(solana_sdk::system_program::id(), false), + AccountMeta::new_readonly(realloc_invoke_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3356,15 +3506,20 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &instruction_data, - vec![ - AccountMeta::new(invoke_pubkey, false), - AccountMeta::new_readonly(realloc_invoke_program_id, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &instruction_data, + vec![ + AccountMeta::new(invoke_pubkey, false), + AccountMeta::new_readonly(realloc_invoke_program_id, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3386,14 +3541,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_MAX_INVOKE_MAX], - vec![ - AccountMeta::new(invoke_pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_MAX_INVOKE_MAX], + vec![ + AccountMeta::new(invoke_pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3420,14 +3580,19 @@ fn test_program_sbf_realloc_invoke() { let result = bank_client.send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &instruction_data, - vec![ - AccountMeta::new(invoke_pubkey, false), - AccountMeta::new_readonly(realloc_invoke_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &instruction_data, + vec![ + AccountMeta::new(invoke_pubkey, false), + AccountMeta::new_readonly(realloc_invoke_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ); @@ -3455,15 +3620,20 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_INVOKE_MAX_TWICE], - vec![ - AccountMeta::new(invoke_pubkey, false), - AccountMeta::new_readonly(realloc_invoke_program_id, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_INVOKE_MAX_TWICE], + vec![ + AccountMeta::new(invoke_pubkey, false), + AccountMeta::new_readonly(realloc_invoke_program_id, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3491,14 +3661,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_EXTEND_MAX, 1, i as u8, (i / 255) as u8], - vec![ - AccountMeta::new(pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_EXTEND_MAX, 1, i as u8, (i / 255) as u8], + vec![ + AccountMeta::new(pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), ) @@ -3516,14 +3691,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &[INVOKE_REALLOC_EXTEND_MAX, 2, 1, 1], - vec![ - AccountMeta::new(pubkey, false), - AccountMeta::new_readonly(realloc_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &[INVOKE_REALLOC_EXTEND_MAX, 2, 1, 1], + vec![ + AccountMeta::new(pubkey, false), + AccountMeta::new_readonly(realloc_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST + ), + ], Some(&mint_pubkey), ) ) @@ -3544,14 +3724,19 @@ fn test_program_sbf_realloc_invoke() { .send_and_confirm_message( signer, Message::new( - &[Instruction::new_with_bytes( - realloc_invoke_program_id, - &instruction_data, - vec![ - AccountMeta::new(invoke_pubkey, false), - AccountMeta::new_readonly(realloc_invoke_program_id, false), - ], - )], + &[ + Instruction::new_with_bytes( + realloc_invoke_program_id, + &instruction_data, + vec![ + AccountMeta::new(invoke_pubkey, false), + AccountMeta::new_readonly(realloc_invoke_program_id, false), + ], + ), + ComputeBudgetInstruction::set_loaded_accounts_data_size_limit( + LOADED_ACCOUNTS_DATA_SIZE_LIMIT_FOR_TEST, + ), + ], Some(&mint_pubkey), ), )