Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-prover refactor #77

Merged
merged 16 commits into from
Feb 6, 2025
Merged

http-prover refactor #77

merged 16 commits into from
Feb 6, 2025

Conversation

chudkowsky
Copy link
Collaborator

@chudkowsky chudkowsky commented Jan 24, 2025

Introduce New HTTP-Prover API

This PR introduces a new HTTP-based prover API and adds several key enhancements:

New Trace Generation Endpoint

  • Supports two trace formats:
    • Traditional Trace: Includes trace file, memory file, private input, and public input.
    • PIE Format: Alternative format for trace generation.

Prover CLI Enhancements

  • Replaces cairo-prove with a new Prover CLI.
  • Extends functionality to:
    • Calculate Stone Prover configuration.
    • Send and retrieve both prove and run jobs.

Server-Side Improvements

  • Refactored thread pool implementation:
    • Introduced a Task enum to improve flexibility.
  • Modified cairo0 program representation:
    • Changed from Struct to Vec<u8> due to serialization/deserialization issues (to be investigated further).
  • Added support for bootloaders.
  • Included additional benchmarking information.

@chudkowsky chudkowsky marked this pull request as ready for review February 3, 2025 12:29
@chudkowsky chudkowsky changed the title Feat/cargo run endpoint http-prover refactor Feb 5, 2025
@chudkowsky chudkowsky merged commit cfe5ec6 into main Feb 6, 2025
4 checks passed
@chudkowsky chudkowsky deleted the feat/cargo-run-endpoint branch February 6, 2025 09:20
@chudkowsky chudkowsky restored the feat/cargo-run-endpoint branch February 6, 2025 09:21
chudkowsky added a commit that referenced this pull request Feb 6, 2025
#[clap(subcommand)]
command: Subcommands,
}
#[allow(clippy::large_enum_variant)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just Box?

pub fn handle_completed_job_response(result: JobResult) -> RunResult {
match result {
JobResult::Prove(_) => {
panic!("Expected a prove result, but got a run result",);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check out unreachable!()

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CairoProverInput {
pub program: CairoCompiledProgram,
pub program_input: Vec<Felt>,
pub layout: Layout,
pub layout: super::Layout,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think absolute paths are good practice

common::models::JobStatus::Failed,
Some(e.to_string()),
)
.await;

let sender = sse_tx.clone();
let sender = sender.lock().await;
if sender.receiver_count() > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a case where recv is not yet called due to congestion and we lose the response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants