Skip to content

Commit 3fc84da

Browse files
authored
Merge 1aa002a into 1507762
2 parents 1507762 + 1aa002a commit 3fc84da

File tree

90 files changed

+1128
-6012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1128
-6012
lines changed

.noir-sync-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e3cdebe515e4dc4ee6e16e01bd8af25135939798
1+
164d29e4d1960d16fdeafe2cc8ea8144a769f7b2

noir-projects/noir-protocol-circuits/Nargo.template.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[workspace]
22
members = [
33
"crates/types",
4-
"crates/blob",
4+
# "crates/blob",
55
"crates/parity-base",
66
"crates/parity-lib",
77
"crates/parity-root",

noir-projects/noir-protocol-circuits/crates/blob/src/main.nr

+32-32
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ unconstrained fn __batch_invert_impl<let N: u32>(mut x: [F; N]) -> [F; N] {
5858
unconstrained fn __compute_fracs(z: F, ys: [F; FIELDS_PER_BLOB]) -> [F; FIELDS_PER_BLOB] {
5959
let mut denoms: [F; FIELDS_PER_BLOB] = [BigNum::new(); FIELDS_PER_BLOB];
6060
for i in 0..FIELDS_PER_BLOB {
61-
denoms[i] = z.__add(NEGATIVE_ROOTS[i]); // (z - ω^i)
61+
denoms[i] = z.__add(NEGATIVE_ROOTS[i]); // (z - omega^i)
6262
}
63-
let inv_denoms = __batch_invert_impl(denoms); // 1 / (z - ω^i), for all i
63+
let inv_denoms = __batch_invert_impl(denoms); // 1 / (z - omega^i), for all i
6464

6565
let mut fracs: [F; FIELDS_PER_BLOB] = [BigNum::new(); FIELDS_PER_BLOB];
6666
for i in 0..FIELDS_PER_BLOB {
67-
let inv_denom = inv_denoms[i]; // 1 / (z - ω^i)
67+
let inv_denom = inv_denoms[i]; // 1 / (z - omega^i)
6868

69-
fracs[i] = ys[i].__mul(inv_denom); // y_i / (z - ω^i)
69+
fracs[i] = ys[i].__mul(inv_denom); // y_i / (z - omega^i)
7070
}
7171
fracs
7272
}
@@ -260,9 +260,9 @@ fn main(blob: [F; FIELDS_PER_BLOB], kzg_commitment: [Field; 2]) -> pub (Field, F
260260

261261
/**
262262
* ___d-1
263-
* z^d - 1 \ ω^i
263+
* z^d - 1 \ omega^i
264264
* p(z) = --------- . / y_i . ---------
265-
* d /____ z - ω^i
265+
* d /____ z - omega^i
266266
* i=0
267267
*
268268
* p(z) = factor . sum( y_i . num / denom )
@@ -271,7 +271,7 @@ fn main(blob: [F; FIELDS_PER_BLOB], kzg_commitment: [Field; 2]) -> pub (Field, F
271271
* where d = 4096
272272
*
273273
* Precompute:
274-
* - The d roots of unity ω^i (plus maybe their negatives for z - ω^i computations).
274+
* - The d roots of unity omega^i (plus maybe their negatives for z - omega^i computations).
275275
* - (1 / d)
276276
*
277277
* @param z
@@ -342,48 +342,48 @@ fn barycentric_evaluate_blob_at_z(z: F, ys: [F; FIELDS_PER_BLOB]) -> F {
342342
let mut sum: F = BigNum::new();
343343

344344
// Making a call to this function causes a "stack too deep" error, so I've put the body of that function here, instead:
345-
// let fracs = __compute_fracs(z, ys); // { y_i / (z - ω^i) }
345+
// let fracs = __compute_fracs(z, ys); // { y_i / (z - omega^i) }
346346

347347
// Note: it's more efficient (saving 30k constraints) to compute:
348348
// ___d-1
349349
// \ / y_i \
350-
// / | --------- | . ω^i
351-
// /____ \ z - ω^i /
350+
// / | --------- | . omega^i
351+
// /____ \ z - omega^i /
352352
// i=0
353353
// ^^^^^^^^^
354354
// frac
355355
//
356356
// ... than to compute:
357357
//
358358
// ___d-1
359-
// \ / ω^i \
359+
// \ / omega^i \
360360
// / y_i . | --------- |
361-
// /____ \ z - ω^i /
361+
// /____ \ z - omega^i /
362362
// i=0
363363
//
364-
// perhaps because all the ω^i terms are constant witnesses?
364+
// perhaps because all the omega^i terms are constant witnesses?
365365

366366
//*****************************************************************
367367
// This section is only needed because `__compute_fracs` isn't working (stack too deep error).
368368

369-
let mut fracs: [F; FIELDS_PER_BLOB] = [BigNum::new(); FIELDS_PER_BLOB]; // y_i / (z - ω^i), for all i
369+
let mut fracs: [F; FIELDS_PER_BLOB] = [BigNum::new(); FIELDS_PER_BLOB]; // y_i / (z - omega^i), for all i
370370

371371
let mut denoms = [BigNum::new(); FIELDS_PER_BLOB];
372372
for i in 0..FIELDS_PER_BLOB {
373-
denoms[i] = z.__add(NEGATIVE_ROOTS[i]); // (z - ω^i)
373+
denoms[i] = z.__add(NEGATIVE_ROOTS[i]); // (z - omega^i)
374374
}
375375

376376
// If you're seeing a `bug` warning for this line, I think it's fine.
377377
// Ideally, we'd be using `__compute_fracs`, anyway, but we're getting a "stack too deep" error.
378-
let inv_denoms = __batch_invert_impl(denoms); // 1 / (z - ω^i), for all i
378+
let inv_denoms = __batch_invert_impl(denoms); // 1 / (z - omega^i), for all i
379379

380380
for i in 0..FIELDS_PER_BLOB {
381381
let num = ys[i];
382-
let inv_denom = inv_denoms[i]; // 1 / (z - ω^i)
382+
let inv_denom = inv_denoms[i]; // 1 / (z - omega^i)
383383

384-
let frac = num.__mul(inv_denom); // y_i * (1 / (z - ω^i))
384+
let frac = num.__mul(inv_denom); // y_i * (1 / (z - omega^i))
385385

386-
fracs[i] = frac; // y_i / (z - ω^i)
386+
fracs[i] = frac; // y_i / (z - omega^i)
387387
std::as_witness(fracs[i].limbs[0]);
388388
std::as_witness(fracs[i].limbs[1]);
389389
std::as_witness(fracs[i].limbs[2]);
@@ -414,9 +414,9 @@ fn barycentric_evaluate_blob_at_z(z: F, ys: [F; FIELDS_PER_BLOB]) -> F {
414414

415415
// Seeking:
416416
// ___d-1
417-
// \ ω^i
417+
// \ omega^i
418418
// sum = / y_i . ---------
419-
// /____ z - ω^i
419+
// /____ z - omega^i
420420
// i=0
421421
let NUM_PARTIAL_SUMS = FIELDS_PER_BLOB / 8;
422422
for i in 0..NUM_PARTIAL_SUMS {
@@ -426,26 +426,26 @@ fn barycentric_evaluate_blob_at_z(z: F, ys: [F; FIELDS_PER_BLOB]) -> F {
426426

427427
// Seeking:
428428
// ___i*8 + 7
429-
// \ ω^k
429+
// \ omega^k
430430
// partial_sum = / y_k . ---------
431-
// /____ z - ω^k
431+
// /____ z - omega^k
432432
// k=i*8 + 0
433433

434434
for j in 0..8 {
435435
let k = i * 8 + j;
436-
lhs[j] = ROOTS[k]; // ω^k
437-
rhs[j] = fracs[k]; // y_k / (z - ω^k)
436+
lhs[j] = ROOTS[k]; // omega^k
437+
rhs[j] = fracs[k]; // y_k / (z - omega^k)
438438
std::as_witness(lhs[j].limbs[0]);
439439
std::as_witness(lhs[j].limbs[1]);
440440
std::as_witness(lhs[j].limbs[2]);
441441
std::as_witness(rhs[j].limbs[0]);
442442
std::as_witness(rhs[j].limbs[1]);
443443
std::as_witness(rhs[j].limbs[2]);
444444

445-
// y_k * ( ω^k / (z - ω^k) )
445+
// y_k * ( omega^k / (z - omega^k) )
446446
let summand = ROOTS[k].__mul(fracs[k]);
447447

448-
// partial_sum + ( y_k * ( ω^k / (z - ω^k) ) -> partial_sum
448+
// partial_sum + ( y_k * ( omega^k / (z - omega^k) ) -> partial_sum
449449
partial_sum = partial_sum.__add(summand);
450450
std::as_witness(partial_sum.limbs[0]);
451451
std::as_witness(partial_sum.limbs[1]);
@@ -454,19 +454,19 @@ fn barycentric_evaluate_blob_at_z(z: F, ys: [F; FIELDS_PER_BLOB]) -> F {
454454

455455
// Seeking:
456456
// ___i*8 - 1 ___i*8 + 7
457-
// \ ω^i \ / y_k \
458-
// sum_out = / y_i . --------- + / ω^k . | --------- |
459-
// /____ z - ω^i /____ \ z - ω^k /
457+
// \ omega^i \ / y_k \
458+
// sum_out = / y_i . --------- + / omega^k . | --------- |
459+
// /____ z - omega^i /____ \ z - omega^k /
460460
// 0 k = i*8
461461
// ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
462462
// sum partial_sum
463463
//
464464
// ... that is:
465465
//
466466
// ___i*8 - 1 ___ 7
467-
// \ ω^i \
467+
// \ omega^i \
468468
// sum_out = / y_i . --------- + / lhs[j] . rhs[j]
469-
// /____ z - ω^i /____
469+
// /____ z - omega^i /____
470470
// 0 j = 0
471471
// ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
472472
// sum partial_sum

noir-projects/noir-protocol-circuits/crates/types/src/constants.nr

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ global ARGS_LENGTH: u32 = 16;
1515
*
1616
* In the kernel circuits, we accumulate elements such as note hashes and the nullifiers from all functions calls in a
1717
* transaction. Therefore, we always must have:
18-
* MAX_XXX_PER_TX MAX_XXX_PER_CALL
18+
* MAX_XXX_PER_TX >= MAX_XXX_PER_CALL
1919
*
2020
* For instance:
21-
* MAX_NOTE_HASHES_PER_TX MAX_NOTE_HASHES_PER_CALL
22-
* MAX_NULLIFIERS_PER_TX MAX_NULLIFIERS_PER_CALL
21+
* MAX_NOTE_HASHES_PER_TX >= MAX_NOTE_HASHES_PER_CALL
22+
* MAX_NULLIFIERS_PER_TX >= MAX_NULLIFIERS_PER_CALL
2323
*
2424
*/
2525

@@ -137,7 +137,7 @@ global AZTEC_TARGET_COMMITTEE_SIZE: u32 = 48;
137137
// The following is taken from building a block and looking at the `lastArchive` value in it.
138138
// You can run the `integration_l1_publisher.test.ts` and look at the first blocks in the fixtures.
139139
global GENESIS_ARCHIVE_ROOT: Field = 0x1200a06aae1368abe36530b585bd7a4d2ba4de5037b82076412691a187d7621e;
140-
// The following and the value in `deploy_l1_contracts´ must match. We should not have the code both places, but
140+
// The following and the value in `deploy_l1_contracts` must match. We should not have the code both places, but
141141
// we are running into circular dependency issues. #3342
142142
global FEE_JUICE_INITIAL_MINT: Field = 20000000000;
143143

@@ -333,12 +333,12 @@ global AVM_PUBLIC_COLUMN_MAX_SIZE_LOG2 = 8;
333333
* +-----------+-------------------------------+----------------------+
334334
* | Hash size | Number of elements hashed (n) | Condition to use |
335335
* |-----------+-------------------------------+----------------------|
336-
* | LOW | n 8 | 0 < hash_index 32 |
337-
* | MID | 8 < n 16 | 32 < hash_index 40 |
338-
* | HIGH | 16 < n 48 | 40 < hash_index 48 |
336+
* | LOW | n <= 8 | 0 < hash_index <= 32 |
337+
* | MID | 8 < n <= 16 | 32 < hash_index <= 40 |
338+
* | HIGH | 16 < n <= 48 | 40 < hash_index <= 48 |
339339
* +-----------+-------------------------------+----------------------+
340340
*/
341-
// Indices with size 8
341+
// Indices with size <= 8
342342
global GENERATOR_INDEX__NOTE_HASH: u32 = 1;
343343
global GENERATOR_INDEX__NOTE_HASH_NONCE: u32 = 2;
344344
global GENERATOR_INDEX__UNIQUE_NOTE_HASH: u32 = 3;
@@ -371,10 +371,10 @@ global GENERATOR_INDEX__SIDE_EFFECT: u32 = 29;
371371
global GENERATOR_INDEX__FEE_PAYLOAD: u32 = 30;
372372
global GENERATOR_INDEX__COMBINED_PAYLOAD: u32 = 31;
373373
global GENERATOR_INDEX__TX_NULLIFIER: u32 = 32;
374-
// Indices with size 16
374+
// Indices with size <= 16
375375
global GENERATOR_INDEX__TX_REQUEST: u32 = 33;
376376
global GENERATOR_INDEX__SIGNATURE_PAYLOAD: u32 = 34;
377-
// Indices with size 44
377+
// Indices with size <= 44
378378
global GENERATOR_INDEX__VK: u32 = 41;
379379
global GENERATOR_INDEX__PRIVATE_CIRCUIT_PUBLIC_INPUTS: u32 = 42;
380380
global GENERATOR_INDEX__PUBLIC_CIRCUIT_PUBLIC_INPUTS: u32 = 43;

noir/.rebuild_patterns_native

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
^noir/scripts/test_native.sh
44
^noir/noir-repo/acvm-repo
55
^noir/noir-repo/compiler
6-
^noir/noir-repo/aztec_macros
76
^noir/noir-repo/noir_stdlib
87
^noir/noir-repo/tooling/backend_interface
98
^noir/noir-repo/tooling/bb_abstraction_leaks

noir/.rebuild_patterns_packages

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
^noir/noir-repo/yarn.lock
88
^noir/noir-repo/acvm-repo
99
^noir/noir-repo/compiler
10-
^noir/noir-repo/aztec_macros
1110
^noir/noir-repo/noir_stdlib
1211
^noir/noir-repo/tooling/noir_codegen
1312
^noir/noir-repo/tooling/noir_js

noir/Earthfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ nargo-src:
77
# Relevant source (TODO finer-grained 'tooling')
88
COPY --dir \
99
noir-repo/acvm-repo \
10-
noir-repo/aztec_macros \
1110
noir-repo/compiler \
1211
noir-repo/noir_stdlib \
1312
noir-repo/tooling \
@@ -43,7 +42,7 @@ nargo:
4342
SAVE IMAGE aztecprotocol/nargo
4443

4544
test:
46-
FROM +nargo
45+
FROM +nargo-src
4746
COPY ./scripts/test_native.sh ./scripts/test_native.sh
4847
COPY noir-repo/.rustfmt.toml noir-repo/.rustfmt.toml
4948

@@ -116,7 +115,6 @@ packages-deps:
116115
# Relevant source (TODO finer-grained)
117116
COPY --dir \
118117
noir-repo/acvm-repo \
119-
noir-repo/aztec_macros \
120118
noir-repo/compiler \
121119
noir-repo/docs \
122120
noir-repo/noir_stdlib \

0 commit comments

Comments
 (0)