Closed huitseeker closed 6 months ago
This is for the purpose of re-starting the proof using the prior RecursiveProof, which at the moment can only be obtained through cloning prior to compression
How come? #1209 accomplishes the above without such clone
How come? https://github.com/lurk-lab/lurk-rs/pull/1209 accomplishes the above without such clone
That's because #1209 drops the recursive proofs as it calls compress on them (compress
takes ownership of self
, and does not return self
in case of actual compression).
This is fine for #1209, since reusing the recursive proof after compression of that recursive proof is not exercised anywhere I could spot.
On a long enough timeline, we'll want to generate compressed proofs without dropping the associated
RecursiveProof
. This is for the purpose of re-starting the proof using the priorRecursiveProof
, which at the moment can only be obtained through cloning prior to compression (which itself would be impossible prior to the companion PR used here).The current approach witnesses that compression only requires a reference to the current proof, and returns a
Cow
: the only situation in which this would result in a clone is if:CompressedProof
,compress()
on it,CompressedProof
that requires an owned value. => this flow seems unlikely.In detail:
compress
function across various files to take&self
instead ofself
, avoiding the drop of theRecursiveProof
;Cargo.toml
to use workspace versions, streamlining dependency management and increasing project consistency.