@aztec/protocol-contracts 5.0.0-rc.1 → 5.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/ContractClassRegistry.json +21 -21
- package/artifacts/ContractInstanceRegistry.json +103 -103
- package/artifacts/FeeJuice.json +33 -33
- package/dest/class-registry/contract_class_published_event.d.ts +1 -1
- package/dest/class-registry/contract_class_published_event.d.ts.map +1 -1
- package/dest/class-registry/contract_class_published_event.js +7 -1
- package/dest/protocol_contract.d.ts +4 -1
- package/dest/protocol_contract.d.ts.map +1 -1
- package/dest/protocol_contract.js +5 -1
- package/dest/protocol_contract_data.js +24 -24
- package/dest/scripts/generate_data.js +4 -4
- package/package.json +4 -4
- package/src/class-registry/contract_class_published_event.ts +6 -1
- package/src/protocol_contract.ts +9 -1
- package/src/protocol_contract_data.ts +24 -24
|
@@ -264,77 +264,7 @@
|
|
|
264
264
|
"path": "std/embedded_curve_ops.nr",
|
|
265
265
|
"source": "use crate::cmp::Eq;\nuse crate::hash::Hash;\nuse crate::ops::arith::{Add, Neg, Sub};\n\n/// A point on the embedded elliptic curve\n/// By definition, the base field of the embedded curve is the scalar field of the proof system curve, i.e the Noir Field.\n/// x and y denotes the Weierstrass coordinates of the point.\npub struct EmbeddedCurvePoint {\n pub x: Field,\n pub y: Field,\n}\n\nimpl EmbeddedCurvePoint {\n /// Create a new point using the provided (x, y) pair\n pub fn new(x: Field, y: Field) -> Self {\n EmbeddedCurvePoint { x, y }\n }\n\n /// Elliptic curve point doubling operation\n /// returns the doubled point of a point P, i.e P+P\n pub fn double(self) -> EmbeddedCurvePoint {\n embedded_curve_add(self, self)\n }\n\n /// Returns the null element of the curve; 'the point at infinity'\n pub fn point_at_infinity() -> EmbeddedCurvePoint {\n EmbeddedCurvePoint { x: 0, y: 0 }\n }\n\n /// Returns the curve's generator point.\n pub fn generator() -> EmbeddedCurvePoint {\n // Generator point for the grumpkin curve (y^2 = x^3 - 17)\n EmbeddedCurvePoint {\n x: 1,\n y: 17631683881184975370165255887551781615748388533673675138860, // sqrt(-16)\n }\n }\n\n /// True if this point is the point at infinity\n pub fn is_infinite(self) -> bool {\n (self.x == 0) & (self.y == 0)\n }\n}\n\nimpl Add for EmbeddedCurvePoint {\n /// Adds two points P+Q, using the curve addition formula, and also handles point at infinity\n fn add(self, other: EmbeddedCurvePoint) -> EmbeddedCurvePoint {\n embedded_curve_add(self, other)\n }\n}\n\nimpl Sub for EmbeddedCurvePoint {\n /// Points subtraction operation, using addition and negation\n fn sub(self, other: EmbeddedCurvePoint) -> EmbeddedCurvePoint {\n self + other.neg()\n }\n}\n\nimpl Neg for EmbeddedCurvePoint {\n /// Negates a point P, i.e returns -P, by negating the y coordinate.\n /// If the point is at infinity, then the result is also at infinity.\n fn neg(self) -> EmbeddedCurvePoint {\n EmbeddedCurvePoint { x: self.x, y: -self.y }\n }\n}\n\nimpl Eq for EmbeddedCurvePoint {\n /// Checks whether two points are equal\n fn eq(self: Self, b: EmbeddedCurvePoint) -> bool {\n (self.x == b.x) & (self.y == b.y)\n }\n}\n\nimpl Hash for EmbeddedCurvePoint {\n fn hash<H>(self, state: &mut H)\n where\n H: crate::hash::Hasher,\n {\n self.x.hash(state);\n self.y.hash(state);\n }\n}\n\n/// Scalar for the embedded curve represented as low and high limbs\n/// By definition, the scalar field of the embedded curve is base field of the proving system curve.\n/// It may not fit into a Field element, so it is represented with two Field elements; its low and high limbs.\npub struct EmbeddedCurveScalar {\n pub lo: Field,\n pub hi: Field,\n}\n\nimpl EmbeddedCurveScalar {\n /// Create a new scalar using the provided (lo, hi) pair\n pub fn new(lo: Field, hi: Field) -> Self {\n EmbeddedCurveScalar { lo, hi }\n }\n\n /// Create a scalar from the given bn254 field value\n #[field(bn254)]\n pub fn from_field(scalar: Field) -> EmbeddedCurveScalar {\n let (a, b) = crate::field::bn254::decompose(scalar);\n EmbeddedCurveScalar { lo: a, hi: b }\n }\n}\n\nimpl Eq for EmbeddedCurveScalar {\n fn eq(self, other: Self) -> bool {\n (other.hi == self.hi) & (other.lo == self.lo)\n }\n}\n\nimpl Hash for EmbeddedCurveScalar {\n fn hash<H>(self, state: &mut H)\n where\n H: crate::hash::Hasher,\n {\n self.hi.hash(state);\n self.lo.hash(state);\n }\n}\n\n/// Computes a multi scalar multiplication over the embedded curve.\n/// For bn254, We have Grumpkin.\n///\n/// The embedded curve being used is decided by the\n/// underlying proof system.\n///\n/// IMPORTANT: Prefer `multi_scalar_mul()` over repeated `embedded_curve_add()`\n/// for adding multiple points. This is significantly more efficient.\n/// For adding exactly 2 points, use `embedded_curve_add()` directly.\n// docs:start:multi_scalar_mul\npub fn multi_scalar_mul<let N: u32>(\n points: [EmbeddedCurvePoint; N],\n scalars: [EmbeddedCurveScalar; N],\n) -> EmbeddedCurvePoint\n// docs:end:multi_scalar_mul\n{\n multi_scalar_mul_array_return(points, scalars, true)[0]\n}\n\n// docs:start:fixed_base_scalar_mul\npub fn fixed_base_scalar_mul(scalar: EmbeddedCurveScalar) -> EmbeddedCurvePoint\n// docs:end:fixed_base_scalar_mul\n{\n multi_scalar_mul([EmbeddedCurvePoint::generator()], [scalar])\n}\n\n#[foreign(multi_scalar_mul)]\npub(crate) fn multi_scalar_mul_array_return<let N: u32>(\n points: [EmbeddedCurvePoint; N],\n scalars: [EmbeddedCurveScalar; N],\n predicate: bool,\n) -> [EmbeddedCurvePoint; 1] {}\n\n/// Elliptic curve addition\n/// IMPORTANT: this function is expected to perform a full addition in order to handle all corner cases:\n/// - points on the curve\n/// - point doubling\n/// - point at infinity\n/// As a result, you may not get optimal performance, depending on the assumptions of your inputs.\n// docs:start:embedded_curve_add\npub fn embedded_curve_add(\n point1: EmbeddedCurvePoint,\n point2: EmbeddedCurvePoint,\n) -> EmbeddedCurvePoint {\n // docs:end:embedded_curve_add\n embedded_curve_add_array_return(point1, point2, true)[0]\n}\n\n#[foreign(embedded_curve_add)]\nfn embedded_curve_add_array_return(\n _point1: EmbeddedCurvePoint,\n _point2: EmbeddedCurvePoint,\n _predicate: bool,\n) -> [EmbeddedCurvePoint; 1] {}\n\nmod tests {\n // TODO: Allow imports from \"super\"\n use crate::default::Default;\n use crate::embedded_curve_ops::{\n embedded_curve_add, EmbeddedCurvePoint, EmbeddedCurveScalar, fixed_base_scalar_mul,\n multi_scalar_mul,\n };\n use crate::field::bn254::TWO_POW_128;\n use crate::hash::Hash;\n use crate::hash::Hasher;\n use crate::hash::poseidon2::Poseidon2Hasher;\n\n fn hash_point(p: EmbeddedCurvePoint) -> Field {\n let mut hasher: Poseidon2Hasher = Default::default();\n p.hash(&mut hasher);\n hasher.finish()\n }\n\n fn hash_scalar(s: EmbeddedCurveScalar) -> Field {\n let mut hasher: Poseidon2Hasher = Default::default();\n s.hash(&mut hasher);\n hasher.finish()\n }\n\n #[test]\n fn point_new_sets_coordinates() {\n let p = EmbeddedCurvePoint::new(3, 5);\n assert_eq(p.x, 3);\n assert_eq(p.y, 5);\n }\n\n #[test]\n fn point_at_infinity_is_origin() {\n let inf = EmbeddedCurvePoint::point_at_infinity();\n assert_eq(inf.x, 0);\n assert_eq(inf.y, 0);\n }\n\n #[test]\n fn generator_has_documented_coordinates() {\n let g = EmbeddedCurvePoint::generator();\n assert_eq(g.x, 1);\n assert_eq(g.y, 17631683881184975370165255887551781615748388533673675138860);\n }\n\n #[test]\n fn is_infinite_only_true_for_origin() {\n assert(EmbeddedCurvePoint::point_at_infinity().is_infinite());\n assert(!EmbeddedCurvePoint::generator().is_infinite());\n assert(!EmbeddedCurvePoint::new(1, 0).is_infinite());\n assert(!EmbeddedCurvePoint::new(0, 1).is_infinite());\n }\n\n #[test]\n fn points_with_same_coords_are_equal() {\n let p = EmbeddedCurvePoint::new(7, 11);\n let q = EmbeddedCurvePoint::new(7, 11);\n assert_eq(p, q);\n }\n\n #[test]\n fn points_with_different_coords_are_unequal() {\n let p = EmbeddedCurvePoint::new(7, 11);\n assert(p != EmbeddedCurvePoint::new(7, 12));\n assert(p != EmbeddedCurvePoint::new(8, 11));\n assert(p != EmbeddedCurvePoint::new(8, 12));\n }\n\n #[test]\n fn neg_negates_y_coordinate() {\n let g = EmbeddedCurvePoint::generator();\n let neg_g = -g;\n assert_eq(neg_g.x, g.x);\n assert_eq(neg_g.y, -g.y);\n }\n\n #[test]\n fn neg_is_involution() {\n let g = EmbeddedCurvePoint::generator();\n assert_eq(--g, g);\n }\n\n #[test]\n fn add_with_point_at_infinity_is_identity() {\n let g = EmbeddedCurvePoint::generator();\n let inf = EmbeddedCurvePoint::point_at_infinity();\n assert_eq(g + inf, g);\n assert_eq(inf + g, g);\n }\n\n #[test]\n fn add_of_two_infinities_is_infinity() {\n let inf = EmbeddedCurvePoint::point_at_infinity();\n assert((inf + inf).is_infinite());\n }\n\n #[test]\n fn add_with_negation_is_point_at_infinity() {\n let g = EmbeddedCurvePoint::generator();\n assert((g + (-g)).is_infinite());\n }\n\n #[test]\n fn add_is_commutative() {\n let g = EmbeddedCurvePoint::generator();\n let g2 = g.double();\n assert_eq(g + g2, g2 + g);\n }\n\n #[test]\n fn add_is_associative() {\n let g = EmbeddedCurvePoint::generator();\n let g2 = g.double();\n let g3 = g + g2;\n assert_eq((g + g2) + g3, g + (g2 + g3));\n }\n\n #[test]\n fn sub_of_a_point_with_itself_is_infinity() {\n let g = EmbeddedCurvePoint::generator();\n assert((g - g).is_infinite());\n }\n\n #[test]\n fn sub_with_point_at_infinity_is_identity() {\n let g = EmbeddedCurvePoint::generator();\n let inf = EmbeddedCurvePoint::point_at_infinity();\n assert_eq(g - inf, g);\n }\n\n #[test]\n fn sub_inverts_add() {\n let g = EmbeddedCurvePoint::generator();\n let g2 = g.double();\n assert_eq((g + g2) - g2, g);\n assert_eq((g + g2) - g, g2);\n }\n\n #[test]\n fn double_equals_self_plus_self() {\n let g = EmbeddedCurvePoint::generator();\n assert_eq(g.double(), g + g);\n }\n\n #[test]\n fn double_of_point_at_infinity_is_infinity() {\n assert(EmbeddedCurvePoint::point_at_infinity().double().is_infinite());\n }\n\n #[test]\n fn embedded_curve_add_matches_add_operator() {\n let g = EmbeddedCurvePoint::generator();\n let g2 = g.double();\n assert_eq(embedded_curve_add(g, g2), g + g2);\n }\n\n #[test]\n fn point_hash_is_consistent_for_equal_points() {\n let p = EmbeddedCurvePoint::new(3, 5);\n let q = EmbeddedCurvePoint::new(3, 5);\n assert_eq(hash_point(p), hash_point(q));\n }\n\n #[test]\n fn point_hash_differs_for_distinct_points() {\n let p = EmbeddedCurvePoint::new(3, 5);\n assert(hash_point(p) != hash_point(EmbeddedCurvePoint::new(3, 7)));\n assert(hash_point(p) != hash_point(EmbeddedCurvePoint::new(4, 5)));\n // Distinguishes (x, y) from (y, x) - order of writes matters.\n assert(hash_point(p) != hash_point(EmbeddedCurvePoint::new(5, 3)));\n }\n\n #[test]\n fn scalar_new_sets_limbs() {\n let s = EmbeddedCurveScalar::new(3, 5);\n assert_eq(s.lo, 3);\n assert_eq(s.hi, 5);\n }\n\n #[test]\n fn scalars_with_same_limbs_are_equal() {\n let s = EmbeddedCurveScalar::new(7, 11);\n let t = EmbeddedCurveScalar::new(7, 11);\n assert_eq(s, t);\n }\n\n #[test]\n fn scalars_with_different_limbs_are_unequal() {\n let s = EmbeddedCurveScalar::new(7, 11);\n assert(s != EmbeddedCurveScalar::new(7, 12));\n assert(s != EmbeddedCurveScalar::new(8, 11));\n }\n\n #[test]\n fn scalar_from_field_decomposes_zero() {\n assert_eq(EmbeddedCurveScalar::from_field(0), EmbeddedCurveScalar::new(0, 0));\n }\n\n #[test]\n fn scalar_from_field_decomposes_small_value() {\n let s = EmbeddedCurveScalar::from_field(0x1234567890);\n assert_eq(s, EmbeddedCurveScalar::new(0x1234567890, 0));\n }\n\n #[test]\n fn scalar_from_field_decomposes_two_pow_128() {\n let s = EmbeddedCurveScalar::from_field(TWO_POW_128);\n assert_eq(s, EmbeddedCurveScalar::new(0, 1));\n }\n\n #[test]\n fn scalar_hash_is_consistent_for_equal_scalars() {\n let s = EmbeddedCurveScalar::new(7, 11);\n let t = EmbeddedCurveScalar::new(7, 11);\n assert_eq(hash_scalar(s), hash_scalar(t));\n }\n\n #[test]\n fn scalar_hash_differs_for_distinct_scalars() {\n let s = EmbeddedCurveScalar::new(7, 11);\n assert(hash_scalar(s) != hash_scalar(EmbeddedCurveScalar::new(7, 12)));\n assert(hash_scalar(s) != hash_scalar(EmbeddedCurveScalar::new(8, 11)));\n // Distinguishes (lo, hi) from (hi, lo) - limb order matters.\n assert(hash_scalar(s) != hash_scalar(EmbeddedCurveScalar::new(11, 7)));\n }\n\n #[test]\n fn msm_with_scalar_one_returns_point() {\n let g = EmbeddedCurvePoint::generator();\n let one = EmbeddedCurveScalar::new(1, 0);\n assert_eq(multi_scalar_mul([g], [one]), g);\n }\n\n #[test]\n fn msm_with_scalar_zero_returns_infinity() {\n let g = EmbeddedCurvePoint::generator();\n let zero = EmbeddedCurveScalar::new(0, 0);\n assert(multi_scalar_mul([g], [zero]).is_infinite());\n }\n\n #[test]\n fn msm_with_scalar_two_doubles_point() {\n let g = EmbeddedCurvePoint::generator();\n let two = EmbeddedCurveScalar::new(2, 0);\n assert_eq(multi_scalar_mul([g], [two]), g.double());\n }\n\n #[test]\n fn msm_sums_terms() {\n let g = EmbeddedCurvePoint::generator();\n let one = EmbeddedCurveScalar::new(1, 0);\n assert_eq(multi_scalar_mul([g, g], [one, one]), g.double());\n }\n\n #[test]\n fn msm_with_opposite_terms_cancels() {\n let g = EmbeddedCurvePoint::generator();\n let one = EmbeddedCurveScalar::new(1, 0);\n assert(multi_scalar_mul([g, -g], [one, one]).is_infinite());\n }\n\n #[test]\n fn msm_skips_point_at_infinity() {\n let g = EmbeddedCurvePoint::generator();\n let inf = EmbeddedCurvePoint::point_at_infinity();\n let one = EmbeddedCurveScalar::new(1, 0);\n assert_eq(multi_scalar_mul([inf, g], [one, one]), g);\n }\n\n #[test]\n fn msm_skips_zero_scalar() {\n let g = EmbeddedCurvePoint::generator();\n let one = EmbeddedCurveScalar::new(1, 0);\n let zero = EmbeddedCurveScalar::new(0, 0);\n assert_eq(multi_scalar_mul([g, g], [zero, one]), g);\n }\n\n #[test]\n fn fixed_base_scalar_mul_with_one_returns_generator() {\n let one = EmbeddedCurveScalar::new(1, 0);\n assert_eq(fixed_base_scalar_mul(one), EmbeddedCurvePoint::generator());\n }\n\n #[test]\n fn fixed_base_scalar_mul_with_zero_returns_infinity() {\n let zero = EmbeddedCurveScalar::new(0, 0);\n assert(fixed_base_scalar_mul(zero).is_infinite());\n }\n\n #[test]\n fn fixed_base_scalar_mul_matches_msm_on_generator() {\n let s = EmbeddedCurveScalar::new(2, 0);\n assert_eq(\n fixed_base_scalar_mul(s),\n multi_scalar_mul([EmbeddedCurvePoint::generator()], [s]),\n );\n }\n}\n"
|
|
266
266
|
},
|
|
267
|
-
"
|
|
268
|
-
"function_locations": [
|
|
269
|
-
{
|
|
270
|
-
"name": "compute_decomposition",
|
|
271
|
-
"start": 456
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
"name": "decompose_hint",
|
|
275
|
-
"start": 818
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
"name": "lte_hint",
|
|
279
|
-
"start": 906
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
"name": "assert_gt_limbs",
|
|
283
|
-
"start": 1116
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
"name": "decompose",
|
|
287
|
-
"start": 1725
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
"name": "assert_gt",
|
|
291
|
-
"start": 2431
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
"name": "assert_lt",
|
|
295
|
-
"start": 2837
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
"name": "gt",
|
|
299
|
-
"start": 2901
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
"name": "lt",
|
|
303
|
-
"start": 3405
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"name": "tests::check_decompose",
|
|
307
|
-
"start": 3678
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
"name": "tests::check_lte_hint",
|
|
311
|
-
"start": 3928
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"name": "tests::check_gt",
|
|
315
|
-
"start": 4261
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"name": "tests::check_plo_phi",
|
|
319
|
-
"start": 4591
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
"name": "tests::check_decompose_edge_cases",
|
|
323
|
-
"start": 5086
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
"name": "tests::check_decompose_large_values",
|
|
327
|
-
"start": 5446
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
"name": "tests::check_lt_comprehensive",
|
|
331
|
-
"start": 5807
|
|
332
|
-
}
|
|
333
|
-
],
|
|
334
|
-
"path": "std/field/bn254.nr",
|
|
335
|
-
"source": "use crate::field::field_less_than;\nuse crate::runtime::is_unconstrained;\n\n// The low and high decomposition of the field modulus\npub(crate) global PLO: Field = 53438638232309528389504892708671455233;\npub(crate) global PHI: Field = 64323764613183177041862057485226039389;\n\npub(crate) global TWO_POW_128: Field = 0x100000000000000000000000000000000;\n\n// Decomposes a single field into two 16 byte fields.\nfn compute_decomposition(x: Field) -> (Field, Field) {\n // Here's we're taking advantage of truncating 128 bit limbs from the input field\n // and then subtracting them from the input such the field division is equivalent to integer division.\n let low = (x as u128) as Field;\n let high = (x - low) / TWO_POW_128;\n\n (low, high)\n}\n\npub(crate) unconstrained fn decompose_hint(x: Field) -> (Field, Field) {\n compute_decomposition(x)\n}\n\nunconstrained fn lte_hint(x: Field, y: Field) -> bool {\n if x == y {\n true\n } else {\n field_less_than(x, y)\n }\n}\n\n// Assert that (alo > blo && ahi >= bhi) || (alo <= blo && ahi > bhi)\nfn assert_gt_limbs(a: (Field, Field), b: (Field, Field)) {\n let (alo, ahi) = a;\n let (blo, bhi) = b;\n // Safety: borrow is enforced to be boolean due to its type.\n // if borrow is 0, it asserts that (alo > blo && ahi >= bhi)\n // if borrow is 1, it asserts that (alo <= blo && ahi > bhi)\n unsafe {\n let borrow = lte_hint(alo, blo);\n\n let rlo = alo - blo - 1 + (borrow as Field) * TWO_POW_128;\n let rhi = ahi - bhi - (borrow as Field);\n\n rlo.assert_max_bit_size::<128>();\n rhi.assert_max_bit_size::<128>();\n }\n}\n\n/// Decompose a single field into two 16 byte fields.\npub fn decompose(x: Field) -> (Field, Field) {\n if is_unconstrained() {\n compute_decomposition(x)\n } else {\n // Safety: decomposition is properly checked below\n unsafe {\n // Take hints of the decomposition\n let (xlo, xhi) = decompose_hint(x);\n\n // Range check the limbs\n xlo.assert_max_bit_size::<128>();\n xhi.assert_max_bit_size::<128>();\n\n // Check that the decomposition is correct\n assert_eq(x, xlo + TWO_POW_128 * xhi);\n\n // Assert that the decomposition of P is greater than the decomposition of x\n assert_gt_limbs((PLO, PHI), (xlo, xhi));\n (xlo, xhi)\n }\n }\n}\n\npub fn assert_gt(a: Field, b: Field) {\n if is_unconstrained() {\n assert(\n // Safety: already unconstrained\n unsafe { field_less_than(b, a) },\n );\n } else {\n // Decompose a and b\n let a_limbs = decompose(a);\n let b_limbs = decompose(b);\n\n // Assert that a_limbs is greater than b_limbs\n assert_gt_limbs(a_limbs, b_limbs)\n }\n}\n\npub fn assert_lt(a: Field, b: Field) {\n assert_gt(b, a);\n}\n\npub fn gt(a: Field, b: Field) -> bool {\n if is_unconstrained() {\n // Safety: unsafe in unconstrained\n unsafe {\n field_less_than(b, a)\n }\n } else if a == b {\n false\n } else {\n // Safety: Take a hint of the comparison and verify it\n unsafe {\n if field_less_than(a, b) {\n assert_gt(b, a);\n false\n } else {\n assert_gt(a, b);\n true\n }\n }\n }\n}\n\npub fn lt(a: Field, b: Field) -> bool {\n gt(b, a)\n}\n\nmod tests {\n // TODO: Allow imports from \"super\"\n use crate::field::bn254::{assert_gt, decompose, gt, lt, lte_hint, PHI, PLO, TWO_POW_128};\n use crate::internal::test_unconstrained;\n use super::assert_lt;\n\n #[test]\n fn check_decompose() {\n assert_eq(decompose(TWO_POW_128), (0, 1));\n assert_eq(decompose(TWO_POW_128 + 0x1234567890), (0x1234567890, 1));\n assert_eq(decompose(0x1234567890), (0x1234567890, 0));\n }\n\n #[test]\n unconstrained fn check_lte_hint() {\n assert(lte_hint(0, 1));\n assert(lte_hint(0, 0x100));\n assert(lte_hint(0x100, TWO_POW_128 - 1));\n assert(!lte_hint(0 - 1, 0));\n\n assert(lte_hint(0, 0));\n assert(lte_hint(0x100, 0x100));\n assert(lte_hint(0 - 1, 0 - 1));\n }\n\n #[test]\n #[test_unconstrained]\n fn check_gt() {\n assert(gt(1, 0));\n assert(gt(0x100, 0));\n assert(gt((0 - 1), (0 - 2)));\n assert(gt(TWO_POW_128, 0));\n assert(!gt(0, 0));\n assert(!gt(0, 0x100));\n assert(gt(0 - 1, 0 - 2));\n assert(!gt(0 - 2, 0 - 1));\n assert_gt(0 - 1, 0);\n }\n\n #[test]\n fn check_plo_phi() {\n assert_eq(PLO + PHI * TWO_POW_128, 0);\n let p_bytes = crate::field::modulus_le_bytes();\n let mut p_low: Field = 0;\n let mut p_high: Field = 0;\n\n let mut offset = 1;\n for i in 0..16 {\n p_low += (p_bytes[i] as Field) * offset;\n p_high += (p_bytes[i + 16] as Field) * offset;\n offset *= 256;\n }\n assert_eq(p_low, PLO);\n assert_eq(p_high, PHI);\n }\n\n #[test]\n fn check_decompose_edge_cases() {\n assert_eq(decompose(0), (0, 0));\n assert_eq(decompose(TWO_POW_128 - 1), (TWO_POW_128 - 1, 0));\n assert_eq(decompose(TWO_POW_128 + 1), (1, 1));\n assert_eq(decompose(TWO_POW_128 * 2), (0, 2));\n assert_eq(decompose(TWO_POW_128 * 2 + 0x1234567890), (0x1234567890, 2));\n }\n\n #[test]\n fn check_decompose_large_values() {\n let large_field = 0xffffffffffffffff;\n let (lo, hi) = decompose(large_field);\n assert_eq(large_field, lo + TWO_POW_128 * hi);\n\n let large_value = large_field - TWO_POW_128;\n let (lo2, hi2) = decompose(large_value);\n assert_eq(large_value, lo2 + TWO_POW_128 * hi2);\n }\n\n #[test]\n fn check_lt_comprehensive() {\n assert(lt(0, 1));\n assert_lt(0, 1);\n assert(!lt(1, 0));\n assert(!lt(0, 0));\n assert(!lt(42, 42));\n\n assert(lt(TWO_POW_128 - 1, TWO_POW_128));\n assert(!lt(TWO_POW_128, TWO_POW_128 - 1));\n }\n}\n"
|
|
336
|
-
},
|
|
337
|
-
"150": {
|
|
267
|
+
"147": {
|
|
338
268
|
"function_locations": [
|
|
339
269
|
{
|
|
340
270
|
"name": "<impl Empty for AztecAddress>::empty",
|
|
@@ -424,7 +354,77 @@
|
|
|
424
354
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr",
|
|
425
355
|
"source": "use crate::{\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{AZTEC_ADDRESS_LENGTH, DOM_SEP__CONTRACT_ADDRESS_V2, MAX_FIELD_VALUE},\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n public_keys::{hash_public_key, IvpkM, PublicKeys, ToPoint},\n traits::{Deserialize, Empty, FromField, Packable, Serialize, ToField},\n utils::field::sqrt,\n};\n\nuse crate::point::EmbeddedCurvePoint;\n\nuse crate::public_keys::AddressPoint;\nuse std::{\n embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key},\n ops::Add,\n};\nuse std::meta::derive;\n\n// Aztec address\n#[derive(Deserialize, Eq, Packable, Serialize)]\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Empty for AztecAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl ToField for AztecAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for AztecAddress {\n fn from_field(value: Field) -> AztecAddress {\n AztecAddress { inner: value }\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n /// Returns `true` if the address is valid.\n ///\n /// An invalid address is one that can be proven to not be correctly derived, meaning it contains no contract code,\n /// public keys, etc., and can therefore not receive messages nor execute calls.\n pub fn is_valid(self) -> bool {\n self.get_y().is_some()\n }\n\n /// Returns an address's [`AddressPoint`].\n ///\n /// This can be used to create shared secrets with the owner of the address. If the address is invalid (see\n /// [`AztecAddress::is_valid`]) then this returns `Option::none()`, and no shared secrets can be created.\n pub fn to_address_point(self) -> Option<AddressPoint> {\n self.get_y().map(|y| {\n // If we get a negative y coordinate (y > (r - 1) / 2), we swap it to the\n // positive one (where y <= (r - 1) / 2) by negating it.\n let final_y = if Self::is_positive(y) { y } else { -y };\n\n AddressPoint { inner: EmbeddedCurvePoint { x: self.inner, y: final_y } }\n })\n }\n\n /// Determines whether a y-coordinate is in the lower (positive) or upper (negative) \"half\" of the field.\n /// I.e.\n /// y <= (r - 1)/2 => positive.\n /// y > (r - 1)/2 => negative.\n /// An AddressPoint always uses the \"positive\" y.\n fn is_positive(y: Field) -> bool {\n // Note: The field modulus r is MAX_FIELD_VALUE + 1.\n let MID = MAX_FIELD_VALUE / 2; // (r - 1) / 2\n let MID_PLUS_1 = MID + 1; // (r - 1)/2 + 1\n // Note: y <= m implies y < m + 1.\n y.lt(MID_PLUS_1)\n }\n\n /// Returns one of the two possible y-coordinates.\n ///\n /// Not all `AztecAddresses` are valid, in which case there is no corresponding y-coordinate. This returns\n /// `Option::none()` for invalid addresses.\n ///\n /// An `AztecAddress` is defined by an x-coordinate, for which two y-coordinates exist as solutions to the curve\n /// equation. This function returns either of them. Note that an [`AddressPoint`] must **always** have a positive\n /// y-coordinate - if trying to obtain the underlying point use [`AztecAddress::to_address_point`] instead.\n fn get_y(self) -> Option<Field> {\n // We compute the address point by taking our address as x, and then solving for y in the\n // equation which defines the grumpkin curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = x * x * x - 17;\n\n sqrt(y_squared)\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\n //\n // address = address_point.x\n // |\n // address_point = pre_address * G + Ivpk_m (always choose \"positive\" y-coord)\n // | ^\n // | |.....................\n // pre_address .\n // / \\ .\n // / \\ .\n // partial_address public_keys_hash .\n // / \\ / / | | | \\ .\n // / \\ / / | | | \\ .\n // npk_m_hash Ivpk_m ovpk_m_hash tpk_m_hash mspk_m_hash fbpk_m_hash\n // contract_class_id \\ |.........................\n // / | \\ \\\n // artifact_hash | public_bytecode_commitment salted_initialization_hash\n // | / / \\ \\\n // private_function_tree_root salt initialization_hash deployer_address immutables_hash\n // / \\ / \\\n // ... ... constructor_fn_selector constructor_args_hash\n // / \\\n // / \\ / \\\n // leaf leaf leaf leaf\n // ^\n // |\n // |---h(function_selector, vk_hash)\n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n // Each of these represents a private function of the contract.\n\n let public_keys_hash = public_keys.hash();\n\n let pre_address = poseidon2_hash_with_separator(\n [public_keys_hash.to_field(), partial_address.to_field()],\n DOM_SEP__CONTRACT_ADDRESS_V2,\n );\n\n // Note: `.add()` will fail within the blackbox fn if either of the points are not on the curve. (See tests below).\n let address_point = derive_public_key(EmbeddedCurveScalar::from_field(pre_address)).add(\n public_keys.ivpk_m.to_point(),\n );\n\n // Note that our address is only the x-coordinate of the full address_point. This is okay because when people want to encrypt something and send it to us\n // they can recover our full point using the x-coordinate (our address itself). To do this, they recompute the y-coordinate according to the equation y^2 = x^3 - 17.\n // When they do this, they may get a positive y-coordinate (a value that is less than or equal to MAX_FIELD_VALUE / 2) or\n // a negative y-coordinate (a value that is more than MAX_FIELD_VALUE), and we cannot dictate which one they get and hence the recovered point may sometimes be different than the one\n // our secret can decrypt. Regardless though, they should and will always encrypt using point with the positive y-coordinate by convention.\n // This ensures that everyone encrypts to the same point given an arbitrary x-coordinate (address). This is allowed because even though our original point may not have a positive y-coordinate,\n // with our original secret, we will be able to derive the secret to the point with the flipped (and now positive) y-coordinate that everyone encrypts to.\n AztecAddress::from_field(address_point.x)\n }\n\n pub fn compute_from_class_id(\n contract_class_id: ContractClassId,\n salted_initialization_hash: SaltedInitializationHash,\n public_keys: PublicKeys,\n ) -> Self {\n let partial_address = PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n salted_initialization_hash,\n );\n\n AztecAddress::compute(public_keys, partial_address)\n }\n\n pub fn is_zero(self) -> bool {\n self.inner == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n\n#[test]\nfn check_max_field_value() {\n // Check that it is indeed r-1.\n assert_eq(MAX_FIELD_VALUE + 1, 0);\n}\n\n#[test]\nfn check_is_positive() {\n assert(AztecAddress::is_positive(0));\n assert(AztecAddress::is_positive(1));\n assert(!AztecAddress::is_positive(-1));\n assert(AztecAddress::is_positive(MAX_FIELD_VALUE / 2));\n assert(!AztecAddress::is_positive((MAX_FIELD_VALUE / 2) + 1));\n}\n\n// Gives us confidence that we don't need to manually check that the input public keys need to be on the curve for `add`,\n// because the blackbox function does this check for us.\n#[test(should_fail_with = \"is not on curve\")]\nfn check_embedded_curve_point_add() {\n // Choose a point not on the curve in the 2nd position.\n let p1 = EmbeddedCurvePoint::generator();\n let key = IvpkM { inner: EmbeddedCurvePoint { x: 1, y: 1 } };\n let _ = p1 + key.to_point();\n}\n\n#[test]\nfn compute_address_from_partial_and_pub_keys() {\n let npk_m_point = EmbeddedCurvePoint {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n };\n let ovpk_m_point = EmbeddedCurvePoint {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n };\n let tpk_m_point = EmbeddedCurvePoint {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n };\n let mspk_m_point = EmbeddedCurvePoint {\n x: 0x1bd6cb13e0bc8c6e0c1a8b2c5d7f9e0a4b6c8d0e2f4a6c8e0a2c4e6f8a0b2c4d,\n y: 0x0a032ec7b21c2bdb35f8a13e594764e39ee786c4b275eef3f0435bf6ab2b9822,\n };\n let fbpk_m_point = EmbeddedCurvePoint {\n x: 0x2c8e0a2c4e6f8b0d2f4a6c8e0a2c4e6f8b0d2f4a6c8e0a2c4e6f8b0d2f4a6c90,\n y: 0x2ef338da3a77e65f90b6d48ac686fc9ff3a95de0c39e0426fc443377425e6634,\n };\n\n let public_keys = PublicKeys {\n npk_m_hash: hash_public_key(npk_m_point),\n ivpk_m: IvpkM {\n inner: EmbeddedCurvePoint {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n },\n },\n ovpk_m_hash: hash_public_key(ovpk_m_point),\n tpk_m_hash: hash_public_key(tpk_m_point),\n mspk_m_hash: hash_public_key(mspk_m_point),\n fbpk_m_hash: hash_public_key(fbpk_m_point),\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address).to_field();\n\n let expected_computed_address_from_partial_and_pubkeys =\n 0x303ffc8bd456d132463b1fc3a633aeb718a7883c268f3956c05e6fe09b5a5424;\n assert_eq(address, expected_computed_address_from_partial_and_pubkeys);\n}\n\n#[test]\nfn compute_preaddress_from_partial_and_pub_keys() {\n let pre_address = poseidon2_hash_with_separator([1, 2], DOM_SEP__CONTRACT_ADDRESS_V2);\n let expected_computed_preaddress_from_partial_and_pubkey =\n 0x0fa1c698858df1a99170cd39d5f4bfad6d0d60f1f8afa3dc92281ee60b36f3bb;\n assert(pre_address == expected_computed_preaddress_from_partial_and_pubkey);\n}\n\n#[test]\nfn from_field_to_field() {\n let address = AztecAddress { inner: 37 };\n assert_eq(FromField::from_field(address.to_field()), address);\n}\n\n#[test]\nfn serde() {\n let address = AztecAddress { inner: 37 };\n // We use the AZTEC_ADDRESS_LENGTH constant to ensure that there is a match between the derived trait\n // implementation and the constant.\n let serialized: [Field; AZTEC_ADDRESS_LENGTH] = address.serialize();\n let deserialized = AztecAddress::deserialize(serialized);\n assert_eq(address, deserialized);\n}\n\n#[test]\nfn to_address_point_valid() {\n // x = 8 where x^3 - 17 = 512 - 17 = 495, which is a residue in this field\n let address = AztecAddress { inner: 8 };\n\n assert(address.get_y().is_some()); // We don't bother checking the result of get_y as it is only used internally\n assert(address.is_valid());\n\n let maybe_point = address.to_address_point();\n assert(maybe_point.is_some());\n\n let point = maybe_point.unwrap().inner;\n // check that x is preserved\n assert_eq(point.x, Field::from(8));\n\n // check that the curve equation holds: y^2 == x^3 - 17\n assert_eq(point.y * point.y, point.x * point.x * point.x - 17);\n}\n\n#[test]\nunconstrained fn to_address_point_invalid() {\n // x = 3 where x^3 - 17 = 27 - 17 = 10, which is a non-residue in this field\n let address = AztecAddress { inner: 3 };\n\n assert(address.get_y().is_none());\n assert(!address.is_valid());\n\n assert(address.to_address_point().is_none());\n}\n"
|
|
426
356
|
},
|
|
427
|
-
"
|
|
357
|
+
"15": {
|
|
358
|
+
"function_locations": [
|
|
359
|
+
{
|
|
360
|
+
"name": "compute_decomposition",
|
|
361
|
+
"start": 456
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "decompose_hint",
|
|
365
|
+
"start": 818
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "lte_hint",
|
|
369
|
+
"start": 906
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"name": "assert_gt_limbs",
|
|
373
|
+
"start": 1116
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "decompose",
|
|
377
|
+
"start": 1725
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "assert_gt",
|
|
381
|
+
"start": 2431
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"name": "assert_lt",
|
|
385
|
+
"start": 2837
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "gt",
|
|
389
|
+
"start": 2901
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"name": "lt",
|
|
393
|
+
"start": 3405
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "tests::check_decompose",
|
|
397
|
+
"start": 3678
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "tests::check_lte_hint",
|
|
401
|
+
"start": 3928
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"name": "tests::check_gt",
|
|
405
|
+
"start": 4261
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "tests::check_plo_phi",
|
|
409
|
+
"start": 4591
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "tests::check_decompose_edge_cases",
|
|
413
|
+
"start": 5086
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"name": "tests::check_decompose_large_values",
|
|
417
|
+
"start": 5446
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "tests::check_lt_comprehensive",
|
|
421
|
+
"start": 5807
|
|
422
|
+
}
|
|
423
|
+
],
|
|
424
|
+
"path": "std/field/bn254.nr",
|
|
425
|
+
"source": "use crate::field::field_less_than;\nuse crate::runtime::is_unconstrained;\n\n// The low and high decomposition of the field modulus\npub(crate) global PLO: Field = 53438638232309528389504892708671455233;\npub(crate) global PHI: Field = 64323764613183177041862057485226039389;\n\npub(crate) global TWO_POW_128: Field = 0x100000000000000000000000000000000;\n\n// Decomposes a single field into two 16 byte fields.\nfn compute_decomposition(x: Field) -> (Field, Field) {\n // Here's we're taking advantage of truncating 128 bit limbs from the input field\n // and then subtracting them from the input such the field division is equivalent to integer division.\n let low = (x as u128) as Field;\n let high = (x - low) / TWO_POW_128;\n\n (low, high)\n}\n\npub(crate) unconstrained fn decompose_hint(x: Field) -> (Field, Field) {\n compute_decomposition(x)\n}\n\nunconstrained fn lte_hint(x: Field, y: Field) -> bool {\n if x == y {\n true\n } else {\n field_less_than(x, y)\n }\n}\n\n// Assert that (alo > blo && ahi >= bhi) || (alo <= blo && ahi > bhi)\nfn assert_gt_limbs(a: (Field, Field), b: (Field, Field)) {\n let (alo, ahi) = a;\n let (blo, bhi) = b;\n // Safety: borrow is enforced to be boolean due to its type.\n // if borrow is 0, it asserts that (alo > blo && ahi >= bhi)\n // if borrow is 1, it asserts that (alo <= blo && ahi > bhi)\n unsafe {\n let borrow = lte_hint(alo, blo);\n\n let rlo = alo - blo - 1 + (borrow as Field) * TWO_POW_128;\n let rhi = ahi - bhi - (borrow as Field);\n\n rlo.assert_max_bit_size::<128>();\n rhi.assert_max_bit_size::<128>();\n }\n}\n\n/// Decompose a single field into two 16 byte fields.\npub fn decompose(x: Field) -> (Field, Field) {\n if is_unconstrained() {\n compute_decomposition(x)\n } else {\n // Safety: decomposition is properly checked below\n unsafe {\n // Take hints of the decomposition\n let (xlo, xhi) = decompose_hint(x);\n\n // Range check the limbs\n xlo.assert_max_bit_size::<128>();\n xhi.assert_max_bit_size::<128>();\n\n // Check that the decomposition is correct\n assert_eq(x, xlo + TWO_POW_128 * xhi);\n\n // Assert that the decomposition of P is greater than the decomposition of x\n assert_gt_limbs((PLO, PHI), (xlo, xhi));\n (xlo, xhi)\n }\n }\n}\n\npub fn assert_gt(a: Field, b: Field) {\n if is_unconstrained() {\n assert(\n // Safety: already unconstrained\n unsafe { field_less_than(b, a) },\n );\n } else {\n // Decompose a and b\n let a_limbs = decompose(a);\n let b_limbs = decompose(b);\n\n // Assert that a_limbs is greater than b_limbs\n assert_gt_limbs(a_limbs, b_limbs)\n }\n}\n\npub fn assert_lt(a: Field, b: Field) {\n assert_gt(b, a);\n}\n\npub fn gt(a: Field, b: Field) -> bool {\n if is_unconstrained() {\n // Safety: unsafe in unconstrained\n unsafe {\n field_less_than(b, a)\n }\n } else if a == b {\n false\n } else {\n // Safety: Take a hint of the comparison and verify it\n unsafe {\n if field_less_than(a, b) {\n assert_gt(b, a);\n false\n } else {\n assert_gt(a, b);\n true\n }\n }\n }\n}\n\npub fn lt(a: Field, b: Field) -> bool {\n gt(b, a)\n}\n\nmod tests {\n // TODO: Allow imports from \"super\"\n use crate::field::bn254::{assert_gt, decompose, gt, lt, lte_hint, PHI, PLO, TWO_POW_128};\n use crate::internal::test_unconstrained;\n use super::assert_lt;\n\n #[test]\n fn check_decompose() {\n assert_eq(decompose(TWO_POW_128), (0, 1));\n assert_eq(decompose(TWO_POW_128 + 0x1234567890), (0x1234567890, 1));\n assert_eq(decompose(0x1234567890), (0x1234567890, 0));\n }\n\n #[test]\n unconstrained fn check_lte_hint() {\n assert(lte_hint(0, 1));\n assert(lte_hint(0, 0x100));\n assert(lte_hint(0x100, TWO_POW_128 - 1));\n assert(!lte_hint(0 - 1, 0));\n\n assert(lte_hint(0, 0));\n assert(lte_hint(0x100, 0x100));\n assert(lte_hint(0 - 1, 0 - 1));\n }\n\n #[test]\n #[test_unconstrained]\n fn check_gt() {\n assert(gt(1, 0));\n assert(gt(0x100, 0));\n assert(gt((0 - 1), (0 - 2)));\n assert(gt(TWO_POW_128, 0));\n assert(!gt(0, 0));\n assert(!gt(0, 0x100));\n assert(gt(0 - 1, 0 - 2));\n assert(!gt(0 - 2, 0 - 1));\n assert_gt(0 - 1, 0);\n }\n\n #[test]\n fn check_plo_phi() {\n assert_eq(PLO + PHI * TWO_POW_128, 0);\n let p_bytes = crate::field::modulus_le_bytes();\n let mut p_low: Field = 0;\n let mut p_high: Field = 0;\n\n let mut offset = 1;\n for i in 0..16 {\n p_low += (p_bytes[i] as Field) * offset;\n p_high += (p_bytes[i + 16] as Field) * offset;\n offset *= 256;\n }\n assert_eq(p_low, PLO);\n assert_eq(p_high, PHI);\n }\n\n #[test]\n fn check_decompose_edge_cases() {\n assert_eq(decompose(0), (0, 0));\n assert_eq(decompose(TWO_POW_128 - 1), (TWO_POW_128 - 1, 0));\n assert_eq(decompose(TWO_POW_128 + 1), (1, 1));\n assert_eq(decompose(TWO_POW_128 * 2), (0, 2));\n assert_eq(decompose(TWO_POW_128 * 2 + 0x1234567890), (0x1234567890, 2));\n }\n\n #[test]\n fn check_decompose_large_values() {\n let large_field = 0xffffffffffffffff;\n let (lo, hi) = decompose(large_field);\n assert_eq(large_field, lo + TWO_POW_128 * hi);\n\n let large_value = large_field - TWO_POW_128;\n let (lo2, hi2) = decompose(large_value);\n assert_eq(large_value, lo2 + TWO_POW_128 * hi2);\n }\n\n #[test]\n fn check_lt_comprehensive() {\n assert(lt(0, 1));\n assert_lt(0, 1);\n assert(!lt(1, 0));\n assert(!lt(0, 0));\n assert(!lt(42, 42));\n\n assert(lt(TWO_POW_128 - 1, TWO_POW_128));\n assert(!lt(TWO_POW_128, TWO_POW_128 - 1));\n }\n}\n"
|
|
426
|
+
},
|
|
427
|
+
"150": {
|
|
428
428
|
"function_locations": [
|
|
429
429
|
{
|
|
430
430
|
"name": "<impl ToField for PartialAddress>::to_field",
|
|
@@ -466,7 +466,7 @@
|
|
|
466
466
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr",
|
|
467
467
|
"source": "use crate::{\n address::{aztec_address::AztecAddress, salted_initialization_hash::SaltedInitializationHash},\n constants::DOM_SEP__PARTIAL_ADDRESS,\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n traits::{Deserialize, Empty, Serialize, ToField},\n};\nuse std::meta::derive;\n\n// Partial address\n#[derive(Deserialize, Eq, Serialize)]\npub struct PartialAddress {\n pub inner: Field,\n}\n\nimpl ToField for PartialAddress {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl Empty for PartialAddress {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\nimpl PartialAddress {\n pub fn from_field(field: Field) -> Self {\n Self { inner: field }\n }\n\n pub fn compute(\n contract_class_id: ContractClassId,\n salt: Field,\n initialization_hash: Field,\n deployer: AztecAddress,\n immutables_hash: Field,\n ) -> Self {\n PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n SaltedInitializationHash::compute(salt, initialization_hash, deployer, immutables_hash),\n )\n }\n\n pub fn compute_from_salted_initialization_hash(\n contract_class_id: ContractClassId,\n salted_initialization_hash: SaltedInitializationHash,\n ) -> Self {\n PartialAddress::from_field(poseidon2_hash_with_separator(\n [contract_class_id.to_field(), salted_initialization_hash.to_field()],\n DOM_SEP__PARTIAL_ADDRESS,\n ))\n }\n\n pub fn to_field(self) -> Field {\n self.inner\n }\n\n pub fn is_zero(self) -> bool {\n self.to_field() == 0\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n\nmod test {\n use crate::{address::partial_address::PartialAddress, traits::{Deserialize, Serialize}};\n\n #[test]\n fn serialization_of_partial_address() {\n let item = PartialAddress::from_field(1);\n let serialized: [Field; 1] = item.serialize();\n let deserialized = PartialAddress::deserialize(serialized);\n assert_eq(item, deserialized);\n }\n}\n"
|
|
468
468
|
},
|
|
469
|
-
"
|
|
469
|
+
"152": {
|
|
470
470
|
"function_locations": [
|
|
471
471
|
{
|
|
472
472
|
"name": "<impl ToField for SaltedInitializationHash>::to_field",
|
|
@@ -936,7 +936,7 @@
|
|
|
936
936
|
"path": "std/hash/mod.nr",
|
|
937
937
|
"source": "// Exposed only for usage in `std::meta`\npub(crate) mod poseidon2;\n\nuse crate::default::Default;\nuse crate::embedded_curve_ops::{\n EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul, multi_scalar_mul_array_return,\n};\nuse crate::meta::derive_via;\nuse crate::static_assert;\n\n/// The size of the state accepted by the backend in `poseidon2_permutation`.\nglobal POSEIDON2_CONFIG_STATE_SIZE: u32 = poseidon2_config_state_size();\n\n#[foreign(sha256_compression)]\n// docs:start:sha256_compression\npub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8] {}\n// docs:end:sha256_compression\n\n#[foreign(keccakf1600)]\n// docs:start:keccakf1600\npub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {}\n// docs:end:keccakf1600\n\npub mod keccak {\n #[deprecated(\"This function has been moved to std::hash::keccakf1600\")]\n pub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {\n super::keccakf1600(input)\n }\n}\n\n#[foreign(blake2s)]\n// docs:start:blake2s\npub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake2s\n{}\n\n// docs:start:blake3\npub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake3\n{\n if crate::runtime::is_unconstrained() {\n // Temporary measure while Barretenberg is main proving system.\n // Please open an issue if you're working on another proving system and running into problems due to this.\n crate::static_assert(\n N <= 1024,\n \"Barretenberg cannot prove blake3 hashes with inputs larger than 1024 bytes\",\n );\n }\n __blake3(input)\n}\n\n#[foreign(blake3)]\nfn __blake3<let N: u32>(input: [u8; N]) -> [u8; 32] {}\n\n// docs:start:pedersen_commitment\npub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint {\n // docs:end:pedersen_commitment\n pedersen_commitment_with_separator(input, 0)\n}\n\n#[inline_always]\npub fn pedersen_commitment_with_separator<let N: u32>(\n input: [Field; N],\n separator: u32,\n) -> EmbeddedCurvePoint {\n let mut points = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N];\n for i in 0..N {\n points[i] = EmbeddedCurveScalar::from_field(input[i]);\n }\n let generators = derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n multi_scalar_mul(generators, points)\n}\n\n// docs:start:pedersen_hash\npub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field\n// docs:end:pedersen_hash\n{\n pedersen_hash_with_separator(input, 0)\n}\n\n#[no_predicates]\npub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {\n let mut scalars: [EmbeddedCurveScalar; N + 1] = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N + 1];\n let mut generators: [EmbeddedCurvePoint; N + 1] =\n [EmbeddedCurvePoint::point_at_infinity(); N + 1];\n crate::assert_constant(separator);\n let domain_generators: [EmbeddedCurvePoint; N] =\n derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n\n for i in 0..N {\n scalars[i] = EmbeddedCurveScalar::from_field(input[i]);\n generators[i] = domain_generators[i];\n }\n scalars[N] = EmbeddedCurveScalar { lo: N as Field, hi: 0 as Field };\n\n let length_generator: [EmbeddedCurvePoint; 1] =\n derive_generators(\"pedersen_hash_length\".as_bytes(), 0);\n generators[N] = length_generator[0];\n multi_scalar_mul_array_return(generators, scalars, true)[0].x\n}\n\n#[field(bn254)]\n#[inline_always]\npub fn derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {\n crate::assert_constant(domain_separator_bytes);\n crate::assert_constant(starting_index);\n __derive_generators(domain_separator_bytes, starting_index)\n}\n\n#[builtin(derive_pedersen_generators)]\n#[field(bn254)]\nfn __derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {}\n\npub fn poseidon2_permutation<let N: u32>(input: [Field; N]) -> [Field; N] {\n static_assert(\n N == POSEIDON2_CONFIG_STATE_SIZE,\n f\"the input length must equal the state size in the Poseidon2 config; expected {POSEIDON2_CONFIG_STATE_SIZE}, got {N}\",\n );\n poseidon2_permutation_internal(input)\n}\n\n#[foreign(poseidon2_permutation)]\nfn poseidon2_permutation_internal<let N: u32>(input: [Field; N]) -> [Field; N] {}\n\n#[foreign(poseidon2_config_state_size)]\ncomptime fn poseidon2_config_state_size() -> u32 {}\n\n// Generic hashing support.\n// Partially ported and impacted by rust.\n\n// Hash trait shall be implemented per type.\n#[derive_via(derive_hash)]\npub trait Hash {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher;\n}\n\n// docs:start:derive_hash\ncomptime fn derive_hash(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::hash::Hash };\n let signature = quote { fn hash<H>(_self: Self, _state: &mut H) where H: $crate::hash::Hasher };\n let for_each_field = |name| quote { _self.$name.hash(_state); };\n crate::meta::make_trait_impl(\n s,\n name,\n signature,\n for_each_field,\n quote {},\n |fields| fields,\n )\n}\n// docs:end:derive_hash\n\n// Hasher trait shall be implemented by algorithms to provide hash-agnostic means.\n// TODO: consider making the types generic here ([u8], [Field], etc.)\npub trait Hasher {\n fn finish(self) -> Field;\n\n /// Returns the hash value without consuming the hasher.\n /// Override this for more efficient implementations that avoid copying.\n /// TODO: deprecate finish() and replace it\n fn finish_ref(&self) -> Field {\n (*self).finish()\n }\n\n fn write(&mut self, input: Field);\n}\n\n// BuildHasher is a factory trait, responsible for production of specific Hasher.\npub trait BuildHasher {\n type H: Hasher;\n\n fn build_hasher(self) -> H;\n}\n\npub struct BuildHasherDefault<H>;\n\nimpl<H> BuildHasher for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n type H = H;\n\n fn build_hasher(_self: Self) -> H {\n H::default()\n }\n}\n\nimpl<H> Default for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n fn default() -> Self {\n BuildHasherDefault {}\n }\n}\n\nimpl Hash for Field {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self);\n }\n}\n\nimpl Hash for u8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u128 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for i8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u8 as Field);\n }\n}\n\nimpl Hash for i16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u16 as Field);\n }\n}\n\nimpl Hash for i32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u32 as Field);\n }\n}\n\nimpl Hash for i64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u64 as Field);\n }\n}\n\nimpl Hash for bool {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for () {\n fn hash<H>(_self: Self, _state: &mut H)\n where\n H: Hasher,\n {}\n}\n\nimpl<T, let N: u32> Hash for [T; N]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<T> Hash for [T]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.len().hash(state);\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<A> Hash for (A,)\nwhere\n A: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n }\n}\n\nimpl<A, B> Hash for (A, B)\nwhere\n A: Hash,\n B: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n }\n}\n\nimpl<A, B, C> Hash for (A, B, C)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n }\n}\n\nimpl<A, B, C, D> Hash for (A, B, C, D)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n }\n}\n\nimpl<A, B, C, D, E> Hash for (A, B, C, D, E)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F> Hash for (A, B, C, D, E, F)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G> Hash for (A, B, C, D, E, F, G)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_> Hash for (A, B, C, D, E, F, G, H_)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I> Hash for (A, B, C, D, E, F, G, H_, I)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J> Hash for (A, B, C, D, E, F, G, H_, I, J)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J, K> Hash for (A, B, C, D, E, F, G, H_, I, J, K)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n K: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n self.10.hash(state);\n }\n}\n\nimpl<A, B, C, D, E, F, G, H_, I, J, K, L> Hash for (A, B, C, D, E, F, G, H_, I, J, K, L)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n F: Hash,\n G: Hash,\n H_: Hash,\n I: Hash,\n J: Hash,\n K: Hash,\n L: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n self.5.hash(state);\n self.6.hash(state);\n self.7.hash(state);\n self.8.hash(state);\n self.9.hash(state);\n self.10.hash(state);\n self.11.hash(state);\n }\n}\n\n// Some test vectors for Pedersen hash and Pedersen Commitment.\n// They have been generated using the same functions so the tests are for now useless\n// but they will be useful when we switch to Noir implementation.\n#[test]\nfn assert_pedersen() {\n assert_eq(\n pedersen_hash_with_separator([1], 1),\n 0x1b3f4b1a83092a13d8d1a59f7acb62aba15e7002f4440f2275edb99ebbc2305f,\n );\n assert_eq(\n pedersen_commitment_with_separator([1], 1),\n EmbeddedCurvePoint {\n x: 0x054aa86a73cb8a34525e5bbed6e43ba1198e860f5f3950268f71df4591bde402,\n y: 0x209dcfbf2cfb57f9f6046f44d71ac6faf87254afc7407c04eb621a6287cac126,\n },\n );\n\n assert_eq(\n pedersen_hash_with_separator([1, 2], 2),\n 0x26691c129448e9ace0c66d11f0a16d9014a9e8498ee78f4d69f0083168188255,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2], 2),\n EmbeddedCurvePoint {\n x: 0x2e2b3b191e49541fe468ec6877721d445dcaffe41728df0a0eafeb15e87b0753,\n y: 0x2ff4482400ad3a6228be17a2af33e2bcdf41be04795f9782bd96efe7e24f8778,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3], 3),\n 0x0bc694b7a1f8d10d2d8987d07433f26bd616a2d351bc79a3c540d85b6206dbe4,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3], 3),\n EmbeddedCurvePoint {\n x: 0x1fee4e8cf8d2f527caa2684236b07c4b1bad7342c01b0f75e9a877a71827dc85,\n y: 0x2f9fedb9a090697ab69bf04c8bc15f7385b3e4b68c849c1536e5ae15ff138fd1,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4], 4),\n 0xdae10fb32a8408521803905981a2b300d6a35e40e798743e9322b223a5eddc,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4], 4),\n EmbeddedCurvePoint {\n x: 0x07ae3e202811e1fca39c2d81eabe6f79183978e6f12be0d3b8eda095b79bdbc9,\n y: 0x0afc6f892593db6fbba60f2da558517e279e0ae04f95758587760ba193145014,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5], 5),\n 0xfc375b062c4f4f0150f7100dfb8d9b72a6d28582dd9512390b0497cdad9c22,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5], 5),\n EmbeddedCurvePoint {\n x: 0x1754b12bd475a6984a1094b5109eeca9838f4f81ac89c5f0a41dbce53189bb29,\n y: 0x2da030e3cfcdc7ddad80eaf2599df6692cae0717d4e9f7bfbee8d073d5d278f7,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6], 6),\n 0x1696ed13dc2730062a98ac9d8f9de0661bb98829c7582f699d0273b18c86a572,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6], 6),\n EmbeddedCurvePoint {\n x: 0x190f6c0e97ad83e1e28da22a98aae156da083c5a4100e929b77e750d3106a697,\n y: 0x1f4b60f34ef91221a0b49756fa0705da93311a61af73d37a0c458877706616fb,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n 0x128c0ff144fc66b6cb60eeac8a38e23da52992fc427b92397a7dffd71c45ede3,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n EmbeddedCurvePoint {\n x: 0x015441e9d29491b06563fac16fc76abf7a9534c715421d0de85d20dbe2965939,\n y: 0x1d2575b0276f4e9087e6e07c2cb75aa1baafad127af4be5918ef8a2ef2fea8fc,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n 0x2f960e117482044dfc99d12fece2ef6862fba9242be4846c7c9a3e854325a55c,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n EmbeddedCurvePoint {\n x: 0x1657737676968887fceb6dd516382ea13b3a2c557f509811cd86d5d1199bc443,\n y: 0x1f39f0cb569040105fa1e2f156521e8b8e08261e635a2b210bdc94e8d6d65f77,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n 0x0c96db0790602dcb166cc4699e2d306c479a76926b81c2cb2aaa92d249ec7be7,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n EmbeddedCurvePoint {\n x: 0x0a3ceae42d14914a432aa60ec7fded4af7dad7dd4acdbf2908452675ec67e06d,\n y: 0xfc19761eaaf621ad4aec9a8b2e84a4eceffdba78f60f8b9391b0bd9345a2f2,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n 0x2cd37505871bc460a62ea1e63c7fe51149df5d0801302cf1cbc48beb8dff7e94,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n EmbeddedCurvePoint {\n x: 0x2fb3f8b3d41ddde007c8c3c62550f9a9380ee546fcc639ffbb3fd30c8d8de30c,\n y: 0x300783be23c446b11a4c0fabf6c91af148937cea15fcf5fb054abf7f752ee245,\n },\n );\n}\n"
|
|
938
938
|
},
|
|
939
|
-
"
|
|
939
|
+
"170": {
|
|
940
940
|
"function_locations": [
|
|
941
941
|
{
|
|
942
942
|
"name": "DelayedPublicMutableValues<T, INITIAL_DELAY>::new",
|
|
@@ -966,7 +966,7 @@
|
|
|
966
966
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/delayed_public_mutable/delayed_public_mutable_values.nr",
|
|
967
967
|
"source": "use crate::{\n delayed_public_mutable::{\n scheduled_delay_change::ScheduledDelayChange, scheduled_value_change::ScheduledValueChange,\n },\n hash::poseidon2_hash,\n traits::{Hash, Packable},\n utils::arrays,\n};\nuse std::meta::derive;\n\nmod test;\n\n/// DelayedPublicMutableValues is just a wrapper around ScheduledValueChange and ScheduledDelayChange that then allows us\n/// to wrap both of these values in WithHash. WithHash allows for efficient read of values in private.\n///\n/// Note that the WithHash optimization does not work in public (due to there being no unconstrained). But we also want\n/// to be able to read the values efficiently in public and we want to be able to read each value separately. Reading\n/// the values separately is tricky because ScheduledValueChange and ScheduledDelayChange are packed together (sdc and\n/// svc.timestamp_of_change are stored in the same slot). For that reason we expose `unpack_value_change` and\n/// `unpack_delay_change` functions that can be used to extract the values from the packed representation. This\n/// is \"hacky\" but there is no way around it.\n#[derive(Eq)]\npub struct DelayedPublicMutableValues<T, let INITIAL_DELAY: u64> {\n pub svc: ScheduledValueChange<T>,\n pub sdc: ScheduledDelayChange<INITIAL_DELAY>,\n}\n\nimpl<T, let INITIAL_DELAY: u64> DelayedPublicMutableValues<T, INITIAL_DELAY> {\n pub fn new(svc: ScheduledValueChange<T>, sdc: ScheduledDelayChange<INITIAL_DELAY>) -> Self {\n DelayedPublicMutableValues { svc, sdc }\n }\n}\n\n/// Extracts a ScheduledValueChange struct from the packed representation of the full DelayedPublicMutable.\n/// TODO: impl the packable trait for ScheduledValueChange.\npub fn unpack_value_change<T, let M: u32>(packed: [Field; 2 * M + 1]) -> ScheduledValueChange<T>\nwhere\n T: Packable<N = M>,\n{\n let svc_pre_packed = arrays::subarray(packed, 1);\n let svc_post_packed = arrays::subarray(packed, M + 1);\n\n // We first cast to u32 as the timestamp_of_change is packed into the same field as the delay change and it\n // occupies the first 32 bits of the field.\n let timestamp_of_change = (packed[0] as u32) as u64;\n ScheduledValueChange::new(\n T::unpack(svc_pre_packed),\n T::unpack(svc_post_packed),\n timestamp_of_change,\n )\n}\n\n/// Extracts a ScheduledDelayChange struct from 0th field of the packed representation of the full DelayedPublicMutable.\n/// This function expects to be called with just the first field of the packed representation, which contains sdc\n/// and svc timestamp_of_change. We'll discard the svc component.\npub fn unpack_delay_change<let INITIAL_DELAY: u64>(\n packed: Field,\n) -> ScheduledDelayChange<INITIAL_DELAY> {\n // This function expects to be called with just the first field of the packed representation, which contains sdc\n // and svc timestamp_of_change. We'll discard the svc component.\n let svc_timestamp_of_change = packed as u32;\n\n let mut tmp = (packed - svc_timestamp_of_change as Field) / TWO_POW_32;\n let sdc_timestamp_of_change = tmp as u32;\n\n tmp = (tmp - sdc_timestamp_of_change as Field) / TWO_POW_32;\n let sdc_post_is_some = (tmp as u8) % 2 != 0;\n\n tmp = (tmp - sdc_post_is_some as Field) / TWO_POW_8;\n let sdc_post_inner = tmp as u32;\n\n tmp = (tmp - sdc_post_inner as Field) / TWO_POW_32;\n let sdc_pre_is_some = (tmp as u8) % 2 != 0;\n\n tmp = (tmp - sdc_pre_is_some as Field) / TWO_POW_8;\n let sdc_pre_inner = tmp as u32;\n\n // Note that below we cast the values to u64 as that is the default type of timestamp in the system. Us packing\n // the values as u32 is a tech debt that is not worth tackling.\n ScheduledDelayChange {\n pre: if sdc_pre_is_some {\n Option::some(sdc_pre_inner as u64)\n } else {\n Option::none()\n },\n post: if sdc_post_is_some {\n Option::some(sdc_post_inner as u64)\n } else {\n Option::none()\n },\n timestamp_of_change: sdc_timestamp_of_change as u64,\n }\n}\n\n// Q: do these evaluate at comptime or runtime?\nglobal TWO_POW_32: Field = 2.pow_32(32);\nglobal TWO_POW_8: Field = 2.pow_32(8);\n\n// We pack to `2 * N + 1` fields because ScheduledValueChange contains T twice (hence `2 * N`) and we need one extra\n// field to store ScheduledDelayChange and the timestamp_of_change of ScheduledValueChange.\nimpl<T, let INITIAL_DELAY: u64> Packable for DelayedPublicMutableValues<T, INITIAL_DELAY>\nwhere\n T: Packable,\n{\n let N: u32 = 2 * <T as Packable>::N + 1;\n\n fn pack(self) -> [Field; Self::N] {\n let mut result = [0; Self::N];\n\n // We pack sdc.pre, sdc.post, sdc.timestamp_of_change and svc.timestamp_of_change into a single field as follows:\n // [ sdc.pre_inner: u32 | sdc.pre_is_some: u8 | sdc.post_inner: u32 | sdc.post_is_some: u8 | sdc.timestamp_of_change: u32 | svc.timestamp_of_change: u32 ]\n // Note that the code below no longer works after 2106 as by that time the timestamp will overflow u32. This is a tech debt that is not worth tackling.\n result[0] = self.svc.timestamp_of_change as Field\n + ((self.sdc.timestamp_of_change as Field) * 2.pow_32(32))\n + ((self.sdc.post.is_some() as Field) * 2.pow_32(64))\n + ((self.sdc.post.unwrap_unchecked() as Field) * 2.pow_32(72))\n + ((self.sdc.pre.is_some() as Field) * 2.pow_32(104))\n + ((self.sdc.pre.unwrap_unchecked() as Field) * 2.pow_32(112));\n\n // Pack the pre and post values from ScheduledValueChange\n let svc_pre_packed = self.svc.pre.pack();\n let svc_post_packed = self.svc.post.pack();\n for i in 0..<T as Packable>::N {\n result[i + 1] = svc_pre_packed[i];\n result[i + 1 + <T as Packable>::N] = svc_post_packed[i];\n }\n result\n }\n\n // Note: inefficient if all you want to unpack is the svc; use unpack_value_change instead.\n fn unpack(fields: [Field; Self::N]) -> Self {\n let svc = unpack_value_change::<T, _>(fields);\n let sdc = unpack_delay_change::<INITIAL_DELAY>(fields[0]);\n Self::new(svc, sdc)\n }\n}\n\nimpl<T, let INITIAL_DELAY: u64> Hash for DelayedPublicMutableValues<T, INITIAL_DELAY>\nwhere\n T: Packable,\n{\n fn hash(self) -> Field {\n poseidon2_hash(self.pack())\n }\n}\n"
|
|
968
968
|
},
|
|
969
|
-
"
|
|
969
|
+
"173": {
|
|
970
970
|
"function_locations": [
|
|
971
971
|
{
|
|
972
972
|
"name": "ScheduledDelayChange<INITIAL_DELAY>::new",
|
|
@@ -1000,7 +1000,7 @@
|
|
|
1000
1000
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/delayed_public_mutable/scheduled_delay_change.nr",
|
|
1001
1001
|
"source": "use crate::traits::Empty;\nuse std::cmp::min;\n\nmod test;\n\n// This data structure is used by DelayedPublicMutable to store the minimum delay with which a ScheduledValueChange\n// object can schedule a change.\n// This delay is initially equal to INITIAL_DELAY, and can be safely mutated to any other value over time. This mutation\n// is performed via `schedule_change` in order to satisfy ScheduleValueChange constraints: if e.g. we allowed for the\n// delay to be decreased immediately then it'd be possible for the state variable to schedule a value change with a\n// reduced delay, invalidating prior private reads.\npub struct ScheduledDelayChange<let INITIAL_DELAY: u64> {\n // Both pre and post are stored in public storage, so by default they are zeroed. By wrapping them in an Option,\n // they default to Option::none(), which we detect and replace with INITIAL_DELAY. The end result is that a\n // ScheduledDelayChange that has not been initialized has a delay equal to INITIAL_DELAY, which is the desired\n // effect. Once initialized, the Option will never be none again.\n pub(crate) pre: Option<u64>,\n pub(crate) post: Option<u64>,\n // Timestamp at which `post` value is used instead of `pre`\n pub(crate) timestamp_of_change: u64,\n}\n\nimpl<let INITIAL_DELAY: u64> ScheduledDelayChange<INITIAL_DELAY> {\n pub fn new(pre: Option<u64>, post: Option<u64>, timestamp_of_change: u64) -> Self {\n Self { pre, post, timestamp_of_change }\n }\n\n /// Returns the current value of the delay stored in the data structure.\n /// WARNING: This function only returns a meaningful value when called in public with the current timestamp - for\n /// historical private reads use `get_effective_minimum_delay_at` instead.\n pub fn get_current(self, current_timestamp: u64) -> u64 {\n // The post value becomes the current one at the timestamp of change, so any transaction that is included at or\n // after the timestamp of change will use the post value.\n if current_timestamp < self.timestamp_of_change {\n self.pre.unwrap_or(INITIAL_DELAY)\n } else {\n self.post.unwrap_or(INITIAL_DELAY)\n }\n }\n\n /// Returns the scheduled change, i.e. the post-change delay and the timestamp at which it will become the current\n /// delay. Note that this timestamp may be in the past if the change has already taken place.\n /// Additionally, further changes might be later scheduled, potentially canceling the one returned by this function.\n pub fn get_scheduled(self) -> (u64, u64) {\n (self.post.unwrap_or(INITIAL_DELAY), self.timestamp_of_change)\n }\n\n /// Schedules a change to the delay, given the `current_timestamp` and the `current` delay.\n /// This function is only meaningful when called in public with the current timestamp.\n /// The timestamp at which the new delay will become effective is determined automatically:\n /// - when increasing the delay, the change is effective immediately\n /// - when reducing the delay, the change will take effect after a delay equal to the difference between old and\n /// new delay. For example, if reducing from 3 days to 1 day, the reduction will be scheduled to happen after 2\n /// days.\n pub fn schedule_change(&mut self, new: u64, current_timestamp: u64) {\n let current = self.get_current(current_timestamp);\n\n // When changing the delay value we must ensure that it is not possible to produce a value change with a delay\n // shorter than the current one.\n let time_until_delay_change = if new > current {\n // Increasing the delay value can therefore be done immediately: this does not invalidate prior constraints\n // about how quickly a value might be changed (indeed it strengthens them).\n //\n //\n // Earliest `svc.timestamp_of_change`, Earliest `svc.timestamp_of_change`\n // `current_timestamp` if the delay had remained unchanged immediately after this scheduling fn.\n // v v v\n // ====|==========================================================|==============|==>\n // | | |\n // [------------------`current` delay-------------------------] |\n // | |\n // [-------------------------`new` (longer) delay----------------------------]\n // |\n // [] <--- `time_until_delay_change` is `0`; the change is immediate.\n // |\n // ^\n // The newly-calculated `self.timestamp_of_change` (unchanged)\n\n 0\n } else {\n // Decreasing the delay requires waiting for the difference between current and new delay in order to ensure\n // that overall the current delay is respected.\n //\n //\n // Earliest `svc.timestamp_of_change`,\n // if the delay had remained unchanged\n // AND\n // Earliest `svc.timestamp_of_change`,\n // `current_timestamp` immediately after this scheduling fn.\n // ====|============================|=============================|=================>\n // | |\n // [---------------------`current` delay----------------------]\n // | |\n // [- --`new` (shorter) delay----]\n // | ^\n // [-`time_until_delay_change`--] |\n // | |\n // ^ |\n // The newly-calculated |\n // `self.timestamp_of_change` |\n // |\n // The new `self.timestamp_of_change`\n // is calculated so that these ends\n // align.\n current - new\n };\n\n self.pre = Option::some(current);\n self.post = Option::some(new);\n self.timestamp_of_change = current_timestamp + time_until_delay_change;\n }\n\n /// Returns the minimum delay before a value might mutate due to a scheduled change, from the perspective of some\n /// anchor block timestamp. It only returns a meaningful value when called in private with anchor block timestamps.\n /// The output of this function can be passed into `ScheduledValueChange.get_time_horizon` to properly\n /// constrain the `expiration_timestamp` when reading delayed mutable state.\n /// This value typically equals the current delay at the timestamp following the anchor block one (the earliest one\n /// in which a value change could be scheduled), but it also considers scenarios in which a delay reduction is\n /// scheduled to happen in the near future, resulting in a way to schedule a change with an overall delay lower than\n /// the current one.\n ///\n /// Alternative explanation: returns the maximum amount of time (from the anchor block timestamp) that a state read\n /// (as at the anchor block timestamp) will remain valid.\n /// A read might end up being valid for less time in the case where a `svc.timestamp_of_change` has already been\n /// set and if it's sooner than the output of this function. In that case, the `scheduled_value_change.nr`'s\n /// `get_time_horizon` function will realize this.\n ///\n pub fn get_effective_minimum_delay_at(self, anchor_block_timestamp: u64) -> u64 {\n // If a change is scheduled, then the effective delay might be lower than the current one (pre). At the\n // timestamp of change the current delay will be the scheduled one, with an overall delay from the anchor block\n // timestamp equal to the time until the change plus the new delay. If this value is lower\n // than the current delay, then that is the effective minimum delay.\n\n // If using some block as the anchor block of some tx, then note that if you\n // read a `delayed_mutable` from that anchor block, you're actually reading the\n // `delayed_mutable` _as at the very end_ of that block.\n // Therefore the `delayed_mutable` that you will read _as at the very start of the next\n // block_ will be _the very same_ `delayed_mutable` (nothing can possibly have changed).\n // Therefore the first opportunity to schedule a value change (from the anchor block timestamp)\n // is the first tx of a subsequent block. Blocks within the same checkpoint can share\n // timestamps, so the earliest scheduling timestamp can equal the anchor block timestamp.\n // So should you choose to go ahead and schedule a value change in a subsequent block,\n // it will only take effect after the \"current\" delay (as dictated by the\n // `delayed_mutable` of that tx, which is the same as the `delayed_mutable` as at the\n // anchor block timestamp).\n // In all, the time between the anchor block's timestamp and the earliest-possible value\n // timestamp_of_change, is therefore: the \"current\" delay (as at the time of the anchor\n // timestamp).\n // Reads must only be valid until _just before_ the earliest-possible value change --\n // i.e. 1 second before the earliest-possible value change.\n // That is, reads are only valid for the \"current\" delay (as at the time of the anchor\n // block timestamp) _at most_.\n //\n // ____________ ____________\n // | | | |\n // | Block |<-- 0 or more seconds gap -->| Block |\n // |____________| |____________|\n // ^ ^\n // | You can schedule a value change from here.\n // |\n // Suppose this is your anchor block.\n // The delayed_mutable (and hence the \"current\" delay) as at the end of this block will\n // be the same as at the start of the next block.\n //\n if self.timestamp_of_change <= anchor_block_timestamp {\n //\n // `self.timestamp_of_change` <= `anchor_block_timestamp`\n // v v\n // ===================|==============================|=========\n // ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n // `self.pre` is |`self.post` takes effect from here.\n // effective before. |\n //\n // So in this `if` case, `self.post` is in effect at the time of the `anchor_block_timestamp`.\n //\n // If no delay changes are scheduled (as at the time of the anchor timestamp), then the \"current delay\" (as\n // at the time of the anchor block timestamp) is `self.post - 1` (or the `INITIAL_DELAY - 1` if never set).\n self.post.unwrap_or(INITIAL_DELAY) - 1\n } else {\n //\n // `anchor_block_timestamp` < `self.timestamp_of_change`\n // v\n // ===================|======================|====================================\n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n // `self.pre` is effective |`self.post` takes effect from here.\n // during this period. |\n //\n //\n // So in this `else` case, `self.pre` is in effect at the time of the `anchor_block_timestamp`.\n //\n //\n //\n // If a delay change _is_ already scheduled (as at the time of the anchor block timestamp):\n // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n // |________________\n // |\n // v Earliest possible\n // `anchor_block_ Scheduled delay change: `svc.timestamp_of_change`\n // timestamp` < `self.timestamp_of_change` (if not already set [^1])\n // v v v\n // ===|==============================|====================================|================>\n // | . .\n // | . .\n // |__ Earliest possible timestamp at which a .\n // . function could call `schedule_change` for a new .\n // . _value_ change.................................................| And the earliest timestamp at\n // . . . which the new value would take effect,\n // . . . as dictated by `self.pre`.\n // . . .\n // [---------------`self.pre` delay------------------------------------]\n // . . .\n // . . .\n // . . .\n // . . .\n // ********************************************************************.\n // * *.\n // [----------------`self.pre - 1`------------------------------------].\n // * *.\n // * If reading a _value_ at that (<--) anchor timestamp, then the *.\n // * read will remain valid for this duration, unless a shorter *.\n // * delay has been scheduled (see just below in this diagram). *.\n // * See the `min` calc in the code below. *.\n // * *.\n // * Future enhancement, recorded here so we don't have to *.\n // * re-remember it: *.\n // * If a _deferred, longer_ delay has been scheduled (not yet *.\n // * possible), it might yet still be cancelled, in which case this *.\n // * `pre - 1` delay would also bite (meaning reads would remain *.\n // * valid for this duration). *.\n // * *.\n // ********************************************************************.\n // . . .\n // . . .\n // . . .\n // . . .\n // [---`time_until_delay_change`--] .\n // . . .\n // . . .\n // . . .\n // SCENARIO 1: an already-scheduled delay is shorter than the `self.pre` delay:\n // . . .\n // . . .\n // . [-`self.post` delay-] .\n // . . (if shorter ^^ .\n // . . than `pre`) ||_ new values can take effect from here.\n // . . |\n // . . |_ reads are only valid until here:\n // . . . `anchor_block_timestamp + time_until_delay_change + self.post - 1`\n // . . . .\n // *************************************************** .\n // * * .\n // [----`time_until_delay_change + self.post - 1`----] .\n // * * .\n // * If reading a _value_ at that (<--) anchor * .\n // * timestamp, then the read will remain valid * .\n // * for this duration: * .\n // * * .\n // *************************************************** .\n // . . .\n // . . .\n // . . .\n // . . .\n // SCENARIO 2: an already-scheduled delay is longer than the `self.pre` delay, AND is deferred:\n // (note: scheduling deferred delay changes is not yet possible)\n // . . .\n // . . .\n // . . .\n // . [-`self.post` delay (if longer than `pre` & deferred)------------------]\n // . . (scheduling deferred delay changes is not yet possible) ^^\n // . . ||\n // . . reads would only be valid until here:___________________________||\n // . . `anchor_block_timestamp + time_until_delay_change + self.post - 1` |\n // . . |\n // . . new values would take effect from here,_______|\n // . . but only once this longer delay takes effect .\n // . . . .\n // . . . .\n // . . . .\n // ******************************************************************************************************.\n // * *.\n // [----`time_until_delay_change + self.post - 1`-------------------------------------------------------].\n // * *.\n // * Given a longer, deferred delay, then if reading a _value_ at that (<--) anchor block timestamp, then *.\n // * you might think the read would remain valid for this duration. *.\n // * BUT, in this case of this deferred, longer-than-`self.pre` delay, the `pre` delay ends sooner (by *.\n // * construction) (see above in this diagram). *.\n // * And since this scheduled delay (`post`) can be cancelled up until the time it takes effect, *.\n // * any reads as at that (<--) anchor block timestamp would cautiously only be valid until the earlier *.\n // * `pre` delay expiry. *.\n // * *.\n // ******************************************************************************************************.\n //\n //\n //\n // [^1] If a svc.timestamp_of_change has already been set, and if it's sooner than the\n // output of this function, then it will bite within `scheduled_value_change.nr`'s\n // `get_time_horizon` function.\n let time_until_delay_change = self.timestamp_of_change - anchor_block_timestamp;\n\n let time_until_next_delay_change = min(\n self.pre.unwrap_or(INITIAL_DELAY), // in case the scheduled delay (`post`) gets cancelled before it takes effect.\n time_until_delay_change + self.post.unwrap_or(INITIAL_DELAY),\n );\n\n // The effective minimum delay equals the minimum time until a value change, minus 1, since reads are\n // valid only up to (but not including) the moment the value can change.\n time_until_next_delay_change - 1\n }\n }\n}\n\nimpl<let INITIAL_DELAY: u64> Eq for ScheduledDelayChange<INITIAL_DELAY> {\n fn eq(self, other: Self) -> bool {\n (self.pre == other.pre)\n & (self.post == other.post)\n & (self.timestamp_of_change == other.timestamp_of_change)\n }\n}\n\nimpl<let INITIAL_DELAY: u64> Empty for ScheduledDelayChange<INITIAL_DELAY> {\n fn empty() -> Self {\n Self { pre: Option::none(), post: Option::none(), timestamp_of_change: 0 }\n }\n}\n"
|
|
1002
1002
|
},
|
|
1003
|
-
"
|
|
1003
|
+
"175": {
|
|
1004
1004
|
"function_locations": [
|
|
1005
1005
|
{
|
|
1006
1006
|
"name": "ScheduledValueChange<T>::new",
|
|
@@ -1038,7 +1038,7 @@
|
|
|
1038
1038
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/delayed_public_mutable/scheduled_value_change.nr",
|
|
1039
1039
|
"source": "use crate::traits::Empty;\nuse std::cmp::min;\n\nmod test;\n\n// This data structure is used by DelayedPublicMutable to represent a value that changes from `pre` to `post` at some timestamp\n// called the `timestamp_of_change`. The value can only be made to change by scheduling a change event at some future\n// timestamp after some minimum delay measured in seconds has elapsed. This means that at any given timestamp we know\n// both the current value and the smallest timestamp at which the value might change - this is called the\n// 'time horizon'.\npub struct ScheduledValueChange<T> {\n pub(crate) pre: T,\n pub(crate) post: T,\n // Timestamp at which `post` value is used instead of `pre`\n pub(crate) timestamp_of_change: u64,\n}\n\nimpl<T> ScheduledValueChange<T> {\n pub fn new(pre: T, post: T, timestamp_of_change: u64) -> Self {\n Self { pre, post, timestamp_of_change }\n }\n\n /// Returns the value stored in the data structure at a given timestamp. This function can be called both in public\n /// (where `timestamp` is simply the current timestamp, i.e. the timestamp at which the current transaction will be\n /// included) and in private (where `timestamp` is the anchor block's timestamp). Reading in private is only safe\n /// if the transaction's `expiration_timestamp` property is set to a value lower or equal to the time horizon (see\n /// `get_time_horizon()`).\n pub fn get_current_at(self, timestamp: u64) -> T {\n // The post value becomes the current one at the timestamp of change. This means different things in each realm:\n // - in public, any transaction that is included at the timestamp of change will use the post value\n // - in private, any transaction that includes the timestamp of change as part of the historical state will use\n // the post value (barring any follow-up changes)\n if timestamp < self.timestamp_of_change {\n self.pre\n } else {\n self.post\n }\n }\n\n /// Returns the scheduled change, i.e. the post-change value and the timestamp at which it will become the current\n /// value. Note that this timestamp may be in the past if the change has already taken place.\n /// Additionally, further changes might be later scheduled, potentially canceling the one returned by this function.\n pub fn get_scheduled(self) -> (T, u64) {\n (self.post, self.timestamp_of_change)\n }\n\n // Returns the previous value. This is the value that is current up until the timestamp of change. Note that this\n // value might not be the current anymore since timestamp of change might have already passed.\n pub fn get_previous(self) -> (T, u64) {\n (self.pre, self.timestamp_of_change)\n }\n\n /// Returns the largest timestamp at which the value returned by `get_current_at` is known to remain the current\n /// value. This value is only meaningful in private where the proof is constructed against an anchor block, since\n /// due to its asynchronous nature private execution cannot know about any later scheduled changes.\n /// The caller of this function must know how quickly the value can change due to a scheduled change in the form of\n /// `minimum_delay`. If the delay itself is immutable, then this is just its duration. If the delay is mutable\n /// however, then this value is the 'effective minimum delay' (obtained by calling\n /// `ScheduledDelayChange.get_effective_minimum_delay_at`), which equals the minimum time in seconds that needs to\n /// elapse from the next block's timestamp until the value changes, regardless of further delay changes.\n /// The value returned by `get_current_at` in private when called with a anchor block's timestamp is only safe to use\n /// if the transaction's `expiration_timestamp` property is set to a value lower or equal to the time horizon\n /// computed using the same anchor timestamp.\n pub fn get_time_horizon(self, anchor_block_timestamp: u64, minimum_delay: u64) -> u64 {\n // The time horizon is the very last timestamp in which the current value is known. Any timestamp past the\n // horizon (i.e. with a timestamp larger than the time horizon) may have a different current value.\n // Reading the current value in private typically requires constraining the maximum valid timestamp to be equal\n // to the time horizon.\n if anchor_block_timestamp >= self.timestamp_of_change {\n // Once the timestamp of change has passed (block with timestamp >= timestamp_of_change was mined),\n // the current value (post) will not change unless a new value change is scheduled. This did not happen at\n // the anchor timestamp (or else it would not be greater or equal to the timestamp of change), and\n // therefore could only happen after the anchor timestamp. The earliest would be the immediate next\n // timestamp, and so the smallest possible next timestamp of change equals `anchor_block_timestamp + 1 +\n // minimum_delay`. Our time horizon is simply the previous timestamp to that one.\n //\n // timestamp of anchor\n // change timestamp time horizon\n // =======|=============N===================H===========>\n // ^ ^\n // ---------------------\n // minimum delay\n anchor_block_timestamp + minimum_delay\n } else {\n // If the timestamp of change has not yet been reached however, then there are two possible scenarios.\n // a) It could be so far into the future that the time horizon is actually determined by the minimum\n // delay, because a new change could be scheduled and take place _before_ the currently scheduled one.\n // This is similar to the scenario where the timestamp of change is in the past: the time horizon is\n // the timestamp prior to the earliest one in which a new timestamp of change might land.\n //\n // anchor\n // timestamp time horizon timestamp of change\n // =====N=================================H=================|=========>\n // ^ ^\n // | |\n // -----------------------------------\n // minimum delay\n //\n // b) It could be fewer than `minimum_delay` seconds away from the anchor timestamp, in which case\n // the timestamp of change would become the limiting factor for the time horizon, which would equal\n // the timestamp right before the timestamp of change (since by definition the value changes at the\n // timestamp of change).\n //\n // anchor time horizon\n // timestamp timestamp of change if not scheduled\n // =======N=============|===================H=================>\n // ^ ^ ^\n // | actual horizon |\n // -----------------------------------\n // minimum delay\n //\n // Note that the current implementation does not allow the caller to set the timestamp of change to an\n // arbitrary value, and therefore scenario a) is not currently possible. However implementing #5501 would\n // allow for this to happen.\n // Because anchor_block_timestamp < self.timestamp_of_change, then timestamp_of_change > 0 and we can safely\n // subtract 1.\n min(\n anchor_block_timestamp + minimum_delay,\n self.timestamp_of_change - 1,\n )\n }\n }\n\n /// Mutates the value by scheduling a change at the current timestamp. This function is only meaningful when\n /// called in public with the current timestamp.\n pub fn schedule_change(\n &mut self,\n new_value: T,\n current_timestamp: u64,\n minimum_delay: u64,\n timestamp_of_change: u64,\n ) {\n assert(timestamp_of_change >= current_timestamp + minimum_delay);\n\n self.pre = self.get_current_at(current_timestamp);\n self.post = new_value;\n self.timestamp_of_change = timestamp_of_change;\n }\n}\n\nimpl<T> Eq for ScheduledValueChange<T>\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n (self.pre == other.pre)\n & (self.post == other.post)\n & (self.timestamp_of_change == other.timestamp_of_change)\n }\n}\n\nimpl<T> Empty for ScheduledValueChange<T>\nwhere\n T: Empty,\n{\n fn empty() -> Self {\n Self { pre: T::empty(), post: T::empty(), timestamp_of_change: 0 }\n }\n}\n"
|
|
1040
1040
|
},
|
|
1041
|
-
"
|
|
1041
|
+
"178": {
|
|
1042
1042
|
"function_locations": [
|
|
1043
1043
|
{
|
|
1044
1044
|
"name": "sha256_to_field",
|
|
@@ -1160,7 +1160,7 @@
|
|
|
1160
1160
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr",
|
|
1161
1161
|
"source": "mod poseidon2_chunks;\n\nuse crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n function_selector::FunctionSelector, nullifier::Nullifier, private_log::PrivateLog,\n transaction::tx_request::TxRequest,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, DOM_SEP__NOTE_HASH_NONCE,\n DOM_SEP__PRIVATE_LOG_FIRST_FIELD, DOM_SEP__SILOED_NOTE_HASH, DOM_SEP__SILOED_NULLIFIER,\n DOM_SEP__UNIQUE_NOTE_HASH, FUNCTION_TREE_HEIGHT, NULL_MSG_SENDER_CONTRACT_ADDRESS,\n TWO_POW_64,\n },\n merkle_tree::root_from_sibling_path,\n messaging::l2_to_l1_message::L2ToL1Message,\n poseidon2::Poseidon2Sponge,\n side_effect::{Counted, Scoped},\n traits::{FromField, Hash, ToField},\n utils::field::{field_from_bytes, field_from_bytes_32_trunc},\n};\n\npub use poseidon2_chunks::poseidon2_absorb_in_chunks_existing_sponge;\nuse poseidon2_chunks::poseidon2_absorb_in_chunks;\nuse std::embedded_curve_ops::EmbeddedCurveScalar;\n\n// TODO: refactor these into their own files: sha256, poseidon2, some protocol-specific hash computations, some merkle computations.\n\npub fn sha256_to_field<let N: u32>(bytes_to_hash: [u8; N]) -> Field {\n let sha256_hashed = sha256::digest(bytes_to_hash);\n let hash_in_a_field = field_from_bytes_32_trunc(sha256_hashed);\n\n hash_in_a_field\n}\n\npub fn private_functions_root_from_siblings(\n selector: FunctionSelector,\n vk_hash: Field,\n function_leaf_index: Field,\n function_leaf_sibling_path: [Field; FUNCTION_TREE_HEIGHT],\n) -> Field {\n let function_leaf_preimage = ContractClassFunctionLeafPreimage { selector, vk_hash };\n let function_leaf = function_leaf_preimage.hash();\n root_from_sibling_path(\n function_leaf,\n function_leaf_index,\n function_leaf_sibling_path,\n )\n}\n\n/// Siloing in the context of Aztec refers to the process of hashing a note hash with a contract address (this way\n/// the note hash is scoped to a specific contract). This is used to prevent intermingling of notes between contracts.\npub fn compute_siloed_note_hash(contract_address: AztecAddress, note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), note_hash],\n DOM_SEP__SILOED_NOTE_HASH,\n )\n}\n\n/// Computes unique, siloed note hashes from siloed note hashes.\n///\n/// The protocol injects uniqueness into every note_hash, so that every single note_hash in the\n/// tree is unique. This prevents faerie gold attacks, where a malicious sender could create\n/// two identical note_hashes for a recipient (meaning only one would be nullifiable in future).\n///\n/// Most privacy protocols will inject the note's leaf_index (its position in the Note Hashes Tree)\n/// into the note, but this requires the creator of a note to wait until their tx is included in\n/// a block to know the note's final note hash (the unique, siloed note hash), because inserting\n/// leaves into trees is the job of a block producer.\n///\n/// We took a different approach so that the creator of a note will know each note's unique, siloed\n/// note hash before broadcasting their tx to the network.\n/// (There was also a historical requirement relating to \"chained transactions\" -- a feature that\n/// Aztec Connect had to enable notes to be spent from distinct txs earlier in the same block,\n/// and hence before an archive block root had been established for that block -- but that feature\n/// was abandoned for the Aztec Network for having too many bad tradeoffs).\n///\n/// (\n/// Edit: it is no longer true that all final note_hashes will be known by the creator of a tx\n/// before they send it to the network. If a tx makes public function calls, then _revertible_\n/// note_hashes that are created in private will not be made unique in private by the Reset circuit,\n/// but will instead be made unique by the AVM, because the `note_index_in_tx` will not be known\n/// until the AVM has executed the public functions of the tx. (See an explanation in\n/// reset_output_composer.nr for why).\n/// For some such txs, the `note_index_in_tx` might still be predictable through simulation, but\n/// for txs whose public functions create a varying number of non-revertible notes (determined at\n/// runtime), the `note_index_in_tx` will not be deterministically derivable before submitting the\n/// tx to the network.\n/// )\n///\n/// We use the `first_nullifier` of a tx as a seed of uniqueness. We have a guarantee that there will\n/// always be at least one nullifier per tx, because the init circuit will create one if one isn't\n/// created naturally by any functions of the tx. (Search \"protocol_nullifier\").\n/// We combine the `first_nullifier` with the note's index (its position within this tx's new\n/// note_hashes array) (`note_index_in_tx`) to get a truly unique value to inject into a note, which\n/// we call a `note_nonce`.\npub fn compute_unique_note_hash(note_nonce: Field, siloed_note_hash: Field) -> Field {\n let inputs = [note_nonce, siloed_note_hash];\n poseidon2_hash_with_separator(inputs, DOM_SEP__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_note_hash_nonce(first_nullifier_in_tx: Field, note_index_in_tx: u32) -> Field {\n // Hashing the first nullifier with note index in tx is guaranteed to be unique (because all nullifiers are also\n // unique).\n poseidon2_hash_with_separator(\n [first_nullifier_in_tx, note_index_in_tx as Field],\n DOM_SEP__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_note_nonce_and_unique_note_hash(\n siloed_note_hash: Field,\n first_nullifier: Field,\n note_index_in_tx: u32,\n) -> Field {\n let note_nonce = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n compute_unique_note_hash(note_nonce, siloed_note_hash)\n}\n\npub fn compute_siloed_nullifier(contract_address: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), nullifier],\n DOM_SEP__SILOED_NULLIFIER,\n )\n}\n\npub fn create_protocol_nullifier(tx_request: TxRequest) -> Scoped<Counted<Nullifier>> {\n // The protocol nullifier is ascribed a special side-effect counter of 1. No other side-effect\n // can have counter 1 (see `validate_as_first_call` for that assertion).\n Nullifier { value: tx_request.hash(), note_hash: 0 }.count(1).scope(\n NULL_MSG_SENDER_CONTRACT_ADDRESS,\n )\n}\n\npub fn compute_log_tag(raw_tag: Field, dom_sep: u32) -> Field {\n poseidon2_hash_with_separator([raw_tag], dom_sep)\n}\n\npub fn compute_siloed_private_log_first_field(\n contract_address: AztecAddress,\n field: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [contract_address.to_field(), field],\n DOM_SEP__PRIVATE_LOG_FIRST_FIELD,\n )\n}\n\npub fn compute_siloed_private_log(contract_address: AztecAddress, log: PrivateLog) -> PrivateLog {\n let mut fields = log.fields;\n fields[0] = compute_siloed_private_log_first_field(contract_address, fields[0]);\n PrivateLog::new(fields, log.length)\n}\n\npub fn compute_contract_class_log_hash(log: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS]) -> Field {\n poseidon2_hash(log)\n}\n\npub fn compute_app_siloed_secret_key(\n master_secret_key: EmbeddedCurveScalar,\n app_address: AztecAddress,\n key_type_domain_separator: Field,\n) -> Field {\n poseidon2_hash_with_separator(\n [master_secret_key.hi, master_secret_key.lo, app_address.to_field()],\n key_type_domain_separator,\n )\n}\n\npub fn compute_l2_to_l1_message_hash(\n message: Scoped<L2ToL1Message>,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let contract_address_bytes: [u8; 32] = message.contract_address.to_field().to_be_bytes();\n let recipient_bytes: [u8; 20] = message.inner.recipient.to_be_bytes();\n let content_bytes: [u8; 32] = message.inner.content.to_be_bytes();\n let rollup_version_id_bytes: [u8; 32] = rollup_version_id.to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n\n let mut bytes: [u8; 148] = std::mem::zeroed();\n for i in 0..32 {\n bytes[i] = contract_address_bytes[i];\n bytes[i + 32] = rollup_version_id_bytes[i];\n // 64 - 84 are for recipient.\n bytes[i + 84] = chain_id_bytes[i];\n bytes[i + 116] = content_bytes[i];\n }\n\n for i in 0..20 {\n bytes[64 + i] = recipient_bytes[i];\n }\n\n sha256_to_field(bytes)\n}\n\n// TODO: consider a variant that enables domain separation with a u32 (we seem to have standardised u32s for domain separators)\n/// Computes sha256 hash of 2 input fields.\n///\n/// @returns A truncated field (i.e., the first byte is always 0).\npub fn accumulate_sha256(v0: Field, v1: Field) -> Field {\n // Concatenate two fields into 32 x 2 = 64 bytes\n let v0_as_bytes: [u8; 32] = v0.to_be_bytes();\n let v1_as_bytes: [u8; 32] = v1.to_be_bytes();\n let hash_input_flattened = v0_as_bytes.concat(v1_as_bytes);\n\n sha256_to_field(hash_input_flattened)\n}\n\npub fn poseidon2_hash<let N: u32>(inputs: [Field; N]) -> Field {\n poseidon::poseidon2::Poseidon2::hash(inputs, N)\n}\n\n#[no_predicates]\npub fn poseidon2_hash_with_separator<let N: u32, T>(inputs: [Field; N], separator: T) -> Field\nwhere\n T: ToField,\n{\n let inputs_with_separator = [separator.to_field()].concat(inputs);\n poseidon2_hash(inputs_with_separator)\n}\n\n/// Computes a Poseidon2 hash over a dynamic-length subarray of the given input.\n/// Only the first `in_len` fields of `input` are absorbed; any remaining fields are ignored.\n/// The caller is responsible for ensuring that the input is padded with zeros if required.\n#[no_predicates]\npub fn poseidon2_hash_subarray<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let mut sponge = poseidon2_absorb_in_chunks(input, in_len);\n sponge.squeeze()\n}\n\n// This function is unconstrained because it is intended to be used in unconstrained context only as\n// in constrained contexts it would be too inefficient.\npub unconstrained fn poseidon2_hash_with_separator_bounded_vec<let N: u32, T>(\n inputs: BoundedVec<Field, N>,\n separator: T,\n) -> Field\nwhere\n T: ToField,\n{\n let in_len = inputs.len() + 1;\n let iv: Field = (in_len as Field) * TWO_POW_64;\n let mut sponge = Poseidon2Sponge::new(iv);\n sponge.absorb(separator.to_field());\n\n for i in 0..inputs.len() {\n sponge.absorb(inputs.get(i));\n }\n\n sponge.squeeze()\n}\n\n#[no_predicates]\npub fn poseidon2_hash_bytes<let N: u32>(inputs: [u8; N]) -> Field {\n let mut fields = [0; (N + 30) / 31];\n let mut field_index = 0;\n let mut current_field = [0; 31];\n for i in 0..inputs.len() {\n let index = i % 31;\n current_field[index] = inputs[i];\n if index == 30 {\n fields[field_index] = field_from_bytes(current_field, false);\n current_field = [0; 31];\n field_index += 1;\n }\n }\n if field_index != fields.len() {\n fields[field_index] = field_from_bytes(current_field, false);\n }\n poseidon2_hash(fields)\n}\n\n#[test]\nfn subarray_hash_matches_fixed() {\n let values_to_hash = [3; 17];\n let padded = values_to_hash.concat([0; 11]);\n let subarray_hash = poseidon2_hash_subarray(padded, values_to_hash.len());\n\n // Hash the entire values_to_hash.\n let fixed_len_hash = poseidon::poseidon2::Poseidon2::hash(values_to_hash, values_to_hash.len());\n\n assert_eq(subarray_hash, fixed_len_hash);\n}\n\n#[test]\nfn subarray_hash_matches_variable() {\n let values_to_hash = [3; 17];\n let padded = values_to_hash.concat([0; 11]);\n let subarray_hash = poseidon2_hash_subarray(padded, values_to_hash.len());\n\n // Hash up to values_to_hash.len() fields of the padded array.\n let variable_len_hash = poseidon::poseidon2::Poseidon2::hash(padded, values_to_hash.len());\n\n assert_eq(subarray_hash, variable_len_hash);\n}\n\n#[test]\nfn smoke_sha256_to_field() {\n let full_buffer = [\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,\n 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,\n 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,\n 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,\n 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,\n 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,\n ];\n let result = sha256_to_field(full_buffer);\n\n assert(result == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184c7);\n\n // to show correctness of the current ver (truncate one byte) vs old ver (mod full bytes):\n let result_bytes = sha256::digest(full_buffer);\n let truncated_field = crate::utils::field::field_from_bytes_32_trunc(result_bytes);\n assert(truncated_field == result);\n let mod_res = result + (result_bytes[31] as Field);\n assert(mod_res == 0x448ebbc9e1a31220a2f3830c18eef61b9bd070e5084b7fa2a359fe729184e0);\n}\n\n#[test]\nfn unique_siloed_note_hash_matches_typescript() {\n let inner_note_hash = 1;\n let contract_address = AztecAddress::from_field(2);\n let first_nullifier = 3;\n let note_index_in_tx = 4;\n\n let siloed_note_hash = compute_siloed_note_hash(contract_address, inner_note_hash);\n let siloed_note_hash_from_ts =\n 0x1986a4bea3eddb1fff917d629a13e10f63f514f401bdd61838c6b475db949169;\n assert_eq(siloed_note_hash, siloed_note_hash_from_ts);\n\n let nonce: Field = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n let note_hash_nonce_from_ts =\n 0x28e7799791bf066a57bb51fdd0fbcaf3f0926414314c7db515ea343f44f5d58b;\n assert_eq(nonce, note_hash_nonce_from_ts);\n\n let unique_siloed_note_hash_from_nonce = compute_unique_note_hash(nonce, siloed_note_hash);\n let unique_siloed_note_hash = compute_note_nonce_and_unique_note_hash(\n siloed_note_hash,\n first_nullifier,\n note_index_in_tx,\n );\n assert_eq(unique_siloed_note_hash_from_nonce, unique_siloed_note_hash);\n\n let unique_siloed_note_hash_from_ts =\n 0x29949aef207b715303b24639737c17fbfeb375c1d965ecfa85c7e4f0febb7d16;\n assert_eq(unique_siloed_note_hash, unique_siloed_note_hash_from_ts);\n}\n\n#[test]\nfn siloed_nullifier_matches_typescript() {\n let contract_address = AztecAddress::from_field(123);\n let nullifier = 456;\n\n let res = compute_siloed_nullifier(contract_address, nullifier);\n\n let siloed_nullifier_from_ts =\n 0x169b50336c1f29afdb8a03d955a81e485f5ac7d5f0b8065673d1e407e5877813;\n\n assert_eq(res, siloed_nullifier_from_ts);\n}\n\n#[test]\nfn siloed_private_log_first_field_matches_typescript() {\n let contract_address = AztecAddress::from_field(123);\n let field = 456;\n let res = compute_siloed_private_log_first_field(contract_address, field);\n\n let siloed_private_log_first_field_from_ts =\n 0x29480984f7b9257fded523d50addbcfc8d1d33adcf2db73ef3390a8fd5cdffaa;\n\n assert_eq(res, siloed_private_log_first_field_from_ts);\n}\n\n#[test]\nfn empty_l2_to_l1_message_hash_matches_typescript() {\n // All zeroes\n let res = compute_l2_to_l1_message_hash(\n L2ToL1Message { recipient: EthAddress::zero(), content: 0 }.scope(AztecAddress::from_field(\n 0,\n )),\n 0,\n 0,\n );\n\n let empty_l2_to_l1_msg_hash_from_ts =\n 0x003b18c58c739716e76429634a61375c45b3b5cd470c22ab6d3e14cee23dd992;\n\n assert_eq(res, empty_l2_to_l1_msg_hash_from_ts);\n}\n\n#[test]\nfn l2_to_l1_message_hash_matches_typescript() {\n let message = L2ToL1Message { recipient: EthAddress::from_field(1), content: 2 }.scope(\n AztecAddress::from_field(3),\n );\n let version = 4;\n let chainId = 5;\n\n let hash = compute_l2_to_l1_message_hash(message, version, chainId);\n\n // The following value was generated by `yarn-project/stdlib/src/hash/hash.test.ts`\n let l2_to_l1_message_hash_from_ts =\n 0x0081edf209e087ad31b3fd24263698723d57190bd1d6e9fe056fc0c0a68ee661;\n\n assert_eq(hash, l2_to_l1_message_hash_from_ts);\n}\n\n#[test]\nunconstrained fn poseidon2_hash_with_separator_bounded_vec_matches_non_bounded_vec_version() {\n let inputs = BoundedVec::<Field, 4>::from_array([1, 2, 3]);\n let separator = 42;\n\n // Hash using bounded vec version\n let bounded_result = poseidon2_hash_with_separator_bounded_vec(inputs, separator);\n\n // Hash using regular version\n let regular_result = poseidon2_hash_with_separator([1, 2, 3], separator);\n\n // Results should match\n assert_eq(bounded_result, regular_result);\n}\n"
|
|
1162
1162
|
},
|
|
1163
|
-
"
|
|
1163
|
+
"180": {
|
|
1164
1164
|
"function_locations": [
|
|
1165
1165
|
{
|
|
1166
1166
|
"name": "fatal_log",
|
|
@@ -1234,7 +1234,7 @@
|
|
|
1234
1234
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/logging.nr",
|
|
1235
1235
|
"source": "// Log levels matching the JS logger:\n\n// global SILENT_LOG_LEVEL: u8 = 0;\nglobal FATAL_LOG_LEVEL: u8 = 1;\nglobal ERROR_LOG_LEVEL: u8 = 2;\nglobal WARN_LOG_LEVEL: u8 = 3;\nglobal INFO_LOG_LEVEL: u8 = 4;\nglobal VERBOSE_LOG_LEVEL: u8 = 5;\nglobal DEBUG_LOG_LEVEL: u8 = 6;\nglobal TRACE_LOG_LEVEL: u8 = 7;\n\n// --- Per-level log functions (no format args) ---\n\npub fn fatal_log<let N: u32>(msg: str<N>) {\n fatal_log_format(msg, []);\n}\n\npub fn error_log<let N: u32>(msg: str<N>) {\n error_log_format(msg, []);\n}\n\npub fn warn_log<let N: u32>(msg: str<N>) {\n warn_log_format(msg, []);\n}\n\npub fn info_log<let N: u32>(msg: str<N>) {\n info_log_format(msg, []);\n}\n\npub fn verbose_log<let N: u32>(msg: str<N>) {\n verbose_log_format(msg, []);\n}\n\npub fn debug_log<let N: u32>(msg: str<N>) {\n debug_log_format(msg, []);\n}\n\npub fn trace_log<let N: u32>(msg: str<N>) {\n trace_log_format(msg, []);\n}\n\n// --- Per-level log functions (with format args) ---\n\npub fn fatal_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(FATAL_LOG_LEVEL, msg, args);\n}\n\npub fn error_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(ERROR_LOG_LEVEL, msg, args);\n}\n\npub fn warn_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(WARN_LOG_LEVEL, msg, args);\n}\n\npub fn info_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(INFO_LOG_LEVEL, msg, args);\n}\n\npub fn verbose_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(VERBOSE_LOG_LEVEL, msg, args);\n}\n\npub fn debug_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(DEBUG_LOG_LEVEL, msg, args);\n}\n\npub fn trace_log_format<let M: u32, let N: u32>(msg: str<M>, args: [Field; N]) {\n log_format(TRACE_LOG_LEVEL, msg, args);\n}\n\nfn log_format<let M: u32, let N: u32>(log_level: u8, msg: str<M>, args: [Field; N]) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe\n // to call.\n unsafe { log_oracle_wrapper(log_level, msg, args) };\n}\n\nunconstrained fn log_oracle_wrapper<let M: u32, let N: u32>(\n log_level: u8,\n msg: str<M>,\n args: [Field; N],\n) {\n log_oracle(log_level, msg, N, args);\n}\n\n// While the length parameter might seem unnecessary given that we have N, we keep it around because at the AVM\n// bytecode level we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally\n// take that route. The AVM transpiler maps this oracle to the DEBUGLOG opcode, which reads the fields size from memory.\n#[oracle(aztec_misc_log)]\nunconstrained fn log_oracle<let M: u32, let N: u32>(\n log_level: u8,\n msg: str<M>,\n length: u32,\n args: [Field; N],\n) {}\n"
|
|
1236
1236
|
},
|
|
1237
|
-
"
|
|
1237
|
+
"198": {
|
|
1238
1238
|
"function_locations": [
|
|
1239
1239
|
{
|
|
1240
1240
|
"name": "validate_on_curve",
|
|
@@ -1244,7 +1244,7 @@
|
|
|
1244
1244
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/point.nr",
|
|
1245
1245
|
"source": "pub use std::embedded_curve_ops::EmbeddedCurvePoint;\n\n/// Validates that the given point exists on the Grumpkin curve.\npub fn validate_on_curve(p: EmbeddedCurvePoint) {\n // y^2 == x^3 - 17\n let x = p.x;\n let y = p.y;\n // p.is_infinite() <==> x == y == 0, considered on the curve:\n if !p.is_infinite() {\n assert_eq(y * y, x * x * x - 17, \"Point not on curve\");\n }\n}\n"
|
|
1246
1246
|
},
|
|
1247
|
-
"
|
|
1247
|
+
"206": {
|
|
1248
1248
|
"function_locations": [
|
|
1249
1249
|
{
|
|
1250
1250
|
"name": "hash_public_key",
|
|
@@ -1314,7 +1314,7 @@
|
|
|
1314
1314
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr",
|
|
1315
1315
|
"source": "use crate::{\n address::public_keys_hash::PublicKeysHash,\n constants::{\n DEFAULT_FBPK_M_HASH, DEFAULT_IVPK_M_X, DEFAULT_IVPK_M_Y, DEFAULT_MSPK_M_HASH,\n DEFAULT_NPK_M_HASH, DEFAULT_OVPK_M_HASH, DEFAULT_TPK_M_HASH, DOM_SEP__PUBLIC_KEYS_HASH,\n DOM_SEP__SINGLE_PUBLIC_KEY_HASH,\n },\n hash::poseidon2_hash_with_separator,\n point::{EmbeddedCurvePoint, validate_on_curve},\n traits::{Deserialize, Hash, Serialize},\n};\n\nuse std::{default::Default, meta::derive};\n\npub trait ToPoint {\n fn to_point(self) -> EmbeddedCurvePoint;\n}\n\n/// Hashes a public key point under the canonical single-public-key domain separator.\n///\n/// Defined as `Poseidon2(DOM_SEP__SINGLE_PUBLIC_KEY_HASH, x, y)`.\npub fn hash_public_key(p: EmbeddedCurvePoint) -> Field {\n poseidon2_hash_with_separator([p.x, p.y], DOM_SEP__SINGLE_PUBLIC_KEY_HASH as Field)\n}\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct IvpkM {\n pub inner: EmbeddedCurvePoint,\n}\n\nimpl ToPoint for IvpkM {\n fn to_point(self) -> EmbeddedCurvePoint {\n self.inner\n }\n}\n\nimpl Hash for IvpkM {\n fn hash(self) -> Field {\n hash_public_key(self.inner)\n }\n}\n\n/// A non-owner's view of an account's master public keys.\n///\n/// `npk_m_hash`, `ovpk_m_hash`, `tpk_m_hash`, `mspk_m_hash`, and `fbpk_m_hash` are the\n/// [`hash_public_key`] digests of the underlying points. The points themselves are not exposed\n/// here - they are only known to the owner. `ivpk_m` remains a point because address derivation\n/// (encrypt-to-address) requires the raw point in-circuit.\n#[derive(Deserialize, Eq, Serialize)]\npub struct PublicKeys {\n pub npk_m_hash: Field,\n pub ivpk_m: IvpkM,\n pub ovpk_m_hash: Field,\n pub tpk_m_hash: Field,\n pub mspk_m_hash: Field,\n pub fbpk_m_hash: Field,\n}\n\nimpl Default for PublicKeys {\n fn default() -> Self {\n PublicKeys {\n npk_m_hash: DEFAULT_NPK_M_HASH,\n ivpk_m: IvpkM {\n inner: EmbeddedCurvePoint { x: DEFAULT_IVPK_M_X, y: DEFAULT_IVPK_M_Y },\n },\n ovpk_m_hash: DEFAULT_OVPK_M_HASH,\n tpk_m_hash: DEFAULT_TPK_M_HASH,\n mspk_m_hash: DEFAULT_MSPK_M_HASH,\n fbpk_m_hash: DEFAULT_FBPK_M_HASH,\n }\n }\n}\n\nimpl PublicKeys {\n pub fn hash(self) -> PublicKeysHash {\n PublicKeysHash::from_field(poseidon2_hash_with_separator(\n [\n self.npk_m_hash,\n self.ivpk_m.hash(),\n self.ovpk_m_hash,\n self.tpk_m_hash,\n self.mspk_m_hash,\n self.fbpk_m_hash,\n ],\n DOM_SEP__PUBLIC_KEYS_HASH as Field,\n ))\n }\n\n /// Validates that the (only) point-form key, `ivpk_m`, lies on the Grumpkin curve.\n ///\n /// The other five keys are exposed only as hashes and are unverifiable on-circuit; the PXE\n /// is responsible for ensuring they were derived from on-curve points before persistence.\n pub fn validate_on_curve(self) {\n validate_on_curve(self.ivpk_m.inner);\n }\n\n /// Validates that `ivpk_m` is not the point at infinity.\n ///\n /// As with [`Self::validate_on_curve`], the other five keys are now exposed only as hashes\n /// and this property must be enforced PXE-side.\n pub fn validate_non_infinity(self) {\n assert_eq(self.ivpk_m.inner.is_infinite(), false, \"IvpkM is the point at infinity\");\n }\n}\n\npub struct AddressPoint {\n pub inner: EmbeddedCurvePoint,\n}\n\nimpl ToPoint for AddressPoint {\n fn to_point(self) -> EmbeddedCurvePoint {\n self.inner\n }\n}\n\nmod test {\n use crate::constants::{\n DEFAULT_FBPK_M_HASH, DEFAULT_FBPK_M_X, DEFAULT_FBPK_M_Y, DEFAULT_MSPK_M_HASH,\n DEFAULT_MSPK_M_X, DEFAULT_MSPK_M_Y, DEFAULT_NPK_M_HASH, DEFAULT_NPK_M_X, DEFAULT_NPK_M_Y,\n DEFAULT_OVPK_M_HASH, DEFAULT_OVPK_M_X, DEFAULT_OVPK_M_Y, DEFAULT_TPK_M_HASH,\n DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y,\n };\n use crate::{\n point::EmbeddedCurvePoint,\n public_keys::{hash_public_key, IvpkM, PublicKeys},\n traits::{Deserialize, Serialize},\n };\n\n global PUBLIC_KEYS_LENGTH: u32 = 7;\n\n /// Catches drift between the precomputed `DEFAULT_*_M_HASH` constants and the\n /// `DEFAULT_*_M_X/Y` curve points they're derived from. If anyone updates the X/Y\n /// constants (or the hashing primitive) without also updating the *_HASH constants,\n /// this test fails and `PublicKeys::default()` would silently produce a stale value.\n #[test]\n unconstrained fn default_hashes_match_default_points() {\n let npk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_NPK_M_X, y: DEFAULT_NPK_M_Y },\n );\n assert_eq(npk, DEFAULT_NPK_M_HASH);\n\n let ovpk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_OVPK_M_X, y: DEFAULT_OVPK_M_Y },\n );\n assert_eq(ovpk, DEFAULT_OVPK_M_HASH);\n\n let tpk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_TPK_M_X, y: DEFAULT_TPK_M_Y },\n );\n assert_eq(tpk, DEFAULT_TPK_M_HASH);\n\n let mspk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_MSPK_M_X, y: DEFAULT_MSPK_M_Y },\n );\n assert_eq(mspk, DEFAULT_MSPK_M_HASH);\n\n let fbpk = hash_public_key(\n EmbeddedCurvePoint { x: DEFAULT_FBPK_M_X, y: DEFAULT_FBPK_M_Y },\n );\n assert_eq(fbpk, DEFAULT_FBPK_M_HASH);\n }\n\n #[test]\n unconstrained fn compute_public_keys_hash() {\n let keys = PublicKeys {\n npk_m_hash: 11,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint { x: 3, y: 4 } },\n ovpk_m_hash: 22,\n tpk_m_hash: 33,\n mspk_m_hash: 44,\n fbpk_m_hash: 55,\n };\n\n let actual = keys.hash().to_field();\n\n let expected_public_keys_hash =\n 0x1e57c605207e2b607720b8e3023f69f5af25683277db5ff3b99f7948213c7878;\n\n assert_eq(actual, expected_public_keys_hash);\n }\n\n #[test]\n unconstrained fn test_validate_on_curve() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint::generator().double() },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_on_curve();\n }\n\n #[test(should_fail_with = \"Point not on curve\")]\n unconstrained fn test_validate_not_on_curve() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint { x: 3, y: 4 } },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_on_curve();\n }\n\n #[test]\n unconstrained fn test_validate_non_infinity() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint::generator().double() },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_non_infinity();\n }\n\n #[test(should_fail_with = \"IvpkM is the point at infinity\")]\n unconstrained fn test_validate_infinity() {\n let keys = PublicKeys {\n npk_m_hash: 0,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint::point_at_infinity() },\n ovpk_m_hash: 0,\n tpk_m_hash: 0,\n mspk_m_hash: 0,\n fbpk_m_hash: 0,\n };\n\n keys.validate_non_infinity();\n }\n\n #[test]\n unconstrained fn compute_default_hash() {\n let keys = PublicKeys::default();\n\n let actual = keys.hash().to_field();\n\n let test_data_default_hash =\n 0x13c13fbec22a396f700180c621fb8c67b830b431fed47d4dd71a20d828829eaa;\n\n assert_eq(actual, test_data_default_hash);\n }\n\n #[test]\n unconstrained fn serde() {\n let keys = PublicKeys {\n npk_m_hash: 11,\n ivpk_m: IvpkM { inner: EmbeddedCurvePoint { x: 3, y: 4 } },\n ovpk_m_hash: 22,\n tpk_m_hash: 33,\n mspk_m_hash: 44,\n fbpk_m_hash: 55,\n };\n\n let serialized: [Field; PUBLIC_KEYS_LENGTH] = keys.serialize();\n let deserialized = PublicKeys::deserialize(serialized);\n\n assert_eq(keys, deserialized);\n }\n}\n"
|
|
1316
1316
|
},
|
|
1317
|
-
"
|
|
1317
|
+
"211": {
|
|
1318
1318
|
"function_locations": [
|
|
1319
1319
|
{
|
|
1320
1320
|
"name": "derive_storage_slot_in_map",
|
|
@@ -1328,7 +1328,7 @@
|
|
|
1328
1328
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr",
|
|
1329
1329
|
"source": "use crate::{\n constants::DOM_SEP__PUBLIC_STORAGE_MAP_SLOT, hash::poseidon2_hash_with_separator,\n traits::ToField,\n};\n\n// TODO: Move this to src/public_data/storage/map.nr\npub fn derive_storage_slot_in_map<K>(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash_with_separator(\n [storage_slot, key.to_field()],\n DOM_SEP__PUBLIC_STORAGE_MAP_SLOT,\n )\n}\n\nmod test {\n use crate::{address::AztecAddress, storage::map::derive_storage_slot_in_map, traits::FromField};\n\n #[test]\n fn test_derive_storage_slot_in_map_matches_typescript() {\n let map_slot = 0x132258fb6962c4387ba659d9556521102d227549a386d39f0b22d1890d59c2b5;\n let key = AztecAddress::from_field(\n 0x302dbc2f9b50a73283d5fb2f35bc01eae8935615817a0b4219a057b2ba8a5a3f,\n );\n\n let slot = derive_storage_slot_in_map(map_slot, key);\n\n // The following value was generated by `map_slot.test.ts`\n let slot_from_typescript =\n 0x2d225f361108379adc2da91378b9702675c5546b57e78bafc1e74ec7fec55967;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n"
|
|
1330
1330
|
},
|
|
1331
|
-
"
|
|
1331
|
+
"238": {
|
|
1332
1332
|
"function_locations": [
|
|
1333
1333
|
{
|
|
1334
1334
|
"name": "Poseidon2::hash",
|
|
@@ -1370,7 +1370,7 @@
|
|
|
1370
1370
|
"path": "/home/aztec-dev/nargo/github.com/noir-lang/poseidon/v0.3.0/src/poseidon2.nr",
|
|
1371
1371
|
"source": "use std::default::Default;\nuse std::hash::Hasher;\n\nglobal RATE: u32 = 3;\n\npub struct Poseidon2 {\n cache: [Field; 3],\n state: [Field; 4],\n cache_size: u32,\n squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2 {\n #[no_predicates]\n pub fn hash<let N: u32>(input: [Field; N], message_size: u32) -> Field {\n Poseidon2::hash_internal(input, message_size)\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n self.state[0] += self.cache[0];\n self.state[1] += self.cache[1];\n self.state[2] += self.cache[2];\n self.state = crate::poseidon2_permutation(self.state);\n }\n\n fn absorb(&mut self, input: Field) {\n assert(!self.squeeze_mode);\n if self.cache_size == RATE {\n // If we're absorbing, and the cache is full, apply the sponge permutation to compress the cache\n self.perform_duplex();\n self.cache[0] = input;\n self.cache_size = 1;\n } else {\n // If we're absorbing, and the cache is not full, add the input into the cache\n self.cache[self.cache_size] = input;\n self.cache_size += 1;\n }\n }\n\n fn squeeze(&mut self) -> Field {\n assert(!self.squeeze_mode);\n // If we're in absorb mode, apply sponge permutation to compress the cache.\n self.perform_duplex();\n self.squeeze_mode = true;\n\n // Pop one item off the top of the permutation and return it.\n self.state[0]\n }\n\n fn hash_internal<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut state = [0; 4];\n state[RATE] = iv;\n\n if std::runtime::is_unconstrained() {\n for i in 0..(in_len / RATE) {\n state[0] += input[i * RATE];\n state[1] += input[i * RATE + 1];\n state[2] += input[i * RATE + 2];\n state = crate::poseidon2_permutation(state);\n }\n\n // handle remaining elements after last full RATE-sized chunk\n let num_extra_fields = in_len % RATE;\n if num_extra_fields != 0 {\n let remainder_start = in_len - num_extra_fields;\n state[0] += input[remainder_start];\n if num_extra_fields > 1 {\n state[1] += input[remainder_start + 1];\n }\n }\n } else {\n let mut states: [[Field; 4]; N / RATE + 1] = [[0; 4]; N / RATE + 1];\n states[0] = state;\n\n // process all full RATE-sized chunks, storing state after each permutation\n for chunk_idx in 0..(N / RATE) {\n for i in 0..RATE {\n state[i] += input[chunk_idx * RATE + i];\n }\n state = crate::poseidon2_permutation(state);\n states[chunk_idx + 1] = state;\n }\n\n // get state at the last full block before in_len\n let first_partially_filled_chunk = in_len / RATE;\n state = states[first_partially_filled_chunk];\n\n // handle remaining elements after last full RATE-sized chunk\n let remainder_start = (in_len / RATE) * RATE;\n for j in 0..RATE {\n let idx = remainder_start + j;\n if idx < in_len {\n state[j] += input[idx];\n }\n }\n }\n\n // always run final permutation unless we just completed a full chunk\n // still need to permute once if in_len is 0\n if (in_len == 0) | (in_len % RATE != 0) {\n state = crate::poseidon2_permutation(state);\n };\n\n state[0]\n }\n}\n\npub struct Poseidon2Hasher {\n _state: [Field],\n}\n\nimpl Hasher for Poseidon2Hasher {\n fn finish(self) -> Field {\n let iv: Field = (self._state.len() as Field) * 18446744073709551616; // iv = (self._state.len() << 64)\n let mut sponge = Poseidon2::new(iv);\n for i in 0..self._state.len() {\n sponge.absorb(self._state[i]);\n }\n sponge.squeeze()\n }\n\n fn write(&mut self, input: Field) {\n self._state = self._state.push_back(input);\n }\n}\n\nimpl Default for Poseidon2Hasher {\n fn default() -> Self {\n Poseidon2Hasher { _state: @[] }\n }\n}\n"
|
|
1372
1372
|
},
|
|
1373
|
-
"
|
|
1373
|
+
"241": {
|
|
1374
1374
|
"function_locations": [
|
|
1375
1375
|
{
|
|
1376
1376
|
"name": "Reader<N>::new",
|
|
@@ -1420,7 +1420,7 @@
|
|
|
1420
1420
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/reader.nr",
|
|
1421
1421
|
"source": "pub struct Reader<let N: u32> {\n data: [Field; N],\n offset: u32,\n}\n\nimpl<let N: u32> Reader<N> {\n pub fn new(data: [Field; N]) -> Self {\n Self { data, offset: 0 }\n }\n\n pub fn read(&mut self) -> Field {\n let result = self.data[self.offset];\n self.offset += 1;\n result\n }\n\n pub fn read_u32(&mut self) -> u32 {\n self.read() as u32\n }\n\n pub fn read_u64(&mut self) -> u64 {\n self.read() as u64\n }\n\n pub fn read_bool(&mut self) -> bool {\n self.read() != 0\n }\n\n pub fn read_array<let K: u32>(&mut self) -> [Field; K] {\n let mut result = [0; K];\n for i in 0..K {\n result[i] = self.data[self.offset + i];\n }\n self.offset += K;\n result\n }\n\n pub fn read_struct<T, let K: u32>(&mut self, deserialise: fn([Field; K]) -> T) -> T {\n let result = deserialise(self.read_array());\n result\n }\n\n pub fn read_struct_array<T, let K: u32, let C: u32>(\n &mut self,\n deserialise: fn([Field; K]) -> T,\n mut result: [T; C],\n ) -> [T; C] {\n for i in 0..C {\n result[i] = self.read_struct(deserialise);\n }\n result\n }\n\n pub fn peek_offset(&mut self, offset: u32) -> Field {\n self.data[self.offset + offset]\n }\n\n pub fn advance_offset(&mut self, offset: u32) {\n self.offset += offset;\n }\n\n pub fn finish(self) {\n assert_eq(self.offset, self.data.len(), \"Reader did not read all data\");\n }\n}\n"
|
|
1422
1422
|
},
|
|
1423
|
-
"
|
|
1423
|
+
"242": {
|
|
1424
1424
|
"function_locations": [
|
|
1425
1425
|
{
|
|
1426
1426
|
"name": "derive_serialize",
|
|
@@ -1446,7 +1446,7 @@
|
|
|
1446
1446
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/serde/src/serialization.nr",
|
|
1447
1447
|
"source": "use crate::{reader::Reader, writer::Writer};\n\n/// Trait for serializing Noir types into arrays of Fields.\n///\n/// An implementation of the Serialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait (and Deserialize) are\n/// typically used to communicate between Noir and TypeScript (via oracles and function arguments).\n///\n/// # On Following Noir's Intrinsic Serialization\n/// When calling a Noir function from TypeScript (TS), first the function arguments are serialized into an array\n/// of fields. This array is then included in the initial witness. Noir's intrinsic serialization is then used\n/// to deserialize the arguments from the witness. When the same Noir function is called from Noir this Serialize trait\n/// is used instead of the serialization in TS. For this reason we need to have a match between TS serialization,\n/// Noir's intrinsic serialization and the implementation of this trait. If there is a mismatch, the function calls\n/// fail with an arguments hash mismatch error message.\n///\n/// # Associated Constants\n/// * `N` - The length of the output Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let N: u32> Serialize for str<N> {\n/// let N: u32 = N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// let bytes = self.as_bytes();\n/// for i in 0..bytes.len() {\n/// writer.write(bytes[i] as Field);\n/// }\n/// }\n/// }\n/// ```\n#[derive_via(derive_serialize)]\npub trait Serialize {\n let N: u32;\n\n fn serialize(self) -> [Field; Self::N];\n\n fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>);\n}\n\n/// Generates a `Serialize` trait implementation for a struct type.\n///\n/// # Parameters\n/// - `s`: The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A quoted code block containing the trait implementation\n///\n/// # Example\n/// For a struct defined as:\n/// ```\n/// struct Log<N> {\n/// fields: [Field; N],\n/// length: u32\n/// }\n/// ```\n///\n/// This function generates code equivalent to:\n/// ```\n/// impl<let N: u32> Serialize for Log<N> {\n/// let N: u32 = <[Field; N] as Serialize>::N + <u32 as Serialize>::N;\n///\n/// fn serialize(self) -> [Field; Self::N] {\n/// let mut writer: Writer<Self::N> = Writer::new();\n/// self.stream_serialize(&mut writer);\n/// writer.finish()\n/// }\n///\n/// #[inline_always]\n/// fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>) {\n/// Serialize::stream_serialize(self.fields, writer);\n/// Serialize::stream_serialize(self.length, writer);\n/// }\n/// }\n/// ```\npub comptime fn derive_serialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n\n // We care only about the name and type so we drop the last item of the tuple\n let params = nested_struct.0.fields(nested_struct.1).map(|(name, typ, _)| (name, typ));\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Serialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_serialize_clause = get_where_trait_clause(s, quote { Serialize });\n\n let params_len_quote = get_params_len_quote(params);\n\n let function_body = params\n .map(|(name, _typ): (Quoted, Type)| {\n quote {\n $crate::serialization::Serialize::stream_serialize(self.$name, writer);\n }\n })\n .join(quote {});\n\n quote {\n impl$generics_declarations $crate::serialization::Serialize for $typ\n $where_serialize_clause\n {\n let N: u32 = $params_len_quote;\n\n\n fn serialize(self) -> [Field; Self::N] {\n let mut writer: $crate::writer::Writer<Self::N> = $crate::writer::Writer::new();\n $crate::serialization::Serialize::stream_serialize(self, &mut writer);\n writer.finish()\n }\n\n\n #[inline_always]\n fn stream_serialize<let K: u32>(self, writer: &mut $crate::writer::Writer<K>) {\n $function_body\n }\n }\n }\n}\n\n/// Trait for deserializing Noir types from arrays of Fields.\n///\n/// An implementation of the Deserialize trait has to follow Noir's intrinsic serialization (each member of a struct\n/// converted directly into one or more Fields without any packing or compression). This trait is typically used when\n/// deserializing return values from function calls in Noir. Since the same function could be called from TypeScript\n/// (TS), in which case the TS deserialization would get used, we need to have a match between the 2.\n///\n/// # Associated Constants\n/// * `N` - The length of the input Field array, known at compile time\n///\n/// # Example\n/// ```\n/// impl<let M: u32> Deserialize for str<M> {\n/// let N: u32 = M;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let mut bytes = [0 as u8; M];\n/// for i in 0..M {\n/// bytes[i] = reader.read() as u8;\n/// }\n/// str::<M>::from(bytes)\n/// }\n/// }\n/// ```\n#[derive_via(derive_deserialize)]\npub trait Deserialize {\n let N: u32;\n\n fn deserialize(fields: [Field; Self::N]) -> Self;\n\n fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self;\n}\n\n/// Generates a `Deserialize` trait implementation for a given struct `s`.\n///\n/// # Arguments\n/// * `s` - The struct type definition to generate the implementation for\n///\n/// # Returns\n/// A `Quoted` block containing the generated trait implementation\n///\n/// # Requirements\n/// Each struct member type must implement the `Deserialize` trait (it gets used in the generated code).\n///\n/// # Example\n/// For a struct like:\n/// ```\n/// struct MyStruct {\n/// x: AztecAddress,\n/// y: Field,\n/// }\n/// ```\n///\n/// This generates:\n/// ```\n/// impl Deserialize for MyStruct {\n/// let N: u32 = <AztecAddress as Deserialize>::N + <Field as Deserialize>::N;\n///\n/// fn deserialize(fields: [Field; Self::N]) -> Self {\n/// let mut reader = Reader::new(fields);\n/// let result = Self::stream_deserialize(&mut reader);\n/// reader.finish();\n/// result\n/// }\n///\n/// #[inline_always]\n/// fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self {\n/// let x = <AztecAddress as Deserialize>::stream_deserialize(reader);\n/// let y = <Field as Deserialize>::stream_deserialize(reader);\n/// Self { x, y }\n/// }\n/// }\n/// ```\npub comptime fn derive_deserialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let nested_struct = typ.as_data_type().unwrap();\n let params = nested_struct.0.fields(nested_struct.1);\n\n // Generates the generic parameter declarations (to be placed after the `impl` keyword) and the `where` clause\n // for the `Deserialize` trait.\n let generics_declarations = get_generics_declarations(s);\n let where_deserialize_clause = get_where_trait_clause(s, quote { Deserialize });\n\n // The following will give us:\n // <type_of_struct_member_1 as Deserialize>::N + <type_of_struct_member_2 as Deserialize>::N + ...\n // (or 0 if the struct has no members)\n let right_hand_side_of_definition_of_n = if params.len() > 0 {\n params\n .map(|(_, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n <$param_type as $crate::serialization::Deserialize>::N\n }\n })\n .join(quote {+})\n } else {\n quote { 0 }\n };\n\n // For structs containing a single member, we can enhance performance by directly deserializing the input array,\n // bypassing the need for loop-based array construction. While this optimization yields significant benefits in\n // Brillig where the loops are expected to not be optimized, it is not relevant in ACIR where the loops are\n // expected to be optimized away.\n let function_body = if params.len() > 1 {\n // This generates deserialization code for each struct member and concatenates them together.\n let deserialization_of_struct_members = params\n .map(|(param_name, param_type, _): (Quoted, Type, Quoted)| {\n quote {\n let $param_name = <$param_type as Deserialize>::stream_deserialize(reader);\n }\n })\n .join(quote {});\n\n // We join the struct member names with a comma to be used in the `Self { ... }` syntax\n // This will give us e.g. `a, b, c` for a struct with three fields named `a`, `b`, and `c`.\n let struct_members = params\n .map(|(param_name, _, _): (Quoted, Type, Quoted)| quote { $param_name })\n .join(quote {,});\n\n quote {\n $deserialization_of_struct_members\n\n Self { $struct_members }\n }\n } else if params.len() == 1 {\n let param_name = params[0].0;\n quote {\n Self { $param_name: $crate::serialization::Deserialize::stream_deserialize(reader) }\n }\n } else {\n quote {\n Self {}\n }\n };\n\n quote {\n impl$generics_declarations $crate::serialization::Deserialize for $typ\n $where_deserialize_clause\n {\n let N: u32 = $right_hand_side_of_definition_of_n;\n\n fn deserialize(fields: [Field; Self::N]) -> Self {\n let mut reader = $crate::reader::Reader::new(fields);\n let result = Self::stream_deserialize(&mut reader);\n reader.finish();\n result\n }\n\n #[inline_always]\n fn stream_deserialize<let K: u32>(reader: &mut $crate::reader::Reader<K>) -> Self {\n $function_body\n }\n }\n }\n}\n\n/// Generates a quoted expression that computes the total serialized length of function parameters.\n///\n/// # Parameters\n/// * `params` - An array of tuples where each tuple contains a quoted parameter name and its Type. The type needs\n/// to implement the Serialize trait.\n///\n/// # Returns\n/// A quoted expression that evaluates to:\n/// * `0` if there are no parameters\n/// * `(<type1 as Serialize>::N + <type2 as Serialize>::N + ...)` for one or more parameters\ncomptime fn get_params_len_quote(params: [(Quoted, Type)]) -> Quoted {\n if params.len() == 0 {\n quote { 0 }\n } else {\n let params_quote_without_parentheses = params\n .map(|(_, param_type): (Quoted, Type)| {\n quote {\n <$param_type as $crate::serialization::Serialize>::N\n }\n })\n .join(quote {+});\n quote { ($params_quote_without_parentheses) }\n }\n}\n\ncomptime fn get_generics_declarations(s: TypeDefinition) -> Quoted {\n let generics = s.generics();\n\n if generics.len() > 0 {\n let generics_declarations_items = generics\n .map(|(name, maybe_integer_typ)| {\n // The second item in the generics tuple is an Option of an integer type that is Some only if\n // the generic is numeric.\n if maybe_integer_typ.is_some() {\n // The generic is numeric, so we return a quote defined as e.g. \"let N: u32\"\n let integer_type = maybe_integer_typ.unwrap();\n quote {let $name: $integer_type}\n } else {\n // The generic is not numeric, so we return a quote containing the name of the generic (e.g. \"T\")\n quote { $name }\n }\n })\n .join(quote {,});\n quote {<$generics_declarations_items>}\n } else {\n // The struct doesn't have any generics defined, so we just return an empty quote.\n quote {}\n }\n}\n\ncomptime fn get_where_trait_clause(s: TypeDefinition, trait_name: Quoted) -> Quoted {\n let generics = s.generics();\n\n // The second item in the generics tuple is an Option of an integer type that is Some only if the generic is\n // numeric.\n let non_numeric_generics =\n generics.filter(|(_, maybe_integer_typ)| maybe_integer_typ.is_none());\n\n if non_numeric_generics.len() > 0 {\n let non_numeric_generics_declarations =\n non_numeric_generics.map(|(name, _)| quote {$name: $trait_name}).join(quote {,});\n quote {where $non_numeric_generics_declarations}\n } else {\n // There are no non-numeric generics, so we return an empty quote.\n quote {}\n }\n}\n"
|
|
1448
1448
|
},
|
|
1449
|
-
"
|
|
1449
|
+
"244": {
|
|
1450
1450
|
"function_locations": [
|
|
1451
1451
|
{
|
|
1452
1452
|
"name": "<impl Serialize for bool>::serialize",
|
|
@@ -2296,7 +2296,7 @@
|
|
|
2296
2296
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/contract_instance_registry_contract/src/main.nr",
|
|
2297
2297
|
"source": "/// Protocol contract responsible for deploying contract instances and managing contract upgrades.\n///\n/// In Aztec, contracts are split into *classes* (code, registered via ContractClassRegistry) and *instances*\n/// (deployments of a class at a unique address). This contract handles contract instance publishing and contract\n/// updates (updating instance to a new class).\npub contract ContractInstanceRegistry {\n use aztec::{\n context::{PrivateContext, PublicContext},\n hash::hash_args,\n nullifier::utils::compute_nullifier_existence_request,\n oracle::{avm, logging::debug_log_format, version::assert_compatible_oracle_version},\n protocol::{\n abis::function_selector::FunctionSelector,\n address::{AztecAddress, PartialAddress},\n constants::{\n CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS, CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE,\n CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE, DEFAULT_UPDATE_DELAY, MINIMUM_UPDATE_DELAY,\n },\n contract_class_id::ContractClassId,\n public_keys::PublicKeys,\n traits::{Deserialize, Serialize, ToField},\n utils::reader::Reader,\n },\n state_vars::{DelayedPublicMutable, Map, StateVariable},\n };\n\n #[abi(events)]\n struct ContractInstancePublished {\n CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE: Field,\n address: AztecAddress,\n version: u8,\n salt: Field,\n contract_class_id: ContractClassId,\n initialization_hash: Field,\n immutables_hash: Field,\n public_keys: PublicKeys,\n deployer: AztecAddress,\n }\n\n // Custom serialization is required because:\n // - npk_m, ovpk_m, tpk_m, mspk_m, fbpk_m are exposed only as hashes so we serialize the hashes\n // directly.\n // - For ivpk_m we drop the `is_infinite` flag (we assume non-infinity).\n impl ContractInstancePublished {\n fn serialize_non_standard(self) -> [Field; 15] {\n [\n self.CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE,\n self.address.to_field(),\n self.version.to_field(),\n self.salt,\n self.contract_class_id.to_field(),\n self.initialization_hash,\n self.immutables_hash,\n self.public_keys.npk_m_hash,\n self.public_keys.ivpk_m.inner.x,\n self.public_keys.ivpk_m.inner.y,\n self.public_keys.ovpk_m_hash,\n self.public_keys.tpk_m_hash,\n self.public_keys.mspk_m_hash,\n self.public_keys.fbpk_m_hash,\n self.deployer.to_field(),\n ]\n }\n }\n\n #[abi(events)]\n #[derive(Serialize)]\n struct ContractInstanceUpdated {\n CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE: Field,\n address: AztecAddress,\n prev_contract_class_id: ContractClassId,\n new_contract_class_id: ContractClassId,\n timestamp_of_change: u64,\n }\n\n struct Storage<Context> {\n /// Map from contract instance address to a `DelayedPublicMutable` holding the updated contract class ID.\n updated_class_ids: Map<AztecAddress, DelayedPublicMutable<ContractClassId, DEFAULT_UPDATE_DELAY, Context>, Context>,\n }\n\n /// Publishes a new contract instance.\n ///\n /// The caller provides deployment parameters (salt, class_id, init_hash, immutables_hash, public_keys,\n /// universal_deploy).\n /// The `universal_deploy` flag controls whether the deployer address is bound into the contract address:\n /// when true, deployer is zero (anyone can deploy the same instance); when false, deployer is the caller.\n ///\n /// This function:\n /// 1. Verifies the contract class is registered in ContractClassRegistry (nullifier existence check).\n /// 2. Validates `ivpk_m` is on the Grumpkin curve and not the point at infinity (preventing AVM DoS via an invalid\n /// point). `npk_m`, `ovpk_m`, `tpk_m`, `mspk_m`, and `fbpk_m` are exposed only as hashes and are not validated\n /// in-circuit.\n /// 3. Computes the deterministic contract address from the deployment parameters.\n /// 4. Emits the address as a nullifier (proving publication preventing duplicate deployment)\n /// --> this address nullifier is then checked to exist by the AVM upon public function execution (if it doesn't\n /// exist AVM reverts)\n /// 5. Broadcasts a `ContractInstancePublished` event so nodes can reconstruct the instance.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_private]\n fn publish_for_public_execution(\n inputs: aztec::context::inputs::PrivateContextInputs,\n salt: Field,\n contract_class_id: ContractClassId,\n initialization_hash: Field,\n immutables_hash: Field,\n public_keys: PublicKeys,\n universal_deploy: bool,\n ) -> return_data aztec::protocol::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs {\n // MACRO CODE START\n // Note: The macros initially inserted a phase check here, but since there is no phase change in this function\n // body, I have removed that check.\n assert_compatible_oracle_version();\n\n // 4 prefix fields (salt, class_id, init_hash, immutables_hash) + 7 public-key fields\n // + 1 universal_deploy flag = 12.\n let serialized_params: [Field; 12] = [salt, contract_class_id.to_field(), initialization_hash, immutables_hash]\n .concat(public_keys.serialize())\n .concat([universal_deploy.to_field()]);\n\n let args_hash: Field = hash_args(serialized_params);\n let mut context: PrivateContext = PrivateContext::new(inputs, args_hash);\n // MACRO CODE END\n\n // Verify the contract class is registered by checking for its nullifier at the ContractClassRegistry address.\n let nullifier_existence_request = compute_nullifier_existence_request(\n contract_class_id.to_field(),\n CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS,\n );\n context.assert_nullifier_exists(nullifier_existence_request);\n\n // For universal deployments, deployer is zero so the resulting address is the same regardless of who initiates\n // deployment.\n let deployer = if universal_deploy {\n AztecAddress::zero()\n } else {\n context.maybe_msg_sender().unwrap()\n };\n\n let partial_address = PartialAddress::compute(\n contract_class_id,\n salt,\n initialization_hash,\n deployer,\n immutables_hash,\n );\n\n // Validate `ivpk_m` is on the Grumpkin curve and is not the point at infinity (preventing AVM\n // DoS attacks). The other five master keys are exposed as hashes and have no\n // curve-point to validate here.\n public_keys.validate_on_curve();\n public_keys.validate_non_infinity();\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // Emit address as nullifier: prevents duplicate deployment and proves publication.\n // We use no domain separators because these are the only nullifiers this contract uses.\n context.push_nullifier(address.to_field());\n\n // Broadcast deployment event. Version 2 carries hashes for npk/ovpk/tpk/mspk/fbpk and the\n // affine coordinates of ivpk only; see `serialize_non_standard`.\n let event = ContractInstancePublished {\n CONTRACT_INSTANCE_PUBLISHED_MAGIC_VALUE,\n contract_class_id,\n address,\n public_keys,\n initialization_hash,\n immutables_hash,\n salt,\n deployer,\n version: 2,\n };\n let payload = event.serialize_non_standard();\n debug_log_format(\"ContractInstancePublished: {}\", payload);\n // We pad the payload with zeros to match the length required by emit_private_log (PRIVATE_LOG_SIZE_IN_FIELDS).\n // Since the log is not encrypted, padding with zero rather than a random value is acceptable (we don't care\n // about privacy here).\n let padded_log = payload.concat([0]);\n let length = payload.len();\n context.emit_private_log(padded_log, length);\n\n // MACRO CODE START\n context.finish()\n // MACRO CODE END\n }\n\n /// Schedules an upgrade of the calling contract instance to a new contract class.\n ///\n /// The change is time-delayed via `DelayedPublicMutable` and only takes effect after the configured\n /// delay has elapsed. Only the contract instance itself can call this function (msg.sender == address).\n ///\n /// This function:\n /// 1. Verifies msg.sender is a deployed contract (its address nullifier exists).\n /// 2. Verifies the new class is registered in ContractClassRegistry.\n /// 3. Schedules the class ID change and emits a `ContractInstanceUpdated` event.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n unconstrained fn update(new_contract_class_id: ContractClassId) {\n // MACRO CODE START\n let context: PublicContext = PublicContext::new(\n || -> Field {\n let serialized_args: [Field; 1] = avm::calldata_copy(1, <ContractClassId as Serialize>::N);\n hash_args(serialized_args)\n },\n );\n let storage: Storage<PublicContext> = Storage::init(context);\n // MACRO CODE END\n\n let address = context.maybe_msg_sender().unwrap();\n\n // Safety: we're using the nullifier's existence as a guarantee of the availability of the contract's\n // information through publishing, which is safe - we just need this information to be _eventually_ available.\n assert(\n context.nullifier_exists_unsafe(address.to_field(), context.this_address()),\n \"msg.sender is not deployed\",\n );\n\n // Safety: we're using the nullifier's existence as a guarantee of the availability of the new contract class'\n // information through registration, which is safe - we just need this information to be _eventually_\n // available.\n assert(\n context.nullifier_exists_unsafe(new_contract_class_id.to_field(), CONTRACT_CLASS_REGISTRY_CONTRACT_ADDRESS),\n \"New contract class is not registered\",\n );\n\n let scheduled_value_update =\n storage.updated_class_ids.at(address).schedule_and_get_value_change(new_contract_class_id);\n let (prev_contract_class_id, timestamp_of_change) = scheduled_value_update.get_previous();\n\n let event = ContractInstanceUpdated {\n CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE,\n address,\n prev_contract_class_id,\n new_contract_class_id,\n timestamp_of_change,\n };\n context.emit_public_log(event);\n }\n\n /// Schedules a change to the upgrade delay for the calling contract instance. The delay change is\n /// itself delayed (preventing atomically reducing delay + scheduling an instant upgrade). The new\n /// delay must be at least `MINIMUM_UPDATE_DELAY`.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n unconstrained fn set_update_delay(new_update_delay: u64) {\n // MACRO CODE START\n let context: PublicContext = PublicContext::new(\n || -> Field {\n let serialized_args: [Field; 1] = avm::calldata_copy(1, <u64 as Serialize>::N);\n hash_args(serialized_args)\n },\n );\n let storage: Storage<PublicContext> = Storage::init(context);\n // MACRO CODE END\n\n let msg_sender = context.maybe_msg_sender().unwrap();\n\n // Safety: we're using the nullifier's existence as a guarantee of the availability of the contract's\n // information through publishing, which is safe - we just need this information to be _eventually_ available.\n assert(\n context.nullifier_exists_unsafe(msg_sender.to_field(), context.this_address()),\n \"msg.sender is not deployed\",\n );\n\n assert(new_update_delay >= MINIMUM_UPDATE_DELAY, \"New update delay is too low\");\n\n storage.updated_class_ids.at(msg_sender).schedule_delay_change(new_update_delay);\n }\n\n /// Returns the current update delay for the calling contract instance.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_view]\n unconstrained fn get_update_delay() -> pub u64 {\n // MACRO CODE START\n let context: PublicContext = PublicContext::new(\n || -> Field {\n let serialized_args: [Field; 0] = avm::calldata_copy(1, 0);\n hash_args(serialized_args)\n },\n );\n let storage: Storage<PublicContext> = Storage::init(context);\n assert(context.is_static_call(), \"Function get_update_delay can only be called statically\");\n // MACRO CODE END\n\n storage.updated_class_ids.at(avm::sender()).get_current_delay()\n }\n\n // THE REST OF THE CODE IN THIS CONTRACT WAS ORIGINALLY INJECTED BY THE #[aztec] MACRO.\n\n global UPDATE_SELECTOR: Field = comptime { FunctionSelector::from_signature(\"update((Field))\").to_field() };\n global SET_UPDATE_DELAY_SELECTOR: Field =\n comptime { FunctionSelector::from_signature(\"set_update_delay(u64)\").to_field() };\n global GET_UPDATE_DELAY_SELECTOR: Field =\n comptime { FunctionSelector::from_signature(\"get_update_delay()\").to_field() };\n\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n pub unconstrained fn public_dispatch(selector: Field) {\n if selector == UPDATE_SELECTOR {\n let input_calldata: [Field; 1] = avm::calldata_copy(1, <ContractClassId as Serialize>::N);\n let mut reader: Reader<1> = Reader::new(input_calldata);\n let arg0: ContractClassId = <ContractClassId as Deserialize>::stream_deserialize(&mut reader);\n update(arg0);\n avm::avm_return([].as_vector());\n };\n if selector == SET_UPDATE_DELAY_SELECTOR {\n let input_calldata: [Field; 1] = avm::calldata_copy(1, <u64 as Serialize>::N);\n let mut reader: Reader<1> = Reader::new(input_calldata);\n let arg0: u64 = <u64 as Deserialize>::stream_deserialize(&mut reader);\n set_update_delay(arg0);\n avm::avm_return([].as_vector());\n };\n if selector == GET_UPDATE_DELAY_SELECTOR {\n let return_value: [Field; 1] = <u64 as Serialize>::serialize(get_update_delay());\n avm::avm_return(return_value.as_vector());\n };\n panic(f\"Unknown selector {selector}\")\n }\n\n impl<Context> Storage<Context> {\n fn init(context: Context) -> Self {\n Self {\n updated_class_ids: <Map<AztecAddress, DelayedPublicMutable<ContractClassId, DEFAULT_UPDATE_DELAY, Context>, Context> as StateVariable<1, Context>>::new(\n context,\n 1,\n ),\n }\n }\n }\n\n pub struct publish_for_public_execution_parameters {\n pub _salt: Field,\n pub _contract_class_id: ContractClassId,\n pub _initialization_hash: Field,\n pub _immutables_hash: Field,\n pub _public_keys: PublicKeys,\n pub _universal_deploy: bool,\n }\n\n pub struct update_parameters {\n pub _new_contract_class_id: ContractClassId,\n }\n\n pub struct set_update_delay_parameters {\n pub _new_update_delay: u64,\n }\n\n pub struct get_update_delay_parameters {}\n\n #[abi(functions)]\n pub struct publish_for_public_execution_abi {\n parameters: publish_for_public_execution_parameters,\n }\n\n #[abi(functions)]\n pub struct update_abi {\n parameters: update_parameters,\n }\n\n #[abi(functions)]\n pub struct set_update_delay_abi {\n parameters: set_update_delay_parameters,\n }\n\n #[abi(functions)]\n pub struct get_update_delay_abi {\n parameters: get_update_delay_parameters,\n return_type: u64,\n }\n}\n"
|
|
2298
2298
|
},
|
|
2299
|
-
"
|
|
2299
|
+
"56": {
|
|
2300
2300
|
"function_locations": [
|
|
2301
2301
|
{
|
|
2302
2302
|
"name": "PrivateContext::new",
|
|
@@ -2398,7 +2398,7 @@
|
|
|
2398
2398
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/context/private_context.nr",
|
|
2399
2399
|
"source": "use crate::{\n context::{inputs::PrivateContextInputs, NullifierExistenceRequest, ReturnsHash},\n hash::hash_args,\n messaging::process_l1_to_l2_message,\n oracle::{\n call_private_function::call_private_function_internal,\n public_call::validate_public_calldata,\n tx_phase::{in_revertible_phase, notify_revertible_phase_start},\n execution_cache,\n logs::notify_created_contract_class_log,\n nullifiers::notify_created_nullifier,\n },\n};\nuse crate::protocol::{\n abis::{\n block_header::BlockHeader,\n call_context::CallContext,\n function_selector::FunctionSelector,\n gas_settings::GasSettings,\n log_hash::LogHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::{PrivateLog, PrivateLogData},\n public_call_request::PublicCallRequest,\n },\n address::{AztecAddress, EthAddress},\n constants::{\n CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, MAX_CONTRACT_CLASS_LOGS_PER_CALL,\n MAX_ENQUEUED_CALLS_PER_CALL, MAX_TX_LIFETIME, MAX_L2_TO_L1_MSGS_PER_CALL,\n MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL,\n MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL,\n NULL_MSG_SENDER_CONTRACT_ADDRESS, PRIVATE_LOG_SIZE_IN_FIELDS,\n },\n hash::poseidon2_hash,\n messaging::l2_to_l1_message::L2ToL1Message,\n side_effect::{Counted, scoped::Scoped},\n traits::Empty,\n utils::arrays::{ClaimedLengthArray, trimmed_array_length_hint},\n};\n\n/// Minimal PrivateContext for protocol contracts going to audit.\n/// Contains only the methods actually used by: fee_juice, auth_registry, contract_class_registry, contract_instance_registry\n#[derive(Eq)]\npub struct PrivateContext {\n pub inputs: PrivateContextInputs,\n pub side_effect_counter: u32,\n\n pub min_revertible_side_effect_counter: u32,\n pub is_fee_payer: bool,\n\n pub args_hash: Field,\n pub return_hash: Field,\n\n pub expiration_timestamp: u64,\n\n pub nullifier_read_requests: BoundedVec<Scoped<Counted<Field>>, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,\n\n pub nullifiers: BoundedVec<Counted<Nullifier>, MAX_NULLIFIERS_PER_CALL>,\n\n pub private_call_requests: BoundedVec<PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,\n pub public_call_requests: BoundedVec<Counted<PublicCallRequest>, MAX_ENQUEUED_CALLS_PER_CALL>,\n pub public_teardown_call_request: PublicCallRequest,\n pub l2_to_l1_msgs: BoundedVec<Counted<L2ToL1Message>, MAX_L2_TO_L1_MSGS_PER_CALL>,\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub anchor_block_header: BlockHeader,\n\n pub private_logs: BoundedVec<Counted<PrivateLogData>, MAX_PRIVATE_LOGS_PER_CALL>,\n pub contract_class_logs_hashes: BoundedVec<Counted<LogHash>, MAX_CONTRACT_CLASS_LOGS_PER_CALL>,\n\n pub expected_non_revertible_side_effect_counter: u32,\n pub expected_revertible_side_effect_counter: u32,\n}\n\nimpl PrivateContext {\n pub fn new(inputs: PrivateContextInputs, args_hash: Field) -> PrivateContext {\n PrivateContext {\n inputs,\n side_effect_counter: inputs.start_side_effect_counter + 1,\n min_revertible_side_effect_counter: 0,\n is_fee_payer: false,\n args_hash,\n return_hash: 0,\n expiration_timestamp: inputs.anchor_block_header.global_variables.timestamp\n + MAX_TX_LIFETIME,\n nullifier_read_requests: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n anchor_block_header: inputs.anchor_block_header,\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n\n /// Returns the contract address that initiated this function call (similar to msg.sender in Solidity).\n pub fn maybe_msg_sender(self) -> Option<AztecAddress> {\n let maybe_msg_sender = self.inputs.call_context.msg_sender;\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the contract address of the current function being executed.\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n /// Returns the chain ID of the current network.\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n /// Returns the protocol version.\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n /// Returns the gas settings for the current transaction.\n pub fn gas_settings(self) -> GasSettings {\n self.inputs.tx_context.gas_settings\n }\n\n /// Returns the function selector of the currently executing function.\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n /// Returns the hash of the arguments passed to the current function.\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n /// Returns the anchor block header.\n pub fn get_anchor_block_header(self) -> BlockHeader {\n self.anchor_block_header\n }\n\n /// Sets the hash of the return values for this private function.\n pub fn set_return_hash<let N: u32>(&mut self, serialized_return_values: [Field; N]) {\n let return_hash = hash_args(serialized_return_values);\n self.return_hash = return_hash;\n execution_cache::store(serialized_return_values, return_hash);\n }\n\n /// Builds the PrivateCircuitPublicInputs for this private function.\n pub fn finish(self) -> PrivateCircuitPublicInputs {\n PrivateCircuitPublicInputs {\n call_context: self.inputs.call_context,\n args_hash: self.args_hash,\n returns_hash: self.return_hash,\n min_revertible_side_effect_counter: self.min_revertible_side_effect_counter,\n is_fee_payer: self.is_fee_payer,\n expiration_timestamp: self.expiration_timestamp,\n note_hash_read_requests: ClaimedLengthArray::empty(), // Not used by protocol contracts\n nullifier_read_requests: ClaimedLengthArray::from_bounded_vec(\n self.nullifier_read_requests,\n ),\n key_validation_requests_and_separators: ClaimedLengthArray::empty(), // Not used by protocol contracts\n note_hashes: ClaimedLengthArray::empty(), // Not used by protocol contracts\n nullifiers: ClaimedLengthArray::from_bounded_vec(self.nullifiers),\n private_call_requests: ClaimedLengthArray::from_bounded_vec(self.private_call_requests),\n public_call_requests: ClaimedLengthArray::from_bounded_vec(self.public_call_requests),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: ClaimedLengthArray::from_bounded_vec(self.l2_to_l1_msgs),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: ClaimedLengthArray::from_bounded_vec(self.private_logs),\n contract_class_logs_hashes: ClaimedLengthArray::from_bounded_vec(\n self.contract_class_logs_hashes,\n ),\n anchor_block_header: self.anchor_block_header,\n tx_context: self.inputs.tx_context,\n expected_non_revertible_side_effect_counter: self\n .expected_non_revertible_side_effect_counter,\n expected_revertible_side_effect_counter: self.expected_revertible_side_effect_counter,\n }\n }\n\n /// Declares the end of the \"setup phase\" of this tx. Used by fee_juice.\n pub fn end_setup(&mut self) {\n self.side_effect_counter += 1;\n self.min_revertible_side_effect_counter = self.next_counter();\n notify_revertible_phase_start(self.min_revertible_side_effect_counter);\n }\n\n pub fn in_revertible_phase(&mut self) -> bool {\n let current_counter = self.side_effect_counter;\n\n // Safety: Kernel will validate that the claim is correct by validating the expected counters.\n let is_revertible =\n unsafe { in_revertible_phase(current_counter) };\n\n if is_revertible {\n if (self.expected_revertible_side_effect_counter == 0)\n | (current_counter < self.expected_revertible_side_effect_counter) {\n self.expected_revertible_side_effect_counter = current_counter;\n }\n } else if current_counter > self.expected_non_revertible_side_effect_counter {\n self.expected_non_revertible_side_effect_counter = current_counter;\n }\n\n is_revertible\n }\n\n /// Sets a deadline for when this transaction must be included in a block.\n pub fn set_expiration_timestamp(&mut self, expiration_timestamp: u64) {\n self.expiration_timestamp = std::cmp::min(self.expiration_timestamp, expiration_timestamp);\n }\n\n /// Pushes a new nullifier. Used by class_registry and instance_registry.\n pub fn push_nullifier(&mut self, nullifier: Field) {\n notify_created_nullifier(nullifier);\n self.nullifiers.push(Nullifier { value: nullifier, note_hash: 0 }.count(self.next_counter()));\n }\n\n /// Asserts that a nullifier has been emitted. Used by instance_registry.\n pub fn assert_nullifier_exists(\n &mut self,\n nullifier_existence_request: NullifierExistenceRequest,\n ) {\n let nullifier = nullifier_existence_request.nullifier();\n let contract_address =\n nullifier_existence_request.maybe_contract_address().unwrap_or(AztecAddress::zero());\n\n let request = Scoped::new(\n Counted::new(nullifier, self.next_counter()),\n contract_address,\n );\n\n self.nullifier_read_requests.push(request);\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2). Used by fee_juice.\n pub fn consume_l1_to_l2_message(\n &mut self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let nullifier = process_l1_to_l2_message(\n self.anchor_block_header.state.l1_to_l2_message_tree.root,\n self.this_address(),\n sender,\n self.chain_id(),\n self.version(),\n content,\n secret,\n leaf_index,\n );\n\n // Push nullifier (and the \"commitment\" corresponding to this can be \"empty\")\n self.push_nullifier(nullifier)\n }\n\n /// Emits a private log. Used by instance_registry.\n pub fn emit_private_log(&mut self, log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS], length: u32) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: PrivateLog::new(log, length), note_hash_counter: 0 }\n .count(counter);\n self.private_logs.push(private_log);\n }\n\n /// Emits a contract class log. Used by class_registry.\n pub fn emit_contract_class_log<let N: u32>(&mut self, log: [Field; N]) {\n let contract_address = self.this_address();\n let counter = self.next_counter();\n\n let log_to_emit: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS] =\n log.concat([0; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - N]);\n // Safety: The below length is constrained in the base rollup, which will make sure that all the fields beyond\n // length are zero. However, it won't be able to check that we didn't add extra padding (trailing zeroes) or\n // that we cut trailing zeroes from the end.\n let length = unsafe { trimmed_array_length_hint(log_to_emit) };\n // We hash the entire padded log to ensure a user cannot pass a shorter length and so emit incorrect shorter\n // bytecode.\n let log_hash = poseidon2_hash(log_to_emit);\n // Safety: the below only exists to broadcast the raw log, so we can provide it to the base rollup later to be\n // constrained.\n unsafe {\n notify_created_contract_class_log(contract_address, log_to_emit, length, counter);\n }\n\n self.contract_class_logs_hashes.push(LogHash { value: log_hash, length: length }.count(\n counter,\n ));\n }\n\n /// Makes a read-only call to a private function. Used by auth_registry for authwit.\n pub fn static_call_private_function<let ArgsCount: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ArgsCount],\n ) -> ReturnsHash {\n let args_hash = hash_args(args);\n execution_cache::store(args, args_hash);\n self.call_private_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n fn call_private_function_with_args_hash(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n is_static_call: bool,\n ) -> ReturnsHash {\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n let start_side_effect_counter = self.side_effect_counter;\n\n // Safety: The oracle simulates the private call and returns the value of the side effects counter after\n // execution of the call.\n let (end_side_effect_counter, returns_hash) = unsafe {\n call_private_function_internal(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n )\n };\n\n self.private_call_requests.push(\n PrivateCallRequest {\n call_context: CallContext {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n },\n args_hash,\n returns_hash,\n start_side_effect_counter,\n end_side_effect_counter,\n },\n );\n\n self.side_effect_counter = end_side_effect_counter + 1;\n ReturnsHash::new(returns_hash)\n }\n\n /// Enqueues a call to a public function with a calldata hash. Used by fee_juice and auth_registry.\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n hide_msg_sender: bool,\n ) {\n let counter = self.next_counter();\n\n let is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n validate_public_calldata(calldata_hash);\n\n let msg_sender = if hide_msg_sender {\n NULL_MSG_SENDER_CONTRACT_ADDRESS\n } else {\n self.this_address()\n };\n\n let call_request =\n PublicCallRequest { msg_sender, contract_address, is_static_call, calldata_hash };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n fn next_counter(&mut self) -> u32 {\n let counter = self.side_effect_counter;\n self.side_effect_counter += 1;\n counter\n }\n}\n\nimpl Empty for PrivateContext {\n fn empty() -> Self {\n PrivateContext {\n inputs: PrivateContextInputs::empty(),\n side_effect_counter: 0 as u32,\n min_revertible_side_effect_counter: 0 as u32,\n is_fee_payer: false,\n args_hash: 0,\n return_hash: 0,\n expiration_timestamp: 0,\n nullifier_read_requests: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n private_call_requests: BoundedVec::new(),\n public_call_requests: BoundedVec::new(),\n public_teardown_call_request: PublicCallRequest::empty(),\n l2_to_l1_msgs: BoundedVec::new(),\n anchor_block_header: BlockHeader::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n expected_non_revertible_side_effect_counter: 0,\n expected_revertible_side_effect_counter: 0,\n }\n }\n}\n"
|
|
2400
2400
|
},
|
|
2401
|
-
"
|
|
2401
|
+
"57": {
|
|
2402
2402
|
"function_locations": [
|
|
2403
2403
|
{
|
|
2404
2404
|
"name": "<impl Eq for PublicContext>::eq",
|
|
@@ -2528,7 +2528,7 @@
|
|
|
2528
2528
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/context/public_context.nr",
|
|
2529
2529
|
"source": "use crate::{\n context::gas::GasOpts,\n hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n compute_siloed_nullifier,\n },\n oracle::avm,\n};\nuse crate::protocol::{\n abis::function_selector::FunctionSelector,\n address::{AztecAddress, EthAddress},\n constants::{MAX_U32_VALUE, NULL_MSG_SENDER_CONTRACT_ADDRESS},\n traits::{Empty, FromField, Packable, Serialize, ToField},\n};\n\n/// Minimal PublicContext for protocol contracts going to audit.\npub struct PublicContext {\n pub args_hash: Option<Field>,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl Eq for PublicContext {\n fn eq(self, other: Self) -> bool {\n (self.args_hash == other.args_hash)\n // Can't compare the function compute_args_hash\n }\n}\n\nimpl PublicContext {\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n /// Emits a _public_ log that will be visible onchain to everyone.\n pub fn emit_public_log<T>(_self: Self, log: T)\n where\n T: Serialize,\n {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_public_log(Serialize::serialize(log).as_vector()) };\n }\n\n /// Checks if a given note hash exists in the note hash tree at a particular leaf_index.\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: u64) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::note_hash_exists(note_hash, leaf_index) }\n }\n\n /// Checks if a specific L1-to-L2 message exists in the L1-to-L2 message tree at a particular leaf index.\n pub fn l1_to_l2_msg_exists(_self: Self, msg_hash: Field, msg_leaf_index: Field) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself TODO(alvaro): Make l1l2msg leaf index a u64 upstream\n unsafe { avm::l1_to_l2_msg_exists(msg_hash, msg_leaf_index as u64) }\n }\n\n /// Returns `true` if an `unsiloed_nullifier` has been emitted by `contract_address`.\n pub fn nullifier_exists_unsafe(\n _self: Self,\n unsiloed_nullifier: Field,\n contract_address: AztecAddress,\n ) -> bool {\n let siloed_nullifier = compute_siloed_nullifier(contract_address, unsiloed_nullifier);\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::nullifier_exists(siloed_nullifier) }\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2).\n pub fn consume_l1_to_l2_message(\n self: Self,\n content: Field,\n secret: Field,\n sender: EthAddress,\n leaf_index: Field,\n ) {\n let secret_hash = compute_secret_hash(secret);\n let message_hash = compute_l1_to_l2_message_hash(\n sender,\n self.chain_id(),\n /*recipient=*/\n self.this_address(),\n self.version(),\n content,\n secret_hash,\n leaf_index,\n );\n let nullifier = compute_l1_to_l2_message_nullifier(message_hash, secret);\n\n assert(\n !self.nullifier_exists_unsafe(nullifier, self.this_address()),\n \"L1-to-L2 message is already nullified\",\n );\n assert(\n self.l1_to_l2_msg_exists(message_hash, leaf_index),\n \"Tried to consume nonexistent L1-to-L2 message\",\n );\n\n self.push_nullifier(nullifier);\n }\n\n /// Sends an \"L2 -> L1 message\".\n pub fn message_portal(_self: Self, recipient: EthAddress, content: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::send_l2_to_l1_msg(recipient, content) };\n }\n\n /// Calls a public function on another contract.\n pub unconstrained fn call_public_function<let N: u32>(\n _self: Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; N],\n gas_opts: GasOpts,\n ) -> [Field] {\n let calldata = [function_selector.to_field()].concat(args);\n\n avm::call(\n gas_opts.l2_gas.unwrap_or(MAX_U32_VALUE),\n gas_opts.da_gas.unwrap_or(MAX_U32_VALUE),\n contract_address,\n calldata,\n );\n // Use success_copy to determine whether the call succeeded\n let success = avm::success_copy();\n\n let result_data = avm::returndata_copy(0, avm::returndata_size());\n if !success {\n // Rethrow the revert data.\n avm::revert(result_data);\n }\n result_data\n }\n\n /// Makes a read-only call to a public function on another contract.\n pub unconstrained fn static_call_public_function<let N: u32>(\n _self: Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; N],\n gas_opts: GasOpts,\n ) -> [Field] {\n let calldata = [function_selector.to_field()].concat(args);\n\n avm::call_static(\n gas_opts.l2_gas.unwrap_or(MAX_U32_VALUE),\n gas_opts.da_gas.unwrap_or(MAX_U32_VALUE),\n contract_address,\n calldata,\n );\n // Use success_copy to determine whether the call succeeded\n let success = avm::success_copy();\n\n let result_data = avm::returndata_copy(0, avm::returndata_size());\n if !success {\n // Rethrow the revert data.\n avm::revert(result_data);\n }\n result_data\n }\n\n /// Adds a new note hash to the Note Hash Tree.\n pub fn push_note_hash(_self: Self, note_hash: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_note_hash(note_hash) };\n }\n\n /// Adds a new nullifier to the Nullifier Tree.\n pub fn push_nullifier(_self: Self, nullifier: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_nullifier(nullifier) };\n }\n\n /// Returns the address of the current contract being executed.\n pub fn this_address(_self: Self) -> AztecAddress {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::address()\n }\n }\n\n /// Returns the contract address that initiated this function call.\n pub fn maybe_msg_sender(_self: Self) -> Option<AztecAddress> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let maybe_msg_sender = unsafe { avm::sender() };\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the function selector of the currently-executing function.\n pub fn selector(_self: Self) -> FunctionSelector {\n // The selector is the first element of the calldata when calling a public function through dispatch.\n // Safety: AVM opcodes are constrained by the AVM itself.\n let raw_selector: [Field; 1] = unsafe { avm::calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n\n /// Returns the hash of the arguments passed to the current function.\n pub fn get_args_hash(mut self) -> Field {\n if !self.args_hash.is_some() {\n self.args_hash = Option::some((self.compute_args_hash)());\n }\n\n self.args_hash.unwrap_unchecked()\n }\n\n /// Returns the \"transaction fee\" for the current transaction.\n pub fn transaction_fee(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::transaction_fee()\n }\n }\n\n /// Returns the chain ID of the current network.\n pub fn chain_id(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::chain_id()\n }\n }\n\n /// Returns the protocol version.\n pub fn version(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::version()\n }\n }\n\n /// Returns the current block number.\n pub fn block_number(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::block_number()\n }\n }\n\n /// Returns the timestamp of the current block.\n pub fn timestamp(_self: Self) -> u64 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::timestamp()\n }\n }\n\n /// Returns the fee per unit of L2 gas.\n pub fn min_fee_per_l2_gas(_self: Self) -> u128 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::min_fee_per_l2_gas()\n }\n }\n\n /// Returns the fee per unit of DA gas.\n pub fn min_fee_per_da_gas(_self: Self) -> u128 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::min_fee_per_da_gas()\n }\n }\n\n /// Returns the remaining L2 gas available.\n pub fn l2_gas_left(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::l2_gas_left()\n }\n }\n\n /// Returns the remaining DA gas available.\n pub fn da_gas_left(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::da_gas_left()\n }\n }\n\n /// Checks if the current execution is within a staticcall context.\n pub fn is_static_call(_self: Self) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::is_static_call() }\n }\n\n /// Reads raw field values from public storage.\n pub fn raw_storage_read<let N: u32>(self: Self, storage_slot: Field) -> [Field; N] {\n let mut out = [0; N];\n for i in 0..N {\n // Safety: AVM opcodes are constrained by the AVM itself\n out[i] = unsafe {\n avm::storage_read(storage_slot + i as Field, self.this_address().to_field())\n };\n }\n out\n }\n\n /// Reads a typed value from public storage.\n pub fn storage_read<T>(self, storage_slot: Field) -> T\n where\n T: Packable,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n\n /// Writes raw field values to public storage.\n pub fn raw_storage_write<let N: u32>(_self: Self, storage_slot: Field, values: [Field; N]) {\n for i in 0..N {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n /// Writes a typed value to public storage.\n pub fn storage_write<T>(self, storage_slot: Field, value: T)\n where\n T: Packable,\n {\n self.raw_storage_write(storage_slot, value.pack());\n }\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n"
|
|
2530
2530
|
},
|
|
2531
|
-
"
|
|
2531
|
+
"60": {
|
|
2532
2532
|
"function_locations": [
|
|
2533
2533
|
{
|
|
2534
2534
|
"name": "compute_secret_hash",
|
|
@@ -2558,7 +2558,7 @@
|
|
|
2558
2558
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/hash.nr",
|
|
2559
2559
|
"source": "//! Aztec hash functions.\n\nuse crate::protocol::{\n address::{AztecAddress, EthAddress},\n constants::{\n DOM_SEP__FUNCTION_ARGS, DOM_SEP__MESSAGE_NULLIFIER, DOM_SEP__PUBLIC_BYTECODE,\n DOM_SEP__PUBLIC_CALLDATA, DOM_SEP__SECRET_HASH, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS,\n },\n hash::{poseidon2_hash_subarray, poseidon2_hash_with_separator, sha256_to_field},\n traits::ToField,\n};\n\npub use crate::protocol::hash::compute_siloed_nullifier;\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], DOM_SEP__SECRET_HASH)\n}\n\npub fn compute_l1_to_l2_message_hash(\n sender: EthAddress,\n chain_id: Field,\n recipient: AztecAddress,\n version: Field,\n content: Field,\n secret_hash: Field,\n leaf_index: Field,\n) -> Field {\n let mut hash_bytes = [0 as u8; 224];\n let sender_bytes: [u8; 32] = sender.to_field().to_be_bytes();\n let chain_id_bytes: [u8; 32] = chain_id.to_be_bytes();\n let recipient_bytes: [u8; 32] = recipient.to_field().to_be_bytes();\n let version_bytes: [u8; 32] = version.to_be_bytes();\n let content_bytes: [u8; 32] = content.to_be_bytes();\n let secret_hash_bytes: [u8; 32] = secret_hash.to_be_bytes();\n let leaf_index_bytes: [u8; 32] = leaf_index.to_be_bytes();\n\n for i in 0..32 {\n hash_bytes[i] = sender_bytes[i];\n hash_bytes[i + 32] = chain_id_bytes[i];\n hash_bytes[i + 64] = recipient_bytes[i];\n hash_bytes[i + 96] = version_bytes[i];\n hash_bytes[i + 128] = content_bytes[i];\n hash_bytes[i + 160] = secret_hash_bytes[i];\n hash_bytes[i + 192] = leaf_index_bytes[i];\n }\n\n sha256_to_field(hash_bytes)\n}\n\n// The nullifier of a l1 to l2 message is the hash of the message salted with the secret\npub fn compute_l1_to_l2_message_nullifier(message_hash: Field, secret: Field) -> Field {\n poseidon2_hash_with_separator([message_hash, secret], DOM_SEP__MESSAGE_NULLIFIER)\n}\n\n// Computes the hash of input arguments or return values for private functions, or for authwit creation.\npub fn hash_args<let N: u32>(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, DOM_SEP__FUNCTION_ARGS)\n }\n}\n\n// Computes the hash of calldata for public functions.\npub fn hash_calldata_array<let N: u32>(calldata: [Field; N]) -> Field {\n poseidon2_hash_with_separator(calldata, DOM_SEP__PUBLIC_CALLDATA)\n}\n\n/// Computes the public bytecode commitment for a contract class. The commitment is `hash([(length | separator),\n/// ...bytecode])`.\n///\n/// @param packed_bytecode - The packed bytecode of the contract class. 0th word is the length in bytes.\n/// packed_bytecode is mutable so that we can avoid copying the array to construct one starting with first_field\n/// instead of length. @returns The public bytecode commitment.\npub fn compute_public_bytecode_commitment(\n mut packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS],\n) -> Field {\n // First field element contains the length of the bytecode\n let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32;\n let bytecode_length_in_fields: u32 = (bytecode_length_in_bytes / 31) + (bytecode_length_in_bytes % 31 != 0) as u32;\n // Don't allow empty public bytecode. AVM doesn't handle execution of contracts that exist with empty bytecode.\n assert(bytecode_length_in_fields != 0);\n assert(bytecode_length_in_fields < MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS);\n\n // Packed_bytecode's 0th entry is the length. Append it to the separator before hashing.\n let first_field = DOM_SEP__PUBLIC_BYTECODE.to_field() + (packed_public_bytecode[0] as u64 << 32) as Field;\n packed_public_bytecode[0] = first_field;\n\n // `fields_to_hash` is the number of fields from the start of `packed_public_bytecode` that should be included in\n // the hash. Fields after this length are ignored. +1 to account for the separator.\n let num_fields_to_hash = bytecode_length_in_fields + 1;\n\n poseidon2_hash_subarray(packed_public_bytecode, num_fields_to_hash)\n}\n"
|
|
2560
2560
|
},
|
|
2561
|
-
"
|
|
2561
|
+
"69": {
|
|
2562
2562
|
"function_locations": [
|
|
2563
2563
|
{
|
|
2564
2564
|
"name": "compute_nullifier_existence_request",
|
|
@@ -2568,7 +2568,7 @@
|
|
|
2568
2568
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/nullifier/utils.nr",
|
|
2569
2569
|
"source": "use crate::{context::NullifierExistenceRequest, oracle::nullifiers::is_nullifier_pending};\n\nuse crate::protocol::{address::aztec_address::AztecAddress, hash::compute_siloed_nullifier};\n\n/// Returns the [NullifierExistenceRequest] used to prove a nullifier exists.\npub fn compute_nullifier_existence_request(\n unsiloed_nullifier: Field,\n contract_address: AztecAddress,\n) -> NullifierExistenceRequest {\n let pending_read_request =\n NullifierExistenceRequest::for_pending(unsiloed_nullifier, contract_address);\n\n let siloed_nullifier = compute_siloed_nullifier(contract_address, unsiloed_nullifier);\n let settled_read_request = NullifierExistenceRequest::for_settled(siloed_nullifier);\n\n // Safety: This is a hint to check whether we are reading a pending or settled nullifier. The chosen read request\n // will be validated by the kernel. Failure to provide a correct hint will cause the read request validation to\n // fail.\n let should_use_pending_read_request =\n unsafe { is_nullifier_pending(unsiloed_nullifier, contract_address) };\n\n if should_use_pending_read_request {\n pending_read_request\n } else {\n settled_read_request\n }\n}\n"
|
|
2570
2570
|
},
|
|
2571
|
-
"
|
|
2571
|
+
"70": {
|
|
2572
2572
|
"function_locations": [
|
|
2573
2573
|
{
|
|
2574
2574
|
"name": "address",
|
|
@@ -2806,7 +2806,7 @@
|
|
|
2806
2806
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/oracle/avm.nr",
|
|
2807
2807
|
"source": "//! AVM oracles.\n//!\n//! There are only available during public execution. Calling any of them from a private or utility function will\n//! result in runtime errors.\n\nuse crate::protocol::address::{AztecAddress, EthAddress};\n\npub unconstrained fn address() -> AztecAddress {\n address_opcode()\n}\npub unconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\npub unconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\npub unconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\npub unconstrained fn version() -> Field {\n version_opcode()\n}\npub unconstrained fn block_number() -> u32 {\n block_number_opcode()\n}\npub unconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\npub unconstrained fn min_fee_per_l2_gas() -> u128 {\n min_fee_per_l2_gas_opcode()\n}\npub unconstrained fn min_fee_per_da_gas() -> u128 {\n min_fee_per_da_gas_opcode()\n}\npub unconstrained fn l2_gas_left() -> u32 {\n l2_gas_left_opcode()\n}\npub unconstrained fn da_gas_left() -> u32 {\n da_gas_left_opcode()\n}\npub unconstrained fn is_static_call() -> bool {\n is_static_call_opcode()\n}\npub unconstrained fn note_hash_exists(note_hash: Field, leaf_index: u64) -> bool {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\npub unconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\npub unconstrained fn nullifier_exists(siloed_nullifier: Field) -> bool {\n nullifier_exists_opcode(siloed_nullifier)\n}\npub unconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\npub unconstrained fn emit_public_log(message: [Field]) {\n emit_public_log_opcode(message)\n}\npub unconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: u64) -> bool {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\npub unconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\n\npub unconstrained fn call<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n args: [Field; N],\n) {\n call_opcode(l2_gas_allocation, da_gas_allocation, address, N, args)\n}\n\npub unconstrained fn call_static<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n args: [Field; N],\n) {\n call_static_opcode(l2_gas_allocation, da_gas_allocation, address, N, args)\n}\n\npub unconstrained fn calldata_copy<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\n/// `success_copy` is placed immediately after the CALL opcode to get the success value\npub unconstrained fn success_copy() -> bool {\n success_copy_opcode()\n}\n\npub unconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\npub unconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\n/// The additional prefix is to avoid clashing with the `return` Noir keyword.\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n/// This opcode reverts using the exact data given. In general it should only be used to do rethrows, where the revert\n/// data is the same as the original revert data. For normal reverts, use Noir's `assert` which, on top of reverting,\n/// will also add an error selector to the revert data.\npub unconstrained fn revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\npub unconstrained fn storage_read(storage_slot: Field, contract_address: Field) -> Field {\n storage_read_opcode(storage_slot, contract_address)\n}\n\npub unconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\n#[oracle(aztec_avm_address)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(aztec_avm_sender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(aztec_avm_transactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(aztec_avm_chainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(aztec_avm_version)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(aztec_avm_blockNumber)]\nunconstrained fn block_number_opcode() -> u32 {}\n\n#[oracle(aztec_avm_timestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(aztec_avm_minFeePerL2Gas)]\nunconstrained fn min_fee_per_l2_gas_opcode() -> u128 {}\n\n#[oracle(aztec_avm_minFeePerDaGas)]\nunconstrained fn min_fee_per_da_gas_opcode() -> u128 {}\n\n#[oracle(aztec_avm_l2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> u32 {}\n\n#[oracle(aztec_avm_daGasLeft)]\nunconstrained fn da_gas_left_opcode() -> u32 {}\n\n#[oracle(aztec_avm_isStaticCall)]\nunconstrained fn is_static_call_opcode() -> bool {}\n\n#[oracle(aztec_avm_noteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: u64) -> bool {}\n\n#[oracle(aztec_avm_emitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(aztec_avm_nullifierExists)]\nunconstrained fn nullifier_exists_opcode(siloed_nullifier: Field) -> bool {}\n\n#[oracle(aztec_avm_emitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(aztec_avm_emitPublicLog)]\nunconstrained fn emit_public_log_opcode(message: [Field]) {}\n\n#[oracle(aztec_avm_l1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: u64) -> bool {}\n\n#[oracle(aztec_avm_sendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(aztec_avm_calldataCopy)]\nunconstrained fn calldata_copy_opcode<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(aztec_avm_returndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(aztec_avm_returndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(aztec_avm_return)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n#[oracle(aztec_avm_revert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n// While the length parameter might seem unnecessary given that we have N we keep it around because at the AVM bytecode\n// level, we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally take\n// that route.\n#[oracle(aztec_avm_call)]\nunconstrained fn call_opcode<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n length: u32,\n args: [Field; N],\n) {}\n\n// While the length parameter might seem unnecessary given that we have N we keep it around because at the AVM bytecode\n// level, we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally take\n// that route.\n#[oracle(aztec_avm_staticCall)]\nunconstrained fn call_static_opcode<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n length: u32,\n args: [Field; N],\n) {}\n\n#[oracle(aztec_avm_successCopy)]\nunconstrained fn success_copy_opcode() -> bool {}\n\n#[oracle(aztec_avm_storageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field, contract_address: Field) -> Field {}\n\n#[oracle(aztec_avm_storageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n"
|
|
2808
2808
|
},
|
|
2809
|
-
"
|
|
2809
|
+
"78": {
|
|
2810
2810
|
"function_locations": [
|
|
2811
2811
|
{
|
|
2812
2812
|
"name": "notify_created_nullifier",
|
|
@@ -2836,7 +2836,7 @@
|
|
|
2836
2836
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/oracle/nullifiers.nr",
|
|
2837
2837
|
"source": "//! Nullifier creation, existence checks, etc.\n\nuse crate::protocol::address::aztec_address::AztecAddress;\n\n/// Notifies the simulator that a nullifier has been created, so that its correct status (pending or settled) can be\n/// determined when reading nullifiers in subsequent private function calls. The first non-revertible nullifier emitted\n/// is also used to compute note nonces.\npub fn notify_created_nullifier(inner_nullifier: Field) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe to\n // call.\n unsafe { notify_created_nullifier_oracle(inner_nullifier) };\n}\n\n#[oracle(aztec_prv_notifyCreatedNullifier)]\nunconstrained fn notify_created_nullifier_oracle(_inner_nullifier: Field) {}\n\n/// Returns true if the nullifier has been emitted in the same transaction, i.e. if [notify_created_nullifier] has been\n/// called for this inner nullifier from the contract with the specified address.\n///\n/// Note that despite sharing pending transaction information with the app, this is not a privacy leak: anyone in the\n/// network can always determine in which transaction a inner nullifier was emitted by a given contract by simply\n/// inspecting transaction effects. What _would_ constitute a leak would be to share the list of inner pending\n/// nullifiers, as that would reveal their preimages.\npub unconstrained fn is_nullifier_pending(\n inner_nullifier: Field,\n contract_address: AztecAddress,\n) -> bool {\n is_nullifier_pending_oracle(inner_nullifier, contract_address)\n}\n\n#[oracle(aztec_prv_isNullifierPending)]\nunconstrained fn is_nullifier_pending_oracle(\n _inner_nullifier: Field,\n _contract_address: AztecAddress,\n) -> bool {}\n\n/// Returns true if the nullifier exists. Note that a `true` value can be constrained by proving existence of the\n/// nullifier, but a `false` value should not be relied upon since other transactions may emit this nullifier before\n/// the current transaction is included in a block. While this might seem of little use at first, certain design\n/// patterns benefit from this abstraction (see e.g. `PrivateMutable`).\npub unconstrained fn check_nullifier_exists(inner_nullifier: Field) -> bool {\n check_nullifier_exists_oracle(inner_nullifier)\n}\n\n// TODO(F-498): review naming consistency\n#[oracle(aztec_utl_doesNullifierExist)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> bool {}\n"
|
|
2838
2838
|
},
|
|
2839
|
-
"
|
|
2839
|
+
"82": {
|
|
2840
2840
|
"function_locations": [
|
|
2841
2841
|
{
|
|
2842
2842
|
"name": "assert_compatible_oracle_version",
|
|
@@ -2860,9 +2860,9 @@
|
|
|
2860
2860
|
}
|
|
2861
2861
|
],
|
|
2862
2862
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/oracle/version.nr",
|
|
2863
|
-
"source": "/// The oracle version constants are used to check that the oracle interface is in sync between PXE and Aztec.nr.\n/// We version the oracle interface as `major.minor` where:\n/// - `major` = backward-breaking changes (must match exactly between PXE and Aztec.nr)\n/// - `minor` = oracle additions (non-breaking; PXE minor >= contract minor)\n///\n/// The TypeScript counterparts are in `oracle_version.ts`.\n///\n/// @dev Whenever a contract function or Noir test is run, the `aztec_misc_assertCompatibleOracleVersion` oracle is\n/// called. If the major version is incompatible, an error is thrown immediately. The minor version is recorded by\n/// the PXE and used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw\n/// immediately if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency\n/// without actually using any of the new oracles then there is no reason to throw.\npub global ORACLE_VERSION_MAJOR: Field =
|
|
2863
|
+
"source": "/// The oracle version constants are used to check that the oracle interface is in sync between PXE and Aztec.nr.\n/// We version the oracle interface as `major.minor` where:\n/// - `major` = backward-breaking changes (must match exactly between PXE and Aztec.nr)\n/// - `minor` = oracle additions (non-breaking; PXE minor >= contract minor)\n///\n/// The TypeScript counterparts are in `oracle_version.ts`.\n///\n/// @dev Whenever a contract function or Noir test is run, the `aztec_misc_assertCompatibleOracleVersion` oracle is\n/// called. If the major version is incompatible, an error is thrown immediately. The minor version is recorded by\n/// the PXE and used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw\n/// immediately if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency\n/// without actually using any of the new oracles then there is no reason to throw.\npub global ORACLE_VERSION_MAJOR: Field = 30;\npub global ORACLE_VERSION_MINOR: Field = 0;\n\n/// Asserts that the version of the oracle is compatible with the version expected by the contract.\npub fn assert_compatible_oracle_version() {\n // Safety: This oracle call returns nothing: we only call it to check Aztec.nr and Oracle interface versions are\n // compatible. It is therefore always safe to call.\n unsafe {\n assert_compatible_oracle_version_wrapper();\n }\n}\n\nunconstrained fn assert_compatible_oracle_version_wrapper() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR);\n}\n\n#[oracle(aztec_misc_assertCompatibleOracleVersion)]\nunconstrained fn assert_compatible_oracle_version_oracle(major: Field, minor: Field) {}\n\nmod test {\n use super::{\n assert_compatible_oracle_version_oracle, ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR,\n };\n\n #[test]\n unconstrained fn compatible_oracle_version() {\n assert_compatible_oracle_version_oracle(ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR);\n }\n\n #[test(should_fail_with = \"Incompatible aztec cli version:\")]\n unconstrained fn incompatible_oracle_version_major() {\n let arbitrary_incorrect_major = 318183437;\n assert_compatible_oracle_version_oracle(arbitrary_incorrect_major, ORACLE_VERSION_MINOR);\n }\n}\n"
|
|
2864
2864
|
},
|
|
2865
|
-
"
|
|
2865
|
+
"83": {
|
|
2866
2866
|
"function_locations": [
|
|
2867
2867
|
{
|
|
2868
2868
|
"name": "<impl StateVariable<(M + 1), Context> for DelayedPublicMutable<T, InitialDelay, Context>>::new",
|
|
@@ -2928,7 +2928,7 @@
|
|
|
2928
2928
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/state_vars/delayed_public_mutable.nr",
|
|
2929
2929
|
"source": "use crate::protocol::{\n delayed_public_mutable::{\n delayed_public_mutable_values::{unpack_delay_change, unpack_value_change},\n DelayedPublicMutableValues,\n ScheduledDelayChange,\n ScheduledValueChange,\n },\n traits::Packable,\n};\n\nuse crate::{context::{PrivateContext, PublicContext, UtilityContext}, state_vars::StateVariable, utils::WithHash};\n\n/// Mutable public values with private read access.\n///\n/// This is an advanced public state variable, with no native Solidity equivalent.\n///\n/// Like [`PublicMutable`](crate::state_vars::PublicMutable) it represents a public value of type `T` that can be\n/// written to repeatedly, but with a key improvement: the current value can also be **read from a private contract\n/// function**.\n///\n/// This comes at the cost of extra restrictions on the state variable: writes do not come into effect immediately,\n/// they must be **scheduled** to take place after some minimum delay. Reading from the state variable will therefore\n/// return the previous value until some time passes, which is why this is a _delayed_ mutable variable.\n///\n/// It is these delays that enable the capacity for reads from private contract functions, as they provide guarantees\n/// regarding how long can some historical state observed at the anchor block be known to not change.\n///\n/// Delays can be modified during the lifetime of the contract.\n///\n/// ## Access Patterns\n///\n/// The current value stored in a `DelayedPublicMutable` can be read from public contract functions, and writes can be\n/// scheduled to happen in the future.\n///\n/// Public contract functions can also schedule changes to the write delay, as well as inspect any already scheduled\n/// value or delay changes.\n///\n/// Private contract functions can read the **current** value of the state variable, but not past or scheduled values.\n/// They cannot read the current delay, and they cannot schedule any kind of value change.\n///\n/// ## Privacy\n///\n/// The value stored in `DelayedPublicMutable` is fully public, as are all scheduled value and delay changes.\n///\n/// Reads from a private contract function are almost fully private: the only observable effect is that they set the\n/// transaction's `expiration_timestamp` property, possibly reducing the privacy set. See\n/// [`PrivateContext::set_expiration_timestamp`](crate::context::PrivateContext::set_expiration_timestamp).\n///\n/// ## Use Cases\n///\n/// These are mostly an extension of [`PublicMutable`](crate::state_vars::PublicMutable)'s, given that what this state\n/// variable essentially achieves is to provide private reads to it. For example, it can be used for global contract\n/// configuration (such as fees, access control, etc.) that users will need to access during private interactions.\n///\n/// The key consideration is whether the enforced minimum delay on writes prevents using this state variable. In some\n/// scenarios this restriction is incompatible with requirements (such as a token's total supply, which must always be\n/// up to date), while in others the enhanced privacy might make the tradeoff acceptable (such as when dealing with\n/// contract pauses or access control revocation, where a delay of some hours could be acceptable).\n///\n/// Note that, just like in [`PublicMutable`](crate::state_vars::PublicMutable), the fact that the values are public\n/// does not necessarily mean the actions that update these values must themselves be wholly public. To learn more,\n/// see the notes there regarding usage of [`only_self`](crate::macros::functions::only_self).\n///\n/// ## Choosing Delays\n///\n/// A short delay reduces the most obvious downside of `DelayedPublicMutable`, and so it is natural to wish to make it\n/// be as low as possible. It is therefore important to understand the tradeoffs involved in delay selection.\n///\n/// A shorter delay will result in a lower `expiration_timestamp` property of transactions that privately read the\n/// state variable, reducing its privacy set. If the delay is smaller than that of any other contract, then this\n/// privacy leak might be large enough to uniquely identify those transactions that interact with the contract - fully\n/// defeating the purpose of `DelayedPublicMutable`.\n///\n/// Additionally, a lower `expiration_timestamp` obviously causes transactions to expire earlier, resulting in\n/// multiple issues. Among others, this can make large transactions that take long to prove be unfeasible, restrict\n/// users with slow proving devices, and force large transaction fees to guarantee fast inclusion.\n///\n/// In practice, a delay of at least a couple hours is recommended. From a privacy point of view the optimal delay is\n/// [`crate::protocol::constants::MAX_TX_LIFETIME`], which puts contracts in the same privacy set as those that do not\n/// use `DelayedPublicMutable` at all.\n///\n/// ## Examples\n///\n/// Declaring a `DelayedPublicMutable` in the contract's [`storage`](crate::macros::storage::storage) struct\n/// requires specifying the type `T` that is stored in the variable, along with the initial delay used when scheduling\n/// value changes:\n///\n/// ```noir\n/// global PAUSE_CONTRACT_INITIAL_DELAY_S: u64 = 6 * 60 * 60; // 6 hours\n/// global CHANGE_AUTHORIZATION_INITIAL_DELAY_S: u64 = 24 * 60 * 60; // 24 hours\n///\n/// #[storage]\n/// struct Storage<C> {\n/// paused: DelayedPublicMutable<bool, PAUSE_CONTRACT_INITIAL_DELAY_S, C>,\n/// user_authorization: Map<AztecAddress, DelayedPublicMutable<bool, CHANGE_AUTHORIZATION_INITIAL_DELAY_S, C>, C>,\n/// }\n/// ```\n///\n/// Note that this initial delay can be altered during the contract's lifetime via\n/// [`DelayedPublicMutable::schedule_delay_change`].\n///\n/// ## Requirements\n///\n/// The type `T` stored in the `DelayedPublicMutable` must implement the `Eq` and\n/// [`Packable`](crate::protocol::traits::Packable) traits.\n///\n/// ## Implementation Details\n///\n/// This state variable stores more information in public storage than\n/// [`PublicMutable`](crate::state_vars::PublicMutable), as it needs to keep track of the current and scheduled change\n/// information for both the value and the delay - see\n/// [`crate::protocol::delayed_public_mutable::DelayedPublicMutableValues`].\n///\n/// It also stores a hash of this entire configuration so that private reads can be performed in a single historical\n/// public storage read - see [`crate::utils::WithHash`].\n///\n/// This results in a total of `N * 2 + 2` storage slots used, where `N` is the packing length of the stored type `T`.\n/// This makes it quite important to ensure `T`'s implementation of [`Packable`](crate::protocol::traits::Packable) is\n/// space-efficient.\npub struct DelayedPublicMutable<T, let InitialDelay: u64, Context> {\n context: Context,\n storage_slot: Field,\n}\n\n// We allocate `M + 1` slots because we're going to store a `WithHash<DelayedPublicMutableValues<T, InitialDelay>>`,\n// and `WithHash` increases the packing length by one.\nimpl<T, let InitialDelay: u64, Context, let M: u32> StateVariable<M + 1, Context> for DelayedPublicMutable<T, InitialDelay, Context>\nwhere\n DelayedPublicMutableValues<T, InitialDelay>: Packable<N = M>,\n{\n fn new(context: Context, storage_slot: Field) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Self { context, storage_slot }\n }\n\n fn get_storage_slot(self) -> Field {\n self.storage_slot\n }\n}\n\nimpl<T, let InitialDelay: u64> DelayedPublicMutable<T, InitialDelay, PublicContext>\nwhere\n T: Eq,\n{\n /// Schedules a write to the current value.\n ///\n /// The current value does not immediately change. Once the current delay passes,\n /// [`get_current_value`](DelayedPublicMutable::get_current_value) automatically begins to return `new_value`.\n ///\n /// ## Multiple Scheduled Changes\n ///\n /// Only a **single** value can be scheduled to become the new value at a given point in time. Any prior scheduled\n /// changes which have not yet become current are **replaced** with the new one and discarded.\n ///\n /// To illustrate this, consider a scenario at `t0` with a current value `A`. A value change to `B` is scheduled to\n /// occur at `t1`. At some point _before_ `t1`, a second value change to `C` is scheduled to occur at `t2` (`t2 >\n /// t1`). The result is that the current value continues to be `A` all the way until `t2`, at which point it\n /// changes to `C`.\n ///\n /// This also means that it is possible to **cancel** a scheduled change by calling `schedule_value_change` with\n /// the current value.\n ///\n /// ## Examples\n ///\n /// A public setter that authorizes a user:\n /// ```noir\n /// #[external(\"public\")]\n /// fn authorize_user(user: AztecAddress) {\n /// assert_eq(self.storage.admin.read(), self.msg_sender(), \"caller is not admin\");\n /// self.storage.user_authorization.at(user).schedule_value_change(true);\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// The `SSTORE` AVM opcode is invoked `2 * N + 2` times, where `N` is `T`'s packed length.\n pub fn schedule_value_change(self, new_value: T)\n where\n T: Packable,\n {\n let _ = self.schedule_and_get_value_change(new_value);\n }\n\n /// Schedules a write to the current value, returning the scheduled entry.\n pub fn schedule_and_get_value_change(self, new_value: T) -> ScheduledValueChange<T>\n where\n T: Packable,\n {\n let mut value_change = self.read_value_change();\n let delay_change = self.read_delay_change();\n\n let current_timestamp = self.context.timestamp();\n let current_delay = delay_change.get_current(current_timestamp);\n\n // TODO: make this configurable https://github.com/AztecProtocol/aztec-packages/issues/5501\n let timestamp_of_change = current_timestamp + current_delay;\n value_change.schedule_change(new_value, current_timestamp, current_delay, timestamp_of_change);\n\n self.write(value_change, delay_change);\n\n value_change\n }\n\n /// Schedules a write to the current delay.\n ///\n /// This works just like [`schedule_value_change`](DelayedPublicMutable::schedule_value_change), except instead of\n /// changing the value in the state variable, it changes the delay that will govern future invocations of that\n /// function.\n ///\n /// The current delay does not immediately change. Once the current delay passes,\n /// [`get_current_delay`](DelayedPublicMutable::get_current_delay) automatically begins to return `new_delay`, and\n /// [`schedule_value_change`](DelayedPublicMutable::schedule_value_change) begins using it.\n ///\n /// ## Multiple Scheduled Changes\n ///\n /// Only a **single** delay can be scheduled to become the new delay at a given point in time. Any prior scheduled\n /// changes which have not yet become current are **replaced** with the new one and discarded.\n ///\n /// To illustrate this, consider a scenario at `t0` with a current delay `A`. A delay change to `B` is scheduled to\n /// occur at `t1`. At some point _before_ `t1`, a second delay change to `C` is scheduled to occur at `t2` (`t2 >\n /// t1`). The result is that the current delay continues to be `A` all the way until `t2`, at which point it\n /// changes to `C`.\n ///\n /// ## Delays When Changing Delays\n ///\n /// A delay change cannot always be immediate: if it were, then it'd be possible to break `DelayedPublicMutable`'s\n /// invariants by setting the delay to a very low or zero value and then scheduling a value change, resulting in a\n /// new value becoming the current one earlier than was predictable based on the prior delay. This would prohibit\n /// private reads, which is the reason for existence of this state variable.\n ///\n /// Instead, delay changes are themselves scheduled and delay so that the property mentioned above is preserved.\n /// This results in delay increases and decreases being asymmetrical.\n ///\n /// If the delay is being decreased, then this requires a delay equal to the difference between the current and new\n /// delay, so that a scheduled value change that occurred as the new delay came into effect would be scheduled for\n /// the same timestamp as if no delay change had occurred.\n ///\n /// If the delay is being increased, then the new delay becomes effective immediately, as new value changes would\n /// be scheduled for a timestamp that is further than the current delay.\n ///\n /// ## Examples\n ///\n /// A public setter that sets the pause delay:\n /// ```noir\n /// #[public]\n /// fn set_pause_delay(delay: u64) {\n /// assert_eq(self.storage.admin.read(), self.msg_sender(), \"caller is not admin\");\n /// self.storage.paused.schedule_delay_change(delay);\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// The `SSTORE` AVM opcode is invoked `2 * N + 2` times, where `N` is `T`'s packed length.\n pub fn schedule_delay_change(self, new_delay: u64)\n where\n T: Packable,\n {\n let mut delay_change = self.read_delay_change();\n\n let current_timestamp = self.context.timestamp();\n\n delay_change.schedule_change(new_delay, current_timestamp);\n\n // We can't just update the `ScheduledDelayChange`, we need to update the entire storage because we need to\n // also recompute and write the hash.\n // We _could_ just read everything, update the hash and `ScheduledDelayChange` but not overwrite the\n // `ScheduledValueChange`, resulting in fewer storage writes, but that would require careful handling of\n // storage slots and `WithHash`'s internal layout, which is not worth doing at this point.\n self.write(self.read_value_change(), delay_change);\n }\n\n /// Returns the current value.\n ///\n /// If [`schedule_value_change`](DelayedPublicMutable::schedule_value_change) has never been called, then this\n /// returns the default empty public storage value, which is all zeroes - equivalent to `let t =\n /// T::unpack(std::mem::zeroed());`.\n ///\n /// It is not possible to detect if a `DelayedPublicMutable` has ever been initialized or not other than by testing\n /// for the zero sentinel value. For a more robust solution, store an `Option<T>` in the `DelayedPublicMutable`.\n ///\n /// Use [`get_scheduled_value`](DelayedPublicMutable::get_scheduled_value) to instead get the last value that was\n /// scheduled to become the current one (which will equal the current value if the delay has already passed).\n ///\n /// ## Examples\n ///\n /// A public getter that returns a user's authorization status:\n /// ```noir\n /// #[external(\"public\")]\n /// fn is_authorized(user: AztecAddress) -> bool {\n /// self.storage.user_authorization.at(user).get_current_value()\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// The `SLOAD` AVM opcode is invoked `2 * N + 1` times, where `N` is `T`'s packed length.\n pub fn get_current_value(self) -> T\n where\n T: Packable,\n {\n let current_timestamp = self.context.timestamp();\n let value_change = self.read_value_change();\n\n value_change.get_current_at(current_timestamp)\n }\n\n /// Returns the current delay.\n ///\n /// This is the delay that would be used by [`schedule_value_change`](DelayedPublicMutable::schedule_value_change)\n /// if it were called in the current transaction.\n ///\n /// If [`schedule_delay_change`](DelayedPublicMutable::schedule_delay_change) has never been called, then this\n /// returns the `InitialDelay` used in the [`storage`](crate::macros::storage::storage) struct.\n ///\n /// Use [`get_scheduled_delay`](DelayedPublicMutable::get_scheduled_delay) to instead get the last delay that was\n /// scheduled to become the current one (which will equal the current delay if the delay has already passed).\n ///\n /// ## Examples\n ///\n /// A public getter that returns the pause delay:\n /// ```noir\n /// #[external(\"public\")]\n /// fn get_pause_delay() -> u64 {\n /// self.storage.paused.get_current_delay()\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// The `SLOAD` AVM opcode is invoked a single time, regardless of `T`.\n pub fn get_current_delay(self) -> u64\n where\n T: Packable,\n {\n let current_timestamp = self.context.timestamp();\n self.read_delay_change().get_current(current_timestamp)\n }\n\n /// Returns the last scheduled value and timestamp of change.\n pub fn get_scheduled_value(self) -> (T, u64)\n where\n T: Packable,\n {\n self.read_value_change().get_scheduled()\n }\n\n /// Returns the last scheduled delay and timestamp of change.\n pub fn get_scheduled_delay(self) -> (u64, u64)\n where\n T: Packable,\n {\n self.read_delay_change().get_scheduled()\n }\n\n fn read_value_change(self) -> ScheduledValueChange<T>\n where\n T: Packable,\n {\n // We don't read ScheduledValueChange directly by having it implement Packable because ScheduledValueChange and\n // ScheduledDelayChange are packed together (sdc and svc.timestamp_of_change are stored in the same slot).\n let packed = self.context.storage_read(self.storage_slot);\n unpack_value_change::<T, <T as Packable>::N>(packed)\n }\n\n fn read_delay_change(self) -> ScheduledDelayChange<InitialDelay>\n where\n T: Packable,\n {\n // Since all ScheduledDelayChange member are packed into a single field, we can read a single storage slot here\n // and skip the ones that correspond to ScheduledValueChange members. We are abusing the fact that the field\n // containing the ScheduledDelayChange data is the first one in the storage layout - otherwise we'd need to\n // offset the storage slot to get the position where it'd land. We don't read ScheduledDelayChange directly by\n // having it implement Packable because ScheduledValueChange and ScheduledDelayChange are packed together (sdc\n // and svc.timestamp_of_change are stored in the same slot).\n let packed = self.context.storage_read(self.storage_slot);\n unpack_delay_change::<InitialDelay>(packed)\n }\n\n fn write(self, value_change: ScheduledValueChange<T>, delay_change: ScheduledDelayChange<InitialDelay>)\n where\n T: Packable,\n {\n // Whenever we write to public storage, we write both the value change and delay change to storage at once. We\n // do so by wrapping them in a single struct (`DelayedPublicMutableValues`). Then we wrap the resulting struct\n // in `WithHash`. Wrapping in `WithHash` makes for more costly writes but it also makes private proofs much\n // simpler because they only need to produce a historical proof for the hash, which results in a single\n // inclusion proof (as opposed to 4 in the best case scenario in which T is a single field). Private delayed\n // public mutable reads are assumed to be much more frequent than public writes, so this tradeoff makes sense.\n let values = WithHash::new(DelayedPublicMutableValues::new(value_change, delay_change));\n\n self.context.storage_write(self.storage_slot, values);\n }\n}\n\nimpl<T, let InitialDelay: u64> DelayedPublicMutable<T, InitialDelay, &mut PrivateContext>\nwhere\n T: Eq,\n{\n /// Returns the current value.\n ///\n /// If [`schedule_value_change`](DelayedPublicMutable::schedule_value_change) has never been called, then this\n /// returns the default empty public storage value, which is all zeroes - equivalent to `let t =\n /// T::unpack(std::mem::zeroed());`.\n ///\n /// It is not possible to detect if a `DelayedPublicMutable` has ever been initialized or not other than by testing\n /// for the zero sentinel value. For a more robust solution, store an `Option<T>` in the `DelayedPublicMutable`.\n ///\n /// ## Privacy\n ///\n /// This function does leak some privacy, though in a subtle way. Understanding this is key to understanding how to\n /// use `DelayedPublicMutable` in a privacy-preserving way.\n ///\n /// Private reads are based on a historical public storage read at the anchor block (i.e.\n /// [`crate::history::storage::public_storage_historical_read`]). `DelayedPublicMutable` is able to provide\n /// guarantees about values read in the past remaining the state variable's current value into the future due to\n /// the existence of delays when scheduling writes. It then sets the `expiration_timestamp` property of the current\n /// transaction (see\n /// [`PrivateContext::set_expiration_timestamp`](crate::context::PrivateContext::set_expiration_timestamp)) to\n /// ensure that the transaction can only be included in a block **prior** to the state variable's value changing.\n /// In other words, it knows some facts about the near future up until some time horizon, and then makes sure that\n /// it doesn't act on this knowledge past said moment.\n ///\n /// Because the `expiration_timestamp` property is part of the transaction's public information, any mutation to\n /// this value could result in transaction fingerprinting. Note that multiple contracts may set this value during a\n /// transaction: it is the smallest (most restrictive) timestamp that will be used.\n ///\n /// If the state variable **does not** have any value changes scheduled, then the timestamp will be set to that of\n /// the anchor block plus the current delay. If multiple contracts use the same delay for their\n /// `DelayedPublicMutable` state variables, then these will all be in the same privacy set.\n ///\n /// If the state variable **does** have a value change scheduled, then the timestamp will be set to equal the time\n /// at which the current value will change, i.e. the one\n /// [`get_scheduled_value`](DelayedPublicMutable::get_scheduled_value) returns - which is public information. This\n /// results in an unavoidable privacy leak of any transactions in which a contract privately reads a\n /// `DelayedPublicMutable` that will change soon.\n ///\n /// Transactions that do not read from a `DelayedPublicMutable` are part of a privacy set in which the\n /// `expiration_timestamp` is set to their anchor block plus [`crate::protocol::constants::MAX_TX_LIFETIME`],\n /// making this the most privacy-preserving delay. The less frequent said value changes are, the more private the\n /// contract is. Wallets can also then choose to further lower this timestamp to make it less obvious that their\n /// transactions are interacting with this soon-to-change variable.\n ///\n /// ## Examples\n ///\n /// A private action that requires authorization:\n /// ```noir\n /// #[external(\"private\")]\n /// fn do_action() {\n /// assert(\n /// self.storage.user_authorization.at(self.msg_sender()).get_current_value(),\n /// \"caller is not authorized\"\n /// );\n ///\n /// // do the action\n /// }\n /// ```\n ///\n /// A private action that can be paused:\n /// ```noir\n /// #[external(\"private\")]\n /// fn do_action() {\n /// assert(!self.storage.paused.get_current_value(), \"contract is paused\");\n ///\n /// // do the action\n /// }\n /// ```\n ///\n /// ## Cost\n ///\n /// This function performs a single merkle tree inclusion proof, which is in the order of 4k gates.\n pub fn get_current_value(self) -> T\n where\n T: Packable,\n {\n // When reading the current value in private we construct a historical state proof for the public value.\n // However, since this value might change, we must constrain the maximum transaction timestamp as this proof\n // will only be valid for the time we can ensure the value will not change, which will depend on the current\n // delay and any scheduled delay changes.\n let (value_change, delay_change, anchor_timestamp) = self.anchor_read_from_public_storage();\n\n // We use the effective minimum delay as opposed to the current delay at the anchor block's timestamp as this\n // one also takes into consideration any scheduled delay changes. For example, consider a scenario in which at\n // timestamp `x` the current delay was 86400 seconds (1 day). We may naively think that the earliest we could\n // change the value would be at timestamp `x + 86400` by scheduling immediately after the anchor block's\n // timestamp, i.e. at timestamp `x + 1`. But if there was a delay change scheduled for timestamp `y` to reduce\n // the delay to 43200 seconds (12 hours), then if a value change was scheduled at timestamp `y` it would go\n // into effect at timestamp `y + 43200`, which is earlier than what we'd expect if we only considered the\n // current delay.\n let effective_minimum_delay = delay_change.get_effective_minimum_delay_at(anchor_timestamp);\n let time_horizon = value_change.get_time_horizon(anchor_timestamp, effective_minimum_delay);\n\n // We prevent this transaction from being included in any timestamp after the time horizon, ensuring that the\n // historical public value matches the current one, since it can only change after the horizon.\n self.context.set_expiration_timestamp(time_horizon);\n\n value_change.get_current_at(anchor_timestamp)\n }\n\n fn anchor_read_from_public_storage(self) -> (ScheduledValueChange<T>, ScheduledDelayChange<InitialDelay>, u64)\n where\n T: Packable,\n {\n let header = self.context.get_anchor_block_header();\n let address = self.context.this_address();\n\n let anchor_timestamp = header.global_variables.timestamp;\n\n let values: DelayedPublicMutableValues<T, InitialDelay> =\n WithHash::historical_public_storage_read(header, address, self.storage_slot);\n\n (values.svc, values.sdc, anchor_timestamp)\n }\n}\n\nimpl<T, let InitialDelay: u64> DelayedPublicMutable<T, InitialDelay, UtilityContext>\nwhere\n T: Eq,\n{\n pub unconstrained fn get_current_value(self) -> T\n where\n T: Packable,\n {\n let dpmv: DelayedPublicMutableValues<T, InitialDelay> =\n WithHash::utility_public_storage_read(self.context, self.storage_slot);\n\n let current_timestamp = self.context.timestamp();\n dpmv.svc.get_current_at(current_timestamp)\n }\n}\n"
|
|
2930
2930
|
},
|
|
2931
|
-
"
|
|
2931
|
+
"84": {
|
|
2932
2932
|
"function_locations": [
|
|
2933
2933
|
{
|
|
2934
2934
|
"name": "<impl StateVariable<1, Context> for Map<K, V, Context>>::new",
|
|
@@ -2946,7 +2946,7 @@
|
|
|
2946
2946
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/aztec_sublib/src/state_vars/map.nr",
|
|
2947
2947
|
"source": "use crate::protocol::{storage::map::derive_storage_slot_in_map, traits::ToField};\nuse crate::state_vars::StateVariable;\n\n/// A key-value container for state variables.\n///\n/// A key-value storage container that maps keys to state variables, similar to Solidity mappings.\npub struct Map<K, V, Context> {\n pub context: Context,\n storage_slot: Field,\n}\n\n// Map reserves a single storage slot regardless of what it stores because nothing is stored at said slot: it is only\n// used to derive the storage slots of nested state variables.\nimpl<K, V, Context> StateVariable<1, Context> for Map<K, V, Context> {\n fn new(context: Context, storage_slot: Field) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Map { context, storage_slot }\n }\n\n fn get_storage_slot(self) -> Field {\n self.storage_slot\n }\n}\n\nimpl<K, V, Context> Map<K, V, Context> {\n /// Returns the state variable associated with the given key.\n ///\n /// This is equivalent to accessing `mapping[key]` in Solidity.\n pub fn at<let N: u32>(self, key: K) -> V\n where\n K: ToField,\n V: StateVariable<N, Context>,\n {\n V::new(\n self.context,\n derive_storage_slot_in_map(self.storage_slot, key),\n )\n }\n}\n"
|
|
2948
2948
|
},
|
|
2949
|
-
"
|
|
2949
|
+
"90": {
|
|
2950
2950
|
"function_locations": [
|
|
2951
2951
|
{
|
|
2952
2952
|
"name": "WithHash<T, M>::new",
|
|
@@ -3013,7 +3013,7 @@
|
|
|
3013
3013
|
"abi_public",
|
|
3014
3014
|
"abi_view"
|
|
3015
3015
|
],
|
|
3016
|
-
"debug_symbols": "
|
|
3016
|
+
"debug_symbols": "rVhbbtswELyLvv1B7oOPXKUoAidRCgOGE7h2gSLw3bsbcym5ANmE6Y81Hlmj4XK4lPU2Pc0P5x/3u8Pzy8/p7tvb9HDc7fe7H/f7l8ftafdyEPZtcvoR5BM3U+DpjjZTdNdDej8knO6CHOSbl9/keD16BwUAGrBTaKfQGDKGjGFvgAtQE1dABnIB0W4RiwufVJAVhAKyN1AYcN6AMd4YrzZkVABgwBjU3yQFoQBSJisIBbAxnAtQz4AKhAFlojDoBahV1FMpFpCVIQXKiB9EMiCXo9hAIgPKRAGsTFKgjNwC9aZXYIzelJyCXEBSxivIBWRjsk4wbCZyUl5CBcqIMSIugDULrIAL0GmioEAZMUbveUkKuIBkTFJGjFF2BoRhMcbOGRA/7BWIQxY/7JVBBcqIDQYyoIzYYK3YFRhDxmjFWByyVuwKjAnGaMVYzLNWjPPlsplsWdyfjvOsq2K1TmT1vG6P8+E03R3O+/1m+rXdn99/9PN1e3g/nrZHOSsDmg9PchTB591+VnTZLFe79qVe4hDK5YJzqhLsbzR8WyMH74tEDgiLQrxRgI4Ll6oJ73JViJ8ZR8gmgS641jh6Guih2kCPuaXBbQ0kcyELZWQc6HJcPAC3PMReLXTN2JQuColuFFJbAZJFCleJkE52I5A7kUBnFjLSEgnppbep6pQiO20PVw2XXVvD96bDJDCtBoJ/KXSiKV3bMgE+0ZgGoNkACB0f1NYgH21OCFxcVePDNjBHX6c15qaNXrR8Xq+yVrR8RyICmESUzW2RwM9IgEmghLIh8fFlxs22Bz2RQGQFFRywZQQ6CU2ytxWNRDE0m2dnXkOdk+hjq+f8YyCRl4Hk2BxIJ6DydOSSiSRJfFOEexsBYG3BDjg26xE6jSMvc+ucp6ZGJ2JBHv+KRvCpbaPXRKOVA3JzK+iPg2EZB6SWCexMLTLXNR8cNG30JzZUH0kae2tisdcCM3CtBqZV+3Kf0KhLBWVeBzW4btDO85CGlKDW1AU/qFFXnHQwHNWgqgFxTMNzrBohjGqEqhH9f9AY9ZGrBsCoj+y+rpFqxgBpTANCzRiM1hRSzRj6UR+pZgxhbN0iLhnD0Yzhkg8crceNxqiPJWPyHDaq4b6usWSMcLB/0NILKeQxjUi2N0hJYUwjrf5uDPZ1+Z9iGSPn273w449B3H6w5N6u71x91ne0NiIa3+Xr9nF3vHkbdlGx4277sJ/L1+fz4XF19vT71c7Y27TX48vj/HQ+zqq0vFLTV03fvPwhki3l+0Xv9wc=",
|
|
3017
3017
|
"is_unconstrained": true,
|
|
3018
3018
|
"name": "get_update_delay"
|
|
3019
3019
|
},
|
|
@@ -3077,7 +3077,7 @@
|
|
|
3077
3077
|
"custom_attributes": [
|
|
3078
3078
|
"abi_public"
|
|
3079
3079
|
],
|
|
3080
|
-
"debug_symbols": "tZ1djhw3DoDvMs9+
|
|
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q+ZeDhfFFfFBvm7nrbZcPUV5v2h23mOtCprbeU5HvXFfqDL3Oq0L6ui1nZ+MK0qQduBdFr9smo3kE75fhFWV+BbgfSDruwF0mlV1toMpB/d37384Ct8DRdzePULq9102PqEVc4nrPkysCo2APnqSqez/MsnStLyV1abz4Ite1OzP6dTa7h05qweSLMOmI9I+WfPz9WCYE5xzP9+RMJVCivYo0/JZ17e9g+OzKya3GCeaFmqKD4UIV5TYQ9PyB/Gu6JC/vCdqSjxmgqbs7zrwkUV2VSkeklFtFoYcCXjogrLgMca76u4aIWl0KXCcFFFuK2CzLX40HVJRbKgHdLF4fTnHAHiRSusDMDp+0szFQBPNZpyUYXdVLg4Fs9UXLTCXSuncFFFuK3CXSvDtfUi+8LHuZBLKmr2vFRJl1TQKTa+toJzTG3PnIZ4aeHDUEdHnj0e+RoVnvTAWOCaCnuSCGPFi1agq2i3x4LCNSssOMCUrlnh0T3KE8jXrCiuAu+OxTmiflVHinUEwqXlF8HCPs6/XrXCOgLXlpzzWMC1DREBvCPXlhyE6sNJV62orqLcHgu6tuTkMPZUPD9L+SoVFpFgxnLRChvOfO3oeh6LfG0TwOqTvZZLw1mj/ZmWGk8pdJ4uZw36JMIi1WsRXjqfUcq+FXbKYWyXNFRPNp1X330NWmHrWcBzSvMVNnjC6/x80UUN8ZINpzxkgnDNBnIN8ZINgKYBr/UCsmko6W4vXmj4md99+O3T12f/reYP0fX104dfP3/sb//4/uW306ff/vvX+GT8t5x/ff3zt4+/f//6UTSd/m/Op/c/EeI7KvXnd08g7zjkp5j4nfw1+Z8KpwdKCT//EFv+Bw==",
|
|
3081
3081
|
"is_unconstrained": true,
|
|
3082
3082
|
"name": "public_dispatch"
|
|
3083
3083
|
},
|
|
@@ -4958,11 +4958,11 @@
|
|
|
4958
4958
|
"visibility": "databus"
|
|
4959
4959
|
}
|
|
4960
4960
|
},
|
|
4961
|
-
"bytecode": "H4sIAAAAAAAA/+2dd3hUxduG875DVSmCiA3FQu/YsAtJaNKk2Y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oCI5z4bKWGR6l6Q4eXcgyIdxlVikLzLki90qqUguUnGi+mtKRUom0s2OXZFQJOYlUemLDEUqXlIcVrwcy3MsMhUp7zK6fEVbJeTEhAJGrA1/Yp02Qm1QbXBtxNpItSGlkVxuqAYJaiMj5wNj8rWRkb3yLmXk7NTTiTaqV4q1kU7xoTakNMSdgjZtQG3gKQTThj/tc9rIyHl+JSNn/gvXRkbOdiUZORdbRU6Nt8z/48Pd98M+UziT/PXxvjJaH1/+f67f1P+4eD4+3e9/vB73mf0n4p/+IULV+KK+MtLXt2wgfwE=",
|
|
4966
4966
|
"is_unconstrained": false,
|
|
4967
4967
|
"name": "publish_for_public_execution",
|
|
4968
4968
|
"verification_key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANHAAAAAAAAAAAAAAAAAAAA6agnz7VvjagC7hCSyaVJnvoAAAAAAAAAAAAAAAAAAAAAAA4Q8x0wyihRybj1fqst0QAAAAAAAAAAAAAAAAAAAI764fTzS7yS2TVF3osSiOjxAAAAAAAAAAAAAAAAAAAAAAAZXqNB801yignDBIfG1/MAAAAAAAAAAAAAAAAAAAB0fXoaKzvH46WLPc+0IXW0lwAAAAAAAAAAAAAAAAAAAAAAGtlW+QMRDBhixXStrn91AAAAAAAAAAAAAAAAAAAAdM0fTzeBr0g5wsSeC5EI7v4AAAAAAAAAAAAAAAAAAAAAABHqXzZW3UG+RYBO4uU7oAAAAAAAAAAAAAAAAAAAAFYOOUjqXxgIO+EHfoiGABvbAAAAAAAAAAAAAAAAAAAAAAAopgZhz/NycqM9qbIY9gkAAAAAAAAAAAAAAAAAAAAr+SFm2iaS/iKJUdCAUAZjegAAAAAAAAAAAAAAAAAAAAAAB0QbXnhb+H1l5lOdImeyAAAAAAAAAAAAAAAAAAAAlz83uFYwbgBiB3olW3DDaTsAA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unconstrained": true,
|
|
5017
5017
|
"name": "set_update_delay"
|
|
5018
5018
|
},
|
|
@@ -5068,7 +5068,7 @@
|
|
|
5068
5068
|
"custom_attributes": [
|
|
5069
5069
|
"abi_public"
|
|
5070
5070
|
],
|
|
5071
|
-
"debug_symbols": "
|
|
5071
|
+
"debug_symbols": "tZvbbhw5Dobfpa99IVKkDnmVQRA4iTMwYDiBJ1lgEfjdl9SBKntXSlvlvZn+zK7+i2SROpQmvy9f7z7/+vvT/eO37/9cPvz1+/L56f7h4f7vTw/fv9z+vP/+KNbfF6f/AebLB39zgSB/sn5y+8zVHql9yt9RPhO1z/Z3juUTHbbPcPkATgBAQC3oGlC3EDfg/hV3S+iWYJbcIPoOqUHCDrFB7rfIoYJ3KpgVqENuAN0C3YLdgt3ixQ2UcDy5DnINooA6j14hNQjioddrQmwQsUO3pG5J3aI+V+AKpD5XoA65AfgOqQGqICqEBh46dAt1C3ULdwurG+I8Beyg10gJUHE+CCTXQTwkvSZTh1SBne/QLdAt0C3qaoXQQF2t0JRZ81yBOuQGrIKsEBuozxW6JXZL7JbULUndkCg4+w56Tbq5BC3eCmqR5x4AG2j1VtDGkF8Fr52iF3sRZP2KfPuKUvuKQ/sqQIfQronQrtGOCiCgLVVBLfJQgqY36DVZu0yeclTHonwV1bEKapG0RM1qJAHODYL2KCvkBtrFMSioRfoilj5OCrlB7pZyU/E5aflVEEsSN5K2TIVuQYk9gYLEnsSx5NUijqXoOkjqkjiWtJAqqEUcS1ktQUEt4ljW4q/QLaCWpMAN9KGkrMAdxJ8s/mQvHmZQUIv4k7WQslfIDVgtpJAbhG4J3aIZy6yQG6RuSd2iGctBQS3iBrgyyjhQ1EcPDgsGwzisqtwwlZ9xwWyohaqlItQKC8B5I7OB2bTV5GpFfTCgI7FgMvTD6qNhGZkbsmEZnRserNkwFDEoWG6hsUAZp8EXTIZpWMtoXbGM1w25I5Yxu+HBmg2hiFHBcgtNF9aIQ8Fi1fkJa8QVh5VwYDCsEVdkwzCsWic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4c4Hyp4z2ssj8+Kx3/w8=",
|
|
5072
5072
|
"is_unconstrained": true,
|
|
5073
5073
|
"name": "update"
|
|
5074
5074
|
}
|
|
@@ -5500,5 +5500,5 @@
|
|
|
5500
5500
|
}
|
|
5501
5501
|
},
|
|
5502
5502
|
"transpiled": true,
|
|
5503
|
-
"aztec_version": "5.0.0-rc.
|
|
5503
|
+
"aztec_version": "5.0.0-rc.2"
|
|
5504
5504
|
}
|