Skip to content

Commit

Permalink
Dedup hash traces and add comment explaining +1 in n_rows_required
Browse files Browse the repository at this point in the history
  • Loading branch information
Mason Liang committed Oct 10, 2023
1 parent 862066e commit 36344ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gadgets/mpt_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ impl MptUpdateConfig {
}

pub fn n_rows_required(proofs: &[Proof]) -> usize {
// +1 because assigment starts on offset = 1 instead of offset = 0.
proofs.iter().map(Proof::n_rows).sum::<usize>() + 1
}

Expand Down Expand Up @@ -2097,6 +2098,8 @@ pub fn hash_traces(proofs: &[Proof]) -> Vec<([Fr; 2], Fr, Fr)> {
}
}
}
hash_traces.sort();
hash_traces.dedup();
hash_traces
}

Expand Down

0 comments on commit 36344ac

Please sign in to comment.