diff --git a/sdk/src/network/auth.rs b/sdk/src/network/auth.rs index 2cf1c8c861..2f34fd0f02 100644 --- a/sdk/src/network/auth.rs +++ b/sdk/src/network/auth.rs @@ -15,6 +15,7 @@ sol! { uint64 nonce; uint64 deadline; uint32 mode; + string version; } struct SubmitProof { @@ -94,11 +95,13 @@ impl NetworkAuth { nonce: u64, deadline: u64, mode: i32, + version: &str, ) -> Result> { let type_struct = CreateProof { nonce, deadline, mode: mode as u32, + version: version.to_string(), }; self.sign_message(type_struct).await } diff --git a/sdk/src/network/client.rs b/sdk/src/network/client.rs index 3a5e13ce62..c47447c602 100644 --- a/sdk/src/network/client.rs +++ b/sdk/src/network/client.rs @@ -27,6 +27,9 @@ const DEFAULT_PROVER_NETWORK_RPC: &str = "https://rpc.succinct.xyz/"; /// The default SP1 Verifier address on all chains. const DEFAULT_SP1_VERIFIER_ADDRESS: &str = "0xed2107448519345059eab9cddab42ddc78fbebe9"; +/// The timeout for a proof request to be fulfilled. +const TIMEOUT: Duration = Duration::from_secs(60 * 60); + pub struct NetworkClient { pub rpc: TwirpClient, pub http: HttpClientWithMiddleware, @@ -172,17 +175,18 @@ impl NetworkClient { elf: &[u8], stdin: &SP1Stdin, mode: ProofMode, + version: &str, ) -> Result { let start = SystemTime::now(); let since_the_epoch = start .duration_since(UNIX_EPOCH) .expect("Invalid start time"); - let deadline = since_the_epoch.as_secs() + 1000; + let deadline = since_the_epoch.as_secs() + TIMEOUT.as_secs(); let nonce = self.get_nonce().await?; let create_proof_signature = self .auth - .sign_create_proof_message(nonce, deadline, mode.into()) + .sign_create_proof_message(nonce, deadline, mode.into(), version) .await?; let res = self .rpc @@ -191,6 +195,7 @@ impl NetworkClient { nonce, deadline, mode: mode.into(), + version: version.to_string(), }) .await?; diff --git a/sdk/src/network/prover.rs b/sdk/src/network/prover.rs index 675c10696d..eb035f8e3c 100644 --- a/sdk/src/network/prover.rs +++ b/sdk/src/network/prover.rs @@ -9,6 +9,7 @@ use crate::{ use crate::{SP1CompressedProof, SP1PlonkBn254Proof, SP1Proof, SP1ProvingKey, SP1VerifyingKey}; use anyhow::{Context, Result}; use serde::de::DeserializeOwned; +use sp1_prover::install::PLONK_BN254_ARTIFACTS_COMMIT; use sp1_prover::utils::block_on; use sp1_prover::{SP1Prover, SP1Stdin}; use tokio::{runtime, time::sleep}; @@ -55,7 +56,10 @@ impl NetworkProver { log::info!("Skipping simulation"); } - let proof_id = client.create_proof(elf, &stdin, mode).await?; + let version = PLONK_BN254_ARTIFACTS_COMMIT; + log::info!("Client version {}", version); + + let proof_id = client.create_proof(elf, &stdin, mode, version).await?; log::info!("Created {}", proof_id); let mut is_claimed = false; diff --git a/sdk/src/proto/network.rs b/sdk/src/proto/network.rs index 173c032f1e..7a8497c319 100644 --- a/sdk/src/proto/network.rs +++ b/sdk/src/proto/network.rs @@ -16,6 +16,9 @@ pub struct CreateProofRequest { /// The deadline for the proof request, signifying the latest time a fulfillment would be valid. #[prost(uint64, tag = "4")] pub deadline: u64, + /// The client version used, in the form of an 8-character git commit hash. + #[prost(string, tag = "5")] + pub version: ::prost::alloc::string::String, } /// The response for creating a proof. #[derive(serde::Serialize, serde::Deserialize)]