@@ -3,13 +3,15 @@ use std::{
3
3
env, fmt,
4
4
str:: FromStr ,
5
5
sync:: Arc ,
6
+ time:: Instant ,
6
7
} ;
7
8
8
9
use crate :: {
9
10
errors:: invalid_request,
10
11
priority_fee:: { MicroLamportPriorityFeeEstimates , PriorityFeeTracker , PriorityLevel } ,
11
12
solana:: solana_rpc:: decode_and_deserialize,
12
13
} ;
14
+ use cadence_macros:: { statsd_count, statsd_time} ;
13
15
use jsonrpsee:: {
14
16
core:: { async_trait, RpcResult } ,
15
17
proc_macros:: rpc,
@@ -131,6 +133,7 @@ fn get_from_address_lookup_tables(
131
133
let address_table_lookups: Option < & [ solana_sdk:: message:: v0:: MessageAddressTableLookup ] > =
132
134
transaction. message . address_table_lookups ( ) ;
133
135
if let Some ( address_table_lookups) = address_table_lookups {
136
+ let start = Instant :: now ( ) ;
134
137
let mut lookup_table_indices = HashMap :: new ( ) ;
135
138
let address_table_lookup_accounts: Vec < Pubkey > = address_table_lookups
136
139
. iter ( )
@@ -142,6 +145,10 @@ fn get_from_address_lookup_tables(
142
145
a. account_key
143
146
} )
144
147
. collect ( ) ;
148
+ statsd_count ! (
149
+ "get_from_address_lookup_tables_num_accounts" ,
150
+ address_table_lookup_accounts. len( ) as i64
151
+ ) ;
145
152
let accounts = rpc_client. get_multiple_accounts ( address_table_lookup_accounts. as_slice ( ) ) ;
146
153
match accounts {
147
154
Ok ( accounts) => {
@@ -185,6 +192,7 @@ fn get_from_address_lookup_tables(
185
192
info ! ( "error getting accounts: {:?}" , e) ;
186
193
}
187
194
}
195
+ statsd_time ! ( "get_from_address_lookup_tables" , start. elapsed( ) ) ;
188
196
}
189
197
account_keys
190
198
}
@@ -279,7 +287,9 @@ impl AtlasPriorityFeeEstimatorRpcServer for AtlasPriorityFeeEstimator {
279
287
} ) ;
280
288
}
281
289
}
282
- let recommended = options. map_or ( false , |o : GetPriorityFeeEstimateOptions | o. recommended . unwrap_or ( false ) ) ;
290
+ let recommended = options. map_or ( false , |o : GetPriorityFeeEstimateOptions | {
291
+ o. recommended . unwrap_or ( false )
292
+ } ) ;
283
293
let priority_fee = if recommended {
284
294
get_recommended_fee ( priority_fee_levels)
285
295
} else {
@@ -317,7 +327,7 @@ fn should_include_vote(options: &Option<GetPriorityFeeEstimateOptions>) -> bool
317
327
318
328
const MIN_RECOMMENDED_PRIORITY_FEE : f64 = 10_000.0 ;
319
329
320
- // Safety buffer on the recommended fee to cover cases where the priority fee is increasing over each block.
330
+ // Safety buffer on the recommended fee to cover cases where the priority fee is increasing over each block.
321
331
const RECOMMENDED_FEE_SAFETY_BUFFER : f64 = 0.05 ;
322
332
323
333
pub fn get_recommended_fee ( priority_fee_levels : MicroLamportPriorityFeeEstimates ) -> f64 {
0 commit comments