Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
print witness size; simplify the air logic
Browse files Browse the repository at this point in the history
  • Loading branch information
weikengchen committed Sep 4, 2024
1 parent beec486 commit 62e9e1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/fiat_shamir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ pub fn compute_fiat_shamir_hints(
let column_log_sizes = components.components().column_log_sizes();
commitment_scheme.commit(proof.commitments[0], &column_log_sizes[0], channel);

if column_log_sizes.len() == 2 {
commitment_scheme.commit(proof.commitments[1], &column_log_sizes[1], channel);
}

channel.mix_felts(
&proof
.lookup_values
Expand Down
15 changes: 11 additions & 4 deletions src/split/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,16 @@ impl CovenantProgram for FibonacciSplitProgram {
{ FibonacciFiatShamirGadget::run(&channel) }
};

let final_stack = get_final_stack(
script,
convert_to_witness(script! {
let witness = convert_to_witness(script! {
{ *fiat_shamir_hints.clone() }
})
.unwrap(),
.unwrap();

println!("fiat-shamir witness size: {}", witness.len());

let final_stack = get_final_stack(
script,
witness,
);

let stack_hash = StackHash::compute(&final_stack);
Expand Down Expand Up @@ -382,6 +386,8 @@ impl CovenantProgram for FibonacciSplitProgram {
.unwrap();
witness.extend_from_slice(stack);

println!("prepare witness size: {}", witness.len());

let final_stack = get_final_stack(script, witness);

let stack_hash = StackHash::compute(&final_stack);
Expand All @@ -396,6 +402,7 @@ impl CovenantProgram for FibonacciSplitProgram {
assert!(matches!(input, Self::Input::PerQuery(_, _, _)));

if id <= 8 {
println!("step witness size: {}", old_state.stack.len());
Ok(Self::State {
pc: id + 1,
stack_hash: old_state.stack_hash.clone(),
Expand Down

0 comments on commit 62e9e1b

Please sign in to comment.