@@ -347,6 +347,11 @@ pub(crate) mod external {
347347 . map ( |( ) | true ) ;
348348 }
349349
350+ let BankPair {
351+ root_bank,
352+ working_bank : _,
353+ } = self . sharable_banks . load ( ) ;
354+
350355 // Loop here to avoid exposing internal error to external scheduler.
351356 // In the vast majority of cases, this will iterate a single time;
352357 // If we began execution when a slot was still in process, and could
@@ -385,7 +390,7 @@ pub(crate) mod external {
385390 )
386391 } ;
387392 let ( translation_results, transactions, max_ages) =
388- Self :: translate_transaction_batch ( & batch, bank) ;
393+ Self :: translate_transaction_batch ( & batch, bank, & root_bank ) ;
389394
390395 // Enforce all or nothing on translation_results.
391396 let execution_flags = ExecutionFlags {
@@ -497,7 +502,7 @@ pub(crate) mod external {
497502
498503 // Do resolving next since we (currently) need resolved transactions for status checks.
499504 let ( parsing_and_resolve_results, txs, max_ages) =
500- Self :: translate_transaction_batch ( & batch, & root_bank) ;
505+ Self :: translate_transaction_batch ( & batch, & working_bank , & root_bank) ;
501506
502507 if message. flags & check_flags:: LOAD_ADDRESS_LOOKUP_TABLES != 0 {
503508 self . check_resolve_pubkeys (
@@ -939,20 +944,22 @@ pub(crate) mod external {
939944 /// Translate batch of transactions into usable
940945 fn translate_transaction_batch (
941946 batch : & TransactionPtrBatch ,
942- bank : & Bank ,
947+ working_bank : & Bank ,
948+ root_bank : & Bank ,
943949 ) -> ( Vec < Result < ( ) , PacketHandlingError > > , Vec < Tx > , Vec < MaxAge > ) {
944- let enable_static_instruction_limit = bank
950+ let enable_static_instruction_limit = root_bank
945951 . feature_set
946952 . is_active ( & agave_feature_set:: static_instruction_limit:: ID ) ;
947- let transaction_account_lock_limit = bank . get_transaction_account_lock_limit ( ) ;
953+ let transaction_account_lock_limit = working_bank . get_transaction_account_lock_limit ( ) ;
948954
949955 let mut translation_results = Vec :: with_capacity ( MAX_TRANSACTIONS_PER_MESSAGE ) ;
950956 let mut transactions = Vec :: with_capacity ( MAX_TRANSACTIONS_PER_MESSAGE ) ;
951957 let mut max_ages = Vec :: with_capacity ( MAX_TRANSACTIONS_PER_MESSAGE ) ;
952958 for ( transaction_ptr, _) in batch. iter ( ) {
953959 match Self :: translate_transaction (
954960 transaction_ptr,
955- bank,
961+ working_bank,
962+ root_bank,
956963 enable_static_instruction_limit,
957964 transaction_account_lock_limit,
958965 ) {
@@ -970,21 +977,23 @@ pub(crate) mod external {
970977
971978 fn translate_transaction (
972979 transaction_ptr : TransactionPtr ,
973- bank : & Bank ,
980+ working_bank : & Bank ,
981+ root_bank : & Bank ,
974982 enable_static_instruction_limit : bool ,
975983 transaction_account_lock_limit : usize ,
976984 ) -> Result < ( Tx , MaxAge ) , PacketHandlingError > {
977985 translate_to_runtime_view (
978986 transaction_ptr,
979- bank,
987+ working_bank,
988+ root_bank,
980989 enable_static_instruction_limit,
981990 transaction_account_lock_limit,
982991 )
983992 . map ( |( view, deactivation_slot) | {
984993 (
985994 view,
986995 MaxAge {
987- sanitized_epoch : bank . epoch ( ) ,
996+ sanitized_epoch : root_bank . epoch ( ) ,
988997 alt_invalidation_slot : deactivation_slot,
989998 } ,
990999 )
@@ -1138,6 +1147,7 @@ pub(crate) mod external {
11381147 translate_to_runtime_view (
11391148 & simple_tx[ ..] ,
11401149 & bank,
1150+ & bank,
11411151 true ,
11421152 bank. get_transaction_account_lock_limit ( ) ,
11431153 )
0 commit comments