From 398d95e88788256d35991e3f265a0c790182ccb3 Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Thu, 23 Jan 2025 16:12:44 -0800 Subject: [PATCH] add --- proposer/succinct/bin/server.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/proposer/succinct/bin/server.rs b/proposer/succinct/bin/server.rs index 26ab79ec..202cea02 100644 --- a/proposer/succinct/bin/server.rs +++ b/proposer/succinct/bin/server.rs @@ -31,7 +31,11 @@ use sp1_sdk::{ utils, HashableKey, Prover, ProverClient, SP1Proof, SP1ProofMode, SP1ProofWithPublicValues, SP1_CIRCUIT_VERSION, }; -use std::{env, fs, str::FromStr, time::Instant}; +use std::{ + env, fs, + str::FromStr, + time::{Instant, SystemTime, UNIX_EPOCH}, +}; use tower_http::limit::RequestBodyLimitLayer; pub const RANGE_ELF: &[u8] = include_bytes!("../../../elf/range-elf"); @@ -554,7 +558,12 @@ async fn get_proof_status( }; // Check the deadline. - if status.deadline < Instant::now().elapsed().as_secs() { + if status.deadline + < SystemTime::now() + .duration_since(UNIX_EPOCH) + .unwrap() + .as_secs() + { error!( "Proof request timed out on the server. Default timeout is set to 4 hours. Returning status as Unfulfillable." );