Skip to content

Commit be61c26

Browse files
authored
Fix partition hashing (#338)
1 parent 686e83d commit be61c26

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

air/src/options.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,11 @@ impl PartitionOptions {
377377

378378
/// Returns the size of each partition used when committing to the main and auxiliary traces as
379379
/// well as the constraint evaluation trace.
380+
/// The returned size is given in terms of number of columns in the field `E`.
380381
pub fn partition_size<E: FieldElement>(&self, num_columns: usize) -> usize {
382+
if self.num_partitions == 1 && self.min_partition_size == 1 {
383+
return num_columns;
384+
}
381385
let base_elements_per_partition = cmp::max(
382386
(num_columns * E::EXTENSION_DEGREE).div_ceil(self.num_partitions as usize),
383387
self.min_partition_size as usize,

prover/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ pub trait Prover {
219219
/// Builds and returns the auxiliary trace.
220220
#[allow(unused_variables)]
221221
#[maybe_async]
222+
#[instrument(skip_all)]
222223
fn build_aux_trace<E>(
223224
&self,
224225
main_trace: &Self::Trace,

prover/src/matrix/row_matrix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl<E: FieldElement> RowMatrix<E> {
188188
// allocate vector to store row hashes
189189
let mut row_hashes = unsafe { uninit_vector::<H::Digest>(self.num_rows()) };
190190

191-
if partition_size == self.num_cols() * E::EXTENSION_DEGREE {
191+
if partition_size == self.num_cols() {
192192
// iterate though matrix rows, hashing each row
193193
batch_iter_mut!(
194194
&mut row_hashes,

verifier/src/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ where
442442
E: FieldElement,
443443
H: ElementHasher<BaseField = E::BaseField>,
444444
{
445-
if partition_size == row.len() * E::EXTENSION_DEGREE {
445+
if partition_size == row.len() {
446446
H::hash_elements(row)
447447
} else {
448448
let mut buffer = vec![H::Digest::default(); partition_size];

0 commit comments

Comments
 (0)