Skip to content

Commit

Permalink
chore: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PangZhi committed Aug 24, 2024
1 parent da4e66c commit 50d2e5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion standalone_circuit/src/scheduler/async_scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ use async_trait::async_trait;

#[derive(Clone)]
pub struct AsyncScheduler {
/// Mutex just to force sequential proving
// executor that can generate proof for a given task
pub executor: Arc<dyn ProofExecutor>,
// circuit_id -> intent params
pub circuit_id_repo: Arc<RwLock<HashMap<NodeParams, String>>>,
// intent params -> circuit_id
pub cid_to_params: Arc<RwLock<HashMap<String, NodeParams>>>,
// tracker for existing tasks
pub task_tracker: Arc<SchedulerTaskTracker>,
// the path for storing execution_summary
pub execution_summary_path: Arc<PathBuf>,
// the client to interact with the smart contract
pub contract_client: Arc<ContractClient>,
Expand Down
5 changes: 3 additions & 2 deletions standalone_circuit/src/scheduler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub trait Scheduler: Send + Sync + 'static {
Ok(match params.node_type {
NodeType::Leaf => unreachable!(),
NodeType::Intermediate => {
// TODO: the logic would be different for v2
assert!(snarks.len() <= 2, "dependencies snarks should be <= 2");
if snarks.len() != 2 {
snarks.resize(2, snarks[0].clone()); // dummy snark
}
Expand All @@ -88,6 +88,7 @@ pub trait Scheduler: Send + Sync + 'static {
RequestRouter::Intermediate(req)
}
NodeType::Root => {
assert!(snarks.len() <= 2, "dependencies snarks should be <= 2");
if snarks.len() != 2 {
snarks.resize(2, snarks[0].clone()); // dummy snark
}
Expand Down Expand Up @@ -145,7 +146,7 @@ pub trait Scheduler: Send + Sync + 'static {
Ok(result.proof)
}

/// Find the circuit id which can handle this request
/// Find the circuit id which can handle the non-recursive part of this request
async fn get_circuit_id(&self, req: &RecursiveRequest) -> Result<String>;

// Generate proof for given task
Expand Down

0 comments on commit 50d2e5f

Please sign in to comment.