From bf9fa7f86e2a8b6aa5546e53025310071e214da9 Mon Sep 17 00:00:00 2001 From: godmodegalactus Date: Fri, 10 May 2024 11:54:26 +0200 Subject: [PATCH] Setting max slot for account update --- accounts/src/inmemory_account_store.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accounts/src/inmemory_account_store.rs b/accounts/src/inmemory_account_store.rs index 19f90399..e687450b 100644 --- a/accounts/src/inmemory_account_store.rs +++ b/accounts/src/inmemory_account_store.rs @@ -16,6 +16,9 @@ lazy_static::lazy_static! { static ref TOTAL_PROCESSED_ACCOUNTS: IntGauge = register_int_gauge!(opts!("literpc_total_processed_accounts_in_memory", "Account processed accounts InMemory")).unwrap(); + + static ref SLOT_FOR_LATEST_ACCOUNT_UPDATE: IntGauge = + register_int_gauge!(opts!("literpc_slot_for_latest_account_update", "Slot of latest account update")).unwrap(); } #[derive(Default)] @@ -299,6 +302,7 @@ impl InmemoryAccountStore { #[async_trait] impl AccountStorageInterface for InmemoryAccountStore { async fn update_account(&self, account_data: AccountData, commitment: Commitment) -> bool { + SLOT_FOR_LATEST_ACCOUNT_UPDATE.set(account_data.updated_slot as i64); // check if the blockhash and slot is already confirmed let commitment = self .maybe_update_slot_status(&account_data, commitment)