4
4
transaction_error_metrics:: TransactionErrorMetrics ,
5
5
transaction_processing_callback:: TransactionProcessingCallback ,
6
6
} ,
7
- itertools:: Itertools ,
8
7
log:: warn,
9
8
solana_program_runtime:: {
10
9
compute_budget_processor:: process_compute_budget_instructions,
11
- loaded_programs:: { ProgramCacheEntry , ProgramCacheForTxBatch } ,
10
+ loaded_programs:: ProgramCacheEntry ,
12
11
} ,
13
12
solana_sdk:: {
14
13
account:: { Account , AccountSharedData , ReadableAccount , WritableAccount } ,
15
- clock:: Slot ,
16
14
feature_set:: {
17
15
self , include_loaded_accounts_data_size_in_fee_calculation,
18
16
remove_rounding_in_fee_calculation,
32
30
transaction_context:: { IndexOfAccount , TransactionAccount } ,
33
31
} ,
34
32
solana_system_program:: { get_system_account_kind, SystemAccountKind } ,
35
- std:: collections:: hash_map:: Entry ,
36
- std:: { collections:: HashMap , num:: NonZeroUsize } ,
33
+ std:: {
34
+ collections:: { hash_map:: Entry , HashMap } ,
35
+ num:: NonZeroUsize ,
36
+ } ,
37
37
} ;
38
38
39
39
// for the load instructions
@@ -113,7 +113,7 @@ pub fn validate_fee_payer(
113
113
pub ( crate ) fn load_accounts < CB : TransactionProcessingCallback > (
114
114
callbacks : & CB ,
115
115
txs : & [ SanitizedTransaction ] ,
116
- check_results : & [ TransactionCheckResult ] ,
116
+ check_results : & mut [ TransactionCheckResult ] ,
117
117
error_counters : & mut TransactionErrorMetrics ,
118
118
fee_structure : & FeeStructure ,
119
119
account_overrides : Option < & AccountOverrides > ,
@@ -138,6 +138,7 @@ pub(crate) fn load_accounts<CB: TransactionProcessingCallback>(
138
138
feature_set. is_active ( & remove_rounding_in_fee_calculation:: id ( ) ) ,
139
139
)
140
140
} else {
141
+ * etx. 1 = ( Err ( TransactionError :: BlockhashNotFound ) , None , None ) ;
141
142
return ( Err ( TransactionError :: BlockhashNotFound ) , None ) ;
142
143
} ;
143
144
@@ -408,6 +409,7 @@ fn get_requested_loaded_accounts_data_size_limit(
408
409
)
409
410
}
410
411
412
+ #[ allow( dead_code) ]
411
413
fn account_shared_data_from_program ( loaded_program : & ProgramCacheEntry ) -> AccountSharedData {
412
414
// It's an executable program account. The program is already loaded in the cache.
413
415
// So the account data is not needed. Return a dummy AccountSharedData with meta
@@ -461,7 +463,6 @@ mod tests {
461
463
solana_program_runtime:: {
462
464
compute_budget:: ComputeBudget ,
463
465
compute_budget_processor,
464
- loaded_programs:: { ProgramCacheEntry , ProgramCacheForTxBatch } ,
465
466
prioritization_fee:: { PrioritizationFeeDetails , PrioritizationFeeType } ,
466
467
} ,
467
468
solana_sdk:: {
@@ -557,7 +558,7 @@ mod tests {
557
558
load_accounts (
558
559
& callbacks,
559
560
& [ sanitized_tx] ,
560
- & [ ( Ok ( ( ) ) , None , Some ( lamports_per_signature) ) ] ,
561
+ & mut [ ( Ok ( ( ) ) , None , Some ( lamports_per_signature) ) ] ,
561
562
error_counters,
562
563
fee_structure,
563
564
None ,
@@ -1048,7 +1049,7 @@ mod tests {
1048
1049
load_accounts (
1049
1050
& callbacks,
1050
1051
& [ tx] ,
1051
- & [ ( Ok ( ( ) ) , None , Some ( 10 ) ) ] ,
1052
+ & mut [ ( Ok ( ( ) ) , None , Some ( 10 ) ) ] ,
1052
1053
& mut error_counters,
1053
1054
& FeeStructure :: default ( ) ,
1054
1055
account_overrides,
@@ -1488,7 +1489,6 @@ mod tests {
1488
1489
mock_bank. accounts_map . insert ( key1. pubkey ( ) , account_data) ;
1489
1490
1490
1491
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1491
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1492
1492
1493
1493
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1494
1494
sanitized_message,
@@ -1817,7 +1817,6 @@ mod tests {
1817
1817
. accounts_map
1818
1818
. insert ( key3. pubkey ( ) , AccountSharedData :: default ( ) ) ;
1819
1819
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1820
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1821
1820
1822
1821
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1823
1822
sanitized_message,
@@ -1879,7 +1878,6 @@ mod tests {
1879
1878
mock_bank. accounts_map . insert ( key3. pubkey ( ) , account_data) ;
1880
1879
1881
1880
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1882
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1883
1881
1884
1882
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1885
1883
sanitized_message,
@@ -1967,7 +1965,6 @@ mod tests {
1967
1965
mock_bank. accounts_map . insert ( key3. pubkey ( ) , account_data) ;
1968
1966
1969
1967
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1970
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1971
1968
1972
1969
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1973
1970
sanitized_message,
@@ -2048,7 +2045,7 @@ mod tests {
2048
2045
let loaded_txs = load_accounts (
2049
2046
& bank,
2050
2047
& [ sanitized_tx. clone ( ) ] ,
2051
- & [ ( Ok ( ( ) ) , None , Some ( 0 ) ) ] ,
2048
+ & mut [ ( Ok ( ( ) ) , None , Some ( 0 ) ) ] ,
2052
2049
& mut error_counters,
2053
2050
& FeeStructure :: default ( ) ,
2054
2051
None ,
@@ -2119,7 +2116,6 @@ mod tests {
2119
2116
mock_bank. accounts_map . insert ( key3. pubkey ( ) , account_data) ;
2120
2117
2121
2118
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
2122
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
2123
2119
2124
2120
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
2125
2121
sanitized_message,
@@ -2132,7 +2128,7 @@ mod tests {
2132
2128
let results = load_accounts (
2133
2129
& mock_bank,
2134
2130
& [ sanitized_transaction] ,
2135
- & [ check_result] ,
2131
+ & mut [ check_result] ,
2136
2132
& mut error_counter,
2137
2133
& FeeStructure :: default ( ) ,
2138
2134
None ,
@@ -2206,7 +2202,7 @@ mod tests {
2206
2202
let result = load_accounts (
2207
2203
& mock_bank,
2208
2204
& [ sanitized_transaction. clone ( ) ] ,
2209
- & [ check_result] ,
2205
+ & mut [ check_result] ,
2210
2206
& mut TransactionErrorMetrics :: default ( ) ,
2211
2207
& fee_structure,
2212
2208
None ,
@@ -2225,7 +2221,7 @@ mod tests {
2225
2221
let result = load_accounts (
2226
2222
& mock_bank,
2227
2223
& [ sanitized_transaction. clone ( ) ] ,
2228
- & [ check_result. clone ( ) ] ,
2224
+ & mut [ check_result. clone ( ) ] ,
2229
2225
& mut TransactionErrorMetrics :: default ( ) ,
2230
2226
& fee_structure,
2231
2227
None ,
@@ -2244,7 +2240,7 @@ mod tests {
2244
2240
let result = load_accounts (
2245
2241
& mock_bank,
2246
2242
& [ sanitized_transaction. clone ( ) ] ,
2247
- & [ check_result] ,
2243
+ & mut [ check_result] ,
2248
2244
& mut TransactionErrorMetrics :: default ( ) ,
2249
2245
& fee_structure,
2250
2246
None ,
0 commit comments