@@ -2677,33 +2677,18 @@ pub async fn set_validator_list_to_uninitialized_account(
26772677 let account_size = std:: mem:: size_of :: < state:: ValidatorList > ( ) ;
26782678 let minimum_balance = rent. minimum_balance ( account_size) ;
26792679
2680- // Create a new uninitialized validator list account
2681- let new_validator_list = Keypair :: new ( ) ;
2682- let create_account_instruction = system_instruction:: create_account (
2683- & context. payer . pubkey ( ) ,
2684- & new_validator_list. pubkey ( ) ,
2685- minimum_balance,
2686- account_size as u64 ,
2687- & id ( ) ,
2688- ) ;
2689- let mut transaction = Transaction :: new_with_payer (
2690- & [ create_account_instruction] ,
2691- Some ( & context. payer . pubkey ( ) ) ,
2692- ) ;
2693- transaction. sign ( & [ & context. payer , & new_validator_list] , context. last_blockhash ) ;
2694- context
2695- . banks_client
2696- . process_transaction ( transaction)
2697- . await
2698- . unwrap ( ) ;
2699- // Get the uninitialized account
2700- let uninitialized_account = context
2701- . banks_client
2702- . get_account ( new_validator_list. pubkey ( ) )
2703- . await
2704- . unwrap ( )
2705- . unwrap ( ) ;
2706- // Set the uninitialized account at the validator list address
2680+ // Create an uninitialized account at the SAME validator list address
2681+ // This simulates the validator list account being corrupted/uninitialized
2682+ // while keeping the same pubkey that the stake pool expects
2683+ let uninitialized_account = solana_sdk:: account:: Account {
2684+ lamports : minimum_balance,
2685+ data : vec ! [ 0u8 ; account_size] , // All zeros - truly uninitialized
2686+ owner : id ( ) , // Owned by stake pool program
2687+ executable : false ,
2688+ rent_epoch : 0 ,
2689+ } ;
2690+
2691+ // Set the uninitialized account at the original validator list address
27072692 context. set_account ( & stake_pool_accounts. validator_list . pubkey ( ) , & uninitialized_account. into ( ) ) ;
27082693}
27092694
0 commit comments