sigil-zk · pipeline
Source declarations, signatures and documentation for pipeline.
Source: sigil/node/sigil-zk/src/pipeline.rs. SHA-256: fd759dca42f27ed690d9e9e6dd939279a8dcd1b28f57fa3bfa780c848fadc0b8.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
pipeline::PipelineStage
Pipeline stages for proof generation.
A proof job progresses through these stages sequentially. The pipeline can overlap proof generation with the next block's consensus.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum PipelineStage {
/// Collecting execution trace from the WASM runtime.
TraceCollection,
/// Translating WASM trace to RISC-V (for Jolt proving system).
TraceTranslation,
/// Generating the zero-knowledge proof from the translated trace.
ProofGeneration,
/// Proof generation is complete and the proof is available.
Complete,
/// Pipeline stage failed with an error message.
Failed(String),
}Source line: 18.
pipeline::PipelineStage::is_terminal
Returns true if this stage represents a terminal state (Complete or Failed).
pub fn is_terminal(&self) -> bool;Source line: 33.
pipeline::PipelineStage::name
Returns a human-readable name for this stage.
pub fn name(&self) -> &str;Source line: 38.
pipeline::ProofJob
Status of a single proof generation job.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ProofJob {
/// Unique identifier for this job.
pub job_id: String,
/// Block height being proved.
pub block_height: u64,
/// Hash of the block being proved.
pub block_hash: SigilHash,
/// Current pipeline stage.
pub stage: PipelineStage,
/// Unix timestamp (ms) when the job started.
pub started_at: u64,
/// Unix timestamp (ms) when the job completed (if terminal).
pub completed_at: Option<u64>,
/// The completed proof, if generation succeeded.
pub proof: Option<BlockProof>,
/// Error message, if the job failed.
pub error: Option<String>
}Source line: 51.
pipeline::ProofPipeline
Proof pipeline that manages proof generation jobs.
The pipeline can overlap proof generation with the next block's consensus round. It maintains a current job and a bounded history of completed proofs.
#[derive(Debug)]
pub struct ProofPipeline {
/// The currently running proof job, if any.
pub current_job: Option<ProofJob>,
/// Completed proofs (bounded by `max_pipeline_depth`).
pub completed_proofs: Vec<BlockProof>,
/// Maximum number of completed proofs to retain.
pub max_pipeline_depth: usize
}Source line: 75.
pipeline::ProofPipeline::new
Create a new proof pipeline with the given maximum depth for completed proofs.
pub fn new(max_depth: usize) -> Self;Source line: 86.
pipeline::ProofPipeline::start_job
Start a new proof generation job for the given block.
Returns the job ID on success. Fails with [ZkError::PipelineBusy] if
there is already an active (non-terminal) job.
pub fn start_job(
&mut self,
block_height: u64,
block_hash: SigilHash,
) -> Result<String, ZkError>;Source line: 98.
pipeline::ProofPipeline::advance_stage
Advance a job to the next pipeline stage.
Errors
Returns [ZkError::JobNotFound] if no job matches the given ID.
pub fn advance_stage(&mut self, job_id: &str, new_stage: PipelineStage) -> Result<(), ZkError>;Source line: 129.
pipeline::ProofPipeline::complete_job
Mark a job as successfully completed with the generated proof.
The proof is moved to the completed proofs list. If the list exceeds
max_pipeline_depth, the oldest proof is evicted.
Errors
Returns [ZkError::JobNotFound] if no job matches the given ID.
pub fn complete_job(&mut self, job_id: &str, proof: BlockProof) -> Result<(), ZkError>;Source line: 147.
pipeline::ProofPipeline::fail_job
Mark a job as failed with an error message.
Clears the current job slot so new jobs can start.
Errors
Returns [ZkError::JobNotFound] if no job matches the given ID.
pub fn fail_job(&mut self, job_id: &str, error: String) -> Result<(), ZkError>;Source line: 178.
pipeline::ProofPipeline::get_proof
Look up a completed proof by block height.
Returns None if no proof for that height is in the completed list.
pub fn get_proof(&self, block_height: u64) -> Option<&BlockProof>;Source line: 198.
pipeline::ProofPipeline::is_busy
Returns true if the pipeline has an active (non-terminal) job.
pub fn is_busy(&self) -> bool;Source line: 205.