feat: Add caching system and performance optimizations

- Add fast_fn module with global caches for PDA, ATA, and instruction operations
- Implement memory-efficient caches using CLRU and parking_lot for thread-safe access
- Optimize compute budget instruction generation with caching
- Replace std::sync::Mutex with parking_lot::Mutex for better performance
- Add dedicated caching for PumpFun PDAs and associated token addresses
- Improve transaction building with batch signature optimization
- Add new dependencies: clru, smallvec, parking_lot for cache infrastructure
- Remove unused utility functions in pumpfun module
- Enhance error messages for tip fee configuration validation
This commit is contained in:
ysq
2025-09-08 17:12:29 +08:00
parent 31b5e2855b
commit 93c133a9ea
12 changed files with 356 additions and 169 deletions
+12 -4
View File
@@ -32,14 +32,14 @@ pub async fn parallel_execute_with_tips(
&& (swqos_clients.len() > priority_fee.buy_tip_fees.len()
|| priority_fee.buy_tip_fees.is_empty())
{
return Err(anyhow!("Number of tip clients exceeds the configured buy tip fees"));
return Err(anyhow!("Number of tip clients exceeds the configured buy tip fees. Please configure buy_tip_fees to match swqos_clients"));
}
if !is_buy
&& !with_tip
&& (swqos_clients.len() > priority_fee.sell_tip_fees.len()
|| priority_fee.sell_tip_fees.is_empty())
{
return Err(anyhow!("Number of tip clients exceeds the configured sell tip fees"));
return Err(anyhow!("Number of tip clients exceeds the configured sell tip fees. Please configure sell_tip_fees to match swqos_clients"));
}
let instructions = Arc::new(instructions);
@@ -82,7 +82,11 @@ pub async fn parallel_execute_with_tips(
)
.await?;
println!("Building transaction instructions: {:?} {:?}", swqos_type, start.elapsed());
println!(
"[{:?}] - Building transaction instructions: {:?}",
swqos_type,
start.elapsed()
);
start = Instant::now();
@@ -93,7 +97,11 @@ pub async fn parallel_execute_with_tips(
)
.await?;
println!("Submitting transaction instructions: {:?} {:?}", swqos_type, start.elapsed());
println!(
"[{:?}] - Submitting transaction instructions: {:?}",
swqos_type,
start.elapsed()
);
Ok::<(), anyhow::Error>(())
});