Skip to content

Commit f1600db

Browse files
fix: failed to fetch satisfactory slot (#533)
## Description Moving that target slot call outside the loop to reduce the FailedToFetchSatisfactorySlot probability compared to recomputing it on every retry, because it removes the “moving target” that can keep outrunning a lagging HTTP node.
1 parent 433354f commit f1600db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

magicblock-account-cloner/src/remote_account_cloner_worker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,10 @@ where
508508

509509
// Fetch the account, repeat and retry until we have a satisfactory response
510510
let mut fetch_count = 0;
511+
let min_context_slot =
512+
self.account_updates.get_last_known_update_slot(&clock::ID);
511513
loop {
512514
fetch_count += 1;
513-
let min_context_slot =
514-
self.account_updates.get_last_known_update_slot(&clock::ID);
515515
match self
516516
.fetch_account_chain_snapshot(pubkey, min_context_slot)
517517
.await

0 commit comments

Comments
 (0)