Skip to content
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

Fix block proof generation #293

Merged
merged 1 commit into from Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ledger/src/proofs/block.rs
Expand Up @@ -1009,7 +1009,7 @@ pub mod consensus {
let slot_as_field = CheckedN32::from_field(slot_as_field);

let (q, _) = slot_as_field.div_mod(
&CheckedN32::from_field(constants.slots_per_window.to_field()),
&CheckedN32::from_field(constants.slots_per_sub_window.to_field()),
w,
);
Self { inner: q }
Expand Down
11 changes: 8 additions & 3 deletions ledger/src/proofs/transaction.rs
Expand Up @@ -4762,14 +4762,19 @@ mod tests {
}

// Block proof
{
let data = std::fs::read(base_dir.join("block_input-2775525-0.bin")).unwrap();
for (filename, fps_filename) in [
("block_input-2775525-0.bin", Some("block_fps.txt")),
("block_prove_inputs_7.bin", None),
] {
let data = std::fs::read(base_dir.join(filename)).unwrap();

let blockchain_input: v2::ProverExtendBlockchainInputStableV2 =
read_binprot(&mut data.as_slice());

let mut witnesses: Witness<Fp> = Witness::new::<StepBlockProof>();
witnesses.ocaml_aux = read_witnesses("block_fps.txt").unwrap();
if let Some(filename) = fps_filename {
witnesses.ocaml_aux = read_witnesses(filename).unwrap();
};

let WrapProof { proof, .. } = generate_block_proof(
BlockParams {
Expand Down