mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-19 11:58:06 +00:00
perf: Refactor event processing system for better performance
This commit is contained in:
@@ -13,7 +13,12 @@ pub struct BlockMetaEvent {
|
||||
}
|
||||
|
||||
impl BlockMetaEvent {
|
||||
pub fn new(slot: u64, block_hash: String, block_time_ms: i64) -> Self {
|
||||
pub fn new(
|
||||
slot: u64,
|
||||
block_hash: String,
|
||||
block_time_ms: i64,
|
||||
program_received_time_us: i64,
|
||||
) -> Self {
|
||||
let metadata = EventMetadata::new(
|
||||
format!("block_{}_{}", slot, block_hash),
|
||||
"".to_string(),
|
||||
@@ -24,7 +29,7 @@ impl BlockMetaEvent {
|
||||
EventType::BlockMeta,
|
||||
solana_sdk::pubkey::Pubkey::default(),
|
||||
"".to_string(),
|
||||
chrono::Utc::now().timestamp_millis(),
|
||||
program_received_time_us,
|
||||
);
|
||||
Self { metadata, slot, block_hash }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user