diff --git a/server/src/geyser_grpc_plugin.rs b/server/src/geyser_grpc_plugin.rs index 5e592bb..de59f5f 100644 --- a/server/src/geyser_grpc_plugin.rs +++ b/server/src/geyser_grpc_plugin.rs @@ -47,7 +47,7 @@ pub struct PluginData { highest_write_slot: Arc, is_startup_completed: AtomicBool, - stream_state_on_startup: bool + ignore_startup_updates: bool } #[derive(Default)] @@ -70,7 +70,7 @@ pub struct PluginConfig { pub slot_update_buffer_size: usize, pub block_update_buffer_size: usize, pub transaction_update_buffer_size: usize, - pub stream_state_on_startup: Option + pub skip_startup_stream: Option } impl GeyserPlugin for GeyserGrpcPlugin { @@ -140,8 +140,8 @@ impl GeyserPlugin for GeyserGrpcPlugin { transaction_update_sender, highest_write_slot, is_startup_completed: AtomicBool::new(false), - // true to keep backwards compatability - stream_state_on_startup: config.stream_state_on_startup.unwrap_or(true) + // don't skip startup to keep backwards compatability + ignore_startup_updates: config.skip_startup_stream.unwrap_or(false) }); info!("plugin data initialized"); @@ -171,7 +171,7 @@ impl GeyserPlugin for GeyserGrpcPlugin { ) -> PluginResult<()> { let data = self.data.as_ref().expect("plugin must be initialized"); - if !data.is_startup_completed.load(Ordering::Relaxed) && !data.stream_state_on_startup { + if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) { return Ok(()); } @@ -280,7 +280,7 @@ impl GeyserPlugin for GeyserGrpcPlugin { ) -> PluginResult<()> { let data = self.data.as_ref().expect("plugin must be initialized"); - if !data.is_startup_completed.load(Ordering::Relaxed) && !data.stream_state_on_startup { + if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) { return Ok(()); } @@ -321,7 +321,7 @@ impl GeyserPlugin for GeyserGrpcPlugin { ) -> PluginResult<()> { let data = self.data.as_ref().expect("plugin must be initialized"); - if !data.is_startup_completed.load(Ordering::Relaxed) && !data.stream_state_on_startup { + if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) { return Ok(()); } @@ -372,7 +372,7 @@ impl GeyserPlugin for GeyserGrpcPlugin { fn notify_block_metadata(&self, block_info: ReplicaBlockInfoVersions) -> PluginResult<()> { let data = self.data.as_ref().expect("plugin must be initialized"); - if !data.is_startup_completed.load(Ordering::Relaxed) && !data.stream_state_on_startup { + if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) { return Ok(()); }