Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions validity/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"]
9 changes: 5 additions & 4 deletions validity/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ pub async fn read_proposer_env() -> Result<EnvironmentConfig> {

// 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
Expand Down
15 changes: 14 additions & 1 deletion validity/src/proof_requester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::{
time::{Duration, Instant},
};
use tracing::{info, warn};
use bincode::Options;

use crate::{
db::DriverDBClient, OPSuccinctRequest, ProgramConfig, RequestExecutionStatistics,
Expand Down Expand Up @@ -531,7 +532,19 @@ impl<H: OPSuccinctHost> OPSuccinctProofRequester<H> {
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?;
Expand Down
Loading