solana-connection-cache 3.0.8
“Solana Connection Cache”
Large registry install base (10k+ downloads)Rust test marker or harness
SHA-256b7ce2d2f1c270cfc06066799f3220c694ba4fdadbcae16f1138ba15f64924a4c
MaleculeMd₂(In₅Pa)
Evidence
1use {
2 crate::{
3 client_connection::ClientConnection as BlockingClientConnection,
4 connection_cache_stats::{ConnectionCacheStats, CONNECTION_STAT_SUBMISSION_INTERVAL},
5 nonblocking::client_connection::ClientConnection as NonblockingClientConnection,
6 },
7 crossbeam_channel::{Receiver, RecvError, Sender},
8 indexmap::map::IndexMap,
9 log::*,
10 rand::{thread_rng, Rng},
11 solana_keypair::Keypair,
12 solana_measure::measure::Measure,
13 solana_time_utils::AtomicInterval,
14 std::{
15 net::SocketAddr,
16 sync::{atomic::Ordering, Arc, RwLock},
17 thread::{Builder, JoinHandle},
18 },
19 thiserror::Error,
20};
21
⋯4 lines
92:20… ion_pool_size = 1.max(connection_pool_size); // The minimum pool size is 1.
93
94 let stats = Arc::new(ConnectionCacheStats::default());
95
96 …
501:48… Stats>,
502 num_evictions: u64,
503 eviction_timing_ms: u64,
504}
505
506#[cfg(test)]
507mod tests {
508 use {
509 super::*,
510 crate::{
511 client_connection::ClientConnection as BlockingClientConnection,
512:65… NonblockingClientConnection,
513 },
514 async_trait::async_trait,
515 rand::{Rng, SeedableRng},
516 rand_chacha::ChaChaRng,
517 solana_net_utils::sockets::bind_to_localhost_unique,
518 solana_transaction_error::TransportResult,
519 std::{
520 net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket},
521 sync::Arc,
522 },
⋯6 lines
683:50… 0");
684
685 addr_str.parse().expect("Invalid address")
686 }
687
688 #[test]
689 fn test_connection_cache() {
690 solana_logger::setup();
691 // Allow the test to run deterministically
692 // with the same pseudorandom sequence between runs
693 // and on different platforms - the cryptog …
No evidence locations were recorded for this file. Raw result