Skip to content

Commit

Permalink
fix: move defualt limits
Browse files Browse the repository at this point in the history
  • Loading branch information
nhtyy committed Dec 12, 2024
1 parent 7474d78 commit 953e5a0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
11 changes: 2 additions & 9 deletions crates/sdk/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use sp1_core_executor::{ExecutionError, ExecutionReport};
use sp1_core_machine::io::SP1Stdin;
use sp1_primitives::io::SP1PublicValues;
use sp1_prover::{SP1ProvingKey, SP1VerifyingKey};
use std::{env, sync::Arc};
use std::sync::Arc;
use crate::ProofOpts;

mod request;
Expand All @@ -37,7 +37,7 @@ impl ProverClient {

fn create_from_env() -> Self {
#[cfg(feature = "network-v2")]
match env::var("SP1_PROVER").unwrap_or("local".to_string()).as_str() {
match std::env::var("SP1_PROVER").unwrap_or("local".to_string()).as_str() {
"network" => {
let rpc_url = env::var("PROVER_NETWORK_RPC")
.unwrap_or_else(|_| DEFAULT_PROVER_NETWORK_RPC.to_string());
Expand Down Expand Up @@ -83,10 +83,3 @@ impl ProverClient {
self.inner.verify(proof, vk).await
}
}

/// The default timeout seconds for a proof request to be generated (4 hours).
pub const DEFAULT_TIMEOUT: u64 = 14400;

/// The default cycle limit for a proof request.
pub const DEFAULT_CYCLE_LIMIT: u64 = 100_000_000;

40 changes: 23 additions & 17 deletions crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,6 @@
//! Visit the [Getting Started](https://succinctlabs.github.io/sp1/getting-started.html) section
//! in the official SP1 documentation for a quick start guide.
mod client;
mod prover;
mod request;
mod verify;

pub mod artifacts;
pub mod install;

#[cfg(feature = "network-v2")]
#[path = "network-v2/mod.rs"]
pub mod network_v2;

#[cfg(feature = "cuda")]
pub use crate::local::CudaProver;
#[cfg(feature = "network-v2")]
pub use crate::network_v2::NetworkProver;

pub mod local;
pub mod proof;
pub mod utils {
Expand All @@ -43,6 +26,29 @@ pub use sp1_prover::{
use sp1_stark::MachineVerificationError;
use thiserror::Error;

mod client;
mod prover;
mod verify;

pub mod artifacts;
pub mod install;

#[cfg(feature = "cuda")]
pub use crate::local::CudaProver;

#[cfg(feature = "network-v2")]
pub use crate::network_v2::NetworkProver;

#[cfg(feature = "network-v2")]
#[path = "network-v2/mod.rs"]
pub mod network_v2;/// The default timeout seconds for a proof request to be generated (4 hours).
///
pub const DEFAULT_TIMEOUT: u64 = 14400;

/// The default cycle limit for a proof request.
pub const DEFAULT_CYCLE_LIMIT: u64 = 100_000_000;


pub struct ProofOpts {
pub mode: Mode,
pub timeout: u64,
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/src/local/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::Mode;
use crate::ProofOpts;
use crate::proof::{SP1Proof, SP1ProofWithPublicValues};
use crate::prover::Prover;
use crate::request::{DEFAULT_CYCLE_LIMIT, DEFAULT_TIMEOUT};
use crate::{DEFAULT_CYCLE_LIMIT, DEFAULT_TIMEOUT};
use crate::verify;
use crate::SP1VerificationError;

Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/src/network-v2/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::network_v2::{
use crate::ProofOpts;
use crate::proof::SP1ProofWithPublicValues;
use crate::prover::Prover;
use crate::request::{DEFAULT_CYCLE_LIMIT, DEFAULT_TIMEOUT};
use crate::{DEFAULT_CYCLE_LIMIT, DEFAULT_TIMEOUT};
use crate::verify;
use crate::SP1VerificationError;

Expand Down

0 comments on commit 953e5a0

Please sign in to comment.