diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 5a6d825e3aa3d7..b7d7db0dcec595 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -2927,6 +2927,7 @@ impl ReplayStage { Some(bank.clock().unix_timestamp), Some(bank.block_height()), bank.executed_transaction_count(), + r_replay_progress.num_entries as u64, ) } bank_complete_time.stop(); diff --git a/geyser-plugin-interface/src/geyser_plugin_interface.rs b/geyser-plugin-interface/src/geyser_plugin_interface.rs index 87c0987f2948e6..b2bbb5a4953aed 100644 --- a/geyser-plugin-interface/src/geyser_plugin_interface.rs +++ b/geyser-plugin-interface/src/geyser_plugin_interface.rs @@ -193,7 +193,7 @@ pub struct ReplicaBlockInfo<'a> { pub block_height: Option, } -/// Extending ReplicaBlockInfo by sending the transaction_entries_count. +/// Extending ReplicaBlockInfo by sending the executed_transaction_count. #[derive(Clone, Debug)] pub struct ReplicaBlockInfoV2<'a> { pub parent_slot: Slot, @@ -206,9 +206,24 @@ pub struct ReplicaBlockInfoV2<'a> { pub executed_transaction_count: u64, } +/// Extending ReplicaBlockInfo by sending the entries_count. +#[derive(Clone, Debug)] +pub struct ReplicaBlockInfoV3<'a> { + pub parent_slot: Slot, + pub parent_blockhash: &'a str, + pub slot: Slot, + pub blockhash: &'a str, + pub rewards: &'a [Reward], + pub block_time: Option, + pub block_height: Option, + pub executed_transaction_count: u64, + pub entry_count: u64, +} + pub enum ReplicaBlockInfoVersions<'a> { V0_0_1(&'a ReplicaBlockInfo<'a>), V0_0_2(&'a ReplicaBlockInfoV2<'a>), + V0_0_3(&'a ReplicaBlockInfoV3<'a>), } /// Errors returned by plugin calls diff --git a/geyser-plugin-manager/src/block_metadata_notifier.rs b/geyser-plugin-manager/src/block_metadata_notifier.rs index 2fcf409ca49b16..ab56cf3be81701 100644 --- a/geyser-plugin-manager/src/block_metadata_notifier.rs +++ b/geyser-plugin-manager/src/block_metadata_notifier.rs @@ -6,7 +6,7 @@ use { log::*, solana_accounts_db::stake_rewards::RewardInfo, solana_geyser_plugin_interface::geyser_plugin_interface::{ - ReplicaBlockInfoV2, ReplicaBlockInfoVersions, + ReplicaBlockInfoV3, ReplicaBlockInfoVersions, }, solana_measure::measure::Measure, solana_metrics::*, @@ -31,6 +31,7 @@ impl BlockMetadataNotifier for BlockMetadataNotifierImpl { block_time: Option, block_height: Option, executed_transaction_count: u64, + entry_count: u64, ) { let plugin_manager = self.plugin_manager.read().unwrap(); if plugin_manager.plugins.is_empty() { @@ -49,8 +50,9 @@ impl BlockMetadataNotifier for BlockMetadataNotifierImpl { block_time, block_height, executed_transaction_count, + entry_count, ); - let block_info = ReplicaBlockInfoVersions::V0_0_2(&block_info); + let block_info = ReplicaBlockInfoVersions::V0_0_3(&block_info); match plugin.notify_block_metadata(block_info) { Err(err) => { error!( @@ -103,8 +105,9 @@ impl BlockMetadataNotifierImpl { block_time: Option, block_height: Option, executed_transaction_count: u64, - ) -> ReplicaBlockInfoV2<'a> { - ReplicaBlockInfoV2 { + entry_count: u64, + ) -> ReplicaBlockInfoV3<'a> { + ReplicaBlockInfoV3 { parent_slot, parent_blockhash, slot, @@ -113,6 +116,7 @@ impl BlockMetadataNotifierImpl { block_time, block_height, executed_transaction_count, + entry_count, } } diff --git a/geyser-plugin-manager/src/block_metadata_notifier_interface.rs b/geyser-plugin-manager/src/block_metadata_notifier_interface.rs index 9b7c34ed5c081f..f48df55d8d0ce5 100644 --- a/geyser-plugin-manager/src/block_metadata_notifier_interface.rs +++ b/geyser-plugin-manager/src/block_metadata_notifier_interface.rs @@ -7,6 +7,7 @@ use { /// Interface for notifying block metadata changes pub trait BlockMetadataNotifier { /// Notify the block metadata + #[allow(clippy::too_many_arguments)] fn notify_block_metadata( &self, parent_slot: u64, @@ -17,6 +18,7 @@ pub trait BlockMetadataNotifier { block_time: Option, block_height: Option, executed_transaction_count: u64, + entry_count: u64, ); }