Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BP: Add config to disable account streaming (#55) #57

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/src/geyser_grpc_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub struct PluginData {

is_startup_completed: AtomicBool,
ignore_startup_updates: bool,
account_data_notifications_enabled: bool,
}

#[derive(Default)]
Expand Down Expand Up @@ -99,6 +100,7 @@ pub struct PluginConfig {
pub block_update_buffer_size: usize,
pub transaction_update_buffer_size: usize,
pub skip_startup_stream: Option<bool>,
pub account_data_notifications_enabled: Option<bool>,
}

impl PluginConfig {
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -499,7 +502,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 {
Expand Down