mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-15 09:58:05 +00:00
refactor: modernize dependency stack and minimize footprint
- Migrate to native 'std::sync' primitives (LazyLock, OnceLock, RwLock). - Replace 'parking_lot' with std library synchronization types. - Switch from 'chrono' to 'std::time::SystemTime' for lightweight timestamps. - Bump core dependencies: tokio (1.50.0) and rustls (0.23.37). - Decouple 'solana-program' by utilizing 'solana-sdk' re-exports. - Prune redundant crates: lazy_static, once_cell, chrono, maplit, and parking_lot. - Remove unused dev-dependencies (criterion) and example-only utils (env_logger). - Improve compile times and reduce supply chain attack surface.
This commit is contained in:
@@ -91,7 +91,12 @@ pub async fn process_grpc_transaction(
|
||||
let block_time_ms = block_meta_pretty
|
||||
.block_time
|
||||
.map(|ts| ts.seconds * 1000 + ts.nanos as i64 / 1_000_000)
|
||||
.unwrap_or_else(|| chrono::Utc::now().timestamp_millis());
|
||||
.unwrap_or_else(|| {
|
||||
std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_millis() as i64
|
||||
});
|
||||
|
||||
let block_meta_event = CommonEventParser::generate_block_meta_event(
|
||||
block_meta_pretty.slot,
|
||||
|
||||
Reference in New Issue
Block a user