diff --git a/validity/Dockerfile b/validity/Dockerfile index 25ac0b839..469fd8567 100644 --- a/validity/Dockerfile +++ b/validity/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/* - +ENV SQLX_OFFLINE=true WORKDIR /build # Install SP1 @@ -25,8 +25,9 @@ COPY . . RUN --mount=type=ssh \ --mount=type=cache,target=/root/.cargo/registry \ --mount=type=cache,target=/build/target \ - cargo build --bin validity --release && \ - cp target/release/validity /build/validity-proposer + cargo build --bin validity --bin fetch-l2oo-config --release && \ + cp target/release/validity /build/validity-proposer && \ + cp target/release/fetch-l2oo-config /build/fetch-l2oo-config # Final stage FROM rust:1.85-slim @@ -52,6 +53,7 @@ RUN curl -L https://sp1.succinct.xyz | bash && \ # Copy only the built binaries from builder COPY --from=builder /build/validity-proposer /usr/local/bin/validity-proposer +COPY --from=builder /build/fetch-l2oo-config /usr/local/bin/fetch-l2oo-config # Run the server from its permanent location CMD ["/usr/local/bin/validity-proposer"] diff --git a/validity/src/env.rs b/validity/src/env.rs index 27ba541f5..da4fe96d6 100644 --- a/validity/src/env.rs +++ b/validity/src/env.rs @@ -98,10 +98,11 @@ pub async fn read_proposer_env() -> Result { // Parse proof mode let agg_proof_mode = - if get_env_var("AGG_PROOF_MODE", Some("plonk".to_string()))?.to_lowercase() == "groth16" { - SP1ProofMode::Groth16 - } else { - SP1ProofMode::Plonk + match get_env_var("AGG_PROOF_MODE", Some("plonk".to_string()))?.to_lowercase().as_str() { + "plonk" => SP1ProofMode::Plonk, + "groth16" => SP1ProofMode::Groth16, + "compressed" => SP1ProofMode::Compressed, + _ => SP1ProofMode::Plonk, // Default to Plonk if no match }; // Optional loop interval diff --git a/validity/src/proof_requester.rs b/validity/src/proof_requester.rs index 30503200c..f7b026915 100644 --- a/validity/src/proof_requester.rs +++ b/validity/src/proof_requester.rs @@ -17,6 +17,7 @@ use std::{ time::{Duration, Instant}, }; use tracing::{info, warn}; +use bincode::Options; use crate::{ db::DriverDBClient, OPSuccinctRequest, ProgramConfig, RequestExecutionStatistics, @@ -531,7 +532,19 @@ impl OPSuccinctProofRequester { RequestType::Aggregation => { if self.mock { let proof = self.generate_mock_agg_proof(&request, stdin).await?; - self.db_client.update_proof_to_complete(request.id, &proof.bytes()).await?; + + let proof_bytes = if self.agg_mode == SP1ProofMode::Compressed { + // If it's a compressed proof, we need to serialize the entire struct with bincode. + bincode::DefaultOptions::new() + .with_big_endian() + .with_fixint_encoding() + .serialize(&proof) + .unwrap() + } else { + proof.bytes() + }; + + self.db_client.update_proof_to_complete(request.id, &proof_bytes).await?; } else { let proof_id = self.request_agg_proof(stdin).await?; self.db_client.update_request_to_prove(request.id, proof_id).await?;