From d05ac290ed1a3c1a4150ab616b2ab29c77f4454a Mon Sep 17 00:00:00 2001 From: Ratan Kaliani Date: Sat, 21 Dec 2024 12:53:16 -0800 Subject: [PATCH] feat(proposer): clear stdin (#301) * feat: clear stdin * cargo fmt --- proposer/succinct/bin/server.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proposer/succinct/bin/server.rs b/proposer/succinct/bin/server.rs index 382bd73a..466abab2 100644 --- a/proposer/succinct/bin/server.rs +++ b/proposer/succinct/bin/server.rs @@ -28,6 +28,7 @@ use sp1_sdk::{ proto::network::{ExecutionStatus, FulfillmentStatus, FulfillmentStrategy, ProofMode}, }, utils, HashableKey, NetworkProverV2, ProverClient, SP1Proof, SP1ProofWithPublicValues, + SP1Stdin, }; use std::{env, str::FromStr, time::Duration}; use tower_http::limit::RequestBodyLimitLayer; @@ -540,7 +541,10 @@ async fn get_proof_status( let fulfillment_status = status.fulfillment_status; let execution_status = status.execution_status; if fulfillment_status == FulfillmentStatus::Fulfilled as i32 { - let proof: SP1ProofWithPublicValues = maybe_proof.unwrap(); + let mut proof: SP1ProofWithPublicValues = maybe_proof.unwrap(); + // Remove the stdin from the proof, as it's unnecessary for verification. Note: In v4, there is no stdin. + // Previously, this caused the memory usage of the proposer to be high. + proof.stdin = SP1Stdin::default(); match proof.proof { SP1Proof::Compressed(_) => {