From 41f9f766b057f33673cd417eb0fa669223146100 Mon Sep 17 00:00:00 2001 From: gd-0 <90608901+gd-0@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:54:42 +0000 Subject: [PATCH] do not exit when fetching payload if get_payload is too late --- crates/api/src/proposer/api.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/api/src/proposer/api.rs b/crates/api/src/proposer/api.rs index 7a63acd7..50efea63 100644 --- a/crates/api/src/proposer/api.rs +++ b/crates/api/src/proposer/api.rs @@ -927,8 +927,8 @@ where let slot_cutoff_millis = (slot_time * 1000) + GET_PAYLOAD_REQUEST_CUTOFF_MS as u64; let mut last_error: Option = None; - - while get_millis_timestamp()? < slot_cutoff_millis { + let mut first_try = true; // Try at least once to cover case where get_payload is called too late. + while first_try || get_millis_timestamp()? < slot_cutoff_millis { match self.auctioneer.get_execution_payload(slot, pub_key, block_hash).await { Ok(Some(versioned_payload)) => return Ok(versioned_payload), Ok(None) => { @@ -940,6 +940,7 @@ where } } + first_try = false; sleep(RETRY_DELAY).await; }