Skip to content

Commit

Permalink
do not exit when fetching payload if get_payload is too late
Browse files Browse the repository at this point in the history
  • Loading branch information
gd-0 committed Feb 1, 2024
1 parent 035458d commit 41f9f76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/api/src/proposer/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -927,8 +927,8 @@ where
let slot_cutoff_millis = (slot_time * 1000) + GET_PAYLOAD_REQUEST_CUTOFF_MS as u64;

let mut last_error: Option<ProposerApiError> = 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) => {
Expand All @@ -940,6 +940,7 @@ where
}
}

first_try = false;
sleep(RETRY_DELAY).await;
}

Expand Down

0 comments on commit 41f9f76

Please sign in to comment.