Skip to content

Commit 1d7dd0a

Browse files
authored
Do not use is_startup_completed (#59) (#61)
BP #59
1 parent 84dce0e commit 1d7dd0a

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

server/src/geyser_grpc_plugin.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ pub struct PluginData {
5555
/// Highest slot that an account write has been processed for thus far.
5656
highest_write_slot: Arc<AtomicU64>,
5757

58+
/// Only set to true if account_data_notifications_enabled is true
59+
/// Otherwise, will always be false
5860
is_startup_completed: AtomicBool,
5961
ignore_startup_updates: bool,
6062
account_data_notifications_enabled: bool,
@@ -219,6 +221,8 @@ impl GeyserPlugin for GeyserGrpcPlugin {
219221
data.runtime.shutdown_background();
220222
}
221223

224+
/// Note: this is called only if account_data_notifications_enabled is set to true.
225+
/// Do not use it for anything except for account updates
222226
fn notify_end_of_startup(&self) -> PluginResult<()> {
223227
self.data
224228
.as_ref()
@@ -345,10 +349,6 @@ impl GeyserPlugin for GeyserGrpcPlugin {
345349
) -> PluginResult<()> {
346350
let data = self.data.as_ref().expect("plugin must be initialized");
347351

348-
if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) {
349-
return Ok(());
350-
}
351-
352352
debug!("Updating slot {:?} at with status {:?}", slot, status);
353353

354354
let status = match status {
@@ -386,10 +386,6 @@ impl GeyserPlugin for GeyserGrpcPlugin {
386386
) -> PluginResult<()> {
387387
let data = self.data.as_ref().expect("plugin must be initialized");
388388

389-
if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) {
390-
return Ok(());
391-
}
392-
393389
let transaction_update = match transaction {
394390
ReplicaTransactionInfoVersions::V0_0_1(tx) => TimestampedTransactionUpdate {
395391
ts: Some(prost_types::Timestamp::from(SystemTime::now())),
@@ -437,10 +433,6 @@ impl GeyserPlugin for GeyserGrpcPlugin {
437433
fn notify_block_metadata(&self, block_info: ReplicaBlockInfoVersions) -> PluginResult<()> {
438434
let data = self.data.as_ref().expect("plugin must be initialized");
439435

440-
if data.ignore_startup_updates && !data.is_startup_completed.load(Ordering::Relaxed) {
441-
return Ok(());
442-
}
443-
444436
let block = match block_info {
445437
ReplicaBlockInfoVersions::V0_0_1(block) => TimestampedBlockUpdate {
446438
ts: Some(prost_types::Timestamp::from(SystemTime::now())),

0 commit comments

Comments
 (0)