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,
@@ -113,7 +111,7 @@ pub fn validate_fee_payer(
113
111
pub ( crate ) fn load_accounts < CB : TransactionProcessingCallback > (
114
112
callbacks : & CB ,
115
113
txs : & [ SanitizedTransaction ] ,
116
- check_results : & [ TransactionCheckResult ] ,
114
+ check_results : & mut [ TransactionCheckResult ] ,
117
115
error_counters : & mut TransactionErrorMetrics ,
118
116
fee_structure : & FeeStructure ,
119
117
account_overrides : Option < & AccountOverrides > ,
@@ -138,6 +136,7 @@ pub(crate) fn load_accounts<CB: TransactionProcessingCallback>(
138
136
feature_set. is_active ( & remove_rounding_in_fee_calculation:: id ( ) ) ,
139
137
)
140
138
} else {
139
+ * etx. 1 = ( Err ( TransactionError :: BlockhashNotFound ) , None , None ) ;
141
140
return ( Err ( TransactionError :: BlockhashNotFound ) , None ) ;
142
141
} ;
143
142
@@ -408,6 +407,7 @@ fn get_requested_loaded_accounts_data_size_limit(
408
407
)
409
408
}
410
409
410
+ #[ allow( dead_code) ]
411
411
fn account_shared_data_from_program ( loaded_program : & ProgramCacheEntry ) -> AccountSharedData {
412
412
// It's an executable program account. The program is already loaded in the cache.
413
413
// So the account data is not needed. Return a dummy AccountSharedData with meta
@@ -461,7 +461,7 @@ mod tests {
461
461
solana_program_runtime:: {
462
462
compute_budget:: ComputeBudget ,
463
463
compute_budget_processor,
464
- loaded_programs:: { ProgramCacheEntry , ProgramCacheForTxBatch } ,
464
+ loaded_programs:: ProgramCacheForTxBatch ,
465
465
prioritization_fee:: { PrioritizationFeeDetails , PrioritizationFeeType } ,
466
466
} ,
467
467
solana_sdk:: {
@@ -557,7 +557,7 @@ mod tests {
557
557
load_accounts (
558
558
& callbacks,
559
559
& [ sanitized_tx] ,
560
- & [ ( Ok ( ( ) ) , None , Some ( lamports_per_signature) ) ] ,
560
+ & mut [ ( Ok ( ( ) ) , None , Some ( lamports_per_signature) ) ] ,
561
561
error_counters,
562
562
fee_structure,
563
563
None ,
@@ -1048,7 +1048,7 @@ mod tests {
1048
1048
load_accounts (
1049
1049
& callbacks,
1050
1050
& [ tx] ,
1051
- & [ ( Ok ( ( ) ) , None , Some ( 10 ) ) ] ,
1051
+ & mut [ ( Ok ( ( ) ) , None , Some ( 10 ) ) ] ,
1052
1052
& mut error_counters,
1053
1053
& FeeStructure :: default ( ) ,
1054
1054
account_overrides,
@@ -1488,7 +1488,6 @@ mod tests {
1488
1488
mock_bank. accounts_map . insert ( key1. pubkey ( ) , account_data) ;
1489
1489
1490
1490
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1491
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1492
1491
1493
1492
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1494
1493
sanitized_message,
@@ -1817,7 +1816,6 @@ mod tests {
1817
1816
. accounts_map
1818
1817
. insert ( key3. pubkey ( ) , AccountSharedData :: default ( ) ) ;
1819
1818
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1820
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1821
1819
1822
1820
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1823
1821
sanitized_message,
@@ -1879,7 +1877,6 @@ mod tests {
1879
1877
mock_bank. accounts_map . insert ( key3. pubkey ( ) , account_data) ;
1880
1878
1881
1879
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1882
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1883
1880
1884
1881
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1885
1882
sanitized_message,
@@ -1967,7 +1964,6 @@ mod tests {
1967
1964
mock_bank. accounts_map . insert ( key3. pubkey ( ) , account_data) ;
1968
1965
1969
1966
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
1970
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
1971
1967
1972
1968
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
1973
1969
sanitized_message,
@@ -2048,7 +2044,7 @@ mod tests {
2048
2044
let loaded_txs = load_accounts (
2049
2045
& bank,
2050
2046
& [ sanitized_tx. clone ( ) ] ,
2051
- & [ ( Ok ( ( ) ) , None , Some ( 0 ) ) ] ,
2047
+ & mut [ ( Ok ( ( ) ) , None , Some ( 0 ) ) ] ,
2052
2048
& mut error_counters,
2053
2049
& FeeStructure :: default ( ) ,
2054
2050
None ,
@@ -2119,7 +2115,6 @@ mod tests {
2119
2115
mock_bank. accounts_map . insert ( key3. pubkey ( ) , account_data) ;
2120
2116
2121
2117
let mut error_counter = TransactionErrorMetrics :: default ( ) ;
2122
- let loaded_programs = ProgramCacheForTxBatch :: default ( ) ;
2123
2118
2124
2119
let sanitized_transaction = SanitizedTransaction :: new_for_tests (
2125
2120
sanitized_message,
@@ -2132,7 +2127,7 @@ mod tests {
2132
2127
let results = load_accounts (
2133
2128
& mock_bank,
2134
2129
& [ sanitized_transaction] ,
2135
- & [ check_result] ,
2130
+ & mut [ check_result] ,
2136
2131
& mut error_counter,
2137
2132
& FeeStructure :: default ( ) ,
2138
2133
None ,
@@ -2206,7 +2201,7 @@ mod tests {
2206
2201
let result = load_accounts (
2207
2202
& mock_bank,
2208
2203
& [ sanitized_transaction. clone ( ) ] ,
2209
- & [ check_result] ,
2204
+ & mut [ check_result] ,
2210
2205
& mut TransactionErrorMetrics :: default ( ) ,
2211
2206
& fee_structure,
2212
2207
None ,
@@ -2225,7 +2220,7 @@ mod tests {
2225
2220
let result = load_accounts (
2226
2221
& mock_bank,
2227
2222
& [ sanitized_transaction. clone ( ) ] ,
2228
- & [ check_result. clone ( ) ] ,
2223
+ & mut [ check_result. clone ( ) ] ,
2229
2224
& mut TransactionErrorMetrics :: default ( ) ,
2230
2225
& fee_structure,
2231
2226
None ,
@@ -2244,7 +2239,7 @@ mod tests {
2244
2239
let result = load_accounts (
2245
2240
& mock_bank,
2246
2241
& [ sanitized_transaction. clone ( ) ] ,
2247
- & [ check_result] ,
2242
+ & mut [ check_result] ,
2248
2243
& mut TransactionErrorMetrics :: default ( ) ,
2249
2244
& fee_structure,
2250
2245
None ,
0 commit comments