-
Notifications
You must be signed in to change notification settings - Fork 401
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
refactor: sdk improvements #580
Conversation
…hris/sdk-improvements
e53aede
to
61b3ea6
Compare
Co-authored-by: Uma Roy <[email protected]>
prover/src/lib.rs
Outdated
let config = CoreSC::default(); | ||
let machine = RiscvAir::machine(config); | ||
let (pk, vk) = machine.setup(&program); | ||
let (pk, vk) = self.core_machine.setup(&program); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we including the ELF in the pk
now? I feel like it should go in there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea program is in SP1ProvingKey already actually
prover/src/lib.rs
Outdated
reduced_proof: SP1ReduceProof<InnerSC>, | ||
) -> ShardProof<OuterSC> { | ||
// Get verify_start_challenger from the reduce proof's public values. | ||
let pv = RecursionPublicValues::from_vec(reduced_proof.proof.public_values.clone()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do we have to do this in verification as well? (Like similar initialization of the challenger)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it's checked in the program when is_complete=1
is committed, so we can just check that
prover/src/lib.rs
Outdated
|
||
// Convert pv.vkey_digest to a bn254 field element | ||
let mut vkey_hash = Bn254Fr::zero(); | ||
for (i, word) in pv.sp1_vk_digest.iter().enumerate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol can we have more comments as to what is going on here and why (also maybe a link to the corresponding parts in the groth16 circuit code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not stable yet, it's not constrained in circuit
sdk/src/types.rs
Outdated
} | ||
|
||
impl Prover for LocalProver { | ||
fn prove(&self, elf: &[u8], stdin: SP1Stdin) -> Result<SP1DefaultProof> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, it might be nice to have a way to setup a prover with just a pk
instead of the ELF, so we don't have to regenerate all of the tables/commitments.
This should probably have been squash-merged, or its history been cleaned up before a merge. |
No description provided.