From 5a57503fee97023c5ecdaf76a6d7faec62ad6b11 Mon Sep 17 00:00:00 2001 From: Irakliy Khaburzaniya Date: Sat, 26 Oct 2024 12:53:57 -0700 Subject: [PATCH 1/4] fixed maybe-async dependency --- README.md | 4 ++-- prover/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4616bf5a5..230146c2b 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ - - + + A STARK prover and verifier for arbitrary computations. diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 85b5dbcd7..6dd616a1a 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -34,7 +34,7 @@ air = { version = "0.10", path = "../air", package = "winter-air", default-featu crypto = { version = "0.10", path = "../crypto", package = "winter-crypto", default-features = false } fri = { version = "0.10", path = '../fri', package = "winter-fri", default-features = false } math = { version = "0.10", path = "../math", package = "winter-math", default-features = false } -maybe_async = { path = "../utils/maybe_async" , package = "winter-maybe-async" } +maybe_async = { version = "0.10", path = "../utils/maybe_async" , package = "winter-maybe-async" } tracing = { version = "0.1", default-features = false, features = ["attributes"]} utils = { version = "0.10", path = "../utils/core", package = "winter-utils", default-features = false } From 7f2413932ecb027449257a912fb22d98b77889ab Mon Sep 17 00:00:00 2001 From: Al-Kindi-0 <82364884+Al-Kindi-0@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:08:11 +0100 Subject: [PATCH 2/4] fix: use correct condition for partitioned hashing --- air/src/options.rs | 3 +++ prover/src/matrix/row_matrix.rs | 2 +- verifier/src/channel.rs | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/air/src/options.rs b/air/src/options.rs index a831bdad7..0635696cf 100644 --- a/air/src/options.rs +++ b/air/src/options.rs @@ -378,6 +378,9 @@ impl PartitionOptions { /// Returns the size of each partition used when committing to the main and auxiliary traces as /// well as the constraint evaluation trace. pub fn partition_size(&self, num_columns: usize) -> usize { + if self.num_partitions == 1 && self.min_partition_size == 1 { + return num_columns; + } let base_elements_per_partition = cmp::max( (num_columns * E::EXTENSION_DEGREE).div_ceil(self.num_partitions as usize), self.min_partition_size as usize, diff --git a/prover/src/matrix/row_matrix.rs b/prover/src/matrix/row_matrix.rs index 85b43122e..6cb9ef60c 100644 --- a/prover/src/matrix/row_matrix.rs +++ b/prover/src/matrix/row_matrix.rs @@ -188,7 +188,7 @@ impl RowMatrix { // allocate vector to store row hashes let mut row_hashes = unsafe { uninit_vector::(self.num_rows()) }; - if partition_size == self.num_cols() * E::EXTENSION_DEGREE { + if partition_size == self.num_cols() { // iterate though matrix rows, hashing each row batch_iter_mut!( &mut row_hashes, diff --git a/verifier/src/channel.rs b/verifier/src/channel.rs index 9d7dbc426..e6c511cd8 100644 --- a/verifier/src/channel.rs +++ b/verifier/src/channel.rs @@ -442,7 +442,7 @@ where E: FieldElement, H: ElementHasher, { - if partition_size == row.len() * E::EXTENSION_DEGREE { + if partition_size == row.len() { H::hash_elements(row) } else { let mut buffer = vec![H::Digest::default(); partition_size]; From 942c75253e5a2715d028a99ff6c4010436c8dd12 Mon Sep 17 00:00:00 2001 From: Al-Kindi-0 <82364884+Al-Kindi-0@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:31:25 +0100 Subject: [PATCH 3/4] doc: add comments about unit of measure of partition size --- air/src/options.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/air/src/options.rs b/air/src/options.rs index 0635696cf..01599489c 100644 --- a/air/src/options.rs +++ b/air/src/options.rs @@ -377,6 +377,7 @@ impl PartitionOptions { /// Returns the size of each partition used when committing to the main and auxiliary traces as /// well as the constraint evaluation trace. + /// The returned size is given in terms of number of columns in the field `E`. pub fn partition_size(&self, num_columns: usize) -> usize { if self.num_partitions == 1 && self.min_partition_size == 1 { return num_columns; From 567e7229d4f652ac92069191d3625490ef413ab4 Mon Sep 17 00:00:00 2001 From: Al-Kindi-0 <82364884+Al-Kindi-0@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:10:00 +0100 Subject: [PATCH 4/4] chore: add tracing to aux trace building --- prover/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/prover/src/lib.rs b/prover/src/lib.rs index 035d6c655..1a2e157ea 100644 --- a/prover/src/lib.rs +++ b/prover/src/lib.rs @@ -219,6 +219,7 @@ pub trait Prover { /// Builds and returns the auxiliary trace. #[allow(unused_variables)] #[maybe_async] + #[instrument(skip_all)] fn build_aux_trace( &self, main_trace: &Self::Trace,