From f4f5e308f99642e949346fc916255ed8be3d94e3 Mon Sep 17 00:00:00 2001 From: buffalu <85544055+buffalu@users.noreply.github.com> Date: Sat, 9 Nov 2024 17:02:59 -0600 Subject: [PATCH] Add config to disable account streaming (#55) Adds a config to disable account streaming --- server/src/geyser_grpc_plugin.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/geyser_grpc_plugin.rs b/server/src/geyser_grpc_plugin.rs index 0afda6e..68b43e1 100644 --- a/server/src/geyser_grpc_plugin.rs +++ b/server/src/geyser_grpc_plugin.rs @@ -57,6 +57,7 @@ pub struct PluginData { is_startup_completed: AtomicBool, ignore_startup_updates: bool, + account_data_notifications_enabled: bool, } #[derive(Default)] @@ -99,6 +100,7 @@ pub struct PluginConfig { pub block_update_buffer_size: usize, pub transaction_update_buffer_size: usize, pub skip_startup_stream: Option, + pub account_data_notifications_enabled: Option, } impl PluginConfig { @@ -198,6 +200,7 @@ impl GeyserPlugin for GeyserGrpcPlugin { is_startup_completed: AtomicBool::new(false), // don't skip startup to keep backwards compatability ignore_startup_updates: config.skip_startup_stream.unwrap_or(false), + account_data_notifications_enabled: config.account_data_notifications_enabled.unwrap_or(true), }); info!("plugin data initialized"); @@ -519,7 +522,7 @@ impl GeyserPlugin for GeyserGrpcPlugin { } fn account_data_notifications_enabled(&self) -> bool { - true + self.data.as_ref().map(|d| d.account_data_notifications_enabled).unwrap_or(true) } fn transaction_notifications_enabled(&self) -> bool {