@aztec/protocol-contracts 0.80.0 → 0.82.0
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/AuthRegistry.json +877 -763
- package/artifacts/ContractClassRegisterer.json +1343 -1220
- package/artifacts/ContractInstanceDeployer.json +707 -593
- package/artifacts/FeeJuice.json +1056 -938
- package/artifacts/MultiCallEntrypoint.json +539 -383
- package/artifacts/Router.json +896 -766
- package/dest/protocol_contract_data.js +7 -7
- package/package.json +4 -4
- package/src/protocol_contract_data.ts +7 -7
|
@@ -3,26 +3,6 @@
|
|
|
3
3
|
"noir_version": "1.0.0-beta.3+0000000000000000000000000000000000000000",
|
|
4
4
|
"name": "ContractInstanceDeployer",
|
|
5
5
|
"functions": [
|
|
6
|
-
{
|
|
7
|
-
"name": "sync_notes",
|
|
8
|
-
"is_unconstrained": true,
|
|
9
|
-
"custom_attributes": [],
|
|
10
|
-
"abi": {
|
|
11
|
-
"error_types": {
|
|
12
|
-
"17843811134343075018": {
|
|
13
|
-
"error_kind": "string",
|
|
14
|
-
"string": "Stack too deep"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"parameters": [],
|
|
18
|
-
"return_type": null
|
|
19
|
-
},
|
|
20
|
-
"bytecode": "H4sIAAAAAAAA/7WTyw7CIBBFqcUo0sTEx39MU0y7dOHafyCtLHVRN+766dZkJkyI0QVwEzJMgMNcHoXwKjBKESGCHDEqjAs2Xs7tjDnEqVbBvin5HRijvvhLWH+jkFnk4QPxM50/rJBzmTyfe6F913PTrF8J/z5y+af7y+l//8OzRq9bzCvh/8P4uvfXx/M2ij/SbJGc0ptoOwAqvkT+EvmhJBvn8w+Yb4Svj6KMqNO1tnaNdfZkh8H0dhfwP+KH/QbzqHp4zgQAAA==",
|
|
21
|
-
"debug_symbols": "ZY5bCoMwEEX3Mt/5MPEBdStSJOoogZBIHoUSsvdORGhofy5zh8PlJNhwiceszG49jFMCbVcZlDXUUmawOKW1Oub6DU0J3l68P6Up1QfpAoy8fQjBAM123UNPG7vSSI2LzP54wm+64/zLdkN+Zqov6ZRcNN42ezRrJRfeJ/54ns6uuEWHxbiSpZx4z0RDszT9AQ==",
|
|
22
|
-
"brillig_names": [
|
|
23
|
-
"sync_notes"
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
6
|
{
|
|
27
7
|
"name": "deploy",
|
|
28
8
|
"is_unconstrained": false,
|
|
@@ -30,36 +10,24 @@
|
|
|
30
10
|
"private"
|
|
31
11
|
],
|
|
32
12
|
"abi": {
|
|
33
|
-
"error_types": {
|
|
34
|
-
"16761564377371454734": {
|
|
35
|
-
"error_kind": "string",
|
|
36
|
-
"string": "Array index out of bounds"
|
|
37
|
-
},
|
|
38
|
-
"17843811134343075018": {
|
|
39
|
-
"error_kind": "string",
|
|
40
|
-
"string": "Stack too deep"
|
|
41
|
-
},
|
|
42
|
-
"5019202896831570965": {
|
|
43
|
-
"error_kind": "string",
|
|
44
|
-
"string": "attempt to add with overflow"
|
|
45
|
-
},
|
|
46
|
-
"6485997221020871071": {
|
|
47
|
-
"error_kind": "string",
|
|
48
|
-
"string": "call to assert_max_bit_size"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
13
|
"parameters": [
|
|
52
14
|
{
|
|
53
15
|
"name": "inputs",
|
|
54
16
|
"type": {
|
|
17
|
+
"kind": "struct",
|
|
18
|
+
"path": "aztec::context::inputs::private_context_inputs::PrivateContextInputs",
|
|
55
19
|
"fields": [
|
|
56
20
|
{
|
|
57
21
|
"name": "call_context",
|
|
58
22
|
"type": {
|
|
23
|
+
"kind": "struct",
|
|
24
|
+
"path": "aztec::protocol_types::abis::call_context::CallContext",
|
|
59
25
|
"fields": [
|
|
60
26
|
{
|
|
61
27
|
"name": "msg_sender",
|
|
62
28
|
"type": {
|
|
29
|
+
"kind": "struct",
|
|
30
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
63
31
|
"fields": [
|
|
64
32
|
{
|
|
65
33
|
"name": "inner",
|
|
@@ -67,14 +35,14 @@
|
|
|
67
35
|
"kind": "field"
|
|
68
36
|
}
|
|
69
37
|
}
|
|
70
|
-
]
|
|
71
|
-
"kind": "struct",
|
|
72
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
38
|
+
]
|
|
73
39
|
}
|
|
74
40
|
},
|
|
75
41
|
{
|
|
76
42
|
"name": "contract_address",
|
|
77
43
|
"type": {
|
|
44
|
+
"kind": "struct",
|
|
45
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
78
46
|
"fields": [
|
|
79
47
|
{
|
|
80
48
|
"name": "inner",
|
|
@@ -82,14 +50,14 @@
|
|
|
82
50
|
"kind": "field"
|
|
83
51
|
}
|
|
84
52
|
}
|
|
85
|
-
]
|
|
86
|
-
"kind": "struct",
|
|
87
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
53
|
+
]
|
|
88
54
|
}
|
|
89
55
|
},
|
|
90
56
|
{
|
|
91
57
|
"name": "function_selector",
|
|
92
58
|
"type": {
|
|
59
|
+
"kind": "struct",
|
|
60
|
+
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector",
|
|
93
61
|
"fields": [
|
|
94
62
|
{
|
|
95
63
|
"name": "inner",
|
|
@@ -99,9 +67,7 @@
|
|
|
99
67
|
"width": 32
|
|
100
68
|
}
|
|
101
69
|
}
|
|
102
|
-
]
|
|
103
|
-
"kind": "struct",
|
|
104
|
-
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector"
|
|
70
|
+
]
|
|
105
71
|
}
|
|
106
72
|
},
|
|
107
73
|
{
|
|
@@ -110,18 +76,20 @@
|
|
|
110
76
|
"kind": "boolean"
|
|
111
77
|
}
|
|
112
78
|
}
|
|
113
|
-
]
|
|
114
|
-
"kind": "struct",
|
|
115
|
-
"path": "aztec::protocol_types::abis::call_context::CallContext"
|
|
79
|
+
]
|
|
116
80
|
}
|
|
117
81
|
},
|
|
118
82
|
{
|
|
119
83
|
"name": "historical_header",
|
|
120
84
|
"type": {
|
|
85
|
+
"kind": "struct",
|
|
86
|
+
"path": "aztec::protocol_types::block_header::BlockHeader",
|
|
121
87
|
"fields": [
|
|
122
88
|
{
|
|
123
89
|
"name": "last_archive",
|
|
124
90
|
"type": {
|
|
91
|
+
"kind": "struct",
|
|
92
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
125
93
|
"fields": [
|
|
126
94
|
{
|
|
127
95
|
"name": "root",
|
|
@@ -137,14 +105,14 @@
|
|
|
137
105
|
"width": 32
|
|
138
106
|
}
|
|
139
107
|
}
|
|
140
|
-
]
|
|
141
|
-
"kind": "struct",
|
|
142
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
108
|
+
]
|
|
143
109
|
}
|
|
144
110
|
},
|
|
145
111
|
{
|
|
146
112
|
"name": "content_commitment",
|
|
147
113
|
"type": {
|
|
114
|
+
"kind": "struct",
|
|
115
|
+
"path": "aztec::protocol_types::content_commitment::ContentCommitment",
|
|
148
116
|
"fields": [
|
|
149
117
|
{
|
|
150
118
|
"name": "num_txs",
|
|
@@ -170,18 +138,20 @@
|
|
|
170
138
|
"kind": "field"
|
|
171
139
|
}
|
|
172
140
|
}
|
|
173
|
-
]
|
|
174
|
-
"kind": "struct",
|
|
175
|
-
"path": "aztec::protocol_types::content_commitment::ContentCommitment"
|
|
141
|
+
]
|
|
176
142
|
}
|
|
177
143
|
},
|
|
178
144
|
{
|
|
179
145
|
"name": "state",
|
|
180
146
|
"type": {
|
|
147
|
+
"kind": "struct",
|
|
148
|
+
"path": "aztec::protocol_types::state_reference::StateReference",
|
|
181
149
|
"fields": [
|
|
182
150
|
{
|
|
183
151
|
"name": "l1_to_l2_message_tree",
|
|
184
152
|
"type": {
|
|
153
|
+
"kind": "struct",
|
|
154
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
185
155
|
"fields": [
|
|
186
156
|
{
|
|
187
157
|
"name": "root",
|
|
@@ -197,18 +167,20 @@
|
|
|
197
167
|
"width": 32
|
|
198
168
|
}
|
|
199
169
|
}
|
|
200
|
-
]
|
|
201
|
-
"kind": "struct",
|
|
202
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
170
|
+
]
|
|
203
171
|
}
|
|
204
172
|
},
|
|
205
173
|
{
|
|
206
174
|
"name": "partial",
|
|
207
175
|
"type": {
|
|
176
|
+
"kind": "struct",
|
|
177
|
+
"path": "aztec::protocol_types::partial_state_reference::PartialStateReference",
|
|
208
178
|
"fields": [
|
|
209
179
|
{
|
|
210
180
|
"name": "note_hash_tree",
|
|
211
181
|
"type": {
|
|
182
|
+
"kind": "struct",
|
|
183
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
212
184
|
"fields": [
|
|
213
185
|
{
|
|
214
186
|
"name": "root",
|
|
@@ -224,14 +196,14 @@
|
|
|
224
196
|
"width": 32
|
|
225
197
|
}
|
|
226
198
|
}
|
|
227
|
-
]
|
|
228
|
-
"kind": "struct",
|
|
229
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
199
|
+
]
|
|
230
200
|
}
|
|
231
201
|
},
|
|
232
202
|
{
|
|
233
203
|
"name": "nullifier_tree",
|
|
234
204
|
"type": {
|
|
205
|
+
"kind": "struct",
|
|
206
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
235
207
|
"fields": [
|
|
236
208
|
{
|
|
237
209
|
"name": "root",
|
|
@@ -247,14 +219,14 @@
|
|
|
247
219
|
"width": 32
|
|
248
220
|
}
|
|
249
221
|
}
|
|
250
|
-
]
|
|
251
|
-
"kind": "struct",
|
|
252
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
222
|
+
]
|
|
253
223
|
}
|
|
254
224
|
},
|
|
255
225
|
{
|
|
256
226
|
"name": "public_data_tree",
|
|
257
227
|
"type": {
|
|
228
|
+
"kind": "struct",
|
|
229
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
258
230
|
"fields": [
|
|
259
231
|
{
|
|
260
232
|
"name": "root",
|
|
@@ -270,24 +242,20 @@
|
|
|
270
242
|
"width": 32
|
|
271
243
|
}
|
|
272
244
|
}
|
|
273
|
-
]
|
|
274
|
-
"kind": "struct",
|
|
275
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
245
|
+
]
|
|
276
246
|
}
|
|
277
247
|
}
|
|
278
|
-
]
|
|
279
|
-
"kind": "struct",
|
|
280
|
-
"path": "aztec::protocol_types::partial_state_reference::PartialStateReference"
|
|
248
|
+
]
|
|
281
249
|
}
|
|
282
250
|
}
|
|
283
|
-
]
|
|
284
|
-
"kind": "struct",
|
|
285
|
-
"path": "aztec::protocol_types::state_reference::StateReference"
|
|
251
|
+
]
|
|
286
252
|
}
|
|
287
253
|
},
|
|
288
254
|
{
|
|
289
255
|
"name": "global_variables",
|
|
290
256
|
"type": {
|
|
257
|
+
"kind": "struct",
|
|
258
|
+
"path": "aztec::protocol_types::abis::global_variables::GlobalVariables",
|
|
291
259
|
"fields": [
|
|
292
260
|
{
|
|
293
261
|
"name": "chain_id",
|
|
@@ -324,6 +292,8 @@
|
|
|
324
292
|
{
|
|
325
293
|
"name": "coinbase",
|
|
326
294
|
"type": {
|
|
295
|
+
"kind": "struct",
|
|
296
|
+
"path": "aztec::protocol_types::address::eth_address::EthAddress",
|
|
327
297
|
"fields": [
|
|
328
298
|
{
|
|
329
299
|
"name": "inner",
|
|
@@ -331,14 +301,14 @@
|
|
|
331
301
|
"kind": "field"
|
|
332
302
|
}
|
|
333
303
|
}
|
|
334
|
-
]
|
|
335
|
-
"kind": "struct",
|
|
336
|
-
"path": "aztec::protocol_types::address::eth_address::EthAddress"
|
|
304
|
+
]
|
|
337
305
|
}
|
|
338
306
|
},
|
|
339
307
|
{
|
|
340
308
|
"name": "fee_recipient",
|
|
341
309
|
"type": {
|
|
310
|
+
"kind": "struct",
|
|
311
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
342
312
|
"fields": [
|
|
343
313
|
{
|
|
344
314
|
"name": "inner",
|
|
@@ -346,14 +316,14 @@
|
|
|
346
316
|
"kind": "field"
|
|
347
317
|
}
|
|
348
318
|
}
|
|
349
|
-
]
|
|
350
|
-
"kind": "struct",
|
|
351
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
319
|
+
]
|
|
352
320
|
}
|
|
353
321
|
},
|
|
354
322
|
{
|
|
355
323
|
"name": "gas_fees",
|
|
356
324
|
"type": {
|
|
325
|
+
"kind": "struct",
|
|
326
|
+
"path": "aztec::protocol_types::abis::gas_fees::GasFees",
|
|
357
327
|
"fields": [
|
|
358
328
|
{
|
|
359
329
|
"name": "fee_per_da_gas",
|
|
@@ -367,14 +337,10 @@
|
|
|
367
337
|
"kind": "field"
|
|
368
338
|
}
|
|
369
339
|
}
|
|
370
|
-
]
|
|
371
|
-
"kind": "struct",
|
|
372
|
-
"path": "aztec::protocol_types::abis::gas_fees::GasFees"
|
|
340
|
+
]
|
|
373
341
|
}
|
|
374
342
|
}
|
|
375
|
-
]
|
|
376
|
-
"kind": "struct",
|
|
377
|
-
"path": "aztec::protocol_types::abis::global_variables::GlobalVariables"
|
|
343
|
+
]
|
|
378
344
|
}
|
|
379
345
|
},
|
|
380
346
|
{
|
|
@@ -389,14 +355,14 @@
|
|
|
389
355
|
"kind": "field"
|
|
390
356
|
}
|
|
391
357
|
}
|
|
392
|
-
]
|
|
393
|
-
"kind": "struct",
|
|
394
|
-
"path": "aztec::protocol_types::block_header::BlockHeader"
|
|
358
|
+
]
|
|
395
359
|
}
|
|
396
360
|
},
|
|
397
361
|
{
|
|
398
362
|
"name": "tx_context",
|
|
399
363
|
"type": {
|
|
364
|
+
"kind": "struct",
|
|
365
|
+
"path": "aztec::protocol_types::transaction::tx_context::TxContext",
|
|
400
366
|
"fields": [
|
|
401
367
|
{
|
|
402
368
|
"name": "chain_id",
|
|
@@ -413,10 +379,14 @@
|
|
|
413
379
|
{
|
|
414
380
|
"name": "gas_settings",
|
|
415
381
|
"type": {
|
|
382
|
+
"kind": "struct",
|
|
383
|
+
"path": "aztec::protocol_types::abis::gas_settings::GasSettings",
|
|
416
384
|
"fields": [
|
|
417
385
|
{
|
|
418
386
|
"name": "gas_limits",
|
|
419
387
|
"type": {
|
|
388
|
+
"kind": "struct",
|
|
389
|
+
"path": "aztec::protocol_types::abis::gas::Gas",
|
|
420
390
|
"fields": [
|
|
421
391
|
{
|
|
422
392
|
"name": "da_gas",
|
|
@@ -434,14 +404,14 @@
|
|
|
434
404
|
"width": 32
|
|
435
405
|
}
|
|
436
406
|
}
|
|
437
|
-
]
|
|
438
|
-
"kind": "struct",
|
|
439
|
-
"path": "aztec::protocol_types::abis::gas::Gas"
|
|
407
|
+
]
|
|
440
408
|
}
|
|
441
409
|
},
|
|
442
410
|
{
|
|
443
411
|
"name": "teardown_gas_limits",
|
|
444
412
|
"type": {
|
|
413
|
+
"kind": "struct",
|
|
414
|
+
"path": "aztec::protocol_types::abis::gas::Gas",
|
|
445
415
|
"fields": [
|
|
446
416
|
{
|
|
447
417
|
"name": "da_gas",
|
|
@@ -459,14 +429,14 @@
|
|
|
459
429
|
"width": 32
|
|
460
430
|
}
|
|
461
431
|
}
|
|
462
|
-
]
|
|
463
|
-
"kind": "struct",
|
|
464
|
-
"path": "aztec::protocol_types::abis::gas::Gas"
|
|
432
|
+
]
|
|
465
433
|
}
|
|
466
434
|
},
|
|
467
435
|
{
|
|
468
436
|
"name": "max_fees_per_gas",
|
|
469
437
|
"type": {
|
|
438
|
+
"kind": "struct",
|
|
439
|
+
"path": "aztec::protocol_types::abis::gas_fees::GasFees",
|
|
470
440
|
"fields": [
|
|
471
441
|
{
|
|
472
442
|
"name": "fee_per_da_gas",
|
|
@@ -480,14 +450,14 @@
|
|
|
480
450
|
"kind": "field"
|
|
481
451
|
}
|
|
482
452
|
}
|
|
483
|
-
]
|
|
484
|
-
"kind": "struct",
|
|
485
|
-
"path": "aztec::protocol_types::abis::gas_fees::GasFees"
|
|
453
|
+
]
|
|
486
454
|
}
|
|
487
455
|
},
|
|
488
456
|
{
|
|
489
457
|
"name": "max_priority_fees_per_gas",
|
|
490
458
|
"type": {
|
|
459
|
+
"kind": "struct",
|
|
460
|
+
"path": "aztec::protocol_types::abis::gas_fees::GasFees",
|
|
491
461
|
"fields": [
|
|
492
462
|
{
|
|
493
463
|
"name": "fee_per_da_gas",
|
|
@@ -501,19 +471,13 @@
|
|
|
501
471
|
"kind": "field"
|
|
502
472
|
}
|
|
503
473
|
}
|
|
504
|
-
]
|
|
505
|
-
"kind": "struct",
|
|
506
|
-
"path": "aztec::protocol_types::abis::gas_fees::GasFees"
|
|
474
|
+
]
|
|
507
475
|
}
|
|
508
476
|
}
|
|
509
|
-
]
|
|
510
|
-
"kind": "struct",
|
|
511
|
-
"path": "aztec::protocol_types::abis::gas_settings::GasSettings"
|
|
477
|
+
]
|
|
512
478
|
}
|
|
513
479
|
}
|
|
514
|
-
]
|
|
515
|
-
"kind": "struct",
|
|
516
|
-
"path": "aztec::protocol_types::transaction::tx_context::TxContext"
|
|
480
|
+
]
|
|
517
481
|
}
|
|
518
482
|
},
|
|
519
483
|
{
|
|
@@ -524,9 +488,7 @@
|
|
|
524
488
|
"width": 32
|
|
525
489
|
}
|
|
526
490
|
}
|
|
527
|
-
]
|
|
528
|
-
"kind": "struct",
|
|
529
|
-
"path": "aztec::context::inputs::private_context_inputs::PrivateContextInputs"
|
|
491
|
+
]
|
|
530
492
|
},
|
|
531
493
|
"visibility": "private"
|
|
532
494
|
},
|
|
@@ -540,6 +502,8 @@
|
|
|
540
502
|
{
|
|
541
503
|
"name": "contract_class_id",
|
|
542
504
|
"type": {
|
|
505
|
+
"kind": "struct",
|
|
506
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId",
|
|
543
507
|
"fields": [
|
|
544
508
|
{
|
|
545
509
|
"name": "inner",
|
|
@@ -547,9 +511,7 @@
|
|
|
547
511
|
"kind": "field"
|
|
548
512
|
}
|
|
549
513
|
}
|
|
550
|
-
]
|
|
551
|
-
"kind": "struct",
|
|
552
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
514
|
+
]
|
|
553
515
|
},
|
|
554
516
|
"visibility": "private"
|
|
555
517
|
},
|
|
@@ -563,14 +525,20 @@
|
|
|
563
525
|
{
|
|
564
526
|
"name": "public_keys",
|
|
565
527
|
"type": {
|
|
528
|
+
"kind": "struct",
|
|
529
|
+
"path": "aztec::protocol_types::public_keys::PublicKeys",
|
|
566
530
|
"fields": [
|
|
567
531
|
{
|
|
568
532
|
"name": "npk_m",
|
|
569
533
|
"type": {
|
|
534
|
+
"kind": "struct",
|
|
535
|
+
"path": "aztec::protocol_types::public_keys::NpkM",
|
|
570
536
|
"fields": [
|
|
571
537
|
{
|
|
572
538
|
"name": "inner",
|
|
573
539
|
"type": {
|
|
540
|
+
"kind": "struct",
|
|
541
|
+
"path": "std::embedded_curve_ops::EmbeddedCurvePoint",
|
|
574
542
|
"fields": [
|
|
575
543
|
{
|
|
576
544
|
"name": "x",
|
|
@@ -590,23 +558,23 @@
|
|
|
590
558
|
"kind": "boolean"
|
|
591
559
|
}
|
|
592
560
|
}
|
|
593
|
-
]
|
|
594
|
-
"kind": "struct",
|
|
595
|
-
"path": "std::embedded_curve_ops::EmbeddedCurvePoint"
|
|
561
|
+
]
|
|
596
562
|
}
|
|
597
563
|
}
|
|
598
|
-
]
|
|
599
|
-
"kind": "struct",
|
|
600
|
-
"path": "aztec::protocol_types::public_keys::NpkM"
|
|
564
|
+
]
|
|
601
565
|
}
|
|
602
566
|
},
|
|
603
567
|
{
|
|
604
568
|
"name": "ivpk_m",
|
|
605
569
|
"type": {
|
|
570
|
+
"kind": "struct",
|
|
571
|
+
"path": "aztec::protocol_types::public_keys::IvpkM",
|
|
606
572
|
"fields": [
|
|
607
573
|
{
|
|
608
574
|
"name": "inner",
|
|
609
575
|
"type": {
|
|
576
|
+
"kind": "struct",
|
|
577
|
+
"path": "std::embedded_curve_ops::EmbeddedCurvePoint",
|
|
610
578
|
"fields": [
|
|
611
579
|
{
|
|
612
580
|
"name": "x",
|
|
@@ -626,23 +594,23 @@
|
|
|
626
594
|
"kind": "boolean"
|
|
627
595
|
}
|
|
628
596
|
}
|
|
629
|
-
]
|
|
630
|
-
"kind": "struct",
|
|
631
|
-
"path": "std::embedded_curve_ops::EmbeddedCurvePoint"
|
|
597
|
+
]
|
|
632
598
|
}
|
|
633
599
|
}
|
|
634
|
-
]
|
|
635
|
-
"kind": "struct",
|
|
636
|
-
"path": "aztec::protocol_types::public_keys::IvpkM"
|
|
600
|
+
]
|
|
637
601
|
}
|
|
638
602
|
},
|
|
639
603
|
{
|
|
640
604
|
"name": "ovpk_m",
|
|
641
605
|
"type": {
|
|
606
|
+
"kind": "struct",
|
|
607
|
+
"path": "aztec::protocol_types::public_keys::OvpkM",
|
|
642
608
|
"fields": [
|
|
643
609
|
{
|
|
644
610
|
"name": "inner",
|
|
645
611
|
"type": {
|
|
612
|
+
"kind": "struct",
|
|
613
|
+
"path": "std::embedded_curve_ops::EmbeddedCurvePoint",
|
|
646
614
|
"fields": [
|
|
647
615
|
{
|
|
648
616
|
"name": "x",
|
|
@@ -662,23 +630,23 @@
|
|
|
662
630
|
"kind": "boolean"
|
|
663
631
|
}
|
|
664
632
|
}
|
|
665
|
-
]
|
|
666
|
-
"kind": "struct",
|
|
667
|
-
"path": "std::embedded_curve_ops::EmbeddedCurvePoint"
|
|
633
|
+
]
|
|
668
634
|
}
|
|
669
635
|
}
|
|
670
|
-
]
|
|
671
|
-
"kind": "struct",
|
|
672
|
-
"path": "aztec::protocol_types::public_keys::OvpkM"
|
|
636
|
+
]
|
|
673
637
|
}
|
|
674
638
|
},
|
|
675
639
|
{
|
|
676
640
|
"name": "tpk_m",
|
|
677
641
|
"type": {
|
|
642
|
+
"kind": "struct",
|
|
643
|
+
"path": "aztec::protocol_types::public_keys::TpkM",
|
|
678
644
|
"fields": [
|
|
679
645
|
{
|
|
680
646
|
"name": "inner",
|
|
681
647
|
"type": {
|
|
648
|
+
"kind": "struct",
|
|
649
|
+
"path": "std::embedded_curve_ops::EmbeddedCurvePoint",
|
|
682
650
|
"fields": [
|
|
683
651
|
{
|
|
684
652
|
"name": "x",
|
|
@@ -698,19 +666,13 @@
|
|
|
698
666
|
"kind": "boolean"
|
|
699
667
|
}
|
|
700
668
|
}
|
|
701
|
-
]
|
|
702
|
-
"kind": "struct",
|
|
703
|
-
"path": "std::embedded_curve_ops::EmbeddedCurvePoint"
|
|
669
|
+
]
|
|
704
670
|
}
|
|
705
671
|
}
|
|
706
|
-
]
|
|
707
|
-
"kind": "struct",
|
|
708
|
-
"path": "aztec::protocol_types::public_keys::TpkM"
|
|
672
|
+
]
|
|
709
673
|
}
|
|
710
674
|
}
|
|
711
|
-
]
|
|
712
|
-
"kind": "struct",
|
|
713
|
-
"path": "aztec::protocol_types::public_keys::PublicKeys"
|
|
675
|
+
]
|
|
714
676
|
},
|
|
715
677
|
"visibility": "private"
|
|
716
678
|
},
|
|
@@ -724,14 +686,20 @@
|
|
|
724
686
|
],
|
|
725
687
|
"return_type": {
|
|
726
688
|
"abi_type": {
|
|
689
|
+
"kind": "struct",
|
|
690
|
+
"path": "aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs",
|
|
727
691
|
"fields": [
|
|
728
692
|
{
|
|
729
693
|
"name": "call_context",
|
|
730
694
|
"type": {
|
|
695
|
+
"kind": "struct",
|
|
696
|
+
"path": "aztec::protocol_types::abis::call_context::CallContext",
|
|
731
697
|
"fields": [
|
|
732
698
|
{
|
|
733
699
|
"name": "msg_sender",
|
|
734
700
|
"type": {
|
|
701
|
+
"kind": "struct",
|
|
702
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
735
703
|
"fields": [
|
|
736
704
|
{
|
|
737
705
|
"name": "inner",
|
|
@@ -739,14 +707,14 @@
|
|
|
739
707
|
"kind": "field"
|
|
740
708
|
}
|
|
741
709
|
}
|
|
742
|
-
]
|
|
743
|
-
"kind": "struct",
|
|
744
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
710
|
+
]
|
|
745
711
|
}
|
|
746
712
|
},
|
|
747
713
|
{
|
|
748
714
|
"name": "contract_address",
|
|
749
715
|
"type": {
|
|
716
|
+
"kind": "struct",
|
|
717
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
750
718
|
"fields": [
|
|
751
719
|
{
|
|
752
720
|
"name": "inner",
|
|
@@ -754,14 +722,14 @@
|
|
|
754
722
|
"kind": "field"
|
|
755
723
|
}
|
|
756
724
|
}
|
|
757
|
-
]
|
|
758
|
-
"kind": "struct",
|
|
759
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
725
|
+
]
|
|
760
726
|
}
|
|
761
727
|
},
|
|
762
728
|
{
|
|
763
729
|
"name": "function_selector",
|
|
764
730
|
"type": {
|
|
731
|
+
"kind": "struct",
|
|
732
|
+
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector",
|
|
765
733
|
"fields": [
|
|
766
734
|
{
|
|
767
735
|
"name": "inner",
|
|
@@ -771,9 +739,7 @@
|
|
|
771
739
|
"width": 32
|
|
772
740
|
}
|
|
773
741
|
}
|
|
774
|
-
]
|
|
775
|
-
"kind": "struct",
|
|
776
|
-
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector"
|
|
742
|
+
]
|
|
777
743
|
}
|
|
778
744
|
},
|
|
779
745
|
{
|
|
@@ -782,9 +748,7 @@
|
|
|
782
748
|
"kind": "boolean"
|
|
783
749
|
}
|
|
784
750
|
}
|
|
785
|
-
]
|
|
786
|
-
"kind": "struct",
|
|
787
|
-
"path": "aztec::protocol_types::abis::call_context::CallContext"
|
|
751
|
+
]
|
|
788
752
|
}
|
|
789
753
|
},
|
|
790
754
|
{
|
|
@@ -816,10 +780,14 @@
|
|
|
816
780
|
{
|
|
817
781
|
"name": "max_block_number",
|
|
818
782
|
"type": {
|
|
783
|
+
"kind": "struct",
|
|
784
|
+
"path": "aztec::protocol_types::abis::max_block_number::MaxBlockNumber",
|
|
819
785
|
"fields": [
|
|
820
786
|
{
|
|
821
787
|
"name": "_opt",
|
|
822
788
|
"type": {
|
|
789
|
+
"kind": "struct",
|
|
790
|
+
"path": "std::option::Option",
|
|
823
791
|
"fields": [
|
|
824
792
|
{
|
|
825
793
|
"name": "_is_some",
|
|
@@ -835,14 +803,10 @@
|
|
|
835
803
|
"width": 32
|
|
836
804
|
}
|
|
837
805
|
}
|
|
838
|
-
]
|
|
839
|
-
"kind": "struct",
|
|
840
|
-
"path": "std::option::Option"
|
|
806
|
+
]
|
|
841
807
|
}
|
|
842
808
|
}
|
|
843
|
-
]
|
|
844
|
-
"kind": "struct",
|
|
845
|
-
"path": "aztec::protocol_types::abis::max_block_number::MaxBlockNumber"
|
|
809
|
+
]
|
|
846
810
|
}
|
|
847
811
|
},
|
|
848
812
|
{
|
|
@@ -851,6 +815,8 @@
|
|
|
851
815
|
"kind": "array",
|
|
852
816
|
"length": 16,
|
|
853
817
|
"type": {
|
|
818
|
+
"kind": "struct",
|
|
819
|
+
"path": "aztec::protocol_types::abis::read_request::ReadRequest",
|
|
854
820
|
"fields": [
|
|
855
821
|
{
|
|
856
822
|
"name": "value",
|
|
@@ -866,9 +832,7 @@
|
|
|
866
832
|
"width": 32
|
|
867
833
|
}
|
|
868
834
|
}
|
|
869
|
-
]
|
|
870
|
-
"kind": "struct",
|
|
871
|
-
"path": "aztec::protocol_types::abis::read_request::ReadRequest"
|
|
835
|
+
]
|
|
872
836
|
}
|
|
873
837
|
}
|
|
874
838
|
},
|
|
@@ -878,6 +842,8 @@
|
|
|
878
842
|
"kind": "array",
|
|
879
843
|
"length": 16,
|
|
880
844
|
"type": {
|
|
845
|
+
"kind": "struct",
|
|
846
|
+
"path": "aztec::protocol_types::abis::read_request::ReadRequest",
|
|
881
847
|
"fields": [
|
|
882
848
|
{
|
|
883
849
|
"name": "value",
|
|
@@ -893,9 +859,7 @@
|
|
|
893
859
|
"width": 32
|
|
894
860
|
}
|
|
895
861
|
}
|
|
896
|
-
]
|
|
897
|
-
"kind": "struct",
|
|
898
|
-
"path": "aztec::protocol_types::abis::read_request::ReadRequest"
|
|
862
|
+
]
|
|
899
863
|
}
|
|
900
864
|
}
|
|
901
865
|
},
|
|
@@ -905,14 +869,20 @@
|
|
|
905
869
|
"kind": "array",
|
|
906
870
|
"length": 16,
|
|
907
871
|
"type": {
|
|
872
|
+
"kind": "struct",
|
|
873
|
+
"path": "aztec::protocol_types::abis::validation_requests::key_validation_request_and_generator::KeyValidationRequestAndGenerator",
|
|
908
874
|
"fields": [
|
|
909
875
|
{
|
|
910
876
|
"name": "request",
|
|
911
877
|
"type": {
|
|
878
|
+
"kind": "struct",
|
|
879
|
+
"path": "aztec::protocol_types::abis::validation_requests::key_validation_request::KeyValidationRequest",
|
|
912
880
|
"fields": [
|
|
913
881
|
{
|
|
914
882
|
"name": "pk_m",
|
|
915
883
|
"type": {
|
|
884
|
+
"kind": "struct",
|
|
885
|
+
"path": "std::embedded_curve_ops::EmbeddedCurvePoint",
|
|
916
886
|
"fields": [
|
|
917
887
|
{
|
|
918
888
|
"name": "x",
|
|
@@ -932,9 +902,7 @@
|
|
|
932
902
|
"kind": "boolean"
|
|
933
903
|
}
|
|
934
904
|
}
|
|
935
|
-
]
|
|
936
|
-
"kind": "struct",
|
|
937
|
-
"path": "std::embedded_curve_ops::EmbeddedCurvePoint"
|
|
905
|
+
]
|
|
938
906
|
}
|
|
939
907
|
},
|
|
940
908
|
{
|
|
@@ -943,9 +911,7 @@
|
|
|
943
911
|
"kind": "field"
|
|
944
912
|
}
|
|
945
913
|
}
|
|
946
|
-
]
|
|
947
|
-
"kind": "struct",
|
|
948
|
-
"path": "aztec::protocol_types::abis::validation_requests::key_validation_request::KeyValidationRequest"
|
|
914
|
+
]
|
|
949
915
|
}
|
|
950
916
|
},
|
|
951
917
|
{
|
|
@@ -954,9 +920,7 @@
|
|
|
954
920
|
"kind": "field"
|
|
955
921
|
}
|
|
956
922
|
}
|
|
957
|
-
]
|
|
958
|
-
"kind": "struct",
|
|
959
|
-
"path": "aztec::protocol_types::abis::validation_requests::key_validation_request_and_generator::KeyValidationRequestAndGenerator"
|
|
923
|
+
]
|
|
960
924
|
}
|
|
961
925
|
}
|
|
962
926
|
},
|
|
@@ -966,6 +930,8 @@
|
|
|
966
930
|
"kind": "array",
|
|
967
931
|
"length": 16,
|
|
968
932
|
"type": {
|
|
933
|
+
"kind": "struct",
|
|
934
|
+
"path": "aztec::protocol_types::abis::note_hash::NoteHash",
|
|
969
935
|
"fields": [
|
|
970
936
|
{
|
|
971
937
|
"name": "value",
|
|
@@ -981,9 +947,7 @@
|
|
|
981
947
|
"width": 32
|
|
982
948
|
}
|
|
983
949
|
}
|
|
984
|
-
]
|
|
985
|
-
"kind": "struct",
|
|
986
|
-
"path": "aztec::protocol_types::abis::note_hash::NoteHash"
|
|
950
|
+
]
|
|
987
951
|
}
|
|
988
952
|
}
|
|
989
953
|
},
|
|
@@ -993,6 +957,8 @@
|
|
|
993
957
|
"kind": "array",
|
|
994
958
|
"length": 16,
|
|
995
959
|
"type": {
|
|
960
|
+
"kind": "struct",
|
|
961
|
+
"path": "aztec::protocol_types::abis::nullifier::Nullifier",
|
|
996
962
|
"fields": [
|
|
997
963
|
{
|
|
998
964
|
"name": "value",
|
|
@@ -1014,9 +980,7 @@
|
|
|
1014
980
|
"kind": "field"
|
|
1015
981
|
}
|
|
1016
982
|
}
|
|
1017
|
-
]
|
|
1018
|
-
"kind": "struct",
|
|
1019
|
-
"path": "aztec::protocol_types::abis::nullifier::Nullifier"
|
|
983
|
+
]
|
|
1020
984
|
}
|
|
1021
985
|
}
|
|
1022
986
|
},
|
|
@@ -1026,14 +990,20 @@
|
|
|
1026
990
|
"kind": "array",
|
|
1027
991
|
"length": 5,
|
|
1028
992
|
"type": {
|
|
993
|
+
"kind": "struct",
|
|
994
|
+
"path": "aztec::protocol_types::abis::private_call_request::PrivateCallRequest",
|
|
1029
995
|
"fields": [
|
|
1030
996
|
{
|
|
1031
997
|
"name": "call_context",
|
|
1032
998
|
"type": {
|
|
999
|
+
"kind": "struct",
|
|
1000
|
+
"path": "aztec::protocol_types::abis::call_context::CallContext",
|
|
1033
1001
|
"fields": [
|
|
1034
1002
|
{
|
|
1035
1003
|
"name": "msg_sender",
|
|
1036
1004
|
"type": {
|
|
1005
|
+
"kind": "struct",
|
|
1006
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1037
1007
|
"fields": [
|
|
1038
1008
|
{
|
|
1039
1009
|
"name": "inner",
|
|
@@ -1041,14 +1011,14 @@
|
|
|
1041
1011
|
"kind": "field"
|
|
1042
1012
|
}
|
|
1043
1013
|
}
|
|
1044
|
-
]
|
|
1045
|
-
"kind": "struct",
|
|
1046
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1014
|
+
]
|
|
1047
1015
|
}
|
|
1048
1016
|
},
|
|
1049
1017
|
{
|
|
1050
1018
|
"name": "contract_address",
|
|
1051
1019
|
"type": {
|
|
1020
|
+
"kind": "struct",
|
|
1021
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1052
1022
|
"fields": [
|
|
1053
1023
|
{
|
|
1054
1024
|
"name": "inner",
|
|
@@ -1056,14 +1026,14 @@
|
|
|
1056
1026
|
"kind": "field"
|
|
1057
1027
|
}
|
|
1058
1028
|
}
|
|
1059
|
-
]
|
|
1060
|
-
"kind": "struct",
|
|
1061
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1029
|
+
]
|
|
1062
1030
|
}
|
|
1063
1031
|
},
|
|
1064
1032
|
{
|
|
1065
1033
|
"name": "function_selector",
|
|
1066
1034
|
"type": {
|
|
1035
|
+
"kind": "struct",
|
|
1036
|
+
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector",
|
|
1067
1037
|
"fields": [
|
|
1068
1038
|
{
|
|
1069
1039
|
"name": "inner",
|
|
@@ -1073,9 +1043,7 @@
|
|
|
1073
1043
|
"width": 32
|
|
1074
1044
|
}
|
|
1075
1045
|
}
|
|
1076
|
-
]
|
|
1077
|
-
"kind": "struct",
|
|
1078
|
-
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector"
|
|
1046
|
+
]
|
|
1079
1047
|
}
|
|
1080
1048
|
},
|
|
1081
1049
|
{
|
|
@@ -1084,9 +1052,7 @@
|
|
|
1084
1052
|
"kind": "boolean"
|
|
1085
1053
|
}
|
|
1086
1054
|
}
|
|
1087
|
-
]
|
|
1088
|
-
"kind": "struct",
|
|
1089
|
-
"path": "aztec::protocol_types::abis::call_context::CallContext"
|
|
1055
|
+
]
|
|
1090
1056
|
}
|
|
1091
1057
|
},
|
|
1092
1058
|
{
|
|
@@ -1117,9 +1083,7 @@
|
|
|
1117
1083
|
"width": 32
|
|
1118
1084
|
}
|
|
1119
1085
|
}
|
|
1120
|
-
]
|
|
1121
|
-
"kind": "struct",
|
|
1122
|
-
"path": "aztec::protocol_types::abis::private_call_request::PrivateCallRequest"
|
|
1086
|
+
]
|
|
1123
1087
|
}
|
|
1124
1088
|
}
|
|
1125
1089
|
},
|
|
@@ -1129,14 +1093,20 @@
|
|
|
1129
1093
|
"kind": "array",
|
|
1130
1094
|
"length": 16,
|
|
1131
1095
|
"type": {
|
|
1096
|
+
"kind": "struct",
|
|
1097
|
+
"path": "aztec::protocol_types::abis::side_effect::counted::Counted",
|
|
1132
1098
|
"fields": [
|
|
1133
1099
|
{
|
|
1134
1100
|
"name": "inner",
|
|
1135
1101
|
"type": {
|
|
1102
|
+
"kind": "struct",
|
|
1103
|
+
"path": "aztec::protocol_types::abis::public_call_request::PublicCallRequest",
|
|
1136
1104
|
"fields": [
|
|
1137
1105
|
{
|
|
1138
1106
|
"name": "msg_sender",
|
|
1139
1107
|
"type": {
|
|
1108
|
+
"kind": "struct",
|
|
1109
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1140
1110
|
"fields": [
|
|
1141
1111
|
{
|
|
1142
1112
|
"name": "inner",
|
|
@@ -1144,14 +1114,14 @@
|
|
|
1144
1114
|
"kind": "field"
|
|
1145
1115
|
}
|
|
1146
1116
|
}
|
|
1147
|
-
]
|
|
1148
|
-
"kind": "struct",
|
|
1149
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1117
|
+
]
|
|
1150
1118
|
}
|
|
1151
1119
|
},
|
|
1152
1120
|
{
|
|
1153
1121
|
"name": "contract_address",
|
|
1154
1122
|
"type": {
|
|
1123
|
+
"kind": "struct",
|
|
1124
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1155
1125
|
"fields": [
|
|
1156
1126
|
{
|
|
1157
1127
|
"name": "inner",
|
|
@@ -1159,14 +1129,14 @@
|
|
|
1159
1129
|
"kind": "field"
|
|
1160
1130
|
}
|
|
1161
1131
|
}
|
|
1162
|
-
]
|
|
1163
|
-
"kind": "struct",
|
|
1164
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1132
|
+
]
|
|
1165
1133
|
}
|
|
1166
1134
|
},
|
|
1167
1135
|
{
|
|
1168
1136
|
"name": "function_selector",
|
|
1169
1137
|
"type": {
|
|
1138
|
+
"kind": "struct",
|
|
1139
|
+
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector",
|
|
1170
1140
|
"fields": [
|
|
1171
1141
|
{
|
|
1172
1142
|
"name": "inner",
|
|
@@ -1176,9 +1146,7 @@
|
|
|
1176
1146
|
"width": 32
|
|
1177
1147
|
}
|
|
1178
1148
|
}
|
|
1179
|
-
]
|
|
1180
|
-
"kind": "struct",
|
|
1181
|
-
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector"
|
|
1149
|
+
]
|
|
1182
1150
|
}
|
|
1183
1151
|
},
|
|
1184
1152
|
{
|
|
@@ -1193,9 +1161,7 @@
|
|
|
1193
1161
|
"kind": "field"
|
|
1194
1162
|
}
|
|
1195
1163
|
}
|
|
1196
|
-
]
|
|
1197
|
-
"kind": "struct",
|
|
1198
|
-
"path": "aztec::protocol_types::abis::public_call_request::PublicCallRequest"
|
|
1164
|
+
]
|
|
1199
1165
|
}
|
|
1200
1166
|
},
|
|
1201
1167
|
{
|
|
@@ -1206,19 +1172,21 @@
|
|
|
1206
1172
|
"width": 32
|
|
1207
1173
|
}
|
|
1208
1174
|
}
|
|
1209
|
-
]
|
|
1210
|
-
"kind": "struct",
|
|
1211
|
-
"path": "aztec::protocol_types::abis::side_effect::counted::Counted"
|
|
1175
|
+
]
|
|
1212
1176
|
}
|
|
1213
1177
|
}
|
|
1214
1178
|
},
|
|
1215
1179
|
{
|
|
1216
1180
|
"name": "public_teardown_call_request",
|
|
1217
1181
|
"type": {
|
|
1182
|
+
"kind": "struct",
|
|
1183
|
+
"path": "aztec::protocol_types::abis::public_call_request::PublicCallRequest",
|
|
1218
1184
|
"fields": [
|
|
1219
1185
|
{
|
|
1220
1186
|
"name": "msg_sender",
|
|
1221
1187
|
"type": {
|
|
1188
|
+
"kind": "struct",
|
|
1189
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1222
1190
|
"fields": [
|
|
1223
1191
|
{
|
|
1224
1192
|
"name": "inner",
|
|
@@ -1226,14 +1194,14 @@
|
|
|
1226
1194
|
"kind": "field"
|
|
1227
1195
|
}
|
|
1228
1196
|
}
|
|
1229
|
-
]
|
|
1230
|
-
"kind": "struct",
|
|
1231
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1197
|
+
]
|
|
1232
1198
|
}
|
|
1233
1199
|
},
|
|
1234
1200
|
{
|
|
1235
1201
|
"name": "contract_address",
|
|
1236
1202
|
"type": {
|
|
1203
|
+
"kind": "struct",
|
|
1204
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1237
1205
|
"fields": [
|
|
1238
1206
|
{
|
|
1239
1207
|
"name": "inner",
|
|
@@ -1241,14 +1209,14 @@
|
|
|
1241
1209
|
"kind": "field"
|
|
1242
1210
|
}
|
|
1243
1211
|
}
|
|
1244
|
-
]
|
|
1245
|
-
"kind": "struct",
|
|
1246
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1212
|
+
]
|
|
1247
1213
|
}
|
|
1248
1214
|
},
|
|
1249
1215
|
{
|
|
1250
1216
|
"name": "function_selector",
|
|
1251
1217
|
"type": {
|
|
1218
|
+
"kind": "struct",
|
|
1219
|
+
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector",
|
|
1252
1220
|
"fields": [
|
|
1253
1221
|
{
|
|
1254
1222
|
"name": "inner",
|
|
@@ -1258,9 +1226,7 @@
|
|
|
1258
1226
|
"width": 32
|
|
1259
1227
|
}
|
|
1260
1228
|
}
|
|
1261
|
-
]
|
|
1262
|
-
"kind": "struct",
|
|
1263
|
-
"path": "aztec::protocol_types::abis::function_selector::FunctionSelector"
|
|
1229
|
+
]
|
|
1264
1230
|
}
|
|
1265
1231
|
},
|
|
1266
1232
|
{
|
|
@@ -1275,9 +1241,7 @@
|
|
|
1275
1241
|
"kind": "field"
|
|
1276
1242
|
}
|
|
1277
1243
|
}
|
|
1278
|
-
]
|
|
1279
|
-
"kind": "struct",
|
|
1280
|
-
"path": "aztec::protocol_types::abis::public_call_request::PublicCallRequest"
|
|
1244
|
+
]
|
|
1281
1245
|
}
|
|
1282
1246
|
},
|
|
1283
1247
|
{
|
|
@@ -1286,10 +1250,14 @@
|
|
|
1286
1250
|
"kind": "array",
|
|
1287
1251
|
"length": 2,
|
|
1288
1252
|
"type": {
|
|
1253
|
+
"kind": "struct",
|
|
1254
|
+
"path": "aztec::protocol_types::messaging::l2_to_l1_message::L2ToL1Message",
|
|
1289
1255
|
"fields": [
|
|
1290
1256
|
{
|
|
1291
1257
|
"name": "recipient",
|
|
1292
1258
|
"type": {
|
|
1259
|
+
"kind": "struct",
|
|
1260
|
+
"path": "aztec::protocol_types::address::eth_address::EthAddress",
|
|
1293
1261
|
"fields": [
|
|
1294
1262
|
{
|
|
1295
1263
|
"name": "inner",
|
|
@@ -1297,9 +1265,7 @@
|
|
|
1297
1265
|
"kind": "field"
|
|
1298
1266
|
}
|
|
1299
1267
|
}
|
|
1300
|
-
]
|
|
1301
|
-
"kind": "struct",
|
|
1302
|
-
"path": "aztec::protocol_types::address::eth_address::EthAddress"
|
|
1268
|
+
]
|
|
1303
1269
|
}
|
|
1304
1270
|
},
|
|
1305
1271
|
{
|
|
@@ -1316,9 +1282,7 @@
|
|
|
1316
1282
|
"width": 32
|
|
1317
1283
|
}
|
|
1318
1284
|
}
|
|
1319
|
-
]
|
|
1320
|
-
"kind": "struct",
|
|
1321
|
-
"path": "aztec::protocol_types::messaging::l2_to_l1_message::L2ToL1Message"
|
|
1285
|
+
]
|
|
1322
1286
|
}
|
|
1323
1287
|
}
|
|
1324
1288
|
},
|
|
@@ -1328,10 +1292,14 @@
|
|
|
1328
1292
|
"kind": "array",
|
|
1329
1293
|
"length": 16,
|
|
1330
1294
|
"type": {
|
|
1295
|
+
"kind": "struct",
|
|
1296
|
+
"path": "aztec::protocol_types::abis::private_log::PrivateLogData",
|
|
1331
1297
|
"fields": [
|
|
1332
1298
|
{
|
|
1333
1299
|
"name": "log",
|
|
1334
1300
|
"type": {
|
|
1301
|
+
"kind": "struct",
|
|
1302
|
+
"path": "aztec::protocol_types::abis::log::Log",
|
|
1335
1303
|
"fields": [
|
|
1336
1304
|
{
|
|
1337
1305
|
"name": "fields",
|
|
@@ -1343,9 +1311,7 @@
|
|
|
1343
1311
|
}
|
|
1344
1312
|
}
|
|
1345
1313
|
}
|
|
1346
|
-
]
|
|
1347
|
-
"kind": "struct",
|
|
1348
|
-
"path": "aztec::protocol_types::abis::log::Log"
|
|
1314
|
+
]
|
|
1349
1315
|
}
|
|
1350
1316
|
},
|
|
1351
1317
|
{
|
|
@@ -1364,9 +1330,7 @@
|
|
|
1364
1330
|
"width": 32
|
|
1365
1331
|
}
|
|
1366
1332
|
}
|
|
1367
|
-
]
|
|
1368
|
-
"kind": "struct",
|
|
1369
|
-
"path": "aztec::protocol_types::abis::private_log::PrivateLogData"
|
|
1333
|
+
]
|
|
1370
1334
|
}
|
|
1371
1335
|
}
|
|
1372
1336
|
},
|
|
@@ -1376,6 +1340,8 @@
|
|
|
1376
1340
|
"kind": "array",
|
|
1377
1341
|
"length": 1,
|
|
1378
1342
|
"type": {
|
|
1343
|
+
"kind": "struct",
|
|
1344
|
+
"path": "aztec::protocol_types::abis::log_hash::LogHash",
|
|
1379
1345
|
"fields": [
|
|
1380
1346
|
{
|
|
1381
1347
|
"name": "value",
|
|
@@ -1399,9 +1365,7 @@
|
|
|
1399
1365
|
"width": 32
|
|
1400
1366
|
}
|
|
1401
1367
|
}
|
|
1402
|
-
]
|
|
1403
|
-
"kind": "struct",
|
|
1404
|
-
"path": "aztec::protocol_types::abis::log_hash::LogHash"
|
|
1368
|
+
]
|
|
1405
1369
|
}
|
|
1406
1370
|
}
|
|
1407
1371
|
},
|
|
@@ -1424,10 +1388,14 @@
|
|
|
1424
1388
|
{
|
|
1425
1389
|
"name": "historical_header",
|
|
1426
1390
|
"type": {
|
|
1391
|
+
"kind": "struct",
|
|
1392
|
+
"path": "aztec::protocol_types::block_header::BlockHeader",
|
|
1427
1393
|
"fields": [
|
|
1428
1394
|
{
|
|
1429
1395
|
"name": "last_archive",
|
|
1430
1396
|
"type": {
|
|
1397
|
+
"kind": "struct",
|
|
1398
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
1431
1399
|
"fields": [
|
|
1432
1400
|
{
|
|
1433
1401
|
"name": "root",
|
|
@@ -1443,14 +1411,14 @@
|
|
|
1443
1411
|
"width": 32
|
|
1444
1412
|
}
|
|
1445
1413
|
}
|
|
1446
|
-
]
|
|
1447
|
-
"kind": "struct",
|
|
1448
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
1414
|
+
]
|
|
1449
1415
|
}
|
|
1450
1416
|
},
|
|
1451
1417
|
{
|
|
1452
1418
|
"name": "content_commitment",
|
|
1453
1419
|
"type": {
|
|
1420
|
+
"kind": "struct",
|
|
1421
|
+
"path": "aztec::protocol_types::content_commitment::ContentCommitment",
|
|
1454
1422
|
"fields": [
|
|
1455
1423
|
{
|
|
1456
1424
|
"name": "num_txs",
|
|
@@ -1476,18 +1444,20 @@
|
|
|
1476
1444
|
"kind": "field"
|
|
1477
1445
|
}
|
|
1478
1446
|
}
|
|
1479
|
-
]
|
|
1480
|
-
"kind": "struct",
|
|
1481
|
-
"path": "aztec::protocol_types::content_commitment::ContentCommitment"
|
|
1447
|
+
]
|
|
1482
1448
|
}
|
|
1483
1449
|
},
|
|
1484
1450
|
{
|
|
1485
1451
|
"name": "state",
|
|
1486
1452
|
"type": {
|
|
1453
|
+
"kind": "struct",
|
|
1454
|
+
"path": "aztec::protocol_types::state_reference::StateReference",
|
|
1487
1455
|
"fields": [
|
|
1488
1456
|
{
|
|
1489
1457
|
"name": "l1_to_l2_message_tree",
|
|
1490
1458
|
"type": {
|
|
1459
|
+
"kind": "struct",
|
|
1460
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
1491
1461
|
"fields": [
|
|
1492
1462
|
{
|
|
1493
1463
|
"name": "root",
|
|
@@ -1503,18 +1473,20 @@
|
|
|
1503
1473
|
"width": 32
|
|
1504
1474
|
}
|
|
1505
1475
|
}
|
|
1506
|
-
]
|
|
1507
|
-
"kind": "struct",
|
|
1508
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
1476
|
+
]
|
|
1509
1477
|
}
|
|
1510
1478
|
},
|
|
1511
1479
|
{
|
|
1512
1480
|
"name": "partial",
|
|
1513
1481
|
"type": {
|
|
1482
|
+
"kind": "struct",
|
|
1483
|
+
"path": "aztec::protocol_types::partial_state_reference::PartialStateReference",
|
|
1514
1484
|
"fields": [
|
|
1515
1485
|
{
|
|
1516
1486
|
"name": "note_hash_tree",
|
|
1517
1487
|
"type": {
|
|
1488
|
+
"kind": "struct",
|
|
1489
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
1518
1490
|
"fields": [
|
|
1519
1491
|
{
|
|
1520
1492
|
"name": "root",
|
|
@@ -1530,14 +1502,14 @@
|
|
|
1530
1502
|
"width": 32
|
|
1531
1503
|
}
|
|
1532
1504
|
}
|
|
1533
|
-
]
|
|
1534
|
-
"kind": "struct",
|
|
1535
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
1505
|
+
]
|
|
1536
1506
|
}
|
|
1537
1507
|
},
|
|
1538
1508
|
{
|
|
1539
1509
|
"name": "nullifier_tree",
|
|
1540
1510
|
"type": {
|
|
1511
|
+
"kind": "struct",
|
|
1512
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
1541
1513
|
"fields": [
|
|
1542
1514
|
{
|
|
1543
1515
|
"name": "root",
|
|
@@ -1553,14 +1525,14 @@
|
|
|
1553
1525
|
"width": 32
|
|
1554
1526
|
}
|
|
1555
1527
|
}
|
|
1556
|
-
]
|
|
1557
|
-
"kind": "struct",
|
|
1558
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
1528
|
+
]
|
|
1559
1529
|
}
|
|
1560
1530
|
},
|
|
1561
1531
|
{
|
|
1562
1532
|
"name": "public_data_tree",
|
|
1563
1533
|
"type": {
|
|
1534
|
+
"kind": "struct",
|
|
1535
|
+
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot",
|
|
1564
1536
|
"fields": [
|
|
1565
1537
|
{
|
|
1566
1538
|
"name": "root",
|
|
@@ -1576,24 +1548,20 @@
|
|
|
1576
1548
|
"width": 32
|
|
1577
1549
|
}
|
|
1578
1550
|
}
|
|
1579
|
-
]
|
|
1580
|
-
"kind": "struct",
|
|
1581
|
-
"path": "aztec::protocol_types::abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot"
|
|
1551
|
+
]
|
|
1582
1552
|
}
|
|
1583
1553
|
}
|
|
1584
|
-
]
|
|
1585
|
-
"kind": "struct",
|
|
1586
|
-
"path": "aztec::protocol_types::partial_state_reference::PartialStateReference"
|
|
1554
|
+
]
|
|
1587
1555
|
}
|
|
1588
1556
|
}
|
|
1589
|
-
]
|
|
1590
|
-
"kind": "struct",
|
|
1591
|
-
"path": "aztec::protocol_types::state_reference::StateReference"
|
|
1557
|
+
]
|
|
1592
1558
|
}
|
|
1593
1559
|
},
|
|
1594
1560
|
{
|
|
1595
1561
|
"name": "global_variables",
|
|
1596
1562
|
"type": {
|
|
1563
|
+
"kind": "struct",
|
|
1564
|
+
"path": "aztec::protocol_types::abis::global_variables::GlobalVariables",
|
|
1597
1565
|
"fields": [
|
|
1598
1566
|
{
|
|
1599
1567
|
"name": "chain_id",
|
|
@@ -1630,6 +1598,8 @@
|
|
|
1630
1598
|
{
|
|
1631
1599
|
"name": "coinbase",
|
|
1632
1600
|
"type": {
|
|
1601
|
+
"kind": "struct",
|
|
1602
|
+
"path": "aztec::protocol_types::address::eth_address::EthAddress",
|
|
1633
1603
|
"fields": [
|
|
1634
1604
|
{
|
|
1635
1605
|
"name": "inner",
|
|
@@ -1637,14 +1607,14 @@
|
|
|
1637
1607
|
"kind": "field"
|
|
1638
1608
|
}
|
|
1639
1609
|
}
|
|
1640
|
-
]
|
|
1641
|
-
"kind": "struct",
|
|
1642
|
-
"path": "aztec::protocol_types::address::eth_address::EthAddress"
|
|
1610
|
+
]
|
|
1643
1611
|
}
|
|
1644
1612
|
},
|
|
1645
1613
|
{
|
|
1646
1614
|
"name": "fee_recipient",
|
|
1647
1615
|
"type": {
|
|
1616
|
+
"kind": "struct",
|
|
1617
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1648
1618
|
"fields": [
|
|
1649
1619
|
{
|
|
1650
1620
|
"name": "inner",
|
|
@@ -1652,14 +1622,14 @@
|
|
|
1652
1622
|
"kind": "field"
|
|
1653
1623
|
}
|
|
1654
1624
|
}
|
|
1655
|
-
]
|
|
1656
|
-
"kind": "struct",
|
|
1657
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
1625
|
+
]
|
|
1658
1626
|
}
|
|
1659
1627
|
},
|
|
1660
1628
|
{
|
|
1661
1629
|
"name": "gas_fees",
|
|
1662
1630
|
"type": {
|
|
1631
|
+
"kind": "struct",
|
|
1632
|
+
"path": "aztec::protocol_types::abis::gas_fees::GasFees",
|
|
1663
1633
|
"fields": [
|
|
1664
1634
|
{
|
|
1665
1635
|
"name": "fee_per_da_gas",
|
|
@@ -1673,14 +1643,10 @@
|
|
|
1673
1643
|
"kind": "field"
|
|
1674
1644
|
}
|
|
1675
1645
|
}
|
|
1676
|
-
]
|
|
1677
|
-
"kind": "struct",
|
|
1678
|
-
"path": "aztec::protocol_types::abis::gas_fees::GasFees"
|
|
1646
|
+
]
|
|
1679
1647
|
}
|
|
1680
1648
|
}
|
|
1681
|
-
]
|
|
1682
|
-
"kind": "struct",
|
|
1683
|
-
"path": "aztec::protocol_types::abis::global_variables::GlobalVariables"
|
|
1649
|
+
]
|
|
1684
1650
|
}
|
|
1685
1651
|
},
|
|
1686
1652
|
{
|
|
@@ -1695,14 +1661,14 @@
|
|
|
1695
1661
|
"kind": "field"
|
|
1696
1662
|
}
|
|
1697
1663
|
}
|
|
1698
|
-
]
|
|
1699
|
-
"kind": "struct",
|
|
1700
|
-
"path": "aztec::protocol_types::block_header::BlockHeader"
|
|
1664
|
+
]
|
|
1701
1665
|
}
|
|
1702
1666
|
},
|
|
1703
1667
|
{
|
|
1704
1668
|
"name": "tx_context",
|
|
1705
1669
|
"type": {
|
|
1670
|
+
"kind": "struct",
|
|
1671
|
+
"path": "aztec::protocol_types::transaction::tx_context::TxContext",
|
|
1706
1672
|
"fields": [
|
|
1707
1673
|
{
|
|
1708
1674
|
"name": "chain_id",
|
|
@@ -1719,10 +1685,14 @@
|
|
|
1719
1685
|
{
|
|
1720
1686
|
"name": "gas_settings",
|
|
1721
1687
|
"type": {
|
|
1688
|
+
"kind": "struct",
|
|
1689
|
+
"path": "aztec::protocol_types::abis::gas_settings::GasSettings",
|
|
1722
1690
|
"fields": [
|
|
1723
1691
|
{
|
|
1724
1692
|
"name": "gas_limits",
|
|
1725
1693
|
"type": {
|
|
1694
|
+
"kind": "struct",
|
|
1695
|
+
"path": "aztec::protocol_types::abis::gas::Gas",
|
|
1726
1696
|
"fields": [
|
|
1727
1697
|
{
|
|
1728
1698
|
"name": "da_gas",
|
|
@@ -1740,14 +1710,14 @@
|
|
|
1740
1710
|
"width": 32
|
|
1741
1711
|
}
|
|
1742
1712
|
}
|
|
1743
|
-
]
|
|
1744
|
-
"kind": "struct",
|
|
1745
|
-
"path": "aztec::protocol_types::abis::gas::Gas"
|
|
1713
|
+
]
|
|
1746
1714
|
}
|
|
1747
1715
|
},
|
|
1748
1716
|
{
|
|
1749
1717
|
"name": "teardown_gas_limits",
|
|
1750
1718
|
"type": {
|
|
1719
|
+
"kind": "struct",
|
|
1720
|
+
"path": "aztec::protocol_types::abis::gas::Gas",
|
|
1751
1721
|
"fields": [
|
|
1752
1722
|
{
|
|
1753
1723
|
"name": "da_gas",
|
|
@@ -1765,14 +1735,14 @@
|
|
|
1765
1735
|
"width": 32
|
|
1766
1736
|
}
|
|
1767
1737
|
}
|
|
1768
|
-
]
|
|
1769
|
-
"kind": "struct",
|
|
1770
|
-
"path": "aztec::protocol_types::abis::gas::Gas"
|
|
1738
|
+
]
|
|
1771
1739
|
}
|
|
1772
1740
|
},
|
|
1773
1741
|
{
|
|
1774
1742
|
"name": "max_fees_per_gas",
|
|
1775
1743
|
"type": {
|
|
1744
|
+
"kind": "struct",
|
|
1745
|
+
"path": "aztec::protocol_types::abis::gas_fees::GasFees",
|
|
1776
1746
|
"fields": [
|
|
1777
1747
|
{
|
|
1778
1748
|
"name": "fee_per_da_gas",
|
|
@@ -1786,14 +1756,14 @@
|
|
|
1786
1756
|
"kind": "field"
|
|
1787
1757
|
}
|
|
1788
1758
|
}
|
|
1789
|
-
]
|
|
1790
|
-
"kind": "struct",
|
|
1791
|
-
"path": "aztec::protocol_types::abis::gas_fees::GasFees"
|
|
1759
|
+
]
|
|
1792
1760
|
}
|
|
1793
1761
|
},
|
|
1794
1762
|
{
|
|
1795
1763
|
"name": "max_priority_fees_per_gas",
|
|
1796
1764
|
"type": {
|
|
1765
|
+
"kind": "struct",
|
|
1766
|
+
"path": "aztec::protocol_types::abis::gas_fees::GasFees",
|
|
1797
1767
|
"fields": [
|
|
1798
1768
|
{
|
|
1799
1769
|
"name": "fee_per_da_gas",
|
|
@@ -1807,30 +1777,40 @@
|
|
|
1807
1777
|
"kind": "field"
|
|
1808
1778
|
}
|
|
1809
1779
|
}
|
|
1810
|
-
]
|
|
1811
|
-
"kind": "struct",
|
|
1812
|
-
"path": "aztec::protocol_types::abis::gas_fees::GasFees"
|
|
1780
|
+
]
|
|
1813
1781
|
}
|
|
1814
1782
|
}
|
|
1815
|
-
]
|
|
1816
|
-
"kind": "struct",
|
|
1817
|
-
"path": "aztec::protocol_types::abis::gas_settings::GasSettings"
|
|
1783
|
+
]
|
|
1818
1784
|
}
|
|
1819
1785
|
}
|
|
1820
|
-
]
|
|
1821
|
-
"kind": "struct",
|
|
1822
|
-
"path": "aztec::protocol_types::transaction::tx_context::TxContext"
|
|
1786
|
+
]
|
|
1823
1787
|
}
|
|
1824
1788
|
}
|
|
1825
|
-
]
|
|
1826
|
-
"kind": "struct",
|
|
1827
|
-
"path": "aztec::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs"
|
|
1789
|
+
]
|
|
1828
1790
|
},
|
|
1829
1791
|
"visibility": "databus"
|
|
1792
|
+
},
|
|
1793
|
+
"error_types": {
|
|
1794
|
+
"5019202896831570965": {
|
|
1795
|
+
"error_kind": "string",
|
|
1796
|
+
"string": "attempt to add with overflow"
|
|
1797
|
+
},
|
|
1798
|
+
"6485997221020871071": {
|
|
1799
|
+
"error_kind": "string",
|
|
1800
|
+
"string": "call to assert_max_bit_size"
|
|
1801
|
+
},
|
|
1802
|
+
"16761564377371454734": {
|
|
1803
|
+
"error_kind": "string",
|
|
1804
|
+
"string": "Array index out of bounds"
|
|
1805
|
+
},
|
|
1806
|
+
"17843811134343075018": {
|
|
1807
|
+
"error_kind": "string",
|
|
1808
|
+
"string": "Stack too deep"
|
|
1809
|
+
}
|
|
1830
1810
|
}
|
|
1831
1811
|
},
|
|
1832
|
-
"bytecode": "H4sIAAAAAAAA/+2dBXwUx9vHN7kkEKRQrKVQvMVh9/zQIMHdHS65O9y9mrbQFlpKW+reAnV3d3d3d3cX+v4euC3DZi+0ZDb09/a/n883t7c7mf0+s7OzNrebZWwbNvsMY4pv23gW8KU/s0ETxzT7Ux3PdUlX1WVadZdpNVym7ekyrR4ocExr7JKuicu0pi7TmrlMa+kyrb1LvKbLtIDLtLDLtEj6Ux3s7wXpz4AZDgaTEX/SClhx0x8riobMYKgoHLWiVigaSvijgUAyGoxGYkWxiBmzgoGklQrFAilz27Cvb3teZrkGf7GXno122dOynFPErRbIUVylHLakx1sZ28dbK+ON0mns/2uM701AU9DMt326PfgcZWCWb7DaaMyrsU/fummurQ6Zppfl11ZjXk00ll8LkvJrpzGvphrLbz+N5efWNjRX2oYWyvh+yngzR9uwP763BK1A6wpoG9przGt/jeumDUnd7qAxr5Yay68tSfl11JhXK43l187jtqGN0ga0VcbbKeOtHW1De3zvADoCswLaBlNjXu01rhuLpG5bGvPqo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t+v1UHDlj8Xp03YcDOty75ZOEZ7/xJGD8/7tjIDXHYW5NlomFUt0YbbLtW4cVmOHAHsiVOxefHj+imuxEw0xjOOIhttz8q0/dsk7mx8rN/zJEqyHl5n8ZAvUQrIdQPcTWQ7geIvWQevd9vfu+3n2td1/r3dd697Xefa13v7zwTtP9DMbgBCOvwLhXYPwrMFqPmVnQtAR6Cof/XD3cXH24vR6mo4dvv999jLPT4fDx36/xmzh//fXh/uP1p+8P18NM9jiJPfhMsLdwoBIO2OyZ0/Tu4SOBvcjw/XDphe5bYcz1hu/J7InHLmT4CN2ecGy4h49A9gipQR7OK7R3FM87dDGhFwiVCxX8Dw==",
|
|
1834
1814
|
"brillig_names": [
|
|
1835
1815
|
"store_in_execution_cache_oracle_wrapper",
|
|
1836
1816
|
"call_private_function_internal",
|
|
@@ -1841,28 +1821,228 @@
|
|
|
1841
1821
|
"directive_integer_quotient",
|
|
1842
1822
|
"directive_invert"
|
|
1843
1823
|
],
|
|
1844
|
-
"verification_key": "
|
|
1824
|
+
"verification_key": "AAAAAAAQAAAAAAAAAAAAFAAAAAAAAAAQAAAAAAADKLEBAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAAAAAAAAAAAAAE+GUJK5jYEpxx5Is/9KfxPbqAoOp08k3RISQgHiBRoYfbte87Am+S3vhSnMI01lYLFkqWUFXrE2HHIWWY4d4QRcKH79ejm9IasVRuKlWCHo6b9YL2SzgGLdVr4Djuma+D7Mqq5DuvG4JX0qtJ16FyqdLlV5pdTLvBzylUtcTvlkkCUA6B9wD7yTwzgh6WYbL+acNFDu6Fvub5RAdWz05NQuZ2KXWmGyFaoJtpwR1PTPg7L5J4oToOFU/HU2UWzEeIXhkkjxpOslmeBgN7GbU0o6W3QfggH1GBg1HauQYGxwpJV9HstY0jqPw/qSGGuIG+0XTzCCBiSLX68v1QmkOEBXvHkRAEs2/quWSAaXncA+zTX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8Pa5YgJ+q7saoanj0s7xh8Z1ucGk1m79H5/kH"
|
|
1845
1825
|
},
|
|
1846
1826
|
{
|
|
1847
|
-
"name": "
|
|
1827
|
+
"name": "public_dispatch",
|
|
1848
1828
|
"is_unconstrained": true,
|
|
1849
|
-
"custom_attributes": [
|
|
1829
|
+
"custom_attributes": [
|
|
1830
|
+
"public"
|
|
1831
|
+
],
|
|
1850
1832
|
"abi": {
|
|
1833
|
+
"parameters": [
|
|
1834
|
+
{
|
|
1835
|
+
"name": "selector",
|
|
1836
|
+
"type": {
|
|
1837
|
+
"kind": "field"
|
|
1838
|
+
},
|
|
1839
|
+
"visibility": "private"
|
|
1840
|
+
}
|
|
1841
|
+
],
|
|
1842
|
+
"return_type": null,
|
|
1851
1843
|
"error_types": {
|
|
1852
|
-
"
|
|
1844
|
+
"206160798890201757": {
|
|
1845
|
+
"error_kind": "string",
|
|
1846
|
+
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
1847
|
+
},
|
|
1848
|
+
"2830029349304997821": {
|
|
1853
1849
|
"error_kind": "fmtstring",
|
|
1854
|
-
"
|
|
1855
|
-
"
|
|
1850
|
+
"length": 27,
|
|
1851
|
+
"item_types": [
|
|
1852
|
+
{
|
|
1853
|
+
"kind": "field"
|
|
1854
|
+
}
|
|
1855
|
+
]
|
|
1856
1856
|
},
|
|
1857
|
-
"
|
|
1857
|
+
"2920182694213909827": {
|
|
1858
1858
|
"error_kind": "string",
|
|
1859
|
-
"string": "
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1859
|
+
"string": "attempt to subtract with overflow"
|
|
1860
|
+
},
|
|
1861
|
+
"5019202896831570965": {
|
|
1862
|
+
"error_kind": "string",
|
|
1863
|
+
"string": "attempt to add with overflow"
|
|
1864
|
+
},
|
|
1865
|
+
"6504213605561840204": {
|
|
1866
|
+
"error_kind": "string",
|
|
1867
|
+
"string": "New contract class is not registered"
|
|
1868
|
+
},
|
|
1869
|
+
"10019982601749771606": {
|
|
1870
|
+
"error_kind": "string",
|
|
1871
|
+
"string": "msg.sender is not deployed"
|
|
1872
|
+
},
|
|
1873
|
+
"11343565365413149907": {
|
|
1874
|
+
"error_kind": "string",
|
|
1875
|
+
"string": "Function get_update_delay can only be called statically"
|
|
1876
|
+
},
|
|
1877
|
+
"15573886522241766899": {
|
|
1878
|
+
"error_kind": "string",
|
|
1879
|
+
"string": "New update delay is too low"
|
|
1880
|
+
},
|
|
1881
|
+
"16761564377371454734": {
|
|
1882
|
+
"error_kind": "string",
|
|
1883
|
+
"string": "Array index out of bounds"
|
|
1884
|
+
},
|
|
1885
|
+
"17595253152434889169": {
|
|
1886
|
+
"error_kind": "string",
|
|
1887
|
+
"string": "offset too large"
|
|
1888
|
+
},
|
|
1889
|
+
"17843811134343075018": {
|
|
1890
|
+
"error_kind": "string",
|
|
1891
|
+
"string": "Stack too deep"
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
"bytecode": "JwACBAEoAAABBIBSJwAABAMnAgIEAScCAwQAHxgAAwACgFEuCIBRAAElAAAARSUAAADMKAIAAQSAUicCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YoAIBFBAAZKgCARgAAAAABAAAAACgAgEcAAQAoAIBIBAADKACASQEAACgAgEoEAAAoAIBLAAAAKACATAEAASgAgE0EAAEoAIBOAAABKACATwQAAigAgFAEAAQmJQAACvgpAgACAPqRAssKOAECAycCBAQAJwIGBAMAOAQGBS0IAQIAEAEFAScDAgQBACgCAgUtDgQFACgFAgUtDgQFJwIFBAMAOAIFBCcCBAArJAIAAwAAASojAAAEcC0IAQMnAgUEAgAQAQUBJwMDBAEAKAMCBR8kgE2ATQAFLQ0DBQAoBQIFLQ4FAy0IAQUAAAECAS0OAwUtCAEDAAABAgEuCoBKAAMnAgcECC0IAAgtDAUJLQwDCgAQAAc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FzdWuBRT1c68FjB8NW1GFmu5xGDtsP+4y2MXo/J17dkeNDfvInR63kogAFzfZkeHBhoYAw89fqqtMb1dsRdMHQ9Jhl46sdR38bUj6M2MAYeMvDUtyE25VPB1Je83i5TlusxYuCpH0FoYK4fDR08u9bAXN8ecEgGzPUjtYNjBw2MgSca7InXx87BIYUG5so4+Gv52/9+/+XD9z98/Pm3BfH0j398+vH3D58/vfz19//7df2XH758+Pjxwy/f/frl848///THl5+/+/j5x6d/exde/u/fAMrvIYIsap7kLzu2+T0k4uXvT26D8PT3ZWr09O9PgGW37f2y4fP015fvafk+yaJsUff/",
|
|
1897
|
+
"brillig_names": [
|
|
1898
|
+
"public_dispatch"
|
|
1899
|
+
]
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
"name": "sync_notes",
|
|
1903
|
+
"is_unconstrained": true,
|
|
1904
|
+
"custom_attributes": [],
|
|
1905
|
+
"abi": {
|
|
1906
|
+
"parameters": [],
|
|
1907
|
+
"return_type": null,
|
|
1908
|
+
"error_types": {
|
|
1909
|
+
"2920182694213909827": {
|
|
1910
|
+
"error_kind": "string",
|
|
1911
|
+
"string": "attempt to subtract with overflow"
|
|
1912
|
+
},
|
|
1913
|
+
"3305101268118424981": {
|
|
1914
|
+
"error_kind": "string",
|
|
1915
|
+
"string": "Attempted to delete past the length of a CapsuleArray"
|
|
1916
|
+
},
|
|
1917
|
+
"3367683922240523006": {
|
|
1918
|
+
"error_kind": "fmtstring",
|
|
1919
|
+
"length": 58,
|
|
1920
|
+
"item_types": [
|
|
1921
|
+
{
|
|
1922
|
+
"kind": "field"
|
|
1923
|
+
}
|
|
1924
|
+
]
|
|
1925
|
+
},
|
|
1926
|
+
"5019202896831570965": {
|
|
1927
|
+
"error_kind": "string",
|
|
1928
|
+
"string": "attempt to add with overflow"
|
|
1929
|
+
},
|
|
1930
|
+
"5727012404371710682": {
|
|
1931
|
+
"error_kind": "string",
|
|
1932
|
+
"string": "push out of bounds"
|
|
1933
|
+
},
|
|
1934
|
+
"6753155520859132764": {
|
|
1935
|
+
"error_kind": "string",
|
|
1936
|
+
"string": "Failed to deliver note"
|
|
1937
|
+
},
|
|
1938
|
+
"8830323656616886390": {
|
|
1939
|
+
"error_kind": "string",
|
|
1940
|
+
"string": "Got a public log emitted by a different contract"
|
|
1941
|
+
},
|
|
1942
|
+
"13649294680379557736": {
|
|
1943
|
+
"error_kind": "string",
|
|
1944
|
+
"string": "extend_from_bounded_vec out of bounds"
|
|
1945
|
+
},
|
|
1946
|
+
"14657895983200220173": {
|
|
1947
|
+
"error_kind": "string",
|
|
1948
|
+
"string": "Attempted to read past the length of a CapsuleArray"
|
|
1949
|
+
},
|
|
1950
|
+
"16761564377371454734": {
|
|
1951
|
+
"error_kind": "string",
|
|
1952
|
+
"string": "Array index out of bounds"
|
|
1953
|
+
},
|
|
1954
|
+
"16775516380094354375": {
|
|
1955
|
+
"error_kind": "fmtstring",
|
|
1956
|
+
"length": 40,
|
|
1957
|
+
"item_types": []
|
|
1958
|
+
},
|
|
1959
|
+
"16954218183513903507": {
|
|
1960
|
+
"error_kind": "string",
|
|
1961
|
+
"string": "Attempted to read past end of BoundedVec"
|
|
1962
|
+
},
|
|
1963
|
+
"17843811134343075018": {
|
|
1964
|
+
"error_kind": "string",
|
|
1965
|
+
"string": "Stack too deep"
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
},
|
|
1969
|
+
"bytecode": "H4sIAAAAAAAA/+1dXYhcyXWunu6eme6Z1rT+tV7J6/WPdjde2/03f5Jszb9GWv2sd9eGQCD0dLcUO+uVWWkNBkMmJBDyYkhiHPKSvDgEB4c4TmJsMAkO+SEQ/BQ2GILJQ1jIQyA4G5I8xLGudE/3N1+fW3175tRMa3cKhum+deo7p06dc+pU3bq3M65XMvH/nNtDEZBnCo/+x//cGNRnH/wtxd8reyvVAvG1xF+oNBYLSv8M5a8XYsxMGPyK4AfSf2Uixrm63cPHvgjfyQd/U/D5mOvZR6j+y/iF7P9xT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a1zMpnlnkQJl6X5J4/4974jH/jM/TGZ8Ibn4lvfCa98ZkaD5Y+8wYPyhs8WH7NbOUz7o3P+Dc+80Y+KG/kg/JGPihv5IPyRj4on+eBN+aNz9g3PuPe+MwnefCfy7/974+///zjn3/56Z+XT1z/479+/csfP//26+1f//i/f0z/5c+///zLLz///U//+P23v/z013/9/tOffvntL9f/9s3c/ue/nXf2B+fJXazxw7+bdPl3my7/Pmxlvsg95ofL/4Tr/2GHEzZfTjhzseViz/8D",
|
|
1971
|
+
"brillig_names": [
|
|
1972
|
+
"sync_notes"
|
|
1973
|
+
]
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
"name": "set_update_delay",
|
|
1977
|
+
"is_unconstrained": true,
|
|
1978
|
+
"custom_attributes": [
|
|
1979
|
+
"public"
|
|
1980
|
+
],
|
|
1981
|
+
"abi": {
|
|
1982
|
+
"parameters": [
|
|
1983
|
+
{
|
|
1984
|
+
"name": "new_update_delay",
|
|
1985
|
+
"type": {
|
|
1986
|
+
"kind": "integer",
|
|
1987
|
+
"sign": "unsigned",
|
|
1988
|
+
"width": 32
|
|
1989
|
+
},
|
|
1990
|
+
"visibility": "private"
|
|
1991
|
+
}
|
|
1992
|
+
],
|
|
1993
|
+
"return_type": null,
|
|
1994
|
+
"error_types": {
|
|
1995
|
+
"206160798890201757": {
|
|
1996
|
+
"error_kind": "string",
|
|
1997
|
+
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
1998
|
+
},
|
|
1999
|
+
"2920182694213909827": {
|
|
2000
|
+
"error_kind": "string",
|
|
2001
|
+
"string": "attempt to subtract with overflow"
|
|
2002
|
+
},
|
|
2003
|
+
"5019202896831570965": {
|
|
2004
|
+
"error_kind": "string",
|
|
2005
|
+
"string": "attempt to add with overflow"
|
|
2006
|
+
},
|
|
2007
|
+
"10019982601749771606": {
|
|
2008
|
+
"error_kind": "string",
|
|
2009
|
+
"string": "msg.sender is not deployed"
|
|
2010
|
+
},
|
|
2011
|
+
"15573886522241766899": {
|
|
2012
|
+
"error_kind": "string",
|
|
2013
|
+
"string": "New update delay is too low"
|
|
2014
|
+
},
|
|
2015
|
+
"16761564377371454734": {
|
|
2016
|
+
"error_kind": "string",
|
|
2017
|
+
"string": "Array index out of bounds"
|
|
2018
|
+
},
|
|
2019
|
+
"17595253152434889169": {
|
|
2020
|
+
"error_kind": "string",
|
|
2021
|
+
"string": "offset too large"
|
|
2022
|
+
},
|
|
2023
|
+
"17843811134343075018": {
|
|
2024
|
+
"error_kind": "string",
|
|
2025
|
+
"string": "Stack too deep"
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
},
|
|
2029
|
+
"bytecode": "JwACBAEoAAABBIBPJwAABAMnAgIEAScCAwQAHxgAAwACgE4dAIBOgE4ELgiATgABJQAAAEwlAAAAoCgCAAEEgE8nAgIEADsNAAEAAigAgEMEABkqAIBEAAAAAAEAAAAAKACARQABACgAgEYEAAMoAIBHAQAAKACASAQAACgAgEkAAAAoAIBKAQABKACASwQAASgAgEwAAAEoAIBNBAAEJiUAAAmELQgBAwAAAQIBLgqARwADLQgBAwAAAQIBLgqASQADLQgBAwAAAQIBJwIEAAItDgQDHgIAAwEeAgAFADM4AAMABQAGJAIABgAAAPQlAAAJrQ0oAAGAQwAFCygABYBHAAYkAgAGAAABESUAAAm/LQgBBScCBgQDABABBgEnAwUEAQAoBQIGLQwGBy4KgEwABwAoBwIHLQ4DBysCAAMAAAAAAAAAAAIAAAAAAAAAACcCCgQLLQgACy0MAwwAEAAKACUAAAnRLQQAAC0MDAYtDA0HLQwOCC0MDwktDQYDACgDAgMtDgMGLQgBAwAAAQIBLQ4GAy0NBwYAKAYCBi0OBgctCAEGAAABAgEtDgcGLQgBBwAAAQIBLQ4IBy0IAQgAAAECAS0OCQgnAgkEAi4IgEgAAiMAAAHaDDgCCQokAgAKAAAJESMAAAHsJwIKBAstCAALLQwDDC0MBg0tDAcOLQwIDwAQAAoAJQAACnEtBAAALQwMBQsoAAWASQ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OkcaceKUHx2agsCkUoL0HxS+pZFElQJFKDRMo7kS0nUt6JlPci5TdGcxNjtsvBEQkqaBEqCFBWoQQFSoSyEtRGDJBDOUHkYA2IUJKIyKLEluP7eWfiF4hoEszGvDd+PhmsTTEowPjrMfyyagZDgth/a1E1h7ISFIlskciWE9lyIlteZMuL6iuIbAURr42+cx/lNzZ+5FCS+a4HEKHo6t7Cb2XkYrpLMxh79Vvska63YwW+8ct3GYy/HkPX92Se/yxvH+MEdrwSYAR1GgR2gsQO+75OS64zxiVzgqnyBBiBnY0s2C6GnxtlMAI7RmCHX9pf1Q+D4WOb3TrduEh+H2MFdvh1+X0MXR8Nbdw7ncFc3x9sLMZnMNdHahsL8RnM1Xam8FcLMHQ9BpQAc2U7+Dn9+u+Hb3cfPt5//j4hLn/8+8unH3dfvzz9/PG/v+a/fPx2d39/9+f7v759/fT597+/fX5///XT5W836uk/v1GgWwdu8uXS8J0Pt1M4cfl1+eM0R71F//Dz8a9TWe8nHyY//g8=",
|
|
2031
|
+
"brillig_names": [
|
|
2032
|
+
"set_update_delay"
|
|
2033
|
+
]
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
"name": "process_log",
|
|
2037
|
+
"is_unconstrained": true,
|
|
2038
|
+
"custom_attributes": [],
|
|
2039
|
+
"abi": {
|
|
2040
|
+
"parameters": [
|
|
2041
|
+
{
|
|
2042
|
+
"name": "_log_ciphertext",
|
|
2043
|
+
"type": {
|
|
2044
|
+
"kind": "struct",
|
|
2045
|
+
"path": "std::collections::bounded_vec::BoundedVec",
|
|
1866
2046
|
"fields": [
|
|
1867
2047
|
{
|
|
1868
2048
|
"name": "storage",
|
|
@@ -1882,9 +2062,7 @@
|
|
|
1882
2062
|
"width": 32
|
|
1883
2063
|
}
|
|
1884
2064
|
}
|
|
1885
|
-
]
|
|
1886
|
-
"kind": "struct",
|
|
1887
|
-
"path": "std::collections::bounded_vec::BoundedVec"
|
|
2065
|
+
]
|
|
1888
2066
|
},
|
|
1889
2067
|
"visibility": "private"
|
|
1890
2068
|
},
|
|
@@ -1898,6 +2076,8 @@
|
|
|
1898
2076
|
{
|
|
1899
2077
|
"name": "_unique_note_hashes_in_tx",
|
|
1900
2078
|
"type": {
|
|
2079
|
+
"kind": "struct",
|
|
2080
|
+
"path": "std::collections::bounded_vec::BoundedVec",
|
|
1901
2081
|
"fields": [
|
|
1902
2082
|
{
|
|
1903
2083
|
"name": "storage",
|
|
@@ -1917,9 +2097,7 @@
|
|
|
1917
2097
|
"width": 32
|
|
1918
2098
|
}
|
|
1919
2099
|
}
|
|
1920
|
-
]
|
|
1921
|
-
"kind": "struct",
|
|
1922
|
-
"path": "std::collections::bounded_vec::BoundedVec"
|
|
2100
|
+
]
|
|
1923
2101
|
},
|
|
1924
2102
|
"visibility": "private"
|
|
1925
2103
|
},
|
|
@@ -1933,6 +2111,8 @@
|
|
|
1933
2111
|
{
|
|
1934
2112
|
"name": "_recipient",
|
|
1935
2113
|
"type": {
|
|
2114
|
+
"kind": "struct",
|
|
2115
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress",
|
|
1936
2116
|
"fields": [
|
|
1937
2117
|
{
|
|
1938
2118
|
"name": "inner",
|
|
@@ -1940,17 +2120,26 @@
|
|
|
1940
2120
|
"kind": "field"
|
|
1941
2121
|
}
|
|
1942
2122
|
}
|
|
1943
|
-
]
|
|
1944
|
-
"kind": "struct",
|
|
1945
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
2123
|
+
]
|
|
1946
2124
|
},
|
|
1947
2125
|
"visibility": "private"
|
|
1948
2126
|
}
|
|
1949
2127
|
],
|
|
1950
|
-
"return_type": null
|
|
2128
|
+
"return_type": null,
|
|
2129
|
+
"error_types": {
|
|
2130
|
+
"16775516380094354375": {
|
|
2131
|
+
"error_kind": "fmtstring",
|
|
2132
|
+
"length": 40,
|
|
2133
|
+
"item_types": []
|
|
2134
|
+
},
|
|
2135
|
+
"17843811134343075018": {
|
|
2136
|
+
"error_kind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s3Fb13NjacGTCgiLx21S+kXKvksk9jZVOu3gtRmHjNc8eX7zm3ScxXmNHFpcXr+P/xquOLTdek2hRpC0V2ZqS/e7I1pXsj3Jhu1Acg+rvsG3yeR+snz3rPmzHw69toayXC39IDK6q7xLlv0f+0fUdWapkcblsp159jpUdrUs4Eqd+Xn1uVec19Rv5fdtjf82xv8Tt+c71S+qpn3rqI9buVH83qgMx9Jf8Jrr47OI4rj5nVyrDwtdO2ukfdH1toaH+U9HfCKK/l4n+zTD8836qGeb+DkT/Vhj+efy0wvD3RH87DP+Z6N8Owz9/j+kE0V/Mx+U7Yfjn8b8bxv9z/r0w/HP9+2H45/f3IIz+sYw7bkSL4o4zD9X3dv1/b3zZcabYrzusocaZhw6P6x89zoTsyMPa9sjcZ/TIY+fIY8ena9NQ14Ghrm1DXQ1DXfuGutqGuuqGuvYMdbUMdaWGuizvo6W/LGN111CXZaxuGeq6ru2E5fNo6fvrGqsbhrosY8IyVi39tWOoy7KNthwDNA11WfYdls/QdY2vp6H9CtEPhV0PzDLfPFhkp987D2aoPxNfS6zquW9tU64vcer/6fh5M4ife1N5J5M2SPvCN1dlabvm2Isi//us2G96eIS77pFd5R/Mno5OTsf383wwzIuifzKsOfqF1f1OzzvrPkfX970b++bVDH098q3xtJRfUWIl23JkiZIJo17j8c07WvJfxv/aftsjc8del72XnWg51vTz2IgWz3Bc2l/7cHTeljxirPQn0fIabuTYT5z6f1ef3bbuqs/I2XDaPetPz6bF9MGD/GTacfRrH8JP/wJJ9PoyCV0AAA==",
|
|
1953
|
-
"debug_symbols": "
|
|
2142
|
+
"debug_symbols": "tZbRCoMgGIXfxWsv0qV/26uMMawsBLGwGozo3acjttiuz0105NfPCz84K2ttvfR3F7phYpfryvzQmNkNIaV146yOznvX34/LrMgfofR7wzSakPM0mzizizgJUpzZ0OZ/KVU6pHPeplTQxv/mSe7DRJ/JkrYbTwBCAyo04AwG6AINEGiARANOaECJBig0AG2yRpus0SZrtMmENpnQJhPaZEKbTGiTCW0yoU0mtMkENXlL6WGiM7W3e8PpltAcCs/8HO1P9xnj0Nh2iTa3oG8Byq+xlFzJfO1sr6gKLiqVIAn0Ag==",
|
|
1954
2143
|
"brillig_names": [
|
|
1955
2144
|
"process_log"
|
|
1956
2145
|
]
|
|
@@ -1962,44 +2151,12 @@
|
|
|
1962
2151
|
"public"
|
|
1963
2152
|
],
|
|
1964
2153
|
"abi": {
|
|
1965
|
-
"error_types": {
|
|
1966
|
-
"10019982601749771606": {
|
|
1967
|
-
"error_kind": "string",
|
|
1968
|
-
"string": "msg.sender is not deployed"
|
|
1969
|
-
},
|
|
1970
|
-
"16761564377371454734": {
|
|
1971
|
-
"error_kind": "string",
|
|
1972
|
-
"string": "Array index out of bounds"
|
|
1973
|
-
},
|
|
1974
|
-
"17595253152434889169": {
|
|
1975
|
-
"error_kind": "string",
|
|
1976
|
-
"string": "offset too large"
|
|
1977
|
-
},
|
|
1978
|
-
"17843811134343075018": {
|
|
1979
|
-
"error_kind": "string",
|
|
1980
|
-
"string": "Stack too deep"
|
|
1981
|
-
},
|
|
1982
|
-
"206160798890201757": {
|
|
1983
|
-
"error_kind": "string",
|
|
1984
|
-
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
1985
|
-
},
|
|
1986
|
-
"2920182694213909827": {
|
|
1987
|
-
"error_kind": "string",
|
|
1988
|
-
"string": "attempt to subtract with overflow"
|
|
1989
|
-
},
|
|
1990
|
-
"5019202896831570965": {
|
|
1991
|
-
"error_kind": "string",
|
|
1992
|
-
"string": "attempt to add with overflow"
|
|
1993
|
-
},
|
|
1994
|
-
"6504213605561840204": {
|
|
1995
|
-
"error_kind": "string",
|
|
1996
|
-
"string": "New contract class is not registered"
|
|
1997
|
-
}
|
|
1998
|
-
},
|
|
1999
2154
|
"parameters": [
|
|
2000
2155
|
{
|
|
2001
2156
|
"name": "new_contract_class_id",
|
|
2002
2157
|
"type": {
|
|
2158
|
+
"kind": "struct",
|
|
2159
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId",
|
|
2003
2160
|
"fields": [
|
|
2004
2161
|
{
|
|
2005
2162
|
"name": "inner",
|
|
@@ -2007,58 +2164,13 @@
|
|
|
2007
2164
|
"kind": "field"
|
|
2008
2165
|
}
|
|
2009
2166
|
}
|
|
2010
|
-
]
|
|
2011
|
-
"kind": "struct",
|
|
2012
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2167
|
+
]
|
|
2013
2168
|
},
|
|
2014
2169
|
"visibility": "private"
|
|
2015
2170
|
}
|
|
2016
2171
|
],
|
|
2017
|
-
"return_type": null
|
|
2018
|
-
},
|
|
2019
|
-
"bytecode": "JwACBAEoAAABBIBQJwAABAMnAgIEAScCAwQAHxgAAwACgE8uCIBPAAElAAAARSUAAAC+KAIAAQSAUCcCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YqAIBFAAAAAAEAAAAAKACARgABACgAgEcEAAMoAIBIAQAAKACASQQAACgAgEoAAAAoAIBLAQABKACATAQAASgAgE0AAAEoAIBOBAAEJiUAAAncLQgBAwAAAQIBLgqASAADLQgBAwAAAQIBLgqASgADLQgBAwAAAQIBJwIEAAItDgQDHgIAAwEeAgAFADM4AAMABQAGJAIABgAAARIlAAAKBTMoAAGAQwAFJAIABQAAASclAAAKFy0IAQUnAgYEAwAQAQYBJwMFBAEAKAUCBi0MBgcuCoBNAAcAKAcCBy0OAwcrAgAGAAAAAAAAAAACAAAAAAAAAAAnAgsEDC0IAAwtDAYNABAACwAlAAAKKS0EAAAtDA0HLQwOCC0MDwktDBAKLQ0HBgAoBgIGLQ4GBy0IAQYAAAECAS0OBwYtDQgHACgHAgctDgcILQgBBwAAAQIBLQ4IBy0IAQgAAAECAS0OCQgtCAEJAAABAgEtDgoJJwIKBAIuCIBJAAIjAAAB8Aw4AgoLJAIACwAACWkjAAACAicCCwQMLQgADC0MBg0tDAcOLQwIDy0MCRAAEAALACUAAArJLQQAAC0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A+ocyC0inKS1BGZItP+2RRJEGByBaIbKHKomxaX7jRoixGFCSt15DKPl8AKWrDFvjlqUw9dBu1DG7nWTbOC3oA460I5QSoja2RWsW04PQaagkLr1Nua/nWm0XxqR9tl/dcqBMUWAmKfy2RRZEExbdDvax519qnavD9vAYV97KCSm3x/XwWFSQo/oV3FsW3KIynzWpE9RoFfECVRYls8ZFVDrWR7syhSILiT0fMorwEBSBCBQkKRbZwg1ecXWsMJkERSVD8678sKkhQHkQokRrBiFASDZE/OVrbJY07DSAJin/Rn0WBCOUlKH4rURZFEpQVqWFFyoPIFoiUB5HyKFJ+YzS3MWa7HByRoMiIUEGCciBBeSVCoQS1EQPkUE4QOZDSIpQkIiItseX4ft7ZuAMRXr9Ctxsvjad3LXNYjphiQIDxt2P418UZDAli/62XxTkUSlBWZMuKbIHIFohsocgWiuqLRLZIxGuj78yg+Bl5FiWZ73qvRSi6vbfYysjFdJdhMHjzUxw03WwnGCXAgADjb8fY23uywB8ftI8BgR1UAoygTklghyR22Oc1YLyh0CVzgsBHOhmMwM5GFmwXw8+NMpib7UyhhRFgKFM/DIaPbfbqFDZefO9jjMCOCbdjLNyOASXAuNsxaAQYfzuGfxGfwQjsOAEfJ2g7XlA//sZ28H369N/3Xx7f//rxw98T4vLlP59++/r4+dPzx6//+2v+5tcvjx8/Pv75y19fPv/24fd/vnz45ePn3y7fPajnf352yr1zxk++XBr+FNi/8/rp0+XLKVfyDpW+fLx868JUNoTJh8mP/wM=",
|
|
2021
|
-
"brillig_names": [
|
|
2022
|
-
"update"
|
|
2023
|
-
]
|
|
2024
|
-
},
|
|
2025
|
-
{
|
|
2026
|
-
"name": "public_dispatch",
|
|
2027
|
-
"is_unconstrained": true,
|
|
2028
|
-
"custom_attributes": [
|
|
2029
|
-
"public"
|
|
2030
|
-
],
|
|
2031
|
-
"abi": {
|
|
2172
|
+
"return_type": null,
|
|
2032
2173
|
"error_types": {
|
|
2033
|
-
"10019982601749771606": {
|
|
2034
|
-
"error_kind": "string",
|
|
2035
|
-
"string": "msg.sender is not deployed"
|
|
2036
|
-
},
|
|
2037
|
-
"11343565365413149907": {
|
|
2038
|
-
"error_kind": "string",
|
|
2039
|
-
"string": "Function get_update_delay can only be called statically"
|
|
2040
|
-
},
|
|
2041
|
-
"15573886522241766899": {
|
|
2042
|
-
"error_kind": "string",
|
|
2043
|
-
"string": "New update delay is too low"
|
|
2044
|
-
},
|
|
2045
|
-
"16541607464495309456": {
|
|
2046
|
-
"error_kind": "fmtstring",
|
|
2047
|
-
"item_types": [],
|
|
2048
|
-
"length": 16
|
|
2049
|
-
},
|
|
2050
|
-
"16761564377371454734": {
|
|
2051
|
-
"error_kind": "string",
|
|
2052
|
-
"string": "Array index out of bounds"
|
|
2053
|
-
},
|
|
2054
|
-
"17595253152434889169": {
|
|
2055
|
-
"error_kind": "string",
|
|
2056
|
-
"string": "offset too large"
|
|
2057
|
-
},
|
|
2058
|
-
"17843811134343075018": {
|
|
2059
|
-
"error_kind": "string",
|
|
2060
|
-
"string": "Stack too deep"
|
|
2061
|
-
},
|
|
2062
2174
|
"206160798890201757": {
|
|
2063
2175
|
"error_kind": "string",
|
|
2064
2176
|
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
@@ -2074,41 +2186,11 @@
|
|
|
2074
2186
|
"6504213605561840204": {
|
|
2075
2187
|
"error_kind": "string",
|
|
2076
2188
|
"string": "New contract class is not registered"
|
|
2077
|
-
}
|
|
2078
|
-
},
|
|
2079
|
-
"parameters": [
|
|
2080
|
-
{
|
|
2081
|
-
"name": "selector",
|
|
2082
|
-
"type": {
|
|
2083
|
-
"kind": "field"
|
|
2084
|
-
},
|
|
2085
|
-
"visibility": "private"
|
|
2086
|
-
}
|
|
2087
|
-
],
|
|
2088
|
-
"return_type": null
|
|
2089
|
-
},
|
|
2090
|
-
"bytecode": "JwACBAEoAAABBIBSJwAABAMnAgIEAScCAwQAHxgAAwACgFEuCIBRAAElAAAARSUAAADMKAIAAQSAUicCAgQAOw0AAQAC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MRYy4xfD9mPLYq4JBBUax3EYegwqVNChScZGKi1VcrOJKKq6kKi9RcYnGrp1nvaso0qB2Jm1qqKhCyd2tRdjr6XIH7guYdHctDlHu50GFtt3+4wam/N5sBXN/SxZ2+pvbGAVPCgqMokxFwSP38+xsFhCc43qdcWcM348BBU95O2oFg/djgoInaHikUj4FTHnK63aZRrkfgwqe8haECub+bGjn2bXbmOQUmPvbg52NBxUM3Y1BBwoMKjD3x87OJoUK5s44+Gv62///8PXjDz9++vDbhLj84x+ff/r945fP17/+/p9f53/58evHT58+/vL9r1+//PTh5z++fvj+05efLv/2zl3/8y+YRijvAQQmNRfXvizeTuNFN/39Yg5cxm3gvL/8+wWA6N9PK9qXv75+72T6HmBSNqn7Lw==",
|
|
2092
|
-
"brillig_names": [
|
|
2093
|
-
"public_dispatch"
|
|
2094
|
-
]
|
|
2095
|
-
},
|
|
2096
|
-
{
|
|
2097
|
-
"name": "set_update_delay",
|
|
2098
|
-
"is_unconstrained": true,
|
|
2099
|
-
"custom_attributes": [
|
|
2100
|
-
"public"
|
|
2101
|
-
],
|
|
2102
|
-
"abi": {
|
|
2103
|
-
"error_types": {
|
|
2189
|
+
},
|
|
2104
2190
|
"10019982601749771606": {
|
|
2105
2191
|
"error_kind": "string",
|
|
2106
2192
|
"string": "msg.sender is not deployed"
|
|
2107
2193
|
},
|
|
2108
|
-
"15573886522241766899": {
|
|
2109
|
-
"error_kind": "string",
|
|
2110
|
-
"string": "New update delay is too low"
|
|
2111
|
-
},
|
|
2112
2194
|
"16761564377371454734": {
|
|
2113
2195
|
"error_kind": "string",
|
|
2114
2196
|
"string": "Array index out of bounds"
|
|
@@ -2120,37 +2202,13 @@
|
|
|
2120
2202
|
"17843811134343075018": {
|
|
2121
2203
|
"error_kind": "string",
|
|
2122
2204
|
"string": "Stack too deep"
|
|
2123
|
-
},
|
|
2124
|
-
"206160798890201757": {
|
|
2125
|
-
"error_kind": "string",
|
|
2126
|
-
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
2127
|
-
},
|
|
2128
|
-
"2920182694213909827": {
|
|
2129
|
-
"error_kind": "string",
|
|
2130
|
-
"string": "attempt to subtract with overflow"
|
|
2131
|
-
},
|
|
2132
|
-
"5019202896831570965": {
|
|
2133
|
-
"error_kind": "string",
|
|
2134
|
-
"string": "attempt to add with overflow"
|
|
2135
2205
|
}
|
|
2136
|
-
}
|
|
2137
|
-
"parameters": [
|
|
2138
|
-
{
|
|
2139
|
-
"name": "new_update_delay",
|
|
2140
|
-
"type": {
|
|
2141
|
-
"kind": "integer",
|
|
2142
|
-
"sign": "unsigned",
|
|
2143
|
-
"width": 32
|
|
2144
|
-
},
|
|
2145
|
-
"visibility": "private"
|
|
2146
|
-
}
|
|
2147
|
-
],
|
|
2148
|
-
"return_type": null
|
|
2206
|
+
}
|
|
2149
2207
|
},
|
|
2150
|
-
"bytecode": "
|
|
2151
|
-
"debug_symbols": "7V3dbhypEn4XX
|
|
2208
|
+
"bytecode": "JwACBAEoAAABBIBQJwAABAMnAgIEAScCAwQAHxgAAwACgE8uCIBPAAElAAAARSUAAAC+KAIAAQSAUCcCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YqAIBFAAAAAAEAAAAAKACARgABACgAgEcEAAMoAIBIAQAAKACASQQAACgAgEoAAAAoAIBLAQABKACATAQAASgAgE0AAAEoAIBOBAAEJiUAAAncLQgBAwAAAQIBLgqASAADLQgBAwAAAQIBLgqASgADLQgBAwAAAQIBJwIEAAItDgQDHgIAAwEeAgAFADM4AAMABQAGJAIABgAAARIlAAAKBTMoAAGAQwAFJAIABQAAASclAAAKFy0IAQUnAgYEAwAQAQYBJwMFBAEAKAUCBi0MBgcuCoBNAAcAKAcCBy0OAwcrAgAGAAAAAAAAAAACAAAAAAAAAAAnAgsEDC0IAAwtDAYNABAACwAlAAAKKS0EAAAtDA0HLQwOCC0MDwktDBAKLQ0HBgAoBgIGLQ4GBy0IAQYAA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|
},
|
|
2156
2214
|
{
|
|
@@ -2161,7 +2219,24 @@
|
|
|
2161
2219
|
"view"
|
|
2162
2220
|
],
|
|
2163
2221
|
"abi": {
|
|
2222
|
+
"parameters": [],
|
|
2223
|
+
"return_type": {
|
|
2224
|
+
"abi_type": {
|
|
2225
|
+
"kind": "integer",
|
|
2226
|
+
"sign": "unsigned",
|
|
2227
|
+
"width": 32
|
|
2228
|
+
},
|
|
2229
|
+
"visibility": "public"
|
|
2230
|
+
},
|
|
2164
2231
|
"error_types": {
|
|
2232
|
+
"206160798890201757": {
|
|
2233
|
+
"error_kind": "string",
|
|
2234
|
+
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
2235
|
+
},
|
|
2236
|
+
"5019202896831570965": {
|
|
2237
|
+
"error_kind": "string",
|
|
2238
|
+
"string": "attempt to add with overflow"
|
|
2239
|
+
},
|
|
2165
2240
|
"11343565365413149907": {
|
|
2166
2241
|
"error_kind": "string",
|
|
2167
2242
|
"string": "Function get_update_delay can only be called statically"
|
|
@@ -2173,28 +2248,11 @@
|
|
|
2173
2248
|
"17843811134343075018": {
|
|
2174
2249
|
"error_kind": "string",
|
|
2175
2250
|
"string": "Stack too deep"
|
|
2176
|
-
},
|
|
2177
|
-
"206160798890201757": {
|
|
2178
|
-
"error_kind": "string",
|
|
2179
|
-
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
2180
|
-
},
|
|
2181
|
-
"5019202896831570965": {
|
|
2182
|
-
"error_kind": "string",
|
|
2183
|
-
"string": "attempt to add with overflow"
|
|
2184
2251
|
}
|
|
2185
|
-
},
|
|
2186
|
-
"parameters": [],
|
|
2187
|
-
"return_type": {
|
|
2188
|
-
"abi_type": {
|
|
2189
|
-
"kind": "integer",
|
|
2190
|
-
"sign": "unsigned",
|
|
2191
|
-
"width": 32
|
|
2192
|
-
},
|
|
2193
|
-
"visibility": "public"
|
|
2194
2252
|
}
|
|
2195
2253
|
},
|
|
2196
|
-
"bytecode": "JwACBAEoAA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YqrdWcLtVnBMdcyN+Q4KAL+VcR1OZ4faQzgmOmS+0IajXoRyybIhwzwLZEqCUcLyNMs5z7lecZQiMNeREhqrSqeL48KyEc852clghxzE0cmyKUpIaNcMzXE1chJEjXR6QyhIPu8NwUodRCLkIrEZmL0ElqzUYoHTwuQi9JDRehDBfyEcqYNROhHnSX/qYIpRZyEQ66T/86hAmGpgA5QklquAgH3am/JUIj4YSNUMIJF+GgW803RYiCkItQIjIX4aB7pa9CaI676hmTzZ3oQTdLb4pQIjIX4aDbpTdFKBGZjVAiMhehLLTmI5SkhoswSC1kI5SkhokQlCQ1bIQoCLkIJalZRoguIbTZ9BNoqYVchCAD/2yEEpG5CAf9znFThNI74SKUFf98hLLWmvnSBJCsZmAjlGchF+Ggm720RCgr/k8Q7qkYiyUqzsQdGtzsQ0XRprxqPWB0FCj348N6m/JHJRZs3GobLC/ePb9NxWRla6zKSzQXrajGCqp8QZUvU+XLVPnCKl9Ydb+oyhdVXVf5zbglq3JoWLRyNVauqqU4u/oZg77IPai4P2aAgs365xKVW/FZP6RVhQ1W2Pj1NgDrGcD6ZyaZCj/ldrtgU3FPqcIP1fgpxzSK9Tq4bCkWlePtgk2Fn/L+8udtypPSCzYVfkKFn/I82+z+5Da2HNfP3lOr7HobXeFHr8+HbHnz5fM2RlXYrH8eWIQKG7/ehkyFTYUfW3E9tqLuuIr741bWg5/T0b+3z9vbu93Dy2Sx/+f3x/vX7dPj4fD1v2/xP3fP291u+/Xm2/PT/cPn788PN7un+/3/Nurw45Mx9sqQ22vZHwLBFfw63DcEQ/5qGouavE6e/wc=",
|
|
2198
2256
|
"brillig_names": [
|
|
2199
2257
|
"get_update_delay"
|
|
2200
2258
|
]
|
|
@@ -2547,21 +2605,28 @@
|
|
|
2547
2605
|
"type": {
|
|
2548
2606
|
"fields": [
|
|
2549
2607
|
{
|
|
2550
|
-
"name": "
|
|
2608
|
+
"name": "new_contract_class_id",
|
|
2551
2609
|
"type": {
|
|
2552
|
-
"
|
|
2553
|
-
|
|
2554
|
-
|
|
2610
|
+
"fields": [
|
|
2611
|
+
{
|
|
2612
|
+
"name": "inner",
|
|
2613
|
+
"type": {
|
|
2614
|
+
"kind": "field"
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
],
|
|
2618
|
+
"kind": "struct",
|
|
2619
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2555
2620
|
}
|
|
2556
2621
|
}
|
|
2557
2622
|
],
|
|
2558
2623
|
"kind": "struct",
|
|
2559
|
-
"path": "ContractInstanceDeployer::
|
|
2624
|
+
"path": "ContractInstanceDeployer::update_parameters"
|
|
2560
2625
|
}
|
|
2561
2626
|
}
|
|
2562
2627
|
],
|
|
2563
2628
|
"kind": "struct",
|
|
2564
|
-
"path": "ContractInstanceDeployer::
|
|
2629
|
+
"path": "ContractInstanceDeployer::update_abi"
|
|
2565
2630
|
},
|
|
2566
2631
|
{
|
|
2567
2632
|
"fields": [
|
|
@@ -2769,215 +2834,264 @@
|
|
|
2769
2834
|
{
|
|
2770
2835
|
"name": "parameters",
|
|
2771
2836
|
"type": {
|
|
2772
|
-
"fields": [
|
|
2837
|
+
"fields": [
|
|
2838
|
+
{
|
|
2839
|
+
"name": "new_update_delay",
|
|
2840
|
+
"type": {
|
|
2841
|
+
"kind": "integer",
|
|
2842
|
+
"sign": "unsigned",
|
|
2843
|
+
"width": 32
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
],
|
|
2773
2847
|
"kind": "struct",
|
|
2774
|
-
"path": "ContractInstanceDeployer::
|
|
2775
|
-
}
|
|
2776
|
-
},
|
|
2777
|
-
{
|
|
2778
|
-
"name": "return_type",
|
|
2779
|
-
"type": {
|
|
2780
|
-
"kind": "integer",
|
|
2781
|
-
"sign": "unsigned",
|
|
2782
|
-
"width": 32
|
|
2848
|
+
"path": "ContractInstanceDeployer::set_update_delay_parameters"
|
|
2783
2849
|
}
|
|
2784
2850
|
}
|
|
2785
2851
|
],
|
|
2786
2852
|
"kind": "struct",
|
|
2787
|
-
"path": "ContractInstanceDeployer::
|
|
2853
|
+
"path": "ContractInstanceDeployer::set_update_delay_abi"
|
|
2788
2854
|
},
|
|
2789
2855
|
{
|
|
2790
2856
|
"fields": [
|
|
2791
2857
|
{
|
|
2792
2858
|
"name": "parameters",
|
|
2793
2859
|
"type": {
|
|
2794
|
-
"fields": [
|
|
2795
|
-
{
|
|
2796
|
-
"name": "new_contract_class_id",
|
|
2797
|
-
"type": {
|
|
2798
|
-
"fields": [
|
|
2799
|
-
{
|
|
2800
|
-
"name": "inner",
|
|
2801
|
-
"type": {
|
|
2802
|
-
"kind": "field"
|
|
2803
|
-
}
|
|
2804
|
-
}
|
|
2805
|
-
],
|
|
2806
|
-
"kind": "struct",
|
|
2807
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2808
|
-
}
|
|
2809
|
-
}
|
|
2810
|
-
],
|
|
2860
|
+
"fields": [],
|
|
2811
2861
|
"kind": "struct",
|
|
2812
|
-
"path": "ContractInstanceDeployer::
|
|
2862
|
+
"path": "ContractInstanceDeployer::get_update_delay_parameters"
|
|
2863
|
+
}
|
|
2864
|
+
},
|
|
2865
|
+
{
|
|
2866
|
+
"name": "return_type",
|
|
2867
|
+
"type": {
|
|
2868
|
+
"kind": "integer",
|
|
2869
|
+
"sign": "unsigned",
|
|
2870
|
+
"width": 32
|
|
2813
2871
|
}
|
|
2814
2872
|
}
|
|
2815
2873
|
],
|
|
2816
2874
|
"kind": "struct",
|
|
2817
|
-
"path": "ContractInstanceDeployer::
|
|
2875
|
+
"path": "ContractInstanceDeployer::get_update_delay_abi"
|
|
2818
2876
|
}
|
|
2819
2877
|
]
|
|
2820
2878
|
}
|
|
2821
2879
|
},
|
|
2822
2880
|
"file_map": {
|
|
2823
|
-
"104": {
|
|
2824
|
-
"path": "/mnt/user-data/grego/repos/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch/mod.nr",
|
|
2825
|
-
"source": "use super::utils::compute_fn_selector;\nuse std::panic;\n\n/// Returns an `fn public_dispatch(...)` function for the given module that's assumed to be an Aztec contract.\npub comptime fn generate_public_dispatch(m: Module) -> Quoted {\n let functions = m.functions();\n let functions =\n functions.filter(|function: FunctionDefinition| function.has_named_attribute(\"public\"));\n\n let unit = get_type::<()>();\n\n let ifs = functions.map(|function: FunctionDefinition| {\n let name = function.name();\n let parameters = function.parameters();\n let return_type = function.return_type();\n\n let selector: Field = compute_fn_selector(function);\n\n let mut parameters_size = 0;\n for param in parameters {\n parameters_size += size_in_fields(param.1);\n }\n\n let initial_read = if parameters.len() == 0 {\n quote {}\n } else {\n // The initial calldata_copy offset is 1 to skip the Field selector\n // The expected calldata is the serialization of\n // - FunctionSelector: the selector of the function intended to dispatch\n // - Parameters: the parameters of the function intended to dispatch\n // That is, exactly what is expected for a call to the target function,\n // but with a selector added at the beginning.\n quote {\n let input_calldata: [Field; $parameters_size] = dep::aztec::context::public_context::calldata_copy(1, $parameters_size);\n let mut reader = dep::aztec::protocol_types::utils::reader::Reader::new(input_calldata);\n }\n };\n\n let parameter_index = &mut 0;\n let reads = parameters.map(|param: (Quoted, Type)| {\n let parameter_index_value = *parameter_index;\n let param_name = f\"arg{parameter_index_value}\".quoted_contents();\n let param_type = param.1;\n let read = quote {\n let $param_name: $param_type = reader.read_struct(dep::aztec::protocol_types::traits::Deserialize::deserialize);\n };\n *parameter_index += 1;\n quote { $read }\n });\n let read = reads.join(quote { });\n\n let mut args = &[];\n for parameter_index in 0..parameters.len() {\n let param_name = f\"arg{parameter_index}\".quoted_contents();\n args = args.push_back(quote { $param_name });\n }\n\n let args = args.join(quote { , });\n let call = quote { $name($args) };\n\n let return_code = if return_type == unit {\n quote {\n $call;\n // Force early return.\n dep::aztec::context::public_context::avm_return([]);\n }\n } else {\n quote {\n let return_value = dep::aztec::protocol_types::traits::Serialize::serialize($call);\n dep::aztec::context::public_context::avm_return(return_value.as_slice());\n }\n };\n\n let if_ = quote {\n if selector == $selector {\n $initial_read\n $read\n $return_code\n }\n };\n if_\n });\n\n if ifs.len() == 0 {\n // No dispatch function if there are no public functions\n quote {}\n } else {\n let ifs = ifs.push_back(quote { panic(f\"Unknown selector\") });\n let dispatch = ifs.join(quote { });\n\n let body = quote {\n // We mark this as public because our whole system depends on public\n // functions having this attribute. However, the public MACRO will\n // handle the public_dispatch function specially and do nothing.\n #[public]\n pub unconstrained fn public_dispatch(selector: Field) {\n $dispatch\n }\n };\n\n body\n }\n}\n\ncomptime fn size_in_fields(typ: Type) -> u32 {\n let size = array_size_in_fields(typ);\n let size = size.or_else(|| bool_size_in_fields(typ));\n let size = size.or_else(|| constant_size_in_fields(typ));\n let size = size.or_else(|| field_size_in_fields(typ));\n let size = size.or_else(|| int_size_in_fields(typ));\n let size = size.or_else(|| str_size_in_fields(typ));\n let size = size.or_else(|| struct_size_in_fields(typ));\n let size = size.or_else(|| tuple_size_in_fields(typ));\n if size.is_some() {\n size.unwrap()\n } else {\n panic(f\"Can't determine size in fields of {typ}\")\n }\n}\n\ncomptime fn array_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_array().and_then(|typ: (Type, Type)| {\n let (typ, element_size) = typ;\n element_size.as_constant().map(|x: u32| x * size_in_fields(typ))\n })\n}\n\ncomptime fn bool_size_in_fields(typ: Type) -> Option<u32> {\n if typ.is_bool() {\n Option::some(1)\n } else {\n Option::none()\n }\n}\n\ncomptime fn field_size_in_fields(typ: Type) -> Option<u32> {\n if typ.is_field() {\n Option::some(1)\n } else {\n Option::none()\n }\n}\n\ncomptime fn int_size_in_fields(typ: Type) -> Option<u32> {\n if typ.as_integer().is_some() {\n Option::some(1)\n } else {\n Option::none()\n }\n}\n\ncomptime fn constant_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_constant()\n}\n\ncomptime fn str_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_str().map(|typ| size_in_fields(typ))\n}\n\ncomptime fn struct_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_struct().map(|typ: (StructDefinition, [Type])| {\n let struct_type = typ.0;\n let generics = typ.1;\n let mut size = 0;\n for field in struct_type.fields(generics) {\n size += size_in_fields(field.1);\n }\n size\n })\n}\n\ncomptime fn tuple_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_tuple().map(|types: [Type]| {\n let mut size = 0;\n for typ in types {\n size += size_in_fields(typ);\n }\n size\n })\n}\n\ncomptime fn get_type<T>() -> Type {\n let t: T = std::mem::zeroed();\n std::meta::type_of(t)\n}\n"
|
|
2826
|
-
},
|
|
2827
2881
|
"107": {
|
|
2828
|
-
"path": "/
|
|
2829
|
-
"source": "use crate::macros::utils::{\n add_to_field_slice, AsStrQuote, compute_fn_selector, is_fn_private, is_fn_view,\n};\nuse std::meta::{type_of, unquote};\n\ncomptime global FROM_FIELD: TypedExpr = {\n let from_field_trait = quote { protocol_types::traits::FromField }.as_trait_constraint();\n let function_selector_typ =\n quote { protocol_types::abis::function_selector::FunctionSelector }.as_type();\n function_selector_typ.get_trait_impl(from_field_trait).unwrap().methods().filter(|m| {\n m.name() == quote { from_field }\n })[0]\n .as_typed_expr()\n};\n\ncomptime global SERIALIZED_ARGS_SLICE_NAME: Quoted = quote { serialized_args };\n\npub comptime fn stub_fn(f: FunctionDefinition) -> Quoted {\n let is_static_call = is_fn_view(f);\n let is_void = f.return_type() == type_of(());\n\n if is_fn_private(f) {\n if is_static_call {\n if is_void {\n create_private_static_void_stub(f)\n } else {\n create_private_static_stub(f)\n }\n } else {\n if is_void {\n create_private_void_stub(f)\n } else {\n create_private_stub(f)\n }\n }\n } else {\n if is_static_call {\n if is_void {\n create_public_static_void_stub(f)\n } else {\n create_public_static_stub(f)\n }\n } else {\n if is_void {\n create_public_void_stub(f)\n } else {\n create_public_stub(f)\n }\n }\n }\n}\n\n/// Utility function creating stubs used by all the stub functions in this file.\ncomptime fn create_stub_base(\n f: FunctionDefinition,\n) -> (Quoted, Quoted, Quoted, Quoted, u32, Field) {\n let fn_name = f.name();\n let fn_parameters = f.parameters();\n let fn_parameters_list =\n fn_parameters.map(|(name, typ): (Quoted, Type)| quote { $name: $typ }).join(quote {,});\n\n // Example of what the fold(...) below will generate for `target_address` and `fee_juice_limit_per_tx` function\n // parameters:\n // ```\n // let mut serialized_args = &[];\n // serialized_args = serialized_args.append(aztec::protocol_types::traits::Serialize::serialize(target_address));\n // serialized_args = serialized_args.push_back(fee_juice_limit_per_tx as Field);\n // ```\n let serialized_args_slice_construction = fn_parameters.fold(\n quote {\n let mut $SERIALIZED_ARGS_SLICE_NAME = &[];\n },\n |args, param: (Quoted, Type)| {\n let (name, typ) = param;\n let arg_to_append = add_to_field_slice(SERIALIZED_ARGS_SLICE_NAME, name, typ);\n quote {\n $args\n $arg_to_append\n }\n },\n );\n\n let (fn_name_str, _) = fn_name.as_str_quote();\n let fn_name_len: u32 = unquote!(quote { $fn_name_str.as_bytes().len()});\n let fn_selector: Field = compute_fn_selector(f);\n\n (\n fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len,\n fn_selector,\n )\n}\n\ncomptime fn create_private_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_private_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateStaticCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateStaticCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n )\n }\n }\n}\n\ncomptime fn create_private_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_private_static_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateStaticVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateStaticVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n serialized_args\n )\n }\n }\n}\n\ncomptime fn create_public_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_public_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicStaticCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicStaticCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n )\n }\n }\n}\n\ncomptime fn create_public_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_public_static_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicStaticVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicStaticVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n serialized_args\n )\n }\n }\n}\n"
|
|
2882
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec.nr",
|
|
2883
|
+
"source": "use crate::{\n discovery::private_notes::MAX_NOTE_PACKED_LEN,\n macros::{\n dispatch::generate_public_dispatch,\n functions::{\n stub_registry,\n utils::{create_message_discovery_call, find_and_transform_top_level_unconstrained_fns},\n },\n notes::{generate_note_export, NOTES},\n storage::STORAGE_LAYOUT_NAME,\n utils::{get_trait_impl_method, module_has_storage},\n },\n};\n\n/// Marks a contract as an Aztec contract, generating the interfaces for its functions and notes, as well as injecting\n/// the `process_log` and `sync_notes` functions PXE requires in order to discover notes.\n/// Note: This is a module annotation, so the returned quote gets injected inside the module (contract) itself.\npub comptime fn aztec(m: Module) -> Quoted {\n let interface = generate_contract_interface(m);\n\n find_and_transform_top_level_unconstrained_fns(m);\n\n let contract_library_method_compute_note_hash_and_nullifier =\n generate_contract_library_method_compute_note_hash_and_nullifier();\n let process_log = generate_process_log();\n let note_exports = generate_note_exports();\n let public_dispatch = generate_public_dispatch(m);\n let sync_notes = generate_sync_notes();\n\n quote {\n $note_exports\n $interface\n $contract_library_method_compute_note_hash_and_nullifier\n $process_log\n $public_dispatch\n $sync_notes\n }\n}\n\ncomptime fn generate_contract_interface(m: Module) -> Quoted {\n let module_name = m.name();\n let contract_stubs = stub_registry::get(m);\n let fn_stubs_quote = if contract_stubs.is_some() {\n contract_stubs.unwrap().join(quote {})\n } else {\n quote {}\n };\n\n let has_storage_layout = module_has_storage(m) & STORAGE_LAYOUT_NAME.get(m).is_some();\n let storage_layout_getter = if has_storage_layout {\n let storage_layout_name = STORAGE_LAYOUT_NAME.get(m).unwrap();\n quote {\n pub fn storage_layout() -> StorageLayoutFields {\n $storage_layout_name.fields\n }\n }\n } else {\n quote {}\n };\n\n let library_storage_layout_getter = if has_storage_layout {\n quote {\n #[contract_library_method]\n $storage_layout_getter\n }\n } else {\n quote {}\n };\n\n quote {\n pub struct $module_name {\n pub target_contract: dep::aztec::protocol_types::address::AztecAddress\n }\n\n impl $module_name {\n $fn_stubs_quote\n\n pub fn at(\n addr: aztec::protocol_types::address::AztecAddress\n ) -> Self {\n Self { target_contract: addr }\n }\n\n pub fn interface() -> Self {\n Self { target_contract: aztec::protocol_types::address::AztecAddress::zero() }\n }\n\n $storage_layout_getter\n }\n\n #[contract_library_method]\n pub fn at(\n addr: aztec::protocol_types::address::AztecAddress\n ) -> $module_name {\n $module_name { target_contract: addr }\n }\n\n #[contract_library_method]\n pub fn interface() -> $module_name {\n $module_name { target_contract: aztec::protocol_types::address::AztecAddress::zero() }\n }\n\n $library_storage_layout_getter\n\n }\n}\n\n/// Generates a contract library method called `_compute_note_hash_and_nullifier` which is used for note\n/// discovery (to create the `aztec::discovery::ComputeNoteHashAndNullifier` function) and to implement the\n/// `compute_note_hash_and_nullifier` unconstrained contract function.\ncomptime fn generate_contract_library_method_compute_note_hash_and_nullifier() -> Quoted {\n let notes = NOTES.entries();\n\n if notes.len() > 0 {\n let max_note_packed_len = notes.fold(\n 0,\n |acc, (_, (_, len, _, _)): (Type, (TypeDefinition, u32, Field, [(Quoted, u32, bool)]))| {\n if len > acc {\n len\n } else {\n acc\n }\n },\n );\n\n if max_note_packed_len > MAX_NOTE_PACKED_LEN {\n panic(\n f\"One of the notes has packed len {max_note_packed_len} but the maximum is {MAX_NOTE_PACKED_LEN}\",\n );\n }\n\n // Contracts that do define notes produce an if-else chain where `note_type_id` is matched against the\n // `get_note_type_id()` function of each note type that we know of, in order to identify the note type. Once we\n // know it we call we correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the note hash (non-siloed) and inner nullifier (also non-siloed).\n\n let mut if_note_type_id_match_statements_list = &[];\n for i in 0..notes.len() {\n let (typ, (_, packed_note_length, _, _)) = notes[i];\n\n let get_note_type_id = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteType },\n quote { get_id },\n );\n let unpack = get_trait_impl_method(\n typ,\n quote { crate::protocol_types::traits::Packable<_> },\n quote { unpack },\n );\n\n let compute_note_hash = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_note_hash },\n );\n\n let compute_nullifier_unconstrained = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_nullifier_unconstrained },\n );\n\n let if_or_else_if = if i == 0 {\n quote { if }\n } else {\n quote { else if }\n };\n\n if_note_type_id_match_statements_list = if_note_type_id_match_statements_list.push_back(\n quote {\n $if_or_else_if note_type_id == $get_note_type_id() {\n // As an extra safety check we make sure that the packed_note BoundedVec has the expected\n // length, since we're about to interpret it's raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = $packed_note_length;\n let actual_len = packed_note.len();\n assert(\n actual_len == expected_len,\n f\"Expected packed note of length {expected_len} but got {actual_len} for note type id {note_type_id}\"\n );\n\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n let note_hash = $compute_note_hash(note, storage_slot);\n \n // The message discovery process finds settled notes, that is, notes that were created in prior\n // transactions and are therefore already part of the note hash tree. We therefore compute the\n // nullification note hash by treating the note as a settled note with the provided nonce.\n let note_hash_for_nullify = aztec::note::utils::compute_note_hash_for_nullify(\n aztec::note::retrieved_note::RetrievedNote{ \n note, \n contract_address, \n metadata: aztec::note::note_metadata::SettledNoteMetadata::new(nonce).into() \n }, \n storage_slot,\n );\n\n let inner_nullifier = $compute_nullifier_unconstrained(note, note_hash_for_nullify);\n\n Option::some(\n aztec::discovery::NoteHashAndNullifier {\n note_hash, inner_nullifier\n }\n )\n }\n },\n );\n }\n\n let if_note_type_id_match_statements = if_note_type_id_match_statements_list.join(quote {});\n\n quote {\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash\n /// (non-siloed) and inner nullifier (non-siloed) assuming the note has been inserted into the note hash\n /// tree with `nonce`.\n ///\n /// The signature of this function notably matches the `aztec::discovery::ComputeNoteHashAndNullifier` type,\n /// and so it can be used to call functions from that module such as `discover_new_messages`, \n /// `do_process_log` and `attempt_note_discovery`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash_and_nullifier(\n packed_note: BoundedVec<Field, aztec::discovery::private_notes::MAX_NOTE_PACKED_LEN>,\n storage_slot: Field,\n note_type_id: Field,\n contract_address: aztec::protocol_types::address::AztecAddress,\n nonce: Field,\n ) -> Option<aztec::discovery::NoteHashAndNullifier> {\n $if_note_type_id_match_statements\n else {\n Option::none()\n }\n }\n }\n } else {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n /// This contract does not use private notes, so this function should never be called as it will\n /// unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash_and_nullifier(\n _packed_note: BoundedVec<Field, aztec::discovery::private_notes::MAX_NOTE_PACKED_LEN>,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol_types::address::AztecAddress,\n _nonce: Field,\n ) -> Option<aztec::discovery::NoteHashAndNullifier> {\n panic(f\"This contract does not use private notes\")\n }\n }\n }\n}\n\ncomptime fn generate_process_log() -> Quoted {\n // This mandatory function processes a log emitted by the contract. This is currently used to process private logs\n // and perform message discovery, resulting in new private notes, partial notes and events.\n // The bulk of the work of this function is done by aztec::discovery::do_process_log, so all we need to do is call\n // that function.\n\n // We'll produce the entire body of the function in one go and then insert it into the function.\n let notes = NOTES.entries();\n\n if notes.len() > 0 {\n quote {\n unconstrained fn process_log(\n log_ciphertext: BoundedVec<Field, dep::aztec::protocol_types::constants::PRIVATE_LOG_SIZE_IN_FIELDS>,\n tx_hash: Field,\n unique_note_hashes_in_tx: BoundedVec<Field, dep::aztec::protocol_types::constants::MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n recipient: aztec::protocol_types::address::AztecAddress,\n ) {\n // Because this unconstrained function is injected after the contract is processed by the macros, it'll\n // not be modified by the macros that alter unconstrained functions. As such, we need to manually inject\n // the unconstrained execution context since it will not be available otherwise.\n let context = dep::aztec::context::unconstrained_context::UnconstrainedContext::new();\n\n // TODO(#10727): allow other contracts to process logs and deliver notes\n let contract_address = context.this_address();\n\n aztec::discovery::private_logs::do_process_log(\n contract_address,\n log_ciphertext,\n tx_hash,\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n recipient,\n _compute_note_hash_and_nullifier,\n );\n }\n }\n } else {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n unconstrained fn process_log(\n _log_ciphertext: BoundedVec<Field, dep::aztec::protocol_types::constants::PRIVATE_LOG_SIZE_IN_FIELDS>,\n _tx_hash: Field,\n _unique_note_hashes_in_tx: BoundedVec<Field, dep::aztec::protocol_types::constants::MAX_NOTE_HASHES_PER_TX>,\n _first_nullifier_in_tx: Field,\n _recipient: aztec::protocol_types::address::AztecAddress,\n ) {\n panic(f\"This contract does not use private notes\")\n }\n }\n }\n}\n\ncomptime fn generate_note_exports() -> Quoted {\n let notes = NOTES.values();\n // Second value in each tuple is `note_packed_len` and that is ignored here because it's only used when\n // generating partial note helper functions.\n notes\n .map(|(s, _, note_type_id, fields): (TypeDefinition, u32, Field, [(Quoted, u32, bool)])| {\n generate_note_export(s, note_type_id, fields)\n })\n .join(quote {})\n}\n\ncomptime fn generate_sync_notes() -> Quoted {\n let message_discovery_call = create_message_discovery_call();\n quote {\n unconstrained fn sync_notes() {\n // Because this unconstrained function is injected after the contract is processed by the macros, it'll not\n // be modified by the macros that alter unconstrained functions. As such, we need to manually inject the\n // unconstrained execution context since it will not be available otherwise.\n let context = dep::aztec::context::unconstrained_context::UnconstrainedContext::new();\n\n $message_discovery_call\n }\n }\n}\n"
|
|
2884
|
+
},
|
|
2885
|
+
"108": {
|
|
2886
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch.nr",
|
|
2887
|
+
"source": "use super::utils::compute_fn_selector;\nuse std::panic;\n\n/// Returns an `fn public_dispatch(...)` function for the given module that's assumed to be an Aztec contract.\npub comptime fn generate_public_dispatch(m: Module) -> Quoted {\n let functions = m.functions();\n let functions =\n functions.filter(|function: FunctionDefinition| function.has_named_attribute(\"public\"));\n\n let unit = get_type::<()>();\n\n let ifs = functions.map(|function: FunctionDefinition| {\n let name = function.name();\n let parameters = function.parameters();\n let return_type = function.return_type();\n\n let selector: Field = compute_fn_selector(function);\n\n let mut parameters_size = 0;\n for param in parameters {\n parameters_size += size_in_fields(param.1);\n }\n\n let initial_read = if parameters.len() == 0 {\n quote {}\n } else {\n // The initial calldata_copy offset is 1 to skip the Field selector\n // The expected calldata is the serialization of\n // - FunctionSelector: the selector of the function intended to dispatch\n // - Parameters: the parameters of the function intended to dispatch\n // That is, exactly what is expected for a call to the target function,\n // but with a selector added at the beginning.\n quote {\n let input_calldata: [Field; $parameters_size] = dep::aztec::context::public_context::calldata_copy(1, $parameters_size);\n let mut reader = dep::aztec::protocol_types::utils::reader::Reader::new(input_calldata);\n }\n };\n\n let parameter_index = &mut 0;\n let reads = parameters.map(|param: (Quoted, Type)| {\n let parameter_index_value = *parameter_index;\n let param_name = f\"arg{parameter_index_value}\".quoted_contents();\n let param_type = param.1;\n let read = quote {\n let $param_name: $param_type = reader.read_struct(dep::aztec::protocol_types::traits::Deserialize::deserialize);\n };\n *parameter_index += 1;\n quote { $read }\n });\n let read = reads.join(quote { });\n\n let mut args = &[];\n for parameter_index in 0..parameters.len() {\n let param_name = f\"arg{parameter_index}\".quoted_contents();\n args = args.push_back(quote { $param_name });\n }\n\n let args = args.join(quote { , });\n let call = quote { $name($args) };\n\n let return_code = if return_type == unit {\n quote {\n $call;\n // Force early return.\n dep::aztec::context::public_context::avm_return([]);\n }\n } else {\n quote {\n let return_value = dep::aztec::protocol_types::traits::Serialize::serialize($call);\n dep::aztec::context::public_context::avm_return(return_value.as_slice());\n }\n };\n\n let if_ = quote {\n if selector == $selector {\n $initial_read\n $read\n $return_code\n }\n };\n if_\n });\n\n if ifs.len() == 0 {\n // No dispatch function if there are no public functions\n quote {}\n } else {\n let ifs = ifs.push_back(quote { panic(f\"Unknown selector {selector}\") });\n let dispatch = ifs.join(quote { });\n\n let body = quote {\n // We mark this as public because our whole system depends on public\n // functions having this attribute. However, the public MACRO will\n // handle the public_dispatch function specially and do nothing.\n #[public]\n pub unconstrained fn public_dispatch(selector: Field) {\n $dispatch\n }\n };\n\n body\n }\n}\n\ncomptime fn size_in_fields(typ: Type) -> u32 {\n let size = array_size_in_fields(typ);\n let size = size.or_else(|| bool_size_in_fields(typ));\n let size = size.or_else(|| constant_size_in_fields(typ));\n let size = size.or_else(|| field_size_in_fields(typ));\n let size = size.or_else(|| int_size_in_fields(typ));\n let size = size.or_else(|| str_size_in_fields(typ));\n let size = size.or_else(|| struct_size_in_fields(typ));\n let size = size.or_else(|| tuple_size_in_fields(typ));\n if size.is_some() {\n size.unwrap()\n } else {\n panic(f\"Can't determine size in fields of {typ}\")\n }\n}\n\ncomptime fn array_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_array().and_then(|typ: (Type, Type)| {\n let (typ, element_size) = typ;\n element_size.as_constant().map(|x: u32| x * size_in_fields(typ))\n })\n}\n\ncomptime fn bool_size_in_fields(typ: Type) -> Option<u32> {\n if typ.is_bool() {\n Option::some(1)\n } else {\n Option::none()\n }\n}\n\ncomptime fn field_size_in_fields(typ: Type) -> Option<u32> {\n if typ.is_field() {\n Option::some(1)\n } else {\n Option::none()\n }\n}\n\ncomptime fn int_size_in_fields(typ: Type) -> Option<u32> {\n if typ.as_integer().is_some() {\n Option::some(1)\n } else {\n Option::none()\n }\n}\n\ncomptime fn constant_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_constant()\n}\n\ncomptime fn str_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_str().map(|typ| size_in_fields(typ))\n}\n\ncomptime fn struct_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_data_type().map(|typ: (TypeDefinition, [Type])| {\n let struct_type = typ.0;\n let generics = typ.1;\n let mut size = 0;\n for field in struct_type.fields(generics) {\n size += size_in_fields(field.1);\n }\n size\n })\n}\n\ncomptime fn tuple_size_in_fields(typ: Type) -> Option<u32> {\n typ.as_tuple().map(|types: [Type]| {\n let mut size = 0;\n for typ in types {\n size += size_in_fields(typ);\n }\n size\n })\n}\n\ncomptime fn get_type<T>() -> Type {\n let t: T = std::mem::zeroed();\n std::meta::type_of(t)\n}\n"
|
|
2830
2888
|
},
|
|
2831
2889
|
"111": {
|
|
2832
|
-
"path": "/
|
|
2833
|
-
"source": "use crate::macros::{\n functions::{abi_export::create_fn_abi_export, call_interface_stubs::stub_fn, stub_registry},\n notes::NOTES,\n utils::{\n add_to_hasher, fn_has_noinitcheck, get_fn_visibility, is_fn_initializer, is_fn_internal,\n is_fn_private, is_fn_view, modify_fn_body, module_has_initializer, module_has_storage,\n },\n};\nuse protocol_types::meta::generate_serialize_to_fields;\nuse std::meta::type_of;\n\npub(crate) comptime fn transform_private(f: FunctionDefinition) -> Quoted {\n let fn_abi = create_fn_abi_export(f);\n let fn_stub = stub_fn(f);\n stub_registry::register(f.module(), fn_stub);\n\n // If a function is further modified as unconstrained, we throw an error\n if f.is_unconstrained() {\n let name = f.name();\n panic(\n f\"Function {name} is annotated with #[private] but marked as unconstrained, remove unconstrained keyword\",\n );\n }\n\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Private functions undergo a lot of transformations from their Aztec.nr form into a circuit that can be fed to the\n // Private Kernel Circuit.\n // First we change the function signature so that it also receives `PrivateContextInputs`, which contain information\n // about the execution context (e.g. the caller).\n let original_params = f.parameters();\n f.set_parameters(&[(\n quote { inputs },\n quote { crate::context::inputs::private_context_inputs::PrivateContextInputs }.as_type(),\n )]\n .append(original_params));\n\n let mut body = f.body().as_block().unwrap();\n\n // The original params are hashed and passed to the `context` object, so that the kernel can verify we've received\n // the correct values.\n // TODO: Optimize args_hasher for small number of arguments\n let args_hasher_name = quote { args_hasher };\n let args_hasher = original_params.fold(\n quote {\n let mut $args_hasher_name = dep::aztec::hash::ArgsHasher::new();\n },\n |args_hasher, param: (Quoted, Type)| {\n let (name, typ) = param;\n let appended_arg = add_to_hasher(args_hasher_name, name, typ);\n quote {\n $args_hasher\n $appended_arg\n }\n },\n );\n\n let context_creation = quote {\n let mut context = dep::aztec::context::private_context::PrivateContext::new(inputs, dep::aztec::protocol_types::traits::Hash::hash($args_hasher_name));\n };\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_internal(f) {\n create_internal_check(f)\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n create_view_check(f)\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n (create_assert_correct_initializer_args(f), create_mark_as_initialized(f))\n } else {\n (quote {}, quote {})\n };\n\n let storage_init = if module_has_storage {\n quote {\n // Some functions don't access storage, but it'd be quite difficult to only inject this variable if it is\n // referenced. We instead ignore 'unused variable' warnings for it.\n #[allow(unused_variables)]\n let storage = Storage::init(&mut context);\n }\n } else {\n quote {}\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !is_fn_initializer(f) & !fn_has_noinitcheck(f) {\n create_init_check(f)\n } else {\n quote {}\n };\n\n // All private functions perform note discovery, since they may need to access notes. This is slightly inefficient\n // and could be improved by only doing it once we actually attempt to read any.\n let note_discovery_call = if NOTES.len() > 0 {\n create_note_discovery_call()\n } else {\n quote {}\n };\n\n // Finally, we need to change the return type to be `PrivateCircuitPublicInputs`, which is what the Private Kernel\n // circuit expects.\n let return_value_var_name = quote { macro__returned__values };\n\n let return_value_type = f.return_type();\n let return_value = if body.len() == 0 {\n quote {}\n } else if return_value_type != type_of(()) {\n // The original return value is passed to a second args hasher which the context receives.\n let (body_without_return, last_body_expr) = body.pop_back();\n let return_value = last_body_expr.quoted();\n let return_value_assignment =\n quote { let $return_value_var_name: $return_value_type = $return_value; };\n let return_hasher_name = quote { return_hasher };\n let return_value_into_hasher =\n add_to_hasher(return_hasher_name, return_value_var_name, return_value_type);\n\n body = body_without_return;\n\n quote {\n let mut $return_hasher_name = dep::aztec::hash::ArgsHasher::new();\n $return_value_assignment\n $return_value_into_hasher\n context.set_return_hash($return_hasher_name);\n }\n } else {\n let (body_without_return, last_body_expr) = body.pop_back();\n if !last_body_expr.has_semicolon()\n & last_body_expr.as_for().is_none()\n & last_body_expr.as_assert().is_none()\n & last_body_expr.as_for_range().is_none()\n & last_body_expr.as_assert_eq().is_none()\n & last_body_expr.as_let().is_none() {\n let unused_return_value_name = f\"_{return_value_var_name}\".quoted_contents();\n body = body_without_return.push_back(\n quote { let $unused_return_value_name = $last_body_expr; }.as_expr().unwrap(),\n );\n }\n quote {}\n };\n\n let context_finish = quote { context.finish() };\n\n let to_prepend = quote {\n $args_hasher\n $context_creation\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $storage_init\n $note_discovery_call\n };\n\n let to_append = quote {\n $return_value\n $mark_as_initialized\n $context_finish\n };\n let modified_body = modify_fn_body(body, to_prepend, to_append);\n f.set_body(modified_body);\n f.set_return_type(\n quote { dep::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs }\n .as_type(),\n );\n f.set_return_data();\n\n fn_abi\n}\n\npub(crate) comptime fn transform_public(f: FunctionDefinition) -> Quoted {\n let fn_abi = create_fn_abi_export(f);\n let fn_stub = stub_fn(f);\n stub_registry::register(f.module(), fn_stub);\n\n // If a function is further modified as unconstrained, we throw an error\n if f.is_unconstrained() {\n let name = f.name();\n panic(\n f\"Function {name} is annotated with #[public] but marked as unconstrained, remove unconstrained keyword\",\n );\n }\n\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Public functions undergo a lot of transformations from their Aztec.nr form.\n let original_params = f.parameters();\n let args_len = original_params\n .map(|(name, typ): (Quoted, Type)| {\n generate_serialize_to_fields(name, typ, &[], false).0.len()\n })\n .fold(0, |acc: u32, val: u32| acc + val);\n\n // Unlike in the private case, in public the `context` does not need to receive the hash of the original params.\n let context_creation = quote {\n let mut context = dep::aztec::context::public_context::PublicContext::new(|| {\n // We start from 1 because we skip the selector for the dispatch function.\n let serialized_args : [Field; $args_len] = dep::aztec::context::public_context::calldata_copy(1, $args_len);\n dep::aztec::hash::hash_args_array(serialized_args)\n });\n };\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_internal(f) {\n create_internal_check(f)\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n create_view_check(f)\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n (create_assert_correct_initializer_args(f), create_mark_as_initialized(f))\n } else {\n (quote {}, quote {})\n };\n\n let storage_init = if module_has_storage {\n // Some functions don't access storage, but it'd be quite difficult to only inject this variable if it is\n // referenced. We instead ignore 'unused variable' warnings for it.\n quote {\n #[allow(unused_variables)]\n let storage = Storage::init(&mut context);\n }\n } else {\n quote {}\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !fn_has_noinitcheck(f) & !is_fn_initializer(f) {\n create_init_check(f)\n } else {\n quote {}\n };\n\n let to_prepend = quote {\n $context_creation\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $storage_init\n };\n\n let to_append = quote {\n $mark_as_initialized\n };\n\n let body = f.body().as_block().unwrap();\n let modified_body = modify_fn_body(body, to_prepend, to_append);\n f.set_body(modified_body);\n\n // All public functions are automatically made unconstrained, even if they were not marked as such. This is because\n // instead of compiling into a circuit, they will compile to bytecode that will be later transpiled into AVM\n // bytecode.\n f.set_unconstrained(true);\n f.set_return_public(true);\n\n fn_abi\n}\n\npub(crate) comptime fn transform_unconstrained(f: FunctionDefinition) {\n let context_creation = quote { let mut context = dep::aztec::context::unconstrained_context::UnconstrainedContext::new(); };\n let module_has_storage = module_has_storage(f.module());\n\n let storage_init = if module_has_storage {\n quote {\n // Some functions don't access storage, but it'd be quite difficult to only inject this variable if it is\n // referenced. We instead ignore 'unused variable' warnings for it.\n #[allow(unused_variables)]\n let storage = Storage::init(context);\n }\n } else {\n quote {}\n };\n\n // All unconstrained functions perform note discovery, since they may need to access notes. This is slightly\n // inefficient and could be improved by only doing it once we actually attempt to read any.\n let note_discovery_call = if NOTES.len() > 0 {\n create_note_discovery_call()\n } else {\n quote {}\n };\n\n let to_prepend = quote {\n $context_creation\n $storage_init\n $note_discovery_call\n };\n let body = f.body().as_block().unwrap();\n let modified_body = modify_fn_body(body, to_prepend, quote {});\n f.set_return_public(true);\n f.set_body(modified_body);\n}\n\ncomptime fn create_internal_check(f: FunctionDefinition) -> Quoted {\n let name = f.name();\n let assertion_message = f\"Function {name} can only be called internally\";\n quote { assert(context.msg_sender() == context.this_address(), $assertion_message); }\n}\n\ncomptime fn create_view_check(f: FunctionDefinition) -> Quoted {\n let name = f.name();\n let assertion_message = f\"Function {name} can only be called statically\";\n if is_fn_private(f) {\n // Here `context` is of type context::PrivateContext\n quote { assert(context.inputs.call_context.is_static_call == true, $assertion_message); }\n } else {\n // Here `context` is of type context::PublicContext\n quote { assert(context.is_static_call(), $assertion_message); }\n }\n}\n\ncomptime fn create_assert_correct_initializer_args(f: FunctionDefinition) -> Quoted {\n let fn_visibility = get_fn_visibility(f);\n f\"dep::aztec::macros::functions::initialization_utils::assert_initialization_matches_address_preimage_{fn_visibility}(context);\"\n .quoted_contents()\n}\n\ncomptime fn create_mark_as_initialized(f: FunctionDefinition) -> Quoted {\n let fn_visibility = get_fn_visibility(f);\n f\"dep::aztec::macros::functions::initialization_utils::mark_as_initialized_{fn_visibility}(&mut context);\"\n .quoted_contents()\n}\n\ncomptime fn create_init_check(f: FunctionDefinition) -> Quoted {\n let fn_visibility = get_fn_visibility(f);\n f\"dep::aztec::macros::functions::initialization_utils::assert_is_initialized_{fn_visibility}(&mut context);\"\n .quoted_contents()\n}\n\n/// Injects a call to `aztec::discovery::discover_new_notes`, causing for new notes to be added to PXE and made\n/// available for the current execution.\ncomptime fn create_note_discovery_call() -> Quoted {\n quote {\n /// Safety: note discovery returns nothing and is performed solely for its side-effects. It is therefore always\n /// safe to call.\n unsafe {\n dep::aztec::discovery::discover_new_notes(\n context.this_address(),\n _compute_note_hash_and_nullifier,\n )\n };\n }\n}\n"
|
|
2890
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/functions/call_interface_stubs.nr",
|
|
2891
|
+
"source": "use crate::macros::utils::{\n add_to_field_slice, AsStrQuote, compute_fn_selector, is_fn_private, is_fn_view,\n};\nuse std::meta::{type_of, unquote};\n\ncomptime global FROM_FIELD: TypedExpr = {\n let from_field_trait = quote { protocol_types::traits::FromField }.as_trait_constraint();\n let function_selector_typ =\n quote { protocol_types::abis::function_selector::FunctionSelector }.as_type();\n function_selector_typ.get_trait_impl(from_field_trait).unwrap().methods().filter(|m| {\n m.name() == quote { from_field }\n })[0]\n .as_typed_expr()\n};\n\ncomptime global SERIALIZED_ARGS_SLICE_NAME: Quoted = quote { serialized_args };\n\npub comptime fn stub_fn(f: FunctionDefinition) -> Quoted {\n let is_static_call = is_fn_view(f);\n let is_void = f.return_type() == type_of(());\n\n if is_fn_private(f) {\n if is_static_call {\n if is_void {\n create_private_static_void_stub(f)\n } else {\n create_private_static_stub(f)\n }\n } else {\n if is_void {\n create_private_void_stub(f)\n } else {\n create_private_stub(f)\n }\n }\n } else {\n if is_static_call {\n if is_void {\n create_public_static_void_stub(f)\n } else {\n create_public_static_stub(f)\n }\n } else {\n if is_void {\n create_public_void_stub(f)\n } else {\n create_public_stub(f)\n }\n }\n }\n}\n\n/// Utility function creating stubs used by all the stub functions in this file.\ncomptime fn create_stub_base(\n f: FunctionDefinition,\n) -> (Quoted, Quoted, Quoted, Quoted, u32, Field) {\n let fn_name = f.name();\n let fn_parameters = f.parameters();\n let fn_parameters_list =\n fn_parameters.map(|(name, typ): (Quoted, Type)| quote { $name: $typ }).join(quote {,});\n\n // Example of what the fold(...) below will generate for `target_address` and `fee_juice_limit_per_tx` function\n // parameters:\n // ```\n // let mut serialized_args = &[];\n // serialized_args = serialized_args.append(aztec::protocol_types::traits::Serialize::serialize(target_address));\n // serialized_args = serialized_args.push_back(fee_juice_limit_per_tx as Field);\n // ```\n let serialized_args_slice_construction = fn_parameters.fold(\n quote {\n let mut $SERIALIZED_ARGS_SLICE_NAME = &[];\n },\n |args, param: (Quoted, Type)| {\n let (name, typ) = param;\n let arg_to_append = add_to_field_slice(SERIALIZED_ARGS_SLICE_NAME, name, typ);\n quote {\n $args\n $arg_to_append\n }\n },\n );\n\n let (fn_name_str, _) = fn_name.as_str_quote();\n let fn_name_len: u32 = unquote!(quote { $fn_name_str.as_bytes().len()});\n let fn_selector: Field = compute_fn_selector(f);\n\n (\n fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len,\n fn_selector,\n )\n}\n\ncomptime fn create_private_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_private_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateStaticCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateStaticCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n )\n }\n }\n}\n\ncomptime fn create_private_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_private_static_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PrivateStaticVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PrivateStaticVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n serialized_args\n )\n }\n }\n}\n\ncomptime fn create_public_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_public_static_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n let fn_return_type = f.return_type();\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicStaticCallInterface<$fn_name_len, $fn_return_type> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicStaticCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n )\n }\n }\n}\n\ncomptime fn create_public_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n $SERIALIZED_ARGS_SLICE_NAME,\n false\n )\n }\n }\n}\n\ncomptime fn create_public_static_void_stub(f: FunctionDefinition) -> Quoted {\n let (fn_name, fn_parameters_list, serialized_args_slice_construction, fn_name_str, fn_name_len, fn_selector) =\n create_stub_base(f);\n\n quote {\n pub fn $fn_name(self, $fn_parameters_list) -> dep::aztec::context::call_interfaces::PublicStaticVoidCallInterface<$fn_name_len> {\n $serialized_args_slice_construction\n let selector = $FROM_FIELD($fn_selector);\n dep::aztec::context::call_interfaces::PublicStaticVoidCallInterface::new(\n self.target_contract,\n selector,\n $fn_name_str,\n serialized_args\n )\n }\n }\n}\n"
|
|
2834
2892
|
},
|
|
2835
|
-
"
|
|
2836
|
-
"path": "/
|
|
2837
|
-
"source": "pub mod dispatch;\npub mod functions;\npub mod utils;\npub mod notes;\npub mod storage;\npub mod events;\n\nuse functions::{stub_registry, utils::transform_unconstrained};\nuse notes::{generate_note_export, NOTES};\nuse storage::STORAGE_LAYOUT_NAME;\n\nuse dispatch::generate_public_dispatch;\nuse utils::{get_trait_impl_method, module_has_storage};\n\nuse crate::discovery::MAX_NOTE_PACKED_LEN;\n\n/// Marks a contract as an Aztec contract, generating the interfaces for its functions and notes, as well as injecting\n/// the `process_log` and `sync_notes` functions PXE requires in order to discover notes.\n/// Note: This is a module annotation, so the returned quote gets injected inside the module (contract) itself.\npub comptime fn aztec(m: Module) -> Quoted {\n let interface = generate_contract_interface(m);\n let unconstrained_functions = m.functions().filter(|f: FunctionDefinition| {\n f.is_unconstrained() & !f.has_named_attribute(\"test\") & !f.has_named_attribute(\"public\")\n });\n for f in unconstrained_functions {\n transform_unconstrained(f);\n }\n\n let contract_library_method_compute_note_hash_and_nullifier =\n generate_contract_library_method_compute_note_hash_and_nullifier();\n let process_log = generate_process_log();\n let note_exports = generate_note_exports();\n let public_dispatch = generate_public_dispatch(m);\n let sync_notes = generate_sync_notes();\n\n quote {\n $note_exports\n $interface\n $contract_library_method_compute_note_hash_and_nullifier\n $process_log\n $public_dispatch\n $sync_notes\n }\n}\n\ncomptime fn generate_contract_interface(m: Module) -> Quoted {\n let module_name = m.name();\n let contract_stubs = stub_registry::get(m);\n let fn_stubs_quote = if contract_stubs.is_some() {\n contract_stubs.unwrap().join(quote {})\n } else {\n quote {}\n };\n\n let has_storage_layout = module_has_storage(m) & STORAGE_LAYOUT_NAME.get(m).is_some();\n let storage_layout_getter = if has_storage_layout {\n let storage_layout_name = STORAGE_LAYOUT_NAME.get(m).unwrap();\n quote {\n pub fn storage_layout() -> StorageLayoutFields {\n $storage_layout_name.fields\n }\n }\n } else {\n quote {}\n };\n\n let library_storage_layout_getter = if has_storage_layout {\n quote {\n #[contract_library_method]\n $storage_layout_getter\n }\n } else {\n quote {}\n };\n\n quote {\n pub struct $module_name {\n pub target_contract: dep::aztec::protocol_types::address::AztecAddress\n }\n\n impl $module_name {\n $fn_stubs_quote\n\n pub fn at(\n addr: aztec::protocol_types::address::AztecAddress\n ) -> Self {\n Self { target_contract: addr }\n }\n\n pub fn interface() -> Self {\n Self { target_contract: aztec::protocol_types::address::AztecAddress::zero() }\n }\n\n $storage_layout_getter\n }\n\n #[contract_library_method]\n pub fn at(\n addr: aztec::protocol_types::address::AztecAddress\n ) -> $module_name {\n $module_name { target_contract: addr }\n }\n\n #[contract_library_method]\n pub fn interface() -> $module_name {\n $module_name { target_contract: aztec::protocol_types::address::AztecAddress::zero() }\n }\n\n $library_storage_layout_getter\n\n }\n}\n\n/// Generates a contract library method called `_compute_note_hash_and_nullifier` which is used for note\n/// discovery (to create the `aztec::discovery::ComputeNoteHashAndNullifier` function) and to implement the\n/// `compute_note_hash_and_nullifier` unconstrained contract function.\ncomptime fn generate_contract_library_method_compute_note_hash_and_nullifier() -> Quoted {\n let notes = NOTES.entries();\n\n let mut max_note_packed_len: u32 = 0;\n if notes.len() > 0 {\n max_note_packed_len = notes.fold(\n 0,\n |acc, (_, (_, len, _, _)): (Type, (StructDefinition, u32, Field, [(Quoted, u32, bool)]))| {\n if len > acc {\n len\n } else {\n acc\n }\n },\n );\n\n if max_note_packed_len > MAX_NOTE_PACKED_LEN {\n panic(\n f\"One of the notes has packed len {max_note_packed_len} but the maximum is {MAX_NOTE_PACKED_LEN}\",\n );\n }\n\n // Contracts that do define notes produce an if-else chain where `note_type_id` is matched against the\n // `get_note_type_id()` function of each note type that we know of, in order to identify the note type. Once we\n // know it we call we correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the note hash (non-siloed) and inner nullifier (also non-siloed).\n\n let mut if_note_type_id_match_statements_list = &[];\n for i in 0..notes.len() {\n let (typ, (_, packed_note_length, _, _)) = notes[i];\n\n let get_note_type_id = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteType },\n quote { get_id },\n );\n let unpack = get_trait_impl_method(\n typ,\n quote { crate::protocol_types::traits::Packable<_> },\n quote { unpack },\n );\n\n let compute_note_hash = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_note_hash },\n );\n\n let compute_nullifier_unconstrained = get_trait_impl_method(\n typ,\n quote { crate::note::note_interface::NoteHash },\n quote { compute_nullifier_unconstrained },\n );\n\n let if_or_else_if = if i == 0 {\n quote { if }\n } else {\n quote { else if }\n };\n\n if_note_type_id_match_statements_list = if_note_type_id_match_statements_list.push_back(\n quote {\n $if_or_else_if note_type_id == $get_note_type_id() {\n // As an extra safety check we make sure that the packed_note BoundedVec has the expected\n // length, since we're about to interpret it's raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = $packed_note_length;\n let actual_len = packed_note.len();\n assert(\n actual_len == expected_len,\n f\"Expected packed note of length {expected_len} but got {actual_len} for note type id {note_type_id}\"\n );\n\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n let note_hash = $compute_note_hash(note, storage_slot);\n \n // The note discovery process finds settled notes, that is, notes that were created in prior\n // transactions and are therefore already part of the note hash tree. We therefore compute the\n // nullification note hash by treating the note as a settled note with the provided nonce.\n let note_hash_for_nullify = aztec::note::utils::compute_note_hash_for_nullify(\n aztec::note::retrieved_note::RetrievedNote{ \n note, \n contract_address, \n metadata: aztec::note::note_metadata::SettledNoteMetadata::new(nonce).into() \n }, \n storage_slot,\n );\n\n let inner_nullifier = $compute_nullifier_unconstrained(note, note_hash_for_nullify);\n\n Option::some(\n aztec::discovery::NoteHashAndNullifier {\n note_hash, inner_nullifier\n }\n )\n }\n },\n );\n }\n\n let if_note_type_id_match_statements = if_note_type_id_match_statements_list.join(quote {});\n\n quote {\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash\n /// (non-siloed) and inner nullifier (non-siloed) assuming the note has been inserted into the note hash\n /// tree with `nonce`.\n ///\n /// The signature of this function notably matches the `aztec::discovery::ComputeNoteHashAndNullifier` type,\n /// and so it can be used to call functions from that module such as `discover_new_notes`, `do_process_log`\n /// and `process_private_note_log`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash_and_nullifier(\n packed_note: BoundedVec<Field, aztec::discovery::MAX_NOTE_PACKED_LEN>,\n storage_slot: Field,\n note_type_id: Field,\n contract_address: aztec::protocol_types::address::AztecAddress,\n nonce: Field,\n ) -> Option<aztec::discovery::NoteHashAndNullifier> {\n $if_note_type_id_match_statements\n else {\n Option::none()\n }\n }\n }\n } else {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n /// This contract does not use private notes, so this function should never be called as it will\n /// unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash_and_nullifier(\n _packed_note: BoundedVec<Field, aztec::discovery::MAX_NOTE_PACKED_LEN>,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol_types::address::AztecAddress,\n ) -> Option<aztec::discovery::NoteHashAndNullifier> {\n panic(f\"This contract does not use private notes\")\n }\n }\n }\n}\n\ncomptime fn generate_process_log() -> Quoted {\n // This mandatory function processes a log emitted by the contract. This is currently used to process private logs\n // and perform note discovery of either private notes or partial notes.\n // The bulk of the work of this function is done by aztec::discovery::do_process_log, so all we need to do is call\n // that function.\n\n // We'll produce the entire body of the function in one go and then insert it into the function.\n let notes = NOTES.entries();\n\n if notes.len() > 0 {\n quote {\n unconstrained fn process_log(\n log_plaintext: BoundedVec<Field, dep::aztec::protocol_types::constants::PRIVATE_LOG_SIZE_IN_FIELDS>,\n tx_hash: Field,\n unique_note_hashes_in_tx: BoundedVec<Field, dep::aztec::protocol_types::constants::MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n recipient: aztec::protocol_types::address::AztecAddress,\n ) {\n // Because this unconstrained function is injected after the contract is processed by the macros, it'll not\n // be modified by the macros that alter unconstrained functions. As such, we need to manually inject the\n // unconstrained execution context since it will not be available otherwise.\n let context = dep::aztec::context::unconstrained_context::UnconstrainedContext::new();\n\n // TODO(#10727): allow other contracts to process logs and deliver notes\n let contract_address = context.this_address();\n\n aztec::discovery::private_logs::do_process_log(\n contract_address,\n log_plaintext,\n tx_hash,\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n recipient,\n _compute_note_hash_and_nullifier,\n );\n }\n }\n } else {\n // Contracts with no notes still implement this function to avoid having special-casing, the implementation\n // simply throws immediately.\n quote {\n unconstrained fn process_log(\n _log_plaintext: BoundedVec<Field, dep::aztec::protocol_types::constants::PRIVATE_LOG_SIZE_IN_FIELDS>,\n _tx_hash: Field,\n _unique_note_hashes_in_tx: BoundedVec<Field, dep::aztec::protocol_types::constants::MAX_NOTE_HASHES_PER_TX>,\n _first_nullifier_in_tx: Field,\n _recipient: aztec::protocol_types::address::AztecAddress,\n ) {\n panic(f\"This contract does not use private notes\")\n }\n }\n }\n}\n\ncomptime fn generate_note_exports() -> Quoted {\n let notes = NOTES.values();\n // Second value in each tuple is `note_packed_len` and that is ignored here because it's only used when\n // generating partial note helper functions.\n notes\n .map(|(s, _, note_type_id, fields): (StructDefinition, u32, Field, [(Quoted, u32, bool)])| {\n generate_note_export(s, note_type_id, fields)\n })\n .join(quote {})\n}\n\ncomptime fn generate_sync_notes() -> Quoted {\n quote {\n unconstrained fn sync_notes() {\n aztec::oracle::note_discovery::sync_notes();\n }\n }\n}\n"
|
|
2893
|
+
"115": {
|
|
2894
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/functions/utils.nr",
|
|
2895
|
+
"source": "use crate::macros::{\n functions::{abi_export::create_fn_abi_export, call_interface_stubs::stub_fn, stub_registry},\n notes::NOTES,\n utils::{\n add_to_hasher, fn_has_noinitcheck, get_fn_visibility, is_fn_initializer, is_fn_internal,\n is_fn_private, is_fn_public, is_fn_view, modify_fn_body, module_has_initializer,\n module_has_storage,\n },\n};\nuse protocol_types::meta::generate_serialize_to_fields;\nuse std::meta::type_of;\n\npub(crate) comptime fn transform_private(f: FunctionDefinition) -> Quoted {\n let fn_abi = create_fn_abi_export(f);\n let fn_stub = stub_fn(f);\n stub_registry::register(f.module(), fn_stub);\n\n // If a function is further modified as unconstrained, we throw an error\n if f.is_unconstrained() {\n let name = f.name();\n panic(\n f\"Function {name} is annotated with #[private] but marked as unconstrained, remove unconstrained keyword\",\n );\n }\n\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Private functions undergo a lot of transformations from their Aztec.nr form into a circuit that can be fed to the\n // Private Kernel Circuit.\n // First we change the function signature so that it also receives `PrivateContextInputs`, which contain information\n // about the execution context (e.g. the caller).\n let original_params = f.parameters();\n f.set_parameters(&[(\n quote { inputs },\n quote { crate::context::inputs::private_context_inputs::PrivateContextInputs }.as_type(),\n )]\n .append(original_params));\n\n let mut body = f.body().as_block().unwrap();\n\n // The original params are hashed and passed to the `context` object, so that the kernel can verify we've received\n // the correct values.\n // TODO: Optimize args_hasher for small number of arguments\n let args_hasher_name = quote { args_hasher };\n let args_hasher = original_params.fold(\n quote {\n let mut $args_hasher_name = dep::aztec::hash::ArgsHasher::new();\n },\n |args_hasher, param: (Quoted, Type)| {\n let (name, typ) = param;\n let appended_arg = add_to_hasher(args_hasher_name, name, typ);\n quote {\n $args_hasher\n $appended_arg\n }\n },\n );\n\n let context_creation = quote {\n let mut context = dep::aztec::context::private_context::PrivateContext::new(inputs, dep::aztec::protocol_types::traits::Hash::hash($args_hasher_name));\n };\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_internal(f) {\n create_internal_check(f)\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n create_view_check(f)\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n (create_assert_correct_initializer_args(f), create_mark_as_initialized(f))\n } else {\n (quote {}, quote {})\n };\n\n let storage_init = if module_has_storage {\n quote {\n // Some functions don't access storage, but it'd be quite difficult to only inject this variable if it is\n // referenced. We instead ignore 'unused variable' warnings for it.\n #[allow(unused_variables)]\n let storage = Storage::init(&mut context);\n }\n } else {\n quote {}\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !is_fn_initializer(f) & !fn_has_noinitcheck(f) {\n create_init_check(f)\n } else {\n quote {}\n };\n\n // All private functions perform message discovery, since they may need to access notes. This is slightly\n // inefficient and could be improved by only doing it once we actually attempt to read any.\n let message_discovery_call = if NOTES.len() > 0 {\n create_message_discovery_call()\n } else {\n quote {}\n };\n\n // Finally, we need to change the return type to be `PrivateCircuitPublicInputs`, which is what the Private Kernel\n // circuit expects.\n let return_value_var_name = quote { macro__returned__values };\n\n let return_value_type = f.return_type();\n let return_value = if body.len() == 0 {\n quote {}\n } else if return_value_type != type_of(()) {\n // The original return value is passed to a second args hasher which the context receives.\n let (body_without_return, last_body_expr) = body.pop_back();\n let return_value = last_body_expr.quoted();\n let return_value_assignment =\n quote { let $return_value_var_name: $return_value_type = $return_value; };\n let return_hasher_name = quote { return_hasher };\n let return_value_into_hasher =\n add_to_hasher(return_hasher_name, return_value_var_name, return_value_type);\n\n body = body_without_return;\n\n quote {\n let mut $return_hasher_name = dep::aztec::hash::ArgsHasher::new();\n $return_value_assignment\n $return_value_into_hasher\n context.set_return_hash($return_hasher_name);\n }\n } else {\n let (body_without_return, last_body_expr) = body.pop_back();\n if !last_body_expr.has_semicolon()\n & last_body_expr.as_for().is_none()\n & last_body_expr.as_assert().is_none()\n & last_body_expr.as_for_range().is_none()\n & last_body_expr.as_assert_eq().is_none()\n & last_body_expr.as_let().is_none() {\n let unused_return_value_name = f\"_{return_value_var_name}\".quoted_contents();\n body = body_without_return.push_back(\n quote { let $unused_return_value_name = $last_body_expr; }.as_expr().unwrap(),\n );\n }\n quote {}\n };\n\n let context_finish = quote { context.finish() };\n\n let to_prepend = quote {\n $args_hasher\n $context_creation\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $storage_init\n $message_discovery_call\n };\n\n let to_append = quote {\n $return_value\n $mark_as_initialized\n $context_finish\n };\n let modified_body = modify_fn_body(body, to_prepend, to_append);\n f.set_body(modified_body);\n f.set_return_type(\n quote { dep::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs }\n .as_type(),\n );\n f.set_return_data();\n\n fn_abi\n}\n\npub(crate) comptime fn transform_public(f: FunctionDefinition) -> Quoted {\n let fn_abi = create_fn_abi_export(f);\n let fn_stub = stub_fn(f);\n stub_registry::register(f.module(), fn_stub);\n\n // If a function is further modified as unconstrained, we throw an error\n if f.is_unconstrained() {\n let name = f.name();\n panic(\n f\"Function {name} is annotated with #[public] but marked as unconstrained, remove unconstrained keyword\",\n );\n }\n\n let module_has_initializer = module_has_initializer(f.module());\n let module_has_storage = module_has_storage(f.module());\n\n // Public functions undergo a lot of transformations from their Aztec.nr form.\n let original_params = f.parameters();\n let args_len = original_params\n .map(|(name, typ): (Quoted, Type)| {\n generate_serialize_to_fields(name, typ, &[], false).0.len()\n })\n .fold(0, |acc: u32, val: u32| acc + val);\n\n // Unlike in the private case, in public the `context` does not need to receive the hash of the original params.\n let context_creation = quote {\n let mut context = dep::aztec::context::public_context::PublicContext::new(|| {\n // We start from 1 because we skip the selector for the dispatch function.\n let serialized_args : [Field; $args_len] = dep::aztec::context::public_context::calldata_copy(1, $args_len);\n dep::aztec::hash::hash_args_array(serialized_args)\n });\n };\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_internal(f) {\n create_internal_check(f)\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n create_view_check(f)\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n (create_assert_correct_initializer_args(f), create_mark_as_initialized(f))\n } else {\n (quote {}, quote {})\n };\n\n let storage_init = if module_has_storage {\n // Some functions don't access storage, but it'd be quite difficult to only inject this variable if it is\n // referenced. We instead ignore 'unused variable' warnings for it.\n quote {\n #[allow(unused_variables)]\n let storage = Storage::init(&mut context);\n }\n } else {\n quote {}\n };\n\n // Initialization checks are not included in contracts that don't have initializers.\n let init_check = if module_has_initializer & !fn_has_noinitcheck(f) & !is_fn_initializer(f) {\n create_init_check(f)\n } else {\n quote {}\n };\n\n let to_prepend = quote {\n $context_creation\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $storage_init\n };\n\n let to_append = quote {\n $mark_as_initialized\n };\n\n let body = f.body().as_block().unwrap();\n let modified_body = modify_fn_body(body, to_prepend, to_append);\n f.set_body(modified_body);\n\n // All public functions are automatically made unconstrained, even if they were not marked as such. This is because\n // instead of compiling into a circuit, they will compile to bytecode that will be later transpiled into AVM\n // bytecode.\n f.set_unconstrained(true);\n f.set_return_public(true);\n\n fn_abi\n}\n\npub(crate) comptime fn find_and_transform_top_level_unconstrained_fns(m: Module) {\n // Top-level unconstrained fns are contract entrypoints, but they're not explicitly designated in any way. They're\n // the fallback case for a function that matches no other rules.\n // TODO(#12743): improve this\n\n // We first find non-standard contract entrypoints, i.e. functions in the `contract` mod that are not private or\n // public, but which *are* contract entrypoints (i.e. they're not opting out via the #[test] or\n // #[contract_library_method] attributes). Ideally entrypoints would be explicitly designated instead.\n let non_private_public_entrypoint_functions = m.functions().filter(|f: FunctionDefinition| {\n !is_fn_private(f)\n & !is_fn_public(f)\n & !f.has_named_attribute(\"contract_library_method\")\n & !f.has_named_attribute(\"test\")\n });\n\n // TODO: uncomment the code below and emit a warning once support for them is added to Noir (tracked in\n // https://github.com/noir-lang/noir/issues/7714). We can't simply print a message since that'd otherwise break the\n // output of utils such as `nargo test --list-tests`.\n // // We don't expect to see any custom constrained entrypoints (i.e. private functions created outside of aztec-nr's\n // // #[private] macro, possibly resulting in a non-standard interface).\n // for f in non_private_public_entrypoint_functions.filter(|f: FunctionDefinition| {\n // !f.is_unconstrained()\n // }) {\n // let name = f.name();\n // warn(\n // f\"found private contract function '{name}' which does not have the #[private] attribute - make sure you know what you're doing!\",\n // );\n // }\n\n // An unconstrained contract entrypoints is what we call a top-level unconstrained function, to which we apply the\n // appropriate transformation. Ideally these would be explicitly designated as such instead.\n for f in non_private_public_entrypoint_functions.filter(|f: FunctionDefinition| {\n f.is_unconstrained()\n }) {\n transform_top_level_unconstrained(f);\n }\n}\n\npub(crate) comptime fn transform_top_level_unconstrained(f: FunctionDefinition) {\n let context_creation = quote { let mut context = dep::aztec::context::unconstrained_context::UnconstrainedContext::new(); };\n let module_has_storage = module_has_storage(f.module());\n\n let storage_init = if module_has_storage {\n quote {\n // Some functions don't access storage, but it'd be quite difficult to only inject this variable if it is\n // referenced. We instead ignore 'unused variable' warnings for it.\n #[allow(unused_variables)]\n let storage = Storage::init(context);\n }\n } else {\n quote {}\n };\n\n // All unconstrained functions perform message discovery, since they may need to access private notes that would be\n // found during this process. This is slightly inefficient and could be improved by only doing it once we actually\n // attempt to read any.\n let message_discovery_call = if NOTES.len() > 0 {\n create_message_discovery_call()\n } else {\n quote {}\n };\n\n let to_prepend = quote {\n $context_creation\n $storage_init\n $message_discovery_call\n };\n let body = f.body().as_block().unwrap();\n let modified_body = modify_fn_body(body, to_prepend, quote {});\n f.set_return_public(true);\n f.set_body(modified_body);\n}\n\ncomptime fn create_internal_check(f: FunctionDefinition) -> Quoted {\n let name = f.name();\n let assertion_message = f\"Function {name} can only be called internally\";\n quote { assert(context.msg_sender() == context.this_address(), $assertion_message); }\n}\n\ncomptime fn create_view_check(f: FunctionDefinition) -> Quoted {\n let name = f.name();\n let assertion_message = f\"Function {name} can only be called statically\";\n if is_fn_private(f) {\n // Here `context` is of type context::PrivateContext\n quote { assert(context.inputs.call_context.is_static_call == true, $assertion_message); }\n } else {\n // Here `context` is of type context::PublicContext\n quote { assert(context.is_static_call(), $assertion_message); }\n }\n}\n\ncomptime fn create_assert_correct_initializer_args(f: FunctionDefinition) -> Quoted {\n let fn_visibility = get_fn_visibility(f);\n f\"dep::aztec::macros::functions::initialization_utils::assert_initialization_matches_address_preimage_{fn_visibility}(context);\"\n .quoted_contents()\n}\n\ncomptime fn create_mark_as_initialized(f: FunctionDefinition) -> Quoted {\n let fn_visibility = get_fn_visibility(f);\n f\"dep::aztec::macros::functions::initialization_utils::mark_as_initialized_{fn_visibility}(&mut context);\"\n .quoted_contents()\n}\n\ncomptime fn create_init_check(f: FunctionDefinition) -> Quoted {\n let fn_visibility = get_fn_visibility(f);\n f\"dep::aztec::macros::functions::initialization_utils::assert_is_initialized_{fn_visibility}(&mut context);\"\n .quoted_contents()\n}\n\n/// Injects a call to `aztec::discovery::discover_new_messages`, causing for new notes to be added to PXE and made\n/// available for the current execution.\npub(crate) comptime fn create_message_discovery_call() -> Quoted {\n quote {\n /// Safety: message discovery returns nothing and is performed solely for its side-effects. It is therefore\n /// always safe to call.\n unsafe {\n dep::aztec::discovery::discover_new_messages(\n context.this_address(),\n _compute_note_hash_and_nullifier,\n );\n };\n }\n}\n"
|
|
2838
2896
|
},
|
|
2839
|
-
"
|
|
2840
|
-
"path": "/
|
|
2841
|
-
"source": "use std::{collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}};\n\nuse super::utils::AsStrQuote;\nuse super::utils::get_storage_size;\nuse super::utils::is_note;\n\n/// Stores a map from a module to the name of the struct that describes its storage layout.\n/// This is then used when generating a `storage_layout()` getter on the contract struct.\npub comptime mut global STORAGE_LAYOUT_NAME: UHashMap<Module, Quoted, BuildHasherDefault<Poseidon2Hasher>> =\n UHashMap::default();\n\n/// Marks a struct as the one describing the storage layout of a contract. Only a single struct in the entire contract\n/// should have this macro (or `storage_no_init`) applied to it.\n/// The contract's storage is accessed via the `storage` variable, which will will automatically be made available in\n/// all functions as an instance of the struct this macro was applied to.\npub comptime fn storage(s:
|
|
2897
|
+
"118": {
|
|
2898
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/storage.nr",
|
|
2899
|
+
"source": "use std::{collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}};\n\nuse super::utils::AsStrQuote;\nuse super::utils::get_storage_size;\nuse super::utils::is_note;\n\n/// Stores a map from a module to the name of the struct that describes its storage layout.\n/// This is then used when generating a `storage_layout()` getter on the contract struct.\npub comptime mut global STORAGE_LAYOUT_NAME: UHashMap<Module, Quoted, BuildHasherDefault<Poseidon2Hasher>> =\n UHashMap::default();\n\n/// Marks a struct as the one describing the storage layout of a contract. Only a single struct in the entire contract\n/// should have this macro (or `storage_no_init`) applied to it.\n/// The contract's storage is accessed via the `storage` variable, which will will automatically be made available in\n/// all functions as an instance of the struct this macro was applied to.\npub comptime fn storage(s: TypeDefinition) -> Quoted {\n // This macro performs three things:\n // - it marks the contract as having storage, so that `macros::utils::module_has_storage` will return true and\n // functions will have the storage variable injected and initialized via the `init` function.\n // - it implements said `init` function by allocating appropriate storage slots to each state variable.\n // - it exposes the storage layout by creating a `StorageLayout` struct that is exposed via the `abi(storage)`\n // macro.\n let mut slot: u32 = 1;\n let mut storage_vars_constructors = &[];\n let mut storage_layout_fields = &[];\n let mut storage_layout_constructors = &[];\n\n // TODO(#8658): uncomment the code below to inject the Context type parameter.\n //let mut new_storage_fields = &[];\n //let context_generic = s.add_generic(\"Context\");\n for field in s.fields_as_written() {\n // FIXME: This doesn't handle field types with generics\n let (name, typ) = field;\n let (storage_field_constructor, storage_size) =\n generate_storage_field_constructor(typ, quote { $slot }, false);\n storage_vars_constructors =\n storage_vars_constructors.push_back(quote { $name: $storage_field_constructor });\n // We have `Storable` in a separate `.nr` file instead of defining it in the last quote of this function\n // because that way a dev gets a more reasonable error if he defines a struct with the same name in\n // a contract.\n storage_layout_fields =\n storage_layout_fields.push_back(quote { pub $name: dep::aztec::prelude::Storable });\n storage_layout_constructors = storage_layout_constructors.push_back(\n quote { $name: dep::aztec::prelude::Storable { slot: $slot } },\n );\n //let with_context_generic = add_context_generic(typ, context_generic);\n //println(with_context_generic);\n //new_storage_fields = new_storage_fields.push_back((name, with_context_generic ));\n slot += storage_size;\n }\n\n //s.set_fields(new_storage_fields);\n let storage_vars_constructors = storage_vars_constructors.join(quote {,});\n let storage_impl = quote {\n impl<Context> Storage<Context> {\n fn init(context: Context) -> Self {\n Self {\n $storage_vars_constructors\n }\n }\n }\n };\n\n let storage_layout_fields = storage_layout_fields.join(quote {,});\n let storage_layout_constructors = storage_layout_constructors.join(quote {,});\n\n let module = s.module();\n let module_name = module.name();\n let storage_layout_name = f\"STORAGE_LAYOUT_{module_name}\".quoted_contents();\n let (module_name_str, module_name_len) = module_name.as_str_quote();\n STORAGE_LAYOUT_NAME.insert(module, storage_layout_name);\n\n quote {\n $storage_impl\n\n pub struct StorageLayoutFields {\n $storage_layout_fields\n }\n\n pub struct StorageLayout<let N: u32> {\n pub contract_name: str<N>,\n pub fields: StorageLayoutFields\n }\n\n #[abi(storage)]\n pub global $storage_layout_name: StorageLayout<$module_name_len> = StorageLayout {\n contract_name: $module_name_str,\n fields: StorageLayoutFields { $storage_layout_constructors }\n };\n }\n}\n\n/// Same as `storage`, except the user is in charge of providing an implementation of the `init` constructor function\n/// with signature `fn init<Context>(context: Context) -> Self`, which allows for manual control of storage slot\n/// allocation. Similarly, no `StorageLayout` struct will be created.\n/// Only a single struct in the entire contract should have this macro (or `storage`) applied to it.\npub comptime fn storage_no_init(_s: TypeDefinition) {\n // All `storage` does is provide the `init` implementation, so we don't need to do anything here. Applying this\n // macro however will cause for `macros::utils::module_has_storage` to return true, resulting in the injection of\n // the `storage` variable.\n}\n\n/// Returns the expression required to initialize a state variable with a given slot, along with its serialization size,\n/// i.e. how many contiguous storage slots the variable requires.\ncomptime fn generate_storage_field_constructor(\n typ: Type,\n slot: Quoted,\n parent_is_map: bool,\n) -> (Quoted, u32) {\n assert(\n typ.as_data_type().is_some(),\n \"Storage containers must be generic structs of the form `Container<_, Context>`, or Map<Key, _, Context>\",\n );\n let (container_struct, generics) = typ.as_data_type().unwrap();\n let struct_name = container_struct.name();\n\n if is_storage_map(typ) {\n // Map state variables recursively initialize their contents - this includes nested maps.\n let (value_constructor, _) =\n generate_storage_field_constructor(generics[1], quote { slot }, true);\n (quote { $struct_name::new(context, $slot, | context, slot | { $value_constructor }) }, 1)\n } else {\n let storage_size = if parent_is_map {\n // Variables inside a map do not require contiguous slots since the map slot derivation is assumed to result\n // in slots very far away from one another.\n 1\n } else {\n let (_, container_struct_generics) = typ.as_data_type().unwrap();\n let stored_struct = container_struct_generics[0];\n\n if is_note(stored_struct) {\n // Private notes always occupy a single slot, since the slot is only used as a state variable\n // identifier.\n 1\n } else {\n get_storage_size(typ)\n }\n };\n\n // We assume below that all state variables implement `fn new<Context>(context: Context, slot: Field) -> Self`.\n (quote { $struct_name::new(context, $slot)}, storage_size)\n }\n}\n\n/// Returns true if `typ` is `state_vars::map::Map`.\ncomptime fn is_storage_map(typ: Type) -> bool {\n if typ.as_data_type().is_some() {\n let (def, generics) = typ.as_data_type().unwrap();\n let maybe_map = if (def.name() == quote { Map }) & (generics.len() == 3) {\n let maybe_key = generics[0];\n let maybe_value = generics[1];\n let maybe_context = generics[2];\n quote { crate::state_vars::map::Map<$maybe_key, $maybe_value, $maybe_context> }.as_type()\n } else {\n quote {()}.as_type()\n };\n typ == maybe_map\n } else {\n false\n }\n}\n\ncomptime fn add_context_generic(typ: Type, context_generic: Type) -> Type {\n let (def, mut generics) = typ.as_data_type().expect(\n f\"Storage containers must be generic structs of the form `Container<..., Context>`\",\n );\n let name = def.name();\n\n if is_storage_map(typ) {\n generics[generics.len() - 2] = add_context_generic(generics[1], context_generic);\n generics[generics.len() - 1] = context_generic;\n } else {\n generics[generics.len() - 1] = context_generic;\n }\n\n let generics = generics.map(|typ: Type| quote {$typ}).join(quote {,});\n quote { $name<$generics> }.as_type()\n}\n"
|
|
2842
2900
|
},
|
|
2843
|
-
"
|
|
2844
|
-
"path": "/
|
|
2901
|
+
"136": {
|
|
2902
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/call_private_function.nr",
|
|
2845
2903
|
"source": "use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress, utils::reader::Reader,\n};\n\n#[oracle(callPrivateFunction)]\nunconstrained fn call_private_function_oracle(\n _contract_address: AztecAddress,\n _function_selector: FunctionSelector,\n _args_hash: Field,\n _start_side_effect_counter: u32,\n _is_static_call: bool,\n) -> [Field; 2] {}\n\npub unconstrained fn call_private_function_internal(\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args_hash: Field,\n start_side_effect_counter: u32,\n is_static_call: bool,\n) -> (u32, Field) {\n let fields = call_private_function_oracle(\n contract_address,\n function_selector,\n args_hash,\n start_side_effect_counter,\n is_static_call,\n );\n\n let mut reader = Reader::new(fields);\n let end_side_effect_counter = reader.read_u32();\n let returns_hash = reader.read();\n\n (end_side_effect_counter, returns_hash)\n}\n"
|
|
2846
2904
|
},
|
|
2847
|
-
"
|
|
2848
|
-
"path": "/
|
|
2849
|
-
"source": "/// Stores
|
|
2905
|
+
"137": {
|
|
2906
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/capsules.nr",
|
|
2907
|
+
"source": "use protocol_types::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\n/// Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `load`. If\n/// data was already stored at this slot, it is overwritten.\npub unconstrained fn store<T, let N: u32>(contract_address: AztecAddress, slot: Field, value: T)\nwhere\n T: Serialize<N>,\n{\n let serialized = value.serialize();\n store_oracle(contract_address, slot, serialized);\n}\n\n/// Returns data previously stored via `storeCapsule` in the per-contract non-volatile database. Returns Option::none() if\n/// nothing was stored at the given slot.\npub unconstrained fn load<T, let N: u32>(contract_address: AztecAddress, slot: Field) -> Option<T>\nwhere\n T: Deserialize<N>,\n{\n let serialized_option = load_oracle::<N>(contract_address, slot, N);\n serialized_option.map(|arr| Deserialize::deserialize(arr))\n}\n\n/// Deletes data in the per-contract non-volatile database. Does nothing if no data was present.\npub unconstrained fn delete(contract_address: AztecAddress, slot: Field) {\n delete_oracle(contract_address, slot);\n}\n\n/// Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data\n/// structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`.\n/// Supports overlapping source and destination regions (which will result in the overlapped source values being\n/// overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)\npub unconstrained fn copy(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n) {\n copy_oracle(contract_address, src_slot, dst_slot, num_entries);\n}\n\n#[oracle(storeCapsule)]\nunconstrained fn store_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n values: [Field; N],\n) {}\n\n/// We need to pass in `array_len` (the value of N) as a parameter to tell the oracle how many fields the response must\n/// have.\n///\n/// Note that the oracle returns an Option<[Field; N]> because we cannot return an Option<T> directly. That would\n/// require for the oracle resolver to know the shape of T (e.g. if T were a struct of 3 u32 values then the expected\n/// response shape would be 3 single items, whereas it were a struct containing `u32, [Field;10], u32` then the expected\n/// shape would be single, array, single.). Instead, we return the serialization and deserialize in Noir.\n#[oracle(loadCapsule)]\nunconstrained fn load_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n array_len: u32,\n) -> Option<[Field; N]> {}\n\n#[oracle(deleteCapsule)]\nunconstrained fn delete_oracle(contract_address: AztecAddress, slot: Field) {}\n\n#[oracle(copyCapsule)]\nunconstrained fn copy_oracle(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n) {}\n\nmod test {\n // These tests are sort of redundant since we already test the oracle implementation directly in TypeScript, but\n // they are cheap regardless and help ensure both that the TXE implementation works accordingly and that the Noir\n // oracles are hooked up correctly.\n\n use crate::{\n oracle::capsules::{copy, delete, load, store},\n test::{helpers::test_environment::TestEnvironment, mocks::mock_struct::MockStruct},\n };\n use protocol_types::{address::AztecAddress, traits::{FromField, ToField}};\n\n unconstrained fn setup() -> AztecAddress {\n let env = TestEnvironment::new();\n env.contract_address()\n }\n\n global SLOT: Field = 1;\n\n #[test]\n unconstrained fn stores_and_loads() {\n let contract_address = setup();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value);\n\n assert_eq(load(contract_address, SLOT).unwrap(), value);\n }\n\n #[test]\n unconstrained fn store_overwrites() {\n let contract_address = setup();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value);\n\n let new_value = MockStruct::new(7, 8);\n store(contract_address, SLOT, new_value);\n\n assert_eq(load(contract_address, SLOT).unwrap(), new_value);\n }\n\n #[test]\n unconstrained fn loads_empty_slot() {\n let contract_address = setup();\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT);\n assert_eq(loaded_value, Option::none());\n }\n\n #[test]\n unconstrained fn deletes_stored_value() {\n let contract_address = setup();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value);\n delete(contract_address, SLOT);\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT);\n assert_eq(loaded_value, Option::none());\n }\n\n #[test]\n unconstrained fn deletes_empty_slot() {\n let contract_address = setup();\n\n delete(contract_address, SLOT);\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT);\n assert_eq(loaded_value, Option::none());\n }\n\n #[test]\n unconstrained fn copies_non_overlapping_values() {\n let contract_address = setup();\n\n let src = 5;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0]);\n store(contract_address, src + 1, values[1]);\n store(contract_address, src + 2, values[2]);\n\n let dst = 10;\n copy(contract_address, src, dst, 3);\n\n assert_eq(load(contract_address, dst).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2).unwrap(), values[2]);\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_src_ahead() {\n let contract_address = setup();\n\n let src = 1;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0]);\n store(contract_address, src + 1, values[1]);\n store(contract_address, src + 2, values[2]);\n\n let dst = 2;\n copy(contract_address, src, dst, 3);\n\n assert_eq(load(contract_address, dst).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2).unwrap(), values[2]);\n\n // src[1] and src[2] should have been overwritten since they are also dst[0] and dst[1]\n assert_eq(load(contract_address, src).unwrap(), values[0]); // src[0] (unchanged)\n assert_eq(load(contract_address, src + 1).unwrap(), values[0]); // dst[0]\n assert_eq(load(contract_address, src + 2).unwrap(), values[1]); // dst[1]\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_dst_ahead() {\n let contract_address = setup();\n\n let src = 2;\n\n let values = [MockStruct::new(5, 6), MockStruct::new(7, 8), MockStruct::new(9, 10)];\n store(contract_address, src, values[0]);\n store(contract_address, src + 1, values[1]);\n store(contract_address, src + 2, values[2]);\n\n let dst = 1;\n copy(contract_address, src, dst, 3);\n\n assert_eq(load(contract_address, dst).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2).unwrap(), values[2]);\n\n // src[0] and src[1] should have been overwritten since they are also dst[1] and dst[2]\n assert_eq(load(contract_address, src).unwrap(), values[1]); // dst[1]\n assert_eq(load(contract_address, src + 1).unwrap(), values[2]); // dst[2]\n assert_eq(load(contract_address, src + 2).unwrap(), values[2]); // src[2] (unchanged)\n }\n\n #[test(should_fail_with = \"copy empty slot\")]\n unconstrained fn cannot_copy_empty_values() {\n let contract_address = setup();\n\n copy(contract_address, SLOT, SLOT, 1);\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_store_other_contract() {\n let contract_address = setup();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let value = MockStruct::new(5, 6);\n store(other_contract_address, SLOT, value);\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_load_other_contract() {\n let contract_address = setup();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let _: Option<MockStruct> = load(other_contract_address, SLOT);\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_delete_other_contract() {\n let contract_address = setup();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n delete(other_contract_address, SLOT);\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_copy_other_contract() {\n let contract_address = setup();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n copy(other_contract_address, SLOT, SLOT, 0);\n }\n}\n"
|
|
2908
|
+
},
|
|
2909
|
+
"139": {
|
|
2910
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution.nr",
|
|
2911
|
+
"source": "use dep::protocol_types::address::AztecAddress;\n\n#[oracle(getContractAddress)]\nunconstrained fn get_contract_address_oracle() -> AztecAddress {}\n\n#[oracle(getBlockNumber)]\nunconstrained fn get_block_number_oracle() -> u32 {}\n\n#[oracle(getChainId)]\nunconstrained fn get_chain_id_oracle() -> Field {}\n\n#[oracle(getVersion)]\nunconstrained fn get_version_oracle() -> Field {}\n\npub unconstrained fn get_contract_address() -> AztecAddress {\n get_contract_address_oracle()\n}\n\npub unconstrained fn get_block_number() -> u32 {\n get_block_number_oracle()\n}\n\npub unconstrained fn get_chain_id() -> Field {\n get_chain_id_oracle()\n}\n\npub unconstrained fn get_version() -> Field {\n get_version_oracle()\n}\n"
|
|
2850
2912
|
},
|
|
2851
|
-
"
|
|
2852
|
-
"path": "/
|
|
2853
|
-
"source": "
|
|
2913
|
+
"140": {
|
|
2914
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution_cache.nr",
|
|
2915
|
+
"source": "/// Stores values represented as slice in execution cache to be later obtained by its hash.\npub fn store(values: [Field]) {\n // Safety: This oracle call returns nothing: we only call it for its side effects. It is therefore always safe\n // to call. When loading the values, however, the caller must check that the values are indeed the preimage.\n unsafe { store_in_execution_cache_oracle_wrapper(values) };\n}\n\npub unconstrained fn store_in_execution_cache_oracle_wrapper(values: [Field]) {\n let _ = store_in_execution_cache_oracle(values);\n}\n\npub unconstrained fn load<let N: u32>(hash: Field) -> [Field; N] {\n load_from_execution_cache_oracle(hash)\n}\n\n#[oracle(storeInExecutionCache)]\nunconstrained fn store_in_execution_cache_oracle(_values: [Field]) -> Field {}\n\n#[oracle(loadFromExecutionCache)]\nunconstrained fn load_from_execution_cache_oracle<let N: u32>(_hash: Field) -> [Field; N] {}\n"
|
|
2854
2916
|
},
|
|
2855
|
-
"
|
|
2856
|
-
"path": "/
|
|
2857
|
-
"source": "use crate::{\n note::{note_interface::NoteType, note_metadata::NoteMetadata, retrieved_note::RetrievedNote},\n utils::array,\n};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\n traits::{Deserialize, FromField, Packable},\n};\n\n/// Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same\n/// transaction. This note should only be added to the non-volatile database if found in an actual block.\npub fn notify_created_note<let N: u32>(\n storage_slot: Field,\n note_type_id: Field,\n packed_note: [Field; N],\n note_hash: Field,\n counter: u32,\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 {\n notify_created_note_oracle_wrapper(\n storage_slot,\n note_type_id,\n packed_note,\n note_hash,\n counter,\n )\n };\n}\n\n/// Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in\n/// the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an\n/// actual block.\npub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32) {\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_nullified_note_oracle_wrapper(nullifier, note_hash, counter) };\n}\n\n/// Notifies the simulator that a non-note nullifier has been created, so that it can be used for note nonces.\npub fn notify_created_nullifier(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_wrapper(nullifier) };\n}\n\nunconstrained fn notify_created_note_oracle_wrapper<let N: u32>(\n storage_slot: Field,\n note_type_id: Field,\n packed_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_created_note_oracle(storage_slot, note_type_id, packed_note, note_hash, counter);\n}\n\n#[oracle(notifyCreatedNote)]\nunconstrained fn notify_created_note_oracle<let N: u32>(\n _storage_slot: Field,\n _note_type_id: Field,\n _packed_note: [Field; N],\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\nunconstrained fn notify_nullified_note_oracle_wrapper(\n nullifier: Field,\n note_hash: Field,\n counter: u32,\n) {\n let _ = notify_nullified_note_oracle(nullifier, note_hash, counter);\n}\n\n#[oracle(notifyNullifiedNote)]\nunconstrained fn notify_nullified_note_oracle(\n _nullifier: Field,\n _note_hash: Field,\n _counter: u32,\n) -> Field {}\n\nunconstrained fn notify_created_nullifier_oracle_wrapper(nullifier: Field) {\n let _ = notify_created_nullifier_oracle(nullifier);\n}\n\n#[oracle(notifyCreatedNullifier)]\nunconstrained fn notify_created_nullifier_oracle(_nullifier: Field) -> Field {}\n\n#[oracle(getNotes)]\nunconstrained fn get_notes_oracle<let N: u32, let S: u32>(\n _storage_slot: Field,\n _num_selects: u8,\n _select_by_indexes: [u8; N],\n _select_by_offsets: [u8; N],\n _select_by_lengths: [u8; N],\n _select_values: [Field; N],\n _select_comparators: [u8; N],\n _sort_by_indexes: [u8; N],\n _sort_by_offsets: [u8; N],\n _sort_by_lengths: [u8; N],\n _sort_order: [u8; N],\n _limit: u32,\n _offset: u32,\n _status: u8,\n _return_size: u32,\n _placeholder_fields: [Field; S],\n) -> [Field; S] {}\n\nunconstrained fn get_notes_oracle_wrapper<let N: u32, let S: u32>(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; N],\n select_by_offsets: [u8; N],\n select_by_lengths: [u8; N],\n select_values: [Field; N],\n select_comparators: [u8; N],\n sort_by_indexes: [u8; N],\n sort_by_offsets: [u8; N],\n sort_by_lengths: [u8; N],\n sort_order: [u8; N],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_fields: [Field; S],\n) -> [Field; S] {\n let return_size = placeholder_fields.len() as u32;\n get_notes_oracle(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n return_size,\n placeholder_fields,\n )\n}\n\npub unconstrained fn get_notes<Note, let N: u32, let M: u32, let S: u32, let NS: u32>(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; M],\n select_by_offsets: [u8; M],\n select_by_lengths: [u8; M],\n select_values: [Field; M],\n select_comparators: [u8; M],\n sort_by_indexes: [u8; M],\n sort_by_offsets: [u8; M],\n sort_by_lengths: [u8; M],\n sort_order: [u8; M],\n limit: u32,\n offset: u32,\n status: u8,\n mut placeholder_opt_notes: [Option<RetrievedNote<Note>>; S], // TODO: Remove it and use `limit` to initialize the note array.\n placeholder_fields: [Field; NS], // TODO: Remove it and use `limit` to initialize the note array.\n _placeholder_note_length: [Field; N], // Turbofish hack? Compiler breaks calculating read_offset unless we add this parameter TODO(benesjan): try removing this.\n) -> [Option<RetrievedNote<Note>>; S]\nwhere\n Note: NoteType + Packable<N>,\n{\n let fields = get_notes_oracle_wrapper(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n placeholder_fields,\n );\n let num_notes = fields[0] as u32;\n let contract_address = AztecAddress::from_field(fields[1]);\n for i in 0..placeholder_opt_notes.len() {\n if i < num_notes {\n // lengths named as per typescript.\n let return_header_length: u32 = 2; // num_notes & contract_address.\n let extra_preimage_length: u32 = 2; // nonce & note_hash_counter.\n let read_offset: u32 = return_header_length + i * (N + extra_preimage_length);\n\n let maybe_nonce = fields[read_offset];\n let maybe_note_hash_counter = fields[read_offset + 1] as u32;\n let packed_note = array::subarray(fields, read_offset + 2);\n\n let note = Note::unpack(packed_note);\n let retrieved_note = RetrievedNote {\n note,\n contract_address,\n metadata: NoteMetadata::from_raw_data(maybe_note_hash_counter != 0, maybe_nonce),\n };\n\n placeholder_opt_notes[i] = Option::some(retrieved_note);\n };\n }\n placeholder_opt_notes\n}\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 the\n/// current transaction is included in a block. While this might seem of little use at first, certain design patterns\n/// 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) == 1\n}\n\n#[oracle(checkNullifierExists)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> Field {}\n\n/// Same as `get_indexed_tagging_secret_as_sender`, except it returns the derived tag, ready to be included in a log.\npub unconstrained fn get_app_tag_as_sender(sender: AztecAddress, recipient: AztecAddress) -> Field {\n get_indexed_tagging_secret_as_sender(sender, recipient).compute_tag(recipient)\n}\n\n/// Returns the tagging secret for a given sender and recipient pair, siloed for the current contract address.\n/// Includes the last known index used to send a note tagged with this secret.\n/// For this to work, PXE must know the ivsk_m of the sender.\n/// For the recipient's side, only the address is needed.\npub unconstrained fn get_indexed_tagging_secret_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> IndexedTaggingSecret {\n let result = get_indexed_tagging_secret_as_sender_oracle(sender, recipient);\n IndexedTaggingSecret::deserialize(result)\n}\n\n#[oracle(getIndexedTaggingSecretAsSender)]\nunconstrained fn get_indexed_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> [Field; INDEXED_TAGGING_SECRET_LENGTH] {}\n\n/// Notifies the simulator that a tag has been used in a note, and to therefore increment the associated index so that\n/// future notes get a different tag and can be discovered by the recipient.\n/// This change should only be persisted in a non-volatile database if the tagged log is found in an actual block -\n/// otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes\n/// that are not found by the recipient.\npub fn increment_app_tagging_secret_index_as_sender(sender: AztecAddress, recipient: AztecAddress) {\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 {\n increment_app_tagging_secret_index_as_sender_wrapper(sender, recipient);\n }\n}\n\nunconstrained fn increment_app_tagging_secret_index_as_sender_wrapper(\n sender: AztecAddress,\n recipient: AztecAddress,\n) {\n increment_app_tagging_secret_index_as_sender_oracle(sender, recipient);\n}\n\n#[oracle(incrementAppTaggingSecretIndexAsSender)]\nunconstrained fn increment_app_tagging_secret_index_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) {}\n"
|
|
2917
|
+
"149": {
|
|
2918
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/message_discovery.nr",
|
|
2919
|
+
"source": "use crate::discovery::private_notes::MAX_NOTE_PACKED_LEN;\nuse dep::protocol_types::{\n address::AztecAddress,\n constants::{MAX_NOTE_HASHES_PER_TX, PUBLIC_LOG_DATA_SIZE_IN_FIELDS},\n};\n\n/// Finds new notes that may have been sent to all registered accounts in PXE in the current contract and makes them\n/// available for later querying via the `get_notes` oracle.\npub unconstrained fn sync_notes() {\n sync_notes_oracle();\n}\n\n#[oracle(syncNotes)]\nunconstrained fn sync_notes_oracle() {}\n\n/// Informs PXE of a note's existence so that it can later be retrieved by the `getNotes` oracle. The note will be\n/// scoped to `contract_address`, meaning other contracts will not be able to access it unless authorized.\n///\n/// The packed note is what `getNotes` will later return. PXE indexes notes by `storage_slot`, so this value\n/// is typically used to filter notes that correspond to different state variables. `note_hash` and `nullifier` are\n/// the inner hashes, i.e. the raw hashes returned by `NoteHash::compute_note_hash` and\n/// `NoteHash::compute_nullifier`. PXE will verify that the siloed unique note hash was inserted into the tree\n/// at `tx_hash`, and will store the nullifier to later check for nullification.\n///\n/// `recipient` is the account to which the note was sent to. Other accounts will not be able to access this note (e.g.\n/// other accounts will not be able to see one another's token balance notes, even in the same PXE) unless authorized.\n///\n/// Returns true if the note was successfully delivered and added to PXE's database.\npub unconstrained fn deliver_note(\n contract_address: AztecAddress,\n storage_slot: Field,\n nonce: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n note_hash: Field,\n nullifier: Field,\n tx_hash: Field,\n recipient: AztecAddress,\n) -> bool {\n deliver_note_oracle(\n contract_address,\n storage_slot,\n nonce,\n packed_note,\n note_hash,\n nullifier,\n tx_hash,\n recipient,\n )\n}\n\n/// The contents of a public log, plus contextual information about the transaction in which the log was emitted. This\n/// is the data required in order to discover notes that are being delivered in a log.\n// TODO(#11639): this could also be used to fetch private logs, but the `BoundedVec` maximum length is that of a public\n// log.\npub struct LogWithTxData {\n pub log_content: BoundedVec<Field, PUBLIC_LOG_DATA_SIZE_IN_FIELDS>,\n pub tx_hash: Field,\n /// The array of new note hashes created by `tx_hash`\n pub unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n /// The first nullifier created by `tx_hash`\n pub first_nullifier_in_tx: Field,\n}\n\n/// Fetches a log from the node that has the corresponding `tag`. The log can be either a public or a private log, and\n/// the tag is the first field in the log's content. Returns `Option::none` if no such log exists. Throws if more than\n/// one log with that tag exists.\n/// Public logs have an extra field included at the beginning with the address of the contract that emitted them.\n// TODO(#11627): handle multiple logs with the same tag.\n// TODO(#10273): improve contract siloing of logs, don't introduce an extra field.\npub unconstrained fn get_log_by_tag(tag: Field) -> Option<LogWithTxData> {\n get_log_by_tag_oracle(tag)\n}\n\n#[oracle(deliverNote)]\nunconstrained fn deliver_note_oracle(\n contract_address: AztecAddress,\n storage_slot: Field,\n nonce: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n note_hash: Field,\n nullifier: Field,\n tx_hash: Field,\n recipient: AztecAddress,\n) -> bool {}\n\n#[oracle(getLogByTag)]\nunconstrained fn get_log_by_tag_oracle(tag: Field) -> Option<LogWithTxData> {}\n"
|
|
2858
2920
|
},
|
|
2859
2921
|
"151": {
|
|
2860
|
-
"path": "/
|
|
2922
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/notes.nr",
|
|
2923
|
+
"source": "use crate::{\n note::{note_interface::NoteType, note_metadata::NoteMetadata, retrieved_note::RetrievedNote},\n utils::array,\n};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::{INDEXED_TAGGING_SECRET_LENGTH, IndexedTaggingSecret},\n traits::{Deserialize, FromField, Packable},\n};\n\n/// Notifies the simulator that a note has been created, so that it can be returned in future read requests in the same\n/// transaction. This note should only be added to the non-volatile database if found in an actual block.\npub fn notify_created_note<let N: u32>(\n storage_slot: Field,\n note_type_id: Field,\n packed_note: [Field; N],\n note_hash: Field,\n counter: u32,\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 {\n notify_created_note_oracle_wrapper(\n storage_slot,\n note_type_id,\n packed_note,\n note_hash,\n counter,\n )\n };\n}\n\n/// Notifies the simulator that a note has been nullified, so that it is no longer returned in future read requests in\n/// the same transaction. This note should only be removed to the non-volatile database if its nullifier is found in an\n/// actual block.\npub fn notify_nullified_note(nullifier: Field, note_hash: Field, counter: u32) {\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_nullified_note_oracle_wrapper(nullifier, note_hash, counter) };\n}\n\n/// Notifies the simulator that a non-note nullifier has been created, so that it can be used for note nonces.\npub fn notify_created_nullifier(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_wrapper(nullifier) };\n}\n\nunconstrained fn notify_created_note_oracle_wrapper<let N: u32>(\n storage_slot: Field,\n note_type_id: Field,\n packed_note: [Field; N],\n note_hash: Field,\n counter: u32,\n) {\n notify_created_note_oracle(storage_slot, note_type_id, packed_note, note_hash, counter);\n}\n\n#[oracle(notifyCreatedNote)]\nunconstrained fn notify_created_note_oracle<let N: u32>(\n _storage_slot: Field,\n _note_type_id: Field,\n _packed_note: [Field; N],\n _note_hash: Field,\n _counter: u32,\n) {}\n\nunconstrained fn notify_nullified_note_oracle_wrapper(\n nullifier: Field,\n note_hash: Field,\n counter: u32,\n) {\n notify_nullified_note_oracle(nullifier, note_hash, counter);\n}\n\n#[oracle(notifyNullifiedNote)]\nunconstrained fn notify_nullified_note_oracle(_nullifier: Field, _note_hash: Field, _counter: u32) {}\n\nunconstrained fn notify_created_nullifier_oracle_wrapper(nullifier: Field) {\n notify_created_nullifier_oracle(nullifier);\n}\n\n#[oracle(notifyCreatedNullifier)]\nunconstrained fn notify_created_nullifier_oracle(_nullifier: Field) {}\n\n#[oracle(getNotes)]\nunconstrained fn get_notes_oracle<let N: u32, let ORACLE_RETURN_FIELD_LENGTH: u32>(\n _storage_slot: Field,\n _num_selects: u8,\n _select_by_indexes: [u8; N],\n _select_by_offsets: [u8; N],\n _select_by_lengths: [u8; N],\n _select_values: [Field; N],\n _select_comparators: [u8; N],\n _sort_by_indexes: [u8; N],\n _sort_by_offsets: [u8; N],\n _sort_by_lengths: [u8; N],\n _sort_order: [u8; N],\n _limit: u32,\n _offset: u32,\n _status: u8,\n _return_size: u32,\n) -> [Field; ORACLE_RETURN_FIELD_LENGTH] {}\n\nunconstrained fn get_notes_oracle_wrapper<let N: u32, let ORACLE_RETURN_FIELD_LENGTH: u32>(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; N],\n select_by_offsets: [u8; N],\n select_by_lengths: [u8; N],\n select_values: [Field; N],\n select_comparators: [u8; N],\n sort_by_indexes: [u8; N],\n sort_by_offsets: [u8; N],\n sort_by_lengths: [u8; N],\n sort_order: [u8; N],\n limit: u32,\n offset: u32,\n status: u8,\n) -> [Field; ORACLE_RETURN_FIELD_LENGTH] {\n // This wrapper exists to extract the ORACLE_RETURN_FIELD_LENGTH generic numeric param into a value and pass it to\n // the oracle, so that it knows how big the return array must be.\n get_notes_oracle(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n ORACLE_RETURN_FIELD_LENGTH,\n )\n}\n\npub unconstrained fn get_notes<Note, let N: u32, let M: u32, let MAX_NOTES: u32, let ORACLE_RETURN_FIELD_LENGTH: u32>(\n storage_slot: Field,\n num_selects: u8,\n select_by_indexes: [u8; M],\n select_by_offsets: [u8; M],\n select_by_lengths: [u8; M],\n select_values: [Field; M],\n select_comparators: [u8; M],\n sort_by_indexes: [u8; M],\n sort_by_offsets: [u8; M],\n sort_by_lengths: [u8; M],\n sort_order: [u8; M],\n limit: u32,\n offset: u32,\n status: u8,\n _placeholder_fields: [Field; ORACLE_RETURN_FIELD_LENGTH], // TODO: Compute this value automatically from MAX_NOTES\n) -> [Option<RetrievedNote<Note>>; MAX_NOTES]\nwhere\n Note: NoteType + Packable<N>,\n{\n let fields: [_; ORACLE_RETURN_FIELD_LENGTH] = get_notes_oracle_wrapper(\n storage_slot,\n num_selects,\n select_by_indexes,\n select_by_offsets,\n select_by_lengths,\n select_values,\n select_comparators,\n sort_by_indexes,\n sort_by_offsets,\n sort_by_lengths,\n sort_order,\n limit,\n offset,\n status,\n );\n let num_notes = fields[0] as u32;\n let contract_address = AztecAddress::from_field(fields[1]);\n\n let mut opt_notes = [Option::none(); MAX_NOTES];\n for i in 0..opt_notes.len() {\n if i < num_notes {\n // lengths named as per typescript.\n let return_header_length: u32 = 2; // num_notes & contract_address.\n let extra_preimage_length: u32 = 2; // nonce & note_hash_counter.\n let read_offset: u32 = return_header_length + i * (N + extra_preimage_length);\n\n let maybe_nonce = fields[read_offset];\n let maybe_note_hash_counter = fields[read_offset + 1] as u32;\n let packed_note = array::subarray(fields, read_offset + 2);\n\n let note = Note::unpack(packed_note);\n let retrieved_note = RetrievedNote {\n note,\n contract_address,\n metadata: NoteMetadata::from_raw_data(maybe_note_hash_counter != 0, maybe_nonce),\n };\n\n opt_notes[i] = Option::some(retrieved_note);\n };\n }\n opt_notes\n}\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 the\n/// current transaction is included in a block. While this might seem of little use at first, certain design patterns\n/// 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#[oracle(checkNullifierExists)]\nunconstrained fn check_nullifier_exists_oracle(_inner_nullifier: Field) -> bool {}\n\n/// Same as `get_indexed_tagging_secret_as_sender`, except it returns the derived tag, ready to be included in a log.\npub unconstrained fn get_app_tag_as_sender(sender: AztecAddress, recipient: AztecAddress) -> Field {\n get_indexed_tagging_secret_as_sender(sender, recipient).compute_tag(recipient)\n}\n\n/// Returns the tagging secret for a given sender and recipient pair, siloed for the current contract address.\n/// Includes the last known index used to send a note tagged with this secret.\n/// For this to work, PXE must know the ivsk_m of the sender.\n/// For the recipient's side, only the address is needed.\npub unconstrained fn get_indexed_tagging_secret_as_sender(\n sender: AztecAddress,\n recipient: AztecAddress,\n) -> IndexedTaggingSecret {\n let result = get_indexed_tagging_secret_as_sender_oracle(sender, recipient);\n IndexedTaggingSecret::deserialize(result)\n}\n\n#[oracle(getIndexedTaggingSecretAsSender)]\nunconstrained fn get_indexed_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> [Field; INDEXED_TAGGING_SECRET_LENGTH] {}\n\n/// Notifies the simulator that a tag has been used in a note, and to therefore increment the associated index so that\n/// future notes get a different tag and can be discovered by the recipient.\n/// This change should only be persisted in a non-volatile database if the tagged log is found in an actual block -\n/// otherwise e.g. a reverting transaction can cause the sender to accidentally skip indices and later produce notes\n/// that are not found by the recipient.\npub fn increment_app_tagging_secret_index_as_sender(sender: AztecAddress, recipient: AztecAddress) {\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 {\n increment_app_tagging_secret_index_as_sender_wrapper(sender, recipient);\n }\n}\n\nunconstrained fn increment_app_tagging_secret_index_as_sender_wrapper(\n sender: AztecAddress,\n recipient: AztecAddress,\n) {\n increment_app_tagging_secret_index_as_sender_oracle(sender, recipient);\n}\n\n#[oracle(incrementAppTaggingSecretIndexAsSender)]\nunconstrained fn increment_app_tagging_secret_index_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) {}\n"
|
|
2924
|
+
},
|
|
2925
|
+
"156": {
|
|
2926
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/map.nr",
|
|
2861
2927
|
"source": "use crate::state_vars::storage::Storage;\nuse dep::protocol_types::{storage::map::derive_storage_slot_in_map, traits::{Packable, ToField}};\n\n// docs:start:map\npub struct Map<K, V, Context> {\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n}\n// docs:end:map\n\nimpl<K, T, Context, let N: u32> Storage<N> for Map<K, T, Context>\nwhere\n T: Packable<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 // docs:start:new\n pub fn new(\n context: Context,\n storage_slot: Field,\n state_var_constructor: fn(Context, Field) -> V,\n ) -> Self {\n assert(storage_slot != 0, \"Storage slot 0 not allowed. Storage slots must start from 1.\");\n Map { context, storage_slot, state_var_constructor }\n }\n // docs:end:new\n\n // docs:start:at\n pub fn at(self, key: K) -> V\n where\n K: ToField,\n {\n // TODO(#1204): use a generator index for the storage slot\n let derived_storage_slot = derive_storage_slot_in_map(self.storage_slot, key);\n\n let state_var_constructor = self.state_var_constructor;\n state_var_constructor(self.context, derived_storage_slot)\n }\n // docs:end:at\n}\n"
|
|
2862
2928
|
},
|
|
2863
2929
|
"16": {
|
|
2864
2930
|
"path": "std/embedded_curve_ops.nr",
|
|
2865
|
-
"source": "use crate::cmp::Eq;\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, if is_infinite is false.\npub struct EmbeddedCurvePoint {\n pub x: Field,\n pub y: Field,\n pub is_infinite: bool,\n}\n\nimpl EmbeddedCurvePoint {\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, is_infinite: true }\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, is_infinite: self.is_infinite }\n }\n}\n\nimpl Eq for EmbeddedCurvePoint {\n /// Checks whether two points are equal\n fn eq(self: Self, b: EmbeddedCurvePoint) -> bool {\n (self.is_infinite & b.is_infinite)\n | ((self.is_infinite == b.is_infinite) & (self.x == b.x) & (self.y == b.y))\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 pub fn new(lo: Field, hi: Field) -> Self {\n EmbeddedCurveScalar { lo, hi }\n }\n\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 //Bytes to scalar: take the first (after the specified offset) 16 bytes of the input as the lo value, and the next 16 bytes as the hi value\n #[field(bn254)]\n pub(crate) fn from_bytes(bytes: [u8; 64], offset: u32) -> EmbeddedCurveScalar {\n let mut v = 1;\n let mut lo = 0 as Field;\n let mut hi = 0 as Field;\n for i in 0..16 {\n lo = lo + (bytes[offset + 31 - i] as Field) * v;\n hi = hi + (bytes[offset + 15 - i] as Field) * v;\n v = v * 256;\n }\n let sig_s = crate::embedded_curve_ops::EmbeddedCurveScalar { lo, hi };\n sig_s\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\n// Computes a multi scalar multiplication over the embedded curve.\n// For bn254, We have Grumpkin and Baby JubJub.\n// For bls12-381, we have JubJub and Bandersnatch.\n//\n// The embedded curve being used is decided by the\n// underlying proof system.\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 let point_array = multi_scalar_mul_array_return(points, scalars);\n EmbeddedCurvePoint { x: point_array[0], y: point_array[1], is_infinite: point_array[2] as bool }\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) -> [Field; 3] {}\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
|
|
2931
|
+
"source": "use crate::cmp::Eq;\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, if is_infinite is false.\npub struct EmbeddedCurvePoint {\n pub x: Field,\n pub y: Field,\n pub is_infinite: bool,\n}\n\nimpl EmbeddedCurvePoint {\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, is_infinite: true }\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 is_infinite: false,\n }\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, is_infinite: self.is_infinite }\n }\n}\n\nimpl Eq for EmbeddedCurvePoint {\n /// Checks whether two points are equal\n fn eq(self: Self, b: EmbeddedCurvePoint) -> bool {\n (self.is_infinite & b.is_infinite)\n | ((self.is_infinite == b.is_infinite) & (self.x == b.x) & (self.y == b.y))\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 pub fn new(lo: Field, hi: Field) -> Self {\n EmbeddedCurveScalar { lo, hi }\n }\n\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 //Bytes to scalar: take the first (after the specified offset) 16 bytes of the input as the lo value, and the next 16 bytes as the hi value\n #[field(bn254)]\n pub(crate) fn from_bytes(bytes: [u8; 64], offset: u32) -> EmbeddedCurveScalar {\n let mut v = 1;\n let mut lo = 0 as Field;\n let mut hi = 0 as Field;\n for i in 0..16 {\n lo = lo + (bytes[offset + 31 - i] as Field) * v;\n hi = hi + (bytes[offset + 15 - i] as Field) * v;\n v = v * 256;\n }\n let sig_s = crate::embedded_curve_ops::EmbeddedCurveScalar { lo, hi };\n sig_s\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\n// Computes a multi scalar multiplication over the embedded curve.\n// For bn254, We have Grumpkin and Baby JubJub.\n// For bls12-381, we have JubJub and Bandersnatch.\n//\n// The embedded curve being used is decided by the\n// underlying proof system.\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 let point_array = multi_scalar_mul_array_return(points, scalars);\n EmbeddedCurvePoint { x: point_array[0], y: point_array[1], is_infinite: point_array[2] as bool }\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) -> [Field; 3] {}\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/// This function only assumes that the points are on the curve\n/// It handles corner cases around the infinity point causing some overhead compared to embedded_curve_add_not_nul and embedded_curve_add_unsafe\n// This is a hack because returning an `EmbeddedCurvePoint` from a foreign function in brillig returns a [BrilligVariable::SingleAddr; 2] rather than BrilligVariable::BrilligArray\n// as is defined in the brillig bytecode format. This is a workaround which allows us to fix this without modifying the serialization format.\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 let x_coordinates_match = point1.x == point2.x;\n let y_coordinates_match = point1.y == point2.y;\n let double_predicate = (x_coordinates_match & y_coordinates_match);\n let infinity_predicate = (x_coordinates_match & !y_coordinates_match);\n let point1_1 = EmbeddedCurvePoint {\n x: point1.x + (x_coordinates_match as Field),\n y: point1.y,\n is_infinite: x_coordinates_match,\n };\n // point1_1 is guaranteed to have a different abscissa than point2\n let mut result = embedded_curve_add_unsafe(point1_1, point2);\n result.is_infinite = x_coordinates_match;\n\n // dbl if x_match, y_match\n let double = embedded_curve_add_unsafe(point1, point1);\n result = if double_predicate { double } else { result };\n\n // infinity if x_match, !y_match\n if point1.is_infinite {\n result = point2;\n }\n if point2.is_infinite {\n result = point1;\n }\n let mut result_is_infinity = infinity_predicate & (!point1.is_infinite & !point2.is_infinite);\n result.is_infinite = result_is_infinity | (point1.is_infinite & point2.is_infinite);\n result\n}\n\n#[foreign(embedded_curve_add)]\nfn embedded_curve_add_array_return(\n _point1: EmbeddedCurvePoint,\n _point2: EmbeddedCurvePoint,\n) -> [Field; 3] {}\n\n/// This function assumes that:\n/// The points are on the curve, and\n/// The points don't share an x-coordinate, and\n/// Neither point is the infinity point.\n/// If it is used with correct input, the function ensures the correct non-zero result is returned.\n/// Except for points on the curve, the other assumptions are checked by the function. It will cause assertion failure if they are not respected.\npub fn embedded_curve_add_not_nul(\n point1: EmbeddedCurvePoint,\n point2: EmbeddedCurvePoint,\n) -> EmbeddedCurvePoint {\n assert(point1.x != point2.x);\n assert(!point1.is_infinite);\n assert(!point2.is_infinite);\n embedded_curve_add_unsafe(point1, point2)\n}\n\n/// Unsafe ec addition\n/// If the inputs are the same, it will perform a doubling, but only if point1 and point2 are the same variable.\n/// If they have the same value but are different variables, the result will be incorrect because in this case\n/// it assumes (but does not check) that the points' x-coordinates are not equal.\n/// It also assumes neither point is the infinity point.\npub fn embedded_curve_add_unsafe(\n point1: EmbeddedCurvePoint,\n point2: EmbeddedCurvePoint,\n) -> EmbeddedCurvePoint {\n let point_array = embedded_curve_add_array_return(point1, point2);\n let x = point_array[0];\n let y = point_array[1];\n\n EmbeddedCurvePoint { x, y, is_infinite: false }\n}\n"
|
|
2866
2932
|
},
|
|
2867
|
-
"
|
|
2868
|
-
"path": "/
|
|
2933
|
+
"166": {
|
|
2934
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable.nr",
|
|
2869
2935
|
"source": "use dep::protocol_types::{\n shared_mutable::{ScheduledDelayChange, ScheduledValueChange, SharedMutableValues},\n traits::Packable,\n};\n\nuse crate::{\n context::{PrivateContext, PublicContext, UnconstrainedContext},\n state_vars::storage::Storage,\n utils::with_hash::WithHash,\n};\n\nmod test;\n\npub struct SharedMutable<T, let INITIAL_DELAY: u32, Context> {\n context: Context,\n storage_slot: Field,\n}\n\n// This will make the Aztec macros require that T implements the Packable and Eq traits, and allocate `M` storage\n// slots to this state variable.\nimpl<T, let INITIAL_DELAY: u32, Context, let M: u32> Storage<M> for SharedMutable<T, INITIAL_DELAY, Context>\nwhere\n WithHash<SharedMutableValues<T, INITIAL_DELAY>, _>: Packable<M>,\n{\n fn get_storage_slot(self) -> Field {\n self.storage_slot\n }\n}\n\n// SharedMutable<T> stores a value of type T that is:\n// - publicly known (i.e. unencrypted)\n// - mutable in public\n// - readable in private with no contention (i.e. multiple parties can all read the same value without blocking one\n// another nor needing to coordinate)\n// This is famously a hard problem to solve. SharedMutable makes it work by introducing a delay to public mutation:\n// the value is not changed immediately but rather a value change is scheduled to happen in the future after some delay\n// measured in blocks. Reads in private are only valid as long as they are included in a block not too far into the\n// future, so that they can guarantee the value will not have possibly changed by then (because of the delay).\n// The delay for changing a value is initially equal to INITIAL_DELAY, but can be changed by calling\n// `schedule_delay_change`.\nimpl<T, let INITIAL_DELAY: u32, let N: u32, Context> SharedMutable<T, INITIAL_DELAY, Context>\nwhere\n T: Packable<N> + Eq,\n{\n pub 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\nimpl<T, let INITIAL_DELAY: u32, let N: u32> SharedMutable<T, INITIAL_DELAY, &mut PublicContext>\nwhere\n T: Packable<N> + Eq,\n{\n\n pub fn schedule_value_change(self, new_value: T) {\n let _value_change = self.schedule_and_return_value_change(new_value);\n }\n\n pub fn schedule_and_return_value_change(self, new_value: T) -> ScheduledValueChange<T> {\n let mut value_change = self.read_value_change();\n let delay_change = self.read_delay_change();\n\n let block_number = self.context.block_number() as u32;\n let current_delay = delay_change.get_current(block_number);\n\n // TODO: make this configurable\n // https://github.com/AztecProtocol/aztec-packages/issues/5501\n let block_of_change = block_number + current_delay;\n value_change.schedule_change(new_value, block_number, current_delay, block_of_change);\n\n self.write(value_change, delay_change);\n\n value_change\n }\n\n pub fn schedule_delay_change(self, new_delay: u32) {\n let mut delay_change = self.read_delay_change();\n\n let block_number = self.context.block_number() as u32;\n\n delay_change.schedule_change(new_delay, block_number);\n\n self.write(self.read_value_change(), delay_change);\n }\n\n pub fn get_current_value(self) -> T {\n let block_number = self.context.block_number() as u32;\n self.read_value_change().get_current_at(block_number)\n }\n\n pub fn get_current_delay(self) -> u32 {\n let block_number = self.context.block_number() as u32;\n self.read_delay_change().get_current(block_number)\n }\n\n pub fn get_scheduled_value(self) -> (T, u32) {\n self.read_value_change().get_scheduled()\n }\n\n pub fn get_scheduled_delay(self) -> (u32, u32) {\n self.read_delay_change().get_scheduled()\n }\n\n fn read_value_change(self) -> ScheduledValueChange<T> {\n // We don't read ScheduledValueChange directly by having it implement Packable because ScheduledValueChange\n // and ScheduledDelayChange are packed together (sdc and svc.block_of_change are stored in the same slot).\n let packed = self.context.storage_read(self.storage_slot);\n SharedMutableValues::unpack_value_change(packed)\n }\n\n fn read_delay_change(self) -> ScheduledDelayChange<INITIAL_DELAY> {\n // Since all ScheduledDelayChange member are packed into a single field, we can read a single storage slot\n // here and skip the ones that correspond to ScheduledValueChange members. We are abusing the fact that\n // the field containing the ScheduledDelayChange data is the first one in the storage layout - otherwise we'd\n // need to offset the storage slot to get the position where it'd land.\n // We don't read ScheduledDelayChange directly by having it implement Packable because\n // ScheduledValueChange and ScheduledDelayChange are packed together (sdc and svc.block_of_change are\n // stored in the same slot).\n let packed = self.context.storage_read(self.storage_slot);\n SharedMutableValues::<T, INITIAL_DELAY>::unpack_delay_change(packed)\n }\n\n fn write(\n self,\n value_change: ScheduledValueChange<T>,\n delay_change: ScheduledDelayChange<INITIAL_DELAY>,\n ) {\n // Whenever we write to public storage, we write both the value change and delay change to storage at once.\n // We do so by wrapping them in a single struct (`SharedMutableValues`). Then we wrap the resulting struct in\n // `WithHash`.\n // Wrapping in `WithHash` makes for more costly writes but it also makes private proofs much simpler because\n // they only need to produce a historical proof for the hash, which results in a single inclusion proof (as\n // opposed to 4 in the best case scenario in which T is a single field). Private shared mutable reads are\n // assumed to be much more frequent than public writes, so this tradeoff makes sense.\n let values = WithHash::new(SharedMutableValues::new(value_change, delay_change));\n\n self.context.storage_write(self.storage_slot, values);\n }\n}\n\nimpl<T, let INITIAL_DELAY: u32, let N: u32> SharedMutable<T, INITIAL_DELAY, &mut PrivateContext>\nwhere\n T: Packable<N> + Eq,\n{\n pub fn get_current_value(self) -> T {\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 block number as this proof\n // will only be valid for however many blocks we can ensure the value will not change, which will depend on the\n // current delay and any scheduled delay changes.\n let (value_change, delay_change, historical_block_number) =\n self.historical_read_from_public_storage();\n\n // We use the effective minimum delay as opposed to the current delay at the historical block as this one also\n // takes into consideration any scheduled delay changes.\n // For example, consider a scenario in which at block 200 the current delay was 50. We may naively think that\n // the earliest we could change the value would be at block 251 by scheduling immediately after the historical\n // block, i.e. at block 201. But if there was a delay change scheduled for block 210 to reduce the delay to 20\n // blocks, then if a value change was scheduled at block 210 it would go into effect at block 230, which is\n // earlier than what we'd expect if we only considered the current delay.\n let effective_minimum_delay =\n delay_change.get_effective_minimum_delay_at(historical_block_number);\n let block_horizon =\n value_change.get_block_horizon(historical_block_number, effective_minimum_delay);\n\n // We prevent this transaction from being included in any block after the block horizon, ensuring that the\n // historical public value matches the current one, since it can only change after the horizon.\n self.context.set_tx_max_block_number(block_horizon);\n value_change.get_current_at(historical_block_number)\n }\n\n fn historical_read_from_public_storage(\n self,\n ) -> (ScheduledValueChange<T>, ScheduledDelayChange<INITIAL_DELAY>, u32) {\n let header = self.context.get_block_header();\n let address = self.context.this_address();\n\n let historical_block_number = header.global_variables.block_number as u32;\n\n let values: SharedMutableValues<T, INITIAL_DELAY> =\n WithHash::historical_public_storage_read(header, address, self.storage_slot);\n\n (values.svc, values.sdc, historical_block_number)\n }\n}\n\nimpl<T, let INITIAL_DELAY: u32, let N: u32> SharedMutable<T, INITIAL_DELAY, UnconstrainedContext>\nwhere\n T: Packable<N> + Eq,\n{\n pub unconstrained fn get_current_value(self) -> T {\n let smv: SharedMutableValues<T, INITIAL_DELAY> =\n WithHash::unconstrained_public_storage_read(self.context, self.storage_slot);\n\n let block_number = self.context.block_number() as u32;\n smv.svc.get_current_at(block_number)\n }\n}\n"
|
|
2870
2936
|
},
|
|
2871
2937
|
"17": {
|
|
2872
2938
|
"path": "std/field/bn254.nr",
|
|
2873
2939
|
"source": "use crate::field::field_less_than;\nuse crate::runtime::is_unconstrained;\n\n// The low and high decomposition of the field modulus\nglobal PLO: Field = 53438638232309528389504892708671455233;\nglobal PHI: Field = 64323764613183177041862057485226039389;\n\npub(crate) global TWO_POW_128: Field = 0x100000000000000000000000000000000;\nglobal TWO_POW_64: Field = 0x10000000000000000;\n\n// Decomposes a single field into two 16 byte fields.\nfn compute_decomposition(mut x: Field) -> (Field, Field) {\n // Here's we're taking advantage of truncating 64 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_lower_64 = (x as u64) as Field;\n x = (x - low_lower_64) / TWO_POW_64;\n let low_upper_64 = (x as u64) as Field;\n\n let high = (x - low_upper_64) / TWO_POW_64;\n let low = low_upper_64 * TWO_POW_64 + low_lower_64;\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, lte_hint, PHI, PLO, TWO_POW_128};\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_decompose_unconstrained() {\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 fn check_assert_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 - 1, 0);\n }\n\n #[test]\n unconstrained fn check_assert_gt_unconstrained() {\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 - 1, 0);\n }\n\n #[test]\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 }\n\n #[test]\n unconstrained fn check_gt_unconstrained() {\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 }\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"
|
|
2874
2940
|
},
|
|
2941
|
+
"178": {
|
|
2942
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/append.nr",
|
|
2943
|
+
"source": "/// Appends two `BoundedVec`s together, returning one that contains all of the elements of the first one followed by all\n/// of the elements of the second one. The resulting `BoundedVec` can have any arbitrary maximum length, but it must be\n/// large enough to fit all of the elements of both the first and second vectors.\npub fn append<T, let A_LEN: u32, let B_LEN: u32, let DST_LEN: u32>(\n a: BoundedVec<T, A_LEN>,\n b: BoundedVec<T, B_LEN>,\n) -> BoundedVec<T, DST_LEN> {\n let mut dst = BoundedVec::new();\n\n dst.extend_from_bounded_vec(a);\n dst.extend_from_bounded_vec(b);\n\n dst\n}\n\nmod test {\n use super::append;\n\n #[test]\n unconstrained fn append_empty_vecs() {\n let a: BoundedVec<_, 3> = BoundedVec::new();\n let b: BoundedVec<_, 14> = BoundedVec::new();\n\n let result: BoundedVec<Field, 5> = append(a, b);\n\n assert_eq(result.len(), 0);\n assert_eq(result.storage(), std::mem::zeroed());\n }\n\n #[test]\n unconstrained fn append_non_empty_vecs() {\n let a: BoundedVec<_, 3> = BoundedVec::from_array([1, 2, 3]);\n let b: BoundedVec<_, 14> = BoundedVec::from_array([4, 5, 6]);\n\n let result: BoundedVec<Field, 8> = append(a, b);\n\n assert_eq(result.len(), 6);\n assert_eq(result.storage(), [1, 2, 3, 4, 5, 6, std::mem::zeroed(), std::mem::zeroed()]);\n }\n\n #[test(should_fail_with = \"out of bounds\")]\n unconstrained fn append_non_empty_vecs_insufficient_max_len() {\n let a: BoundedVec<_, 3> = BoundedVec::from_array([1, 2, 3]);\n let b: BoundedVec<_, 14> = BoundedVec::from_array([4, 5, 6]);\n\n let _: BoundedVec<Field, 5> = append(a, b);\n }\n}\n"
|
|
2944
|
+
},
|
|
2875
2945
|
"18": {
|
|
2876
2946
|
"path": "std/field/mod.nr",
|
|
2877
2947
|
"source": "pub mod bn254;\nuse crate::{runtime::is_unconstrained, static_assert};\nuse bn254::lt as bn254_lt;\n\nimpl Field {\n /// Asserts that `self` can be represented in `bit_size` bits.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^{bit_size}`.\n // docs:start:assert_max_bit_size\n pub fn assert_max_bit_size<let BIT_SIZE: u32>(self) {\n // docs:end:assert_max_bit_size\n static_assert(\n BIT_SIZE < modulus_num_bits() as u32,\n \"BIT_SIZE must be less than modulus_num_bits\",\n );\n self.__assert_max_bit_size(BIT_SIZE);\n }\n\n #[builtin(apply_range_constraint)]\n fn __assert_max_bit_size(self, bit_size: u32) {}\n\n /// Decomposes `self` into its little endian bit decomposition as a `[u1; N]` array.\n /// This slice will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting slice will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n /// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n /// wrap around due to overflow when verifying the decomposition.\n #[builtin(to_le_bits)]\n fn _to_le_bits<let N: u32>(self: Self) -> [u1; N] {}\n\n /// Decomposes `self` into its big endian bit decomposition as a `[u1; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting slice will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// Values of `N` equal to or greater than the number of bits necessary to represent the `Field` modulus\n /// (e.g. 254 for the BN254 field) allow for multiple bit decompositions. This is due to how the `Field` will\n /// wrap around due to overflow when verifying the decomposition.\n #[builtin(to_be_bits)]\n fn _to_be_bits<let N: u32>(self: Self) -> [u1; N] {}\n\n /// Decomposes `self` into its little endian bit decomposition as a `[u1; N]` array.\n /// This slice will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting slice will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_le_bits\n pub fn to_le_bits<let N: u32>(self: Self) -> [u1; N] {\n // docs:end:to_le_bits\n let bits = self._to_le_bits();\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[N - 1 - i] != p[N - 1 - i]) {\n assert(p[N - 1 - i] == 1);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its big endian bit decomposition as a `[u1; N]` array.\n /// This array will be zero padded should not all bits be necessary to represent `self`.\n ///\n /// # Failures\n /// Causes a constraint failure for `Field` values exceeding `2^N` as the resulting slice will not\n /// be able to represent the original `Field`.\n ///\n /// # Safety\n /// The bit decomposition returned is canonical and is guaranteed to not overflow the modulus.\n // docs:start:to_be_bits\n pub fn to_be_bits<let N: u32>(self: Self) -> [u1; N] {\n // docs:end:to_be_bits\n let bits = self._to_be_bits();\n\n if !is_unconstrained() {\n // Ensure that the decomposition does not overflow the modulus\n let p = modulus_be_bits();\n assert(bits.len() <= p.len());\n let mut ok = bits.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bits[i] != p[i]) {\n assert(p[i] == 1);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bits\n }\n\n /// Decomposes `self` into its little endian byte decomposition as a `[u8;N]` array\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_le_bytes\n pub fn to_le_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_le_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_le_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_le_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[N - 1 - i] != p[N - 1 - i]) {\n assert(bytes[N - 1 - i] < p[N - 1 - i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n /// Decomposes `self` into its big endian byte decomposition as a `[u8;N]` array of length required to represent the field modulus\n /// This array will be zero padded should not all bytes be necessary to represent `self`.\n ///\n /// # Failures\n /// The length N of the array must be big enough to contain all the bytes of the 'self',\n /// and no more than the number of bytes required to represent the field modulus\n ///\n /// # Safety\n /// The result is ensured to be the canonical decomposition of the field element\n // docs:start:to_be_bytes\n pub fn to_be_bytes<let N: u32>(self: Self) -> [u8; N] {\n // docs:end:to_be_bytes\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n // Compute the byte decomposition\n let bytes = self.to_be_radix(256);\n\n if !is_unconstrained() {\n // Ensure that the byte decomposition does not overflow the modulus\n let p = modulus_be_bytes();\n assert(bytes.len() <= p.len());\n let mut ok = bytes.len() != p.len();\n for i in 0..N {\n if !ok {\n if (bytes[i] != p[i]) {\n assert(bytes[i] < p[i]);\n ok = true;\n }\n }\n }\n assert(ok);\n }\n bytes\n }\n\n // docs:start:to_le_radix\n pub fn to_le_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n static_assert(1 < radix, \"radix must be greater than 1\");\n static_assert(radix <= 256, \"radix must be less than or equal to 256\");\n static_assert(radix & (radix - 1) == 0, \"radix must be a power of 2\");\n }\n self.__to_le_radix(radix)\n }\n // docs:end:to_le_radix\n\n // docs:start:to_be_radix\n pub fn to_be_radix<let N: u32>(self: Self, radix: u32) -> [u8; N] {\n // Brillig does not need an immediate radix\n if !crate::runtime::is_unconstrained() {\n crate::assert_constant(radix);\n }\n self.__to_be_radix(radix)\n }\n // docs:end:to_be_radix\n\n // `_radix` must be less than 256\n #[builtin(to_le_radix)]\n fn __to_le_radix<let N: u32>(self, radix: u32) -> [u8; N] {}\n\n // `_radix` must be less than 256\n #[builtin(to_be_radix)]\n fn __to_be_radix<let N: u32>(self, radix: u32) -> [u8; N] {}\n\n // Returns self to the power of the given exponent value.\n // Caution: we assume the exponent fits into 32 bits\n // using a bigger bit size impacts negatively the performance and should be done only if the exponent does not fit in 32 bits\n pub fn pow_32(self, exponent: Field) -> Field {\n let mut r: Field = 1;\n let b: [u1; 32] = exponent.to_le_bits();\n\n for i in 1..33 {\n r *= r;\n r = (b[32 - i] as Field) * (r * self) + (1 - b[32 - i] as Field) * r;\n }\n r\n }\n\n // Parity of (prime) Field element, i.e. sgn0(x mod p) = 0 if x `elem` {0, ..., p-1} is even, otherwise sgn0(x mod p) = 1.\n pub fn sgn0(self) -> u1 {\n self as u1\n }\n\n pub fn lt(self, another: Field) -> bool {\n if crate::compat::is_bn254() {\n bn254_lt(self, another)\n } else {\n lt_fallback(self, another)\n }\n }\n\n /// Convert a little endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n pub fn from_le_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n static_assert(\n N <= modulus_le_bytes().len(),\n \"N must be less than or equal to modulus_le_bytes().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[i] as Field) * v;\n v = v * 256;\n }\n result\n }\n\n /// Convert a big endian byte array to a field element.\n /// If the provided byte array overflows the field modulus then the Field will silently wrap around.\n pub fn from_be_bytes<let N: u32>(bytes: [u8; N]) -> Field {\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bytes[N - 1 - i] as Field) * v;\n v = v * 256;\n }\n result\n }\n}\n\n#[builtin(modulus_num_bits)]\npub comptime fn modulus_num_bits() -> u64 {}\n\n#[builtin(modulus_be_bits)]\npub comptime fn modulus_be_bits() -> [u1] {}\n\n#[builtin(modulus_le_bits)]\npub comptime fn modulus_le_bits() -> [u1] {}\n\n#[builtin(modulus_be_bytes)]\npub comptime fn modulus_be_bytes() -> [u8] {}\n\n#[builtin(modulus_le_bytes)]\npub comptime fn modulus_le_bytes() -> [u8] {}\n\n/// An unconstrained only built in to efficiently compare fields.\n#[builtin(field_less_than)]\nunconstrained fn __field_less_than(x: Field, y: Field) -> bool {}\n\npub(crate) unconstrained fn field_less_than(x: Field, y: Field) -> bool {\n __field_less_than(x, y)\n}\n\n// Convert a 32 byte array to a field element by modding\npub fn bytes32_to_field(bytes32: [u8; 32]) -> Field {\n // Convert it to a field element\n let mut v = 1;\n let mut high = 0 as Field;\n let mut low = 0 as Field;\n\n for i in 0..16 {\n high = high + (bytes32[15 - i] as Field) * v;\n low = low + (bytes32[16 + 15 - i] as Field) * v;\n v = v * 256;\n }\n // Abuse that a % p + b % p = (a + b) % p and that low < p\n low + high * v\n}\n\nfn lt_fallback(x: Field, y: Field) -> bool {\n if is_unconstrained() {\n // Safety: unconstrained context\n unsafe {\n field_less_than(x, y)\n }\n } else {\n let x_bytes: [u8; 32] = x.to_le_bytes();\n let y_bytes: [u8; 32] = y.to_le_bytes();\n let mut x_is_lt = false;\n let mut done = false;\n for i in 0..32 {\n if (!done) {\n let x_byte = x_bytes[32 - 1 - i] as u8;\n let y_byte = y_bytes[32 - 1 - i] as u8;\n let bytes_match = x_byte == y_byte;\n if !bytes_match {\n x_is_lt = x_byte < y_byte;\n done = true;\n }\n }\n }\n x_is_lt\n }\n}\n\nmod tests {\n use crate::{panic::panic, runtime};\n use super::field_less_than;\n\n #[test]\n // docs:start:to_be_bits_example\n fn test_to_be_bits() {\n let field = 2;\n let bits: [u1; 8] = field.to_be_bits();\n assert_eq(bits, [0, 0, 0, 0, 0, 0, 1, 0]);\n }\n // docs:end:to_be_bits_example\n\n #[test]\n // docs:start:to_le_bits_example\n fn test_to_le_bits() {\n let field = 2;\n let bits: [u1; 8] = field.to_le_bits();\n assert_eq(bits, [0, 1, 0, 0, 0, 0, 0, 0]);\n }\n // docs:end:to_le_bits_example\n\n #[test]\n // docs:start:to_be_bytes_example\n fn test_to_be_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_be_bytes();\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 0, 2]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_bytes_example\n\n #[test]\n // docs:start:to_le_bytes_example\n fn test_to_le_bytes() {\n let field = 2;\n let bytes: [u8; 8] = field.to_le_bytes();\n assert_eq(bytes, [2, 0, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_bytes_example\n\n #[test]\n // docs:start:to_be_radix_example\n fn test_to_be_radix() {\n // 259, in base 256, big endian, is [1, 3].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_be_radix(256);\n assert_eq(bytes, [0, 0, 0, 0, 0, 0, 1, 3]);\n assert_eq(Field::from_be_bytes::<8>(bytes), field);\n }\n // docs:end:to_be_radix_example\n\n #[test]\n // docs:start:to_le_radix_example\n fn test_to_le_radix() {\n // 259, in base 256, little endian, is [3, 1].\n // i.e. 3 * 256^0 + 1 * 256^1\n let field = 259;\n\n // The radix (in this example, 256) must be a power of 2.\n // The length of the returned byte array can be specified to be\n // >= the amount of space needed.\n let bytes: [u8; 8] = field.to_le_radix(256);\n assert_eq(bytes, [3, 1, 0, 0, 0, 0, 0, 0]);\n assert_eq(Field::from_le_bytes::<8>(bytes), field);\n }\n // docs:end:to_le_radix_example\n\n #[test(should_fail_with = \"radix must be greater than 1\")]\n fn test_to_le_radix_1() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(f\"radix must be greater than 1\");\n }\n }\n\n // TODO: Update this test to account for the Brillig restriction that the radix must be greater than 2\n //#[test]\n //fn test_to_le_radix_brillig_1() {\n // // this test should only fail in constrained mode\n // if runtime::is_unconstrained() {\n // let field = 1;\n // let out: [u8; 8] = field.to_le_radix(1);\n // crate::println(out);\n // let expected = [0; 8];\n // assert(out == expected, \"unexpected result\");\n // }\n //}\n\n #[test(should_fail_with = \"radix must be a power of 2\")]\n fn test_to_le_radix_3() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(3);\n } else {\n panic(f\"radix must be a power of 2\");\n }\n }\n\n #[test]\n fn test_to_le_radix_brillig_3() {\n // this test should only fail in constrained mode\n if runtime::is_unconstrained() {\n let field = 1;\n let out: [u8; 8] = field.to_le_radix(3);\n let mut expected = [0; 8];\n expected[0] = 1;\n assert(out == expected, \"unexpected result\");\n }\n }\n\n #[test(should_fail_with = \"radix must be less than or equal to 256\")]\n fn test_to_le_radix_512() {\n // this test should only fail in constrained mode\n if !runtime::is_unconstrained() {\n let field = 2;\n let _: [u8; 8] = field.to_le_radix(512);\n } else {\n panic(f\"radix must be less than or equal to 256\")\n }\n }\n\n // TODO: Update this test to account for the Brillig restriction that the radix must be less than 512\n //#[test]\n //fn test_to_le_radix_brillig_512() {\n // // this test should only fail in constrained mode\n // if runtime::is_unconstrained() {\n // let field = 1;\n // let out: [u8; 8] = field.to_le_radix(512);\n // let mut expected = [0; 8];\n // expected[0] = 1;\n // assert(out == expected, \"unexpected result\");\n // }\n //}\n\n #[test]\n unconstrained fn test_field_less_than() {\n assert(field_less_than(0, 1));\n assert(field_less_than(0, 0x100));\n assert(field_less_than(0x100, 0 - 1));\n assert(!field_less_than(0 - 1, 0));\n }\n}\n"
|
|
2878
2948
|
},
|
|
2879
|
-
"
|
|
2880
|
-
"path": "/
|
|
2881
|
-
"source": "
|
|
2949
|
+
"180": {
|
|
2950
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/mod.nr",
|
|
2951
|
+
"source": "pub mod append;\npub mod collapse;\npub mod subarray;\npub mod subbvec;\n\npub use append::append;\npub use collapse::collapse;\npub use subarray::subarray;\npub use subbvec::subbvec;\n\n// This will eventually be replaced by `BoundedVec::for_each`, once that's implemented.\npub unconstrained fn for_each_in_bounded_vec<T, let MaxLen: u32, Env>(\n vec: BoundedVec<T, MaxLen>,\n f: fn[Env](T, u32) -> (),\n) {\n for i in 0..vec.len() {\n f(vec.get_unchecked(i), i);\n }\n}\n"
|
|
2952
|
+
},
|
|
2953
|
+
"181": {
|
|
2954
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/subarray.nr",
|
|
2955
|
+
"source": "/// Returns `DST_LEN` elements from a source array, starting at `offset`. `DST_LEN` must not be larger than the number\n/// of elements past `offset`.\n///\n/// Examples:\n/// ```\n/// let foo: [Field; 2] = subarray([1, 2, 3, 4, 5], 2);\n/// assert_eq(foo, [3, 4]);\n///\n/// let bar: [Field; 5] = subarray([1, 2, 3, 4, 5], 2); // fails - we can't return 5 elements since only 3 remain\n/// ```\npub fn subarray<T, let SRC_LEN: u32, let DST_LEN: u32>(\n src: [T; SRC_LEN],\n offset: u32,\n) -> [T; DST_LEN] {\n assert(offset + DST_LEN <= SRC_LEN, \"DST_LEN too large for offset\");\n\n let mut dst: [T; DST_LEN] = std::mem::zeroed();\n for i in 0..DST_LEN {\n dst[i] = src[i + offset];\n }\n\n dst\n}\n\nmod test {\n use super::subarray;\n\n #[test]\n unconstrained fn subarray_into_empty() {\n // In all of these cases we're setting DST_LEN to be 0, so we always get back an emtpy array.\n assert_eq(subarray::<Field, _, _>([], 0), []);\n assert_eq(subarray([1, 2, 3, 4, 5], 0), []);\n assert_eq(subarray([1, 2, 3, 4, 5], 2), []);\n }\n\n #[test]\n unconstrained fn subarray_complete() {\n assert_eq(subarray::<Field, _, _>([], 0), []);\n assert_eq(subarray([1, 2, 3, 4, 5], 0), [1, 2, 3, 4, 5]);\n }\n\n #[test]\n unconstrained fn subarray_different_end_sizes() {\n // We implicitly select how many values to read in the size of the return array\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2, 3, 4, 5]);\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2, 3, 4]);\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2, 3]);\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [2]);\n }\n\n #[test(should_fail_with = \"DST_LEN too large for offset\")]\n unconstrained fn subarray_offset_too_large() {\n // With an offset of 1 we can only request up to 4 elements\n let _: [_; 5] = subarray([1, 2, 3, 4, 5], 1);\n }\n\n #[test(should_fail)]\n unconstrained fn subarray_bad_return_value() {\n assert_eq(subarray([1, 2, 3, 4, 5], 1), [3, 3, 4, 5]);\n }\n}\n"
|
|
2956
|
+
},
|
|
2957
|
+
"182": {
|
|
2958
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/subbvec.nr",
|
|
2959
|
+
"source": "use crate::utils::array;\n\n/// Returns `DST_MAX_LEN` elements from a source BoundedVec, starting at `offset`. `offset` must not be larger than the\n/// original length, and `DST_LEN` must not be larger than the total number of elements past `offset` (including the\n/// zeroed elements past `len()`).\n///\n/// Only elements at the beginning of the vector can be removed: it is not possible to also remove elements at the end\n/// of the vector by passing a value for `DST_LEN` that is smaller than `len() - offset`.\n///\n/// Examples:\n/// ```\n/// let foo = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n/// assert_eq(subbvec(foo, 2), BoundedVec::<_, 8>::from_array([3, 4, 5]));\n///\n/// let bar: BoundedVec<_, 1> = subbvec(foo, 2); // fails - we can't return just 1 element since 3 remain\n/// let baz: BoundedVec<_, 10> = subbvec(foo, 3); // fails - we can't return 10 elements since only 7 remain\n/// ```\npub fn subbvec<T, let SRC_MAX_LEN: u32, let DST_MAX_LEN: u32>(\n bvec: BoundedVec<T, SRC_MAX_LEN>,\n offset: u32,\n) -> BoundedVec<T, DST_MAX_LEN> {\n // from_parts_unchecked does not verify that the elements past len are zeroed, but that is not an issue in our case\n // because we're constructing the new storage array as a subarray of the original one (which should have zeroed\n // storage past len), guaranteeing correctness. This is because `subarray` does not allow extending arrays past\n // their original length.\n BoundedVec::from_parts_unchecked(array::subarray(bvec.storage(), offset), bvec.len() - offset)\n}\n\nmod test {\n use super::subbvec;\n\n #[test]\n unconstrained fn subbvec_empty() {\n let bvec = BoundedVec::<Field, 0>::from_array([]);\n assert_eq(subbvec(bvec, 0), bvec);\n }\n\n #[test]\n unconstrained fn subbvec_complete() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n assert_eq(subbvec(bvec, 0), bvec);\n\n let smaller_capacity = BoundedVec::<_, 5>::from_array([1, 2, 3, 4, 5]);\n assert_eq(subbvec(bvec, 0), smaller_capacity);\n }\n\n #[test]\n unconstrained fn subbvec_partial() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n assert_eq(subbvec(bvec, 2), BoundedVec::<_, 8>::from_array([3, 4, 5]));\n assert_eq(subbvec(bvec, 2), BoundedVec::<_, 3>::from_array([3, 4, 5]));\n }\n\n #[test]\n unconstrained fn subbvec_into_empty() {\n let bvec: BoundedVec<_, 10> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(subbvec(bvec, 5), BoundedVec::<_, 5>::from_array([]));\n }\n\n #[test(should_fail)]\n unconstrained fn subbvec_offset_past_len() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n let _: BoundedVec<_, 1> = subbvec(bvec, 6);\n }\n\n #[test(should_fail)]\n unconstrained fn subbvec_insufficient_dst_len() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n // We're not providing enough space to hold all of the items inside the original BoundedVec. subbvec can cause\n // for the capacity to reduce, but not the length (other than by len - offset).\n let _: BoundedVec<_, 1> = subbvec(bvec, 2);\n }\n\n #[test(should_fail_with = \"DST_LEN too large for offset\")]\n unconstrained fn subbvec_dst_len_causes_enlarge() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n // subbvec does not supprt capacity increases\n let _: BoundedVec<_, 11> = subbvec(bvec, 0);\n }\n\n #[test(should_fail_with = \"DST_LEN too large for offset\")]\n unconstrained fn subbvec_dst_len_too_large_for_offset() {\n let bvec = BoundedVec::<_, 10>::from_array([1, 2, 3, 4, 5]);\n\n // This effectively requests a capacity increase, since there'd be just one element plus the 5 empty slots,\n // which is less than 7.\n let _: BoundedVec<_, 7> = subbvec(bvec, 4);\n }\n}\n"
|
|
2960
|
+
},
|
|
2961
|
+
"193": {
|
|
2962
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/with_hash.nr",
|
|
2963
|
+
"source": "use crate::{\n context::{PublicContext, UnconstrainedContext},\n history::public_storage::PublicStorageHistoricalRead,\n oracle,\n};\nuse dep::protocol_types::{\n address::AztecAddress, block_header::BlockHeader, hash::poseidon2_hash, traits::Packable,\n};\n\n/// A struct that allows for efficient reading of value `T` from public storage in private.\n///\n/// The efficient reads are achieved by verifying large values through a single hash check\n/// and then proving inclusion only of the hash in public storage. This reduces the number\n/// of required tree inclusion proofs from `N` to 1.\n///\n/// # Type Parameters\n/// - `T`: The underlying type being wrapped, must implement `Packable<N>`\n/// - `N`: The number of field elements required to pack values of type `T`\npub struct WithHash<T, let N: u32> {\n value: T,\n packed: [Field; N],\n hash: Field,\n}\n\nimpl<T, let N: u32> WithHash<T, N>\nwhere\n T: Packable<N> + Eq,\n{\n pub fn new(value: T) -> Self {\n let packed = value.pack();\n Self { value, packed, hash: poseidon2_hash(packed) }\n }\n\n pub fn get_value(self) -> T {\n self.value\n }\n\n pub fn get_hash(self) -> Field {\n self.hash\n }\n\n pub fn public_storage_read(context: PublicContext, storage_slot: Field) -> T {\n context.storage_read(storage_slot)\n }\n\n pub unconstrained fn unconstrained_public_storage_read(\n context: UnconstrainedContext,\n storage_slot: Field,\n ) -> T {\n context.storage_read(storage_slot)\n }\n\n pub fn historical_public_storage_read(\n header: BlockHeader,\n address: AztecAddress,\n storage_slot: Field,\n ) -> T {\n let historical_block_number = header.global_variables.block_number as u32;\n\n // We could simply produce historical inclusion proofs for each field in `packed`, but that would require one\n // full sibling path per storage slot (since due to kernel siloing the storage is not contiguous). Instead, we\n // get an oracle to provide us the values, and instead we prove inclusion of their hash, which is both a much\n // smaller proof (a single slot), and also independent of the size of T (except in that we need to pack and hash T).\n let hint = WithHash::new(\n // Safety: We verify that a hash of the hint/packed data matches the stored hash.\n unsafe {\n oracle::storage::storage_read(address, storage_slot, historical_block_number)\n },\n );\n\n let hash = header.public_storage_historical_read(storage_slot + N as Field, address);\n\n if hash != 0 {\n assert_eq(hash, hint.get_hash(), \"Hint values do not match hash\");\n } else {\n // The hash slot can only hold a zero if it is uninitialized. Therefore, the hints must then be zero\n // (i.e. the default value for public storage) as well.\n assert_eq(\n hint.get_value(),\n T::unpack(std::mem::zeroed()),\n \"Non-zero hint for zero hash\",\n );\n };\n\n hint.get_value()\n }\n}\n\nimpl<T, let N: u32> Packable<N + 1> for WithHash<T, N>\nwhere\n T: Packable<N>,\n{\n fn pack(self) -> [Field; N + 1] {\n let mut result: [Field; N + 1] = std::mem::zeroed();\n for i in 0..N {\n result[i] = self.packed[i];\n }\n result[N] = self.hash;\n\n result\n }\n\n fn unpack(packed: [Field; N + 1]) -> Self {\n let mut value_packed: [Field; N] = std::mem::zeroed();\n for i in 0..N {\n value_packed[i] = packed[i];\n }\n let hash = packed[N];\n\n Self { value: T::unpack(value_packed), packed: value_packed, hash }\n }\n}\n\nmod test {\n use crate::{\n oracle::random::random,\n test::{\n helpers::{cheatcodes, test_environment::TestEnvironment},\n mocks::mock_struct::MockStruct,\n },\n utils::with_hash::WithHash,\n };\n use dep::protocol_types::hash::poseidon2_hash;\n use dep::protocol_types::traits::{Packable, ToField};\n use dep::std::{mem, test::OracleMock};\n\n global storage_slot: Field = 47;\n\n #[test]\n unconstrained fn create_and_recover() {\n let value = MockStruct { a: 5, b: 3 };\n let value_with_hash = WithHash::new(value);\n let recovered = WithHash::unpack(value_with_hash.pack());\n\n assert_eq(recovered.value, value);\n assert_eq(recovered.packed, value.pack());\n assert_eq(recovered.hash, poseidon2_hash(value.pack()));\n }\n\n #[test]\n unconstrained fn read_uninitialized_value() {\n let mut env = TestEnvironment::new();\n\n let block_header = env.private().historical_header;\n let address = env.contract_address();\n\n let result = WithHash::<MockStruct, _>::historical_public_storage_read(\n block_header,\n address,\n storage_slot,\n );\n\n // We should get zeroed value\n let expected: MockStruct = mem::zeroed();\n assert_eq(result, expected);\n }\n\n #[test]\n unconstrained fn read_initialized_value() {\n let mut env = TestEnvironment::new();\n\n let value = MockStruct { a: 5, b: 3 };\n let value_with_hash = WithHash::new(value);\n\n // We write the value with hash to storage\n cheatcodes::direct_storage_write(\n env.contract_address(),\n storage_slot,\n value_with_hash.pack(),\n );\n\n // We advance block by 1 because env.private() currently returns context at latest_block - 1\n env.advance_block_by(1);\n\n let result = WithHash::<MockStruct, _>::historical_public_storage_read(\n env.private().historical_header,\n env.contract_address(),\n storage_slot,\n );\n\n assert_eq(result, value);\n }\n\n #[test(should_fail_with = \"Non-zero hint for zero hash\")]\n unconstrained fn test_bad_hint_uninitialized_value() {\n let mut env = TestEnvironment::new();\n\n env.advance_block_to(6);\n\n let value_packed = MockStruct { a: 1, b: 1 }.pack();\n\n let block_header = env.private().historical_header;\n let address = env.contract_address();\n\n // Mock the oracle to return a non-zero hint/packed value\n let _ = OracleMock::mock(\"storageRead\")\n .with_params((\n address.to_field(), storage_slot, block_header.global_variables.block_number as u32,\n value_packed.len(),\n ))\n .returns(value_packed)\n .times(1);\n\n // This should revert because the hint value is non-zero and the hash is zero (default value of storage)\n let _ = WithHash::<MockStruct, _>::historical_public_storage_read(\n block_header,\n address,\n storage_slot,\n );\n }\n\n #[test(should_fail_with = \"Hint values do not match hash\")]\n unconstrained fn test_bad_hint_initialized_value() {\n let mut env = TestEnvironment::new();\n\n let value_packed = MockStruct { a: 5, b: 3 }.pack();\n\n // We write the value to storage\n cheatcodes::direct_storage_write(env.contract_address(), storage_slot, value_packed);\n\n // Now we write incorrect hash to the hash storage slot\n let incorrect_hash = random();\n let hash_storage_slot = storage_slot + (value_packed.len() as Field);\n cheatcodes::direct_storage_write(\n env.contract_address(),\n hash_storage_slot,\n [incorrect_hash],\n );\n\n // We advance block by 1 because env.private() currently returns context at latest_block - 1\n env.advance_block_by(1);\n\n let _ = WithHash::<MockStruct, _>::historical_public_storage_read(\n env.private().historical_header,\n env.contract_address(),\n storage_slot,\n );\n }\n}\n"
|
|
2882
2964
|
},
|
|
2883
2965
|
"24": {
|
|
2884
2966
|
"path": "std/hash/poseidon2.nr",
|
|
2885
2967
|
"source": "use crate::default::Default;\nuse crate::hash::Hasher;\n\ncomptime global 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, message_size != N)\n }\n\n pub 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 for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = crate::hash::poseidon2_permutation(self.state, 4);\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>(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let two_pow_64 = 18446744073709551616;\n let iv: Field = (in_len as Field) * two_pow_64;\n let mut sponge = Poseidon2::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if is_variable_length {\n sponge.absorb(1);\n }\n sponge.squeeze()\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"
|
|
2886
2968
|
},
|
|
2887
|
-
"
|
|
2888
|
-
"path": "/
|
|
2889
|
-
"source": "use crate::{\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{\n AZTEC_ADDRESS_LENGTH, GENERATOR_INDEX__CONTRACT_ADDRESS_V1, MAX_FIELD_VALUE,\n MAX_PROTOCOL_CONTRACTS,\n },\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, ToPoint, TpkM},\n traits::{Deserialize, Empty, FromField, Packable, Serialize, ToField},\n};\n\n// We do below because `use crate::point::Point;` does not work\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\n\nuse crate::public_keys::AddressPoint;\nuse
|
|
2969
|
+
"254": {
|
|
2970
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr",
|
|
2971
|
+
"source": "use crate::{\n address::{\n partial_address::PartialAddress, salted_initialization_hash::SaltedInitializationHash,\n },\n constants::{\n AZTEC_ADDRESS_LENGTH, GENERATOR_INDEX__CONTRACT_ADDRESS_V1, MAX_FIELD_VALUE,\n MAX_PROTOCOL_CONTRACTS,\n },\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, ToPoint, TpkM},\n traits::{Deserialize, Empty, FromField, Packable, Serialize, ToField},\n utils::field::{pow, sqrt},\n};\n\n// We do below because `use crate::point::Point;` does not work\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\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};\n\n// Aztec address\npub struct AztecAddress {\n pub inner: Field,\n}\n\nimpl Eq for AztecAddress {\n fn eq(self, other: Self) -> bool {\n self.to_field() == other.to_field()\n }\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 Serialize<AZTEC_ADDRESS_LENGTH> for AztecAddress {\n fn serialize(self: Self) -> [Field; AZTEC_ADDRESS_LENGTH] {\n [self.to_field()]\n }\n}\n\nimpl Deserialize<AZTEC_ADDRESS_LENGTH> for AztecAddress {\n fn deserialize(fields: [Field; AZTEC_ADDRESS_LENGTH]) -> Self {\n FromField::from_field(fields[0])\n }\n}\n\n/// We implement the Packable trait for AztecAddress because it can be stored in contract's storage (and there\n/// the implementation of Packable is required).\nimpl Packable<AZTEC_ADDRESS_LENGTH> for AztecAddress {\n fn pack(self) -> [Field; AZTEC_ADDRESS_LENGTH] {\n self.serialize()\n }\n\n fn unpack(fields: [Field; AZTEC_ADDRESS_LENGTH]) -> Self {\n Self::deserialize(fields)\n }\n}\n\nimpl AztecAddress {\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n\n pub fn to_address_point(self) -> AddressPoint {\n // We compute the address point by taking our address, setting it to x, and then solving for y in the\n // equation which defines our bn curve:\n // y^2 = x^3 - 17; x = address\n let x = self.inner;\n let y_squared = pow(x, 3) - 17;\n\n // TODO (#8970): Handle cases where we cannot recover a point from an address\n let mut y = sqrt(y_squared);\n\n // If we get a negative y coordinate (any y where y > MAX_FIELD_VALUE / 2), we pin it to the\n // positive one (any value where y <= MAX_FIELD_VALUE / 2) by subtracting it from the Field modulus\n // note: The field modulus is MAX_FIELD_VALUE + 1\n if (!(y.lt(MAX_FIELD_VALUE / 2) | y.eq(MAX_FIELD_VALUE / 2))) {\n y = (MAX_FIELD_VALUE + 1) - y;\n }\n\n AddressPoint { inner: Point { x: self.inner, y, is_infinite: false } }\n }\n\n pub fn compute(public_keys: PublicKeys, partial_address: PartialAddress) -> AztecAddress {\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 GENERATOR_INDEX__CONTRACT_ADDRESS_V1,\n );\n\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_protocol_contract(self) -> bool {\n self.inner.lt(MAX_PROTOCOL_CONTRACTS as Field)\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 compute_address_from_partial_and_pub_keys() {\n let public_keys = PublicKeys {\n npk_m: NpkM {\n inner: Point {\n x: 0x22f7fcddfa3ce3e8f0cc8e82d7b94cdd740afa3e77f8e4a63ea78a239432dcab,\n y: 0x0471657de2b6216ade6c506d28fbc22ba8b8ed95c871ad9f3e3984e90d9723a7,\n is_infinite: false,\n },\n },\n ivpk_m: IvpkM {\n inner: Point {\n x: 0x111223493147f6785514b1c195bb37a2589f22a6596d30bb2bb145fdc9ca8f1e,\n y: 0x273bbffd678edce8fe30e0deafc4f66d58357c06fd4a820285294b9746c3be95,\n is_infinite: false,\n },\n },\n ovpk_m: OvpkM {\n inner: Point {\n x: 0x09115c96e962322ffed6522f57194627136b8d03ac7469109707f5e44190c484,\n y: 0x0c49773308a13d740a7f0d4f0e6163b02c5a408b6f965856b6a491002d073d5b,\n is_infinite: false,\n },\n },\n tpk_m: TpkM {\n inner: Point {\n x: 0x00d3d81beb009873eb7116327cf47c612d5758ef083d4fda78e9b63980b2a762,\n y: 0x2f567d22d2b02fe1f4ad42db9d58a36afd1983e7e2909d1cab61cafedad6193a,\n is_infinite: false,\n },\n },\n };\n\n let partial_address = PartialAddress::from_field(\n 0x0a7c585381b10f4666044266a02405bf6e01fa564c8517d4ad5823493abd31de,\n );\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // The following value was generated by `derivation.test.ts`.\n // --> Run the test with AZTEC_GENERATE_TEST_DATA=1 flag to update test data.\n let expected_computed_address_from_partial_and_pubkeys =\n 0x24e4646f58b9fbe7d38e317db8d5636c423fbbdfbe119fc190fe9c64747e0c62;\n assert(address.to_field() == 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], GENERATOR_INDEX__CONTRACT_ADDRESS_V1);\n let expected_computed_preaddress_from_partial_and_pubkey =\n 0x23ce9be3fa3c846b0f9245cc796902e731d04f086e8a42473bb29e405fc98075;\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 assert_eq(Deserialize::deserialize(address.serialize()), address);\n}\n"
|
|
2890
2972
|
},
|
|
2891
|
-
"
|
|
2892
|
-
"path": "/
|
|
2973
|
+
"257": {
|
|
2974
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr",
|
|
2893
2975
|
"source": "use crate::{\n address::{aztec_address::AztecAddress, salted_initialization_hash::SaltedInitializationHash},\n constants::GENERATOR_INDEX__PARTIAL_ADDRESS,\n contract_class_id::ContractClassId,\n hash::poseidon2_hash_with_separator,\n traits::{Deserialize, Serialize, ToField},\n};\n\nglobal PARTIAL_ADDRESS_LENGTH: u32 = 1;\n\n// Partial address\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 Serialize<PARTIAL_ADDRESS_LENGTH> for PartialAddress {\n fn serialize(self: Self) -> [Field; PARTIAL_ADDRESS_LENGTH] {\n [self.to_field()]\n }\n}\n\nimpl Deserialize<PARTIAL_ADDRESS_LENGTH> for PartialAddress {\n fn deserialize(fields: [Field; PARTIAL_ADDRESS_LENGTH]) -> Self {\n PartialAddress { inner: fields[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 ) -> Self {\n PartialAddress::compute_from_salted_initialization_hash(\n contract_class_id,\n SaltedInitializationHash::compute(salt, initialization_hash, deployer),\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 GENERATOR_INDEX__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"
|
|
2894
2976
|
},
|
|
2895
|
-
"
|
|
2896
|
-
"path": "/
|
|
2977
|
+
"259": {
|
|
2978
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr",
|
|
2897
2979
|
"source": "use crate::{\n address::aztec_address::AztecAddress, constants::GENERATOR_INDEX__PARTIAL_ADDRESS,\n hash::poseidon2_hash_with_separator, traits::ToField,\n};\n\n// Salted initialization hash. Used in the computation of a partial address.\npub struct SaltedInitializationHash {\n pub inner: Field,\n}\n\nimpl ToField for SaltedInitializationHash {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl SaltedInitializationHash {\n pub fn from_field(field: Field) -> Self {\n Self { inner: field }\n }\n\n pub fn compute(salt: Field, initialization_hash: Field, deployer: AztecAddress) -> Self {\n SaltedInitializationHash::from_field(poseidon2_hash_with_separator(\n [salt, initialization_hash, deployer.to_field()],\n GENERATOR_INDEX__PARTIAL_ADDRESS,\n ))\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n"
|
|
2898
2980
|
},
|
|
2899
|
-
"
|
|
2900
|
-
"path": "/
|
|
2981
|
+
"263": {
|
|
2982
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/contract_class_id.nr",
|
|
2901
2983
|
"source": "use crate::constants::GENERATOR_INDEX__CONTRACT_LEAF;\nuse crate::traits::{Deserialize, Empty, FromField, Packable, Serialize, ToField};\n\npub struct ContractClassId {\n pub inner: Field,\n}\n\nimpl Eq for ContractClassId {\n fn eq(self, other: ContractClassId) -> bool {\n other.inner == self.inner\n }\n}\n\nimpl ToField for ContractClassId {\n fn to_field(self) -> Field {\n self.inner\n }\n}\n\nimpl FromField for ContractClassId {\n fn from_field(value: Field) -> Self {\n Self { inner: value }\n }\n}\n\nimpl Serialize<1> for ContractClassId {\n fn serialize(self: Self) -> [Field; 1] {\n [self.inner]\n }\n}\n\nimpl Deserialize<1> for ContractClassId {\n fn deserialize(fields: [Field; 1]) -> Self {\n Self { inner: fields[0] }\n }\n}\n\nimpl Empty for ContractClassId {\n fn empty() -> Self {\n Self { inner: 0 }\n }\n}\n\n// Implement the Packable trait so ContractClassId can be stored in contract's storage.\nimpl Packable<1> for ContractClassId {\n fn pack(self) -> [Field; 1] {\n self.serialize()\n }\n\n fn unpack(fields: [Field; 1]) -> Self {\n Self::deserialize(fields)\n }\n}\n\nimpl ContractClassId {\n pub fn compute(\n artifact_hash: Field,\n private_functions_root: Field,\n public_bytecode_commitment: Field,\n ) -> Self {\n let hash = crate::hash::poseidon2_hash_with_separator(\n [artifact_hash, private_functions_root, public_bytecode_commitment],\n GENERATOR_INDEX__CONTRACT_LEAF,\n ); // TODO(@spalladino): Update generator index\n ContractClassId::from_field(hash)\n }\n\n pub fn assert_is_zero(self) {\n assert(self.to_field() == 0);\n }\n}\n"
|
|
2902
2984
|
},
|
|
2903
|
-
"
|
|
2904
|
-
"path": "/
|
|
2985
|
+
"271": {
|
|
2986
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/debug_log.nr",
|
|
2905
2987
|
"source": "/// Utility function to console.log data in the acir simulator.\n/// Example:\n/// debug_log(\"blah blah this is a debug string\");\npub fn debug_log<let N: u32>(msg: str<N>) {\n debug_log_format(msg, []);\n}\n\n/// Utility function to console.log data in the acir simulator. This variant receives a format string in which the\n/// `${k}` tokens will be replaced with the k-eth value in the `args` array.\n/// Examples:\n/// debug_log_format(\"get_2(slot:{0}) =>\\n\\t0:{1}\\n\\t1:{2}\", [storage_slot, note0_hash, note1_hash]);\n/// debug_log_format(\"whole array: {}\", [e1, e2, e3, e4]);\npub fn debug_log_format<let M: u32, let N: u32>(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 { debug_log_oracle_wrapper(msg, args) };\n}\n\npub unconstrained fn debug_log_oracle_wrapper<let M: u32, let N: u32>(\n msg: str<M>,\n args: [Field; N],\n) {\n debug_log_oracle(msg, args.as_slice());\n}\n\n// WARNING: sometimes when using debug logs the ACVM errors with: `thrown: \"solver opcode resolution error: cannot solve opcode: expression has too many unknowns x155\"`\n#[oracle(debugLog)]\nunconstrained fn debug_log_oracle<let M: u32>(_msg: str<M>, args: [Field]) {}\n"
|
|
2906
2988
|
},
|
|
2907
|
-
"
|
|
2908
|
-
"path": "/
|
|
2989
|
+
"272": {
|
|
2990
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr",
|
|
2909
2991
|
"source": "use crate::{\n abis::{\n contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage,\n contract_class_log::ContractClassLog,\n function_selector::FunctionSelector,\n note_hash::ScopedNoteHash,\n nullifier::ScopedNullifier,\n private_log::{PrivateLog, PrivateLogData},\n side_effect::{OrderedValue, scoped::Scoped},\n },\n address::{AztecAddress, EthAddress},\n constants::{\n FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER,\n GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH, TWO_POW_64,\n },\n merkle_tree::root::root_from_sibling_path,\n messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message},\n poseidon2::Poseidon2Sponge,\n traits::{FromField, Hash, ToField},\n utils::{\n arrays::{array_concat, unsafe_padded_array_length},\n field::{field_from_bytes, field_from_bytes_32_trunc},\n },\n};\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\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 GENERATOR_INDEX__NOTE_HASH_NONCE,\n )\n}\n\npub fn compute_unique_note_hash(nonce: Field, siloed_note_hash: Field) -> Field {\n let inputs = [nonce, siloed_note_hash];\n poseidon2_hash_with_separator(inputs, GENERATOR_INDEX__UNIQUE_NOTE_HASH)\n}\n\npub fn compute_siloed_note_hash(app: AztecAddress, note_hash: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), note_hash],\n GENERATOR_INDEX__SILOED_NOTE_HASH,\n )\n}\n\n/// Computes unique note hashes from siloed note hashes\npub fn compute_unique_siloed_note_hash(\n siloed_note_hash: Field,\n first_nullifier: Field,\n note_index_in_tx: u32,\n) -> Field {\n if siloed_note_hash == 0 {\n 0\n } else {\n let nonce = compute_note_hash_nonce(first_nullifier, note_index_in_tx);\n compute_unique_note_hash(nonce, siloed_note_hash)\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 silo_note_hash(note_hash: ScopedNoteHash) -> Field {\n if note_hash.contract_address.is_zero() {\n 0\n } else {\n compute_siloed_note_hash(note_hash.contract_address, note_hash.value())\n }\n}\n\npub fn compute_siloed_nullifier(app: AztecAddress, nullifier: Field) -> Field {\n poseidon2_hash_with_separator(\n [app.to_field(), nullifier],\n GENERATOR_INDEX__OUTER_NULLIFIER,\n )\n}\n\npub fn silo_nullifier(nullifier: ScopedNullifier) -> Field {\n if nullifier.contract_address.is_zero() {\n nullifier.value() // Return value instead of 0 because the first nullifier's contract address is zero.\n } else {\n compute_siloed_nullifier(nullifier.contract_address, nullifier.value())\n }\n}\n\npub fn compute_siloed_private_log_field(contract_address: AztecAddress, field: Field) -> Field {\n poseidon2_hash([contract_address.to_field(), field])\n}\n\npub fn silo_private_log(private_log: Scoped<PrivateLogData>) -> PrivateLog {\n if private_log.contract_address.is_zero() {\n private_log.inner.log\n } else {\n let mut fields = private_log.inner.log.fields;\n fields[0] = compute_siloed_private_log_field(private_log.contract_address, fields[0]);\n PrivateLog { fields }\n }\n}\n\nfn compute_siloed_contract_class_log_field(\n contract_address: AztecAddress,\n first_field: Field,\n) -> Field {\n poseidon2_hash([contract_address.to_field(), first_field])\n}\n\npub fn silo_contract_class_log(contract_class_log: ContractClassLog) -> ContractClassLog {\n if contract_class_log.contract_address.is_zero() {\n contract_class_log\n } else {\n let mut log = contract_class_log;\n log.log.fields[0] = compute_siloed_contract_class_log_field(\n contract_class_log.contract_address,\n log.log.fields[0],\n );\n log\n }\n}\n\npub fn compute_contract_class_log_hash(contract_class_log: ContractClassLog) -> Field {\n let array = contract_class_log.log.fields;\n // Safety: The below length is constrained in the base rollup.\n let length = unsafe { unsafe_padded_array_length(array) };\n if length == 0 {\n 0\n } else {\n poseidon2_hash(array)\n }\n}\n\npub fn merkle_hash(left: Field, right: Field) -> Field {\n poseidon2_hash([left, right])\n}\n\npub fn compute_l2_to_l1_hash(\n contract_address: AztecAddress,\n recipient: EthAddress,\n content: Field,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n let mut bytes: [u8; 160] = std::mem::zeroed();\n\n let inputs =\n [contract_address.to_field(), rollup_version_id, recipient.to_field(), chain_id, content];\n for i in 0..5 {\n // TODO are bytes be in fr.to_buffer() ?\n let item_bytes: [u8; 32] = inputs[i].to_be_bytes();\n for j in 0..32 {\n bytes[32 * i + j] = item_bytes[j];\n }\n }\n\n sha256_to_field(bytes)\n}\n\npub fn silo_l2_to_l1_message(\n msg: ScopedL2ToL1Message,\n rollup_version_id: Field,\n chain_id: Field,\n) -> Field {\n if msg.contract_address.is_zero() {\n 0\n } else {\n compute_l2_to_l1_hash(\n msg.contract_address,\n msg.message.recipient,\n msg.message.content,\n rollup_version_id,\n chain_id,\n )\n }\n}\n\n// Computes sha256 hash of 2 input hashes.\n//\n// NB: This method now takes in two 31 byte fields - it assumes that any input\n// is the result of a sha_to_field hash and => is truncated\n//\n// TODO(Jan and David): This is used for the encrypted_log hashes.\n// Can we check to see if we can just use hash_to_field or pedersen_compress here?\n//\npub fn accumulate_sha256(input: [Field; 2]) -> Field {\n // This is a note about the cpp code, since it takes an array of Fields\n // instead of a u128.\n // 4 Field elements when converted to bytes will usually\n // occupy 4 * 32 = 128 bytes.\n // However, this function is making the assumption that each Field\n // only occupies 128 bits.\n //\n // TODO(David): This does not seem to be getting guaranteed anywhere in the code?\n // Concatentate two fields into 32x2 = 64 bytes\n // accumulate_sha256 assumes that the inputs are pre-truncated 31 byte numbers\n let mut hash_input_flattened = [0; 64];\n for offset in 0..input.len() {\n let input_as_bytes: [u8; 32] = input[offset].to_be_bytes();\n for byte_index in 0..32 {\n hash_input_flattened[offset * 32 + byte_index] = input_as_bytes[byte_index];\n }\n }\n\n sha256_to_field(hash_input_flattened)\n}\n\npub fn verification_key_hash<let N: u32>(key: [Field; N]) -> Field {\n crate::hash::poseidon2_hash(key)\n}\n\n#[inline_always]\npub fn pedersen_hash<let N: u32>(inputs: [Field; N], hash_index: u32) -> Field {\n std::hash::pedersen_hash_with_separator(inputs, hash_index)\n}\n\npub fn poseidon2_hash<let N: u32>(inputs: [Field; N]) -> Field {\n std::hash::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 = array_concat([separator.to_field()], inputs);\n poseidon2_hash(inputs_with_separator)\n}\n\n// Performs a fixed length hash with a subarray of the given input.\n// Useful for SpongeBlob in which we aborb M things and want to check it vs a hash of M elts of an N-len array.\n// Using stdlib poseidon, this will always absorb an extra 1 as a 'variable' hash, and not match spongeblob.squeeze()\n// or any ts implementation. Also checks that any remaining elts not hashed are empty.\n#[no_predicates]\npub fn poseidon2_hash_subarray<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let mut sponge = poseidon2_absorb_chunks(input, in_len, false);\n sponge.squeeze()\n}\n\n// NB the below is the same as std::hash::poseidon2::Poseidon2::hash(), but replacing a range check with a bit check,\n// and absorbing in chunks of 3 below.\n#[no_predicates]\npub fn poseidon2_cheaper_variable_hash<let N: u32>(input: [Field; N], in_len: u32) -> Field {\n let mut sponge = poseidon2_absorb_chunks(input, in_len, true);\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if in_len != N {\n sponge.absorb(1);\n }\n sponge.squeeze()\n}\n\n// The below fn reduces gates of a conditional poseidon2 hash by approx 3x (thank you ~* Giant Brain Dev @IlyasRidhuan *~ for the idea)\n// Why? Because when we call stdlib poseidon, we call absorb for each item. When absorbing is conditional, it seems the compiler does not know\n// what cache_size will be when calling absorb, so it assigns the permutation gates for /each i/ rather than /every 3rd i/, which is actually required.\n// The below code forces the compiler to:\n// - absorb normally up to 2 times to set cache_size to 1\n// - absorb in chunks of 3 to ensure perm. only happens every 3rd absorb\n// - absorb normally up to 2 times to add any remaining values to the hash\n// In fixed len hashes, the compiler is able to tell that it will only need to perform the permutation every 3 absorbs.\n// NB: it also replaces unnecessary range checks (i < thing) with a bit check (&= i != thing), which alone reduces the gates of a var. hash by half.\n\n#[no_predicates]\nfn poseidon2_absorb_chunks<let N: u32>(\n input: [Field; N],\n in_len: u32,\n variable: bool,\n) -> Poseidon2Sponge {\n let iv: Field = (in_len as Field) * TWO_POW_64;\n let mut sponge = Poseidon2Sponge::new(iv);\n // Even though shift is always 1 here, if we input in_len = 0 we get an underflow\n // since we cannot isolate computation branches. The below is just to avoid that.\n let shift = if in_len == 0 { 0 } else { 1 };\n if in_len != 0 {\n // cache_size = 0, init absorb\n sponge.cache[0] = input[0];\n sponge.cache_size = 1;\n // shift = num elts already added to make cache_size 1 = 1 for a fresh sponge\n // M = max_chunks = (N - 1 - (N - 1) % 3) / 3: (must be written as a fn of N to compile)\n // max_remainder = (N - 1) % 3;\n // max_chunks = (N - 1 - max_remainder) / 3;\n sponge = poseidon2_absorb_chunks_loop::<N, (N - 1 - (N - 1) % 3) / 3>(\n sponge,\n input,\n in_len,\n variable,\n shift,\n );\n }\n sponge\n}\n\n// NB: If it's not required to check that the non-absorbed elts of 'input' are 0s, set skip_0_check=true\n#[no_predicates]\npub fn poseidon2_absorb_chunks_existing_sponge<let N: u32>(\n in_sponge: Poseidon2Sponge,\n input: [Field; N],\n in_len: u32,\n skip_0_check: bool,\n) -> Poseidon2Sponge {\n let mut sponge = in_sponge;\n // 'shift' is to account for already added inputs\n let mut shift = 0;\n // 'stop' is to avoid an underflow when inputting in_len = 0\n let mut stop = false;\n for i in 0..3 {\n if shift == in_len {\n stop = true;\n }\n if (sponge.cache_size != 1) & (!stop) {\n sponge.absorb(input[i]);\n shift += 1;\n }\n }\n sponge = if stop {\n sponge\n } else {\n // max_chunks = (N - (N % 3)) / 3;\n poseidon2_absorb_chunks_loop::<N, (N - (N % 3)) / 3>(\n sponge,\n input,\n in_len,\n skip_0_check,\n shift,\n )\n };\n sponge\n}\n\n// The below is the loop to absorb elts into a poseidon sponge in chunks of 3\n// shift - the num of elts already absorbed to ensure the sponge's cache_size = 1\n// M - the max number of chunks required to absorb N things (must be comptime to compile)\n// NB: The 0 checks ('Found non-zero field...') are messy, but having a separate loop over N to check\n// for 0s costs 3N gates. Current approach is approx 2N gates.\n#[no_predicates]\nfn poseidon2_absorb_chunks_loop<let N: u32, let M: u32>(\n in_sponge: Poseidon2Sponge,\n input: [Field; N],\n in_len: u32,\n variable: bool,\n shift: u32,\n) -> Poseidon2Sponge {\n assert(in_len <= N, \"Given in_len to absorb is larger than the input array len\");\n // When we have an existing sponge, we may have a shift of 0, and the final 'k+2' below = N\n // The below avoids an overflow\n let skip_last = 3 * M == N;\n // Writing in_sponge: &mut does not compile\n let mut sponge = in_sponge;\n let mut should_add = true;\n // The num of things left over after absorbing in 3s\n let remainder = (in_len - shift) % 3;\n // The num of chunks of 3 to absorb (maximum M)\n let chunks = (in_len - shift - remainder) / 3;\n for i in 0..M {\n // Now we loop through cache size = 1 -> 3\n should_add &= i != chunks;\n // This is the index at the start of the chunk (for readability)\n let k = 3 * i + shift;\n if should_add {\n // cache_size = 1, 2 => just assign\n sponge.cache[1] = input[k];\n sponge.cache[2] = input[k + 1];\n // cache_size = 3 => duplex + perm\n for j in 0..3 {\n sponge.state[j] += sponge.cache[j];\n }\n sponge.state = std::hash::poseidon2_permutation(sponge.state, 4);\n sponge.cache[0] = input[k + 2];\n // cache_size is now 1 again, repeat loop\n } else if (!variable) & (i != chunks) {\n // if we are hashing a fixed len array which is a subarray, we check the remaining elts are 0\n // NB: we don't check at i == chunks, because that chunk contains elts to be absorbed or checked below\n let last_0 = if (i == M - 1) & (skip_last) {\n 0\n } else {\n input[k + 2]\n };\n let all_0 = (input[k] == 0) & (input[k + 1] == 0) & (last_0 == 0);\n assert(all_0, \"Found non-zero field after breakpoint\");\n }\n }\n // we have 'remainder' num of items left to absorb\n should_add = true;\n // below is to avoid overflows (i.e. if inlen is close to N)\n let mut should_check = !variable;\n for i in 0..3 {\n should_add &= i != remainder;\n should_check &= in_len - remainder + i != N;\n if should_add {\n // we want to absorb the final 'remainder' items\n sponge.absorb(input[in_len - remainder + i]);\n } else if should_check {\n assert(input[in_len - remainder + i] == 0, \"Found non-zero field after breakpoint\");\n }\n }\n sponge\n}\n\npub fn poseidon2_hash_with_separator_slice<T>(inputs: [Field], separator: T) -> 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[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 poseidon_chunks_matches_fixed() {\n let in_len = 501;\n let mut input: [Field; 4096] = [0; 4096];\n let mut fixed_input = [3; 501];\n assert(in_len == fixed_input.len()); // sanity check\n for i in 0..in_len {\n input[i] = 3;\n }\n let sub_chunk_hash = poseidon2_hash_subarray(input, in_len);\n let fixed_len_hash = std::hash::poseidon2::Poseidon2::hash(fixed_input, fixed_input.len());\n assert(sub_chunk_hash == fixed_len_hash);\n}\n\n#[test]\nfn poseidon_chunks_matches_variable() {\n let in_len = 501;\n let mut input: [Field; 4096] = [0; 4096];\n for i in 0..in_len {\n input[i] = 3;\n }\n let variable_chunk_hash = poseidon2_cheaper_variable_hash(input, in_len);\n let variable_len_hash = std::hash::poseidon2::Poseidon2::hash(input, in_len);\n assert(variable_chunk_hash == variable_len_hash);\n}\n\n#[test]\nfn existing_sponge_poseidon_chunks_matches_fixed() {\n let in_len = 501;\n let mut input: [Field; 4096] = [0; 4096];\n let mut fixed_input = [3; 501];\n assert(in_len == fixed_input.len()); // sanity check\n for i in 0..in_len {\n input[i] = 3;\n }\n // absorb 250 of the 501 things\n let empty_sponge = Poseidon2Sponge::new((in_len as Field) * TWO_POW_64);\n let first_sponge = poseidon2_absorb_chunks_existing_sponge(empty_sponge, input, 250, true);\n // now absorb the final 251 (since they are all 3s, im being lazy and not making a new array)\n let mut final_sponge = poseidon2_absorb_chunks_existing_sponge(first_sponge, input, 251, true);\n let fixed_len_hash = Poseidon2Sponge::hash(fixed_input, fixed_input.len());\n assert(final_sponge.squeeze() == fixed_len_hash);\n}\n\n#[test]\nfn poseidon_chunks_empty_inputs() {\n let in_len = 0;\n let mut input: [Field; 4096] = [0; 4096];\n let mut constructed_empty_sponge = poseidon2_absorb_chunks(input, in_len, true);\n let mut first_sponge =\n poseidon2_absorb_chunks_existing_sponge(constructed_empty_sponge, input, in_len, true);\n assert(first_sponge.squeeze() == constructed_empty_sponge.squeeze());\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 compute_l2_l1_hash() {\n // All zeroes\n let hash_result =\n compute_l2_to_l1_hash(AztecAddress::from_field(0), EthAddress::zero(), 0, 0, 0);\n assert(hash_result == 0xb393978842a0fa3d3e1470196f098f473f9678e72463cb65ec4ab5581856c2);\n\n // Non-zero case\n let hash_result = compute_l2_to_l1_hash(\n AztecAddress::from_field(1),\n EthAddress::from_field(3),\n 5,\n 2,\n 4,\n );\n assert(hash_result == 0x3f88c1044a05e5340ed20466276500f6d45ca5603913b9091e957161734e16);\n}\n\n#[test]\nfn silo_l2_to_l1_message_matches_typescript() {\n let version = 4;\n let chainId = 5;\n\n let hash = silo_l2_to_l1_message(\n ScopedL2ToL1Message {\n message: L2ToL1Message { recipient: EthAddress::from_field(1), content: 2, counter: 0 },\n contract_address: AztecAddress::from_field(3),\n },\n version,\n chainId,\n );\n\n // The following value was generated by `l2_to_l1_message.test.ts`\n let hash_from_typescript = 0x00c6155d69febb9d5039b374dd4f77bf57b7c881709aa524a18acaa0bd57476a;\n\n assert_eq(hash, hash_from_typescript);\n}\n"
|
|
2910
2992
|
},
|
|
2911
|
-
"
|
|
2912
|
-
"path": "/
|
|
2913
|
-
"source": "use super::traits::{Deserialize, Packable, Serialize};\n\n/// Returns the typed expression of a trait method implementation.\n///\n/// This helper function is preferred over directly inlining with `$typ::target_method()` in a quote,\n/// as direct inlining would result in missing import warnings in the generated code (specifically,\n/// warnings that the trait implementation is not in scope).\n///\n/// # Note\n/// A copy of this function exists in `aztec-nr/aztec/src/macros/utils.nr`. We maintain separate copies\n/// because importing it there from here would cause the `target_trait` to be interpreted in the context\n/// of this crate, making it impossible to compile code for traits from that crate (e.g. NoteType).\ncomptime fn get_trait_impl_method(\n typ: Type,\n target_trait: Quoted,\n target_method: Quoted,\n) -> TypedExpr {\n let trait_constraint = target_trait.as_trait_constraint();\n typ\n .get_trait_impl(trait_constraint)\n .expect(f\"Could not find impl for {target_trait} for type {typ}\")\n .methods()\n .filter(|m| m.name() == target_method)[0]\n .as_typed_expr()\n}\n\n/// Generates code that deserializes a struct, primitive type, array or string from a field array.\n///\n/// # Parameters\n/// - `name`: The name of the current field being processed, used to identify fields for replacement.\n/// - `typ`: The type of the struct or field being deserialized (e.g., a custom struct, array, or primitive).\n/// - `field_array_name`: The name of the field array containing serialized field data (e.g., `\"values\"`).\n/// - `num_already_consumed`: The number of fields already processed in previous recursion calls.\n/// - `should_unpack`: A boolean indicating whether the type should be unpacked (see description of `Packable`\n/// and `Serialize` trait for more information about the difference between packing and serialization).\n///\n/// # Returns\n/// A tuple containing:\n/// - `Quoted`: A code that deserializes a given struct, primitive type, array, or string from the field array.\n/// - `u32`: The total number of fields consumed during deserialization (used for recursion).\n///\n/// # Nested Struct Example\n/// Given the following setup:\n/// ```\n/// struct UintNote {\n/// value: u128,\n/// owner: AztecAddress,\n/// randomness: Field,\n/// }\n///\n/// struct AztecAddress {\n/// inner: Field,\n/// }\n/// ```\n///\n/// If `UintNote` is the input type, the function will generate the following deserialization code:\n/// ```\n/// UintNote {\n/// value: fields[0] as u128,\n/// owner: AztecAddress {\n/// inner: fields[1],\n/// },\n/// randomness: fields[2],\n/// }\n/// ```\n/// # Nested Struct Example with Unpacking\n/// - given the same setup as above and given that u128, AztecAddress and Field implement the `Packable` trait\n/// the result we get is:\n/// ```\n/// UintNote {\n/// value: aztec::protocol_types::traits::Packable::unpack([fields[0]]),\n/// owner: aztec::protocol_types::traits::Packable::unpack([fields[1]]),\n/// randomness: aztec::protocol_types::traits::Packable::unpack([fields[2]]),\n/// }\n/// ```\n///\n/// # Panics\n/// - If the deserialization logic encounters a type it does not support.\n/// - If an incorrect number of fields are consumed when deserializing a string.\npub comptime fn generate_deserialize_from_fields(\n name: Quoted,\n typ: Type,\n field_array_name: Quoted,\n num_already_consumed: u32,\n should_unpack: bool,\n) -> (Quoted, u32) {\n let mut result = quote {};\n // Counter for the number of fields consumed\n let mut consumed_counter: u32 = 0;\n\n // If the type implements `Packable`, its length will be assigned to the `maybe_packed_len_typ` variable.\n let maybe_packed_len_typ = std::meta::typ::fresh_type_variable();\n let packable_constraint = quote { Packable<$maybe_packed_len_typ> }.as_trait_constraint();\n\n if (should_unpack & typ.implements(packable_constraint)) {\n // Unpacking is enabled and the given type implements the `Packable` trait so we call the `unpack()`\n // method, add the resulting field array to `aux_vars` and each field to `fields`.\n let packed_len = maybe_packed_len_typ.as_constant().unwrap();\n\n // We copy the packed fields into a new array and pass that to the unpack function in a quote\n let mut packed_fields_quotes = &[];\n for i in 0..packed_len {\n let index_in_field_array = i + num_already_consumed;\n packed_fields_quotes =\n packed_fields_quotes.push_back(quote { $field_array_name[$index_in_field_array] });\n }\n let packed_fields = packed_fields_quotes.join(quote {,});\n\n // Now we call unpack on the type\n let unpack_method = get_trait_impl_method(typ, quote { Packable<_> }, quote { unpack });\n result = quote { $unpack_method([ $packed_fields ]) };\n\n consumed_counter = packed_len;\n } else if typ.is_field() | typ.as_integer().is_some() | typ.is_bool() {\n // The field is a primitive so we just reference it in the field array\n result = quote { $field_array_name[$num_already_consumed] as $typ };\n consumed_counter = 1;\n } else if typ.as_struct().is_some() {\n // The field is a struct so we iterate over each struct field and recursively call\n // `generate_deserialize_from_fields`\n let (nested_def, generics) = typ.as_struct().unwrap();\n let nested_name = nested_def.name();\n let mut deserialized_fields_list = &[];\n\n // Iterate over each field in the struct\n for field in nested_def.fields(generics) {\n let (field_name, field_type) = field;\n // Recursively call `generate_deserialize_from_fields` for each field in the struct\n let (deserialized_field, num_consumed_in_recursion) = generate_deserialize_from_fields(\n field_name,\n field_type,\n field_array_name,\n consumed_counter + num_already_consumed,\n should_unpack,\n );\n // We increment the consumed counter by the number of fields consumed in the recursion\n consumed_counter += num_consumed_in_recursion;\n // We add the deserialized field to the list of deserialized fields.\n // E.g. `value: u128 { lo: fields[0], hi: fields[1] }`\n deserialized_fields_list =\n deserialized_fields_list.push_back(quote { $field_name: $deserialized_field });\n }\n\n // We can construct the struct from the deserialized fields\n let deserialized_fields = deserialized_fields_list.join(quote {,});\n result = quote {\n $nested_name {\n $deserialized_fields\n }\n };\n } else if typ.as_array().is_some() {\n // The field is an array so we iterate over each element and recursively call\n // `generate_deserialize_from_fields`\n let (element_type, array_len) = typ.as_array().unwrap();\n let array_len = array_len.as_constant().unwrap();\n let mut array_fields_list = &[];\n\n // Iterate over each element in the array\n for _ in 0..array_len {\n // Recursively call `generate_deserialize_from_fields` for each element in the array\n let (deserialized_field, num_consumed_in_recursion) = generate_deserialize_from_fields(\n name,\n element_type,\n field_array_name,\n consumed_counter + num_already_consumed,\n should_unpack,\n );\n // We increment the consumed counter by the number of fields consumed in the recursion\n consumed_counter += num_consumed_in_recursion;\n // We add the deserialized field to the list of deserialized fields.\n array_fields_list = array_fields_list.push_back(deserialized_field);\n }\n\n // We can construct the array from the deserialized fields\n let array_fields = array_fields_list.join(quote {,});\n result = quote { [ $array_fields ] };\n } else if typ.as_str().is_some() {\n // The field is a string and we expect each byte of the string to be represented as 1 field in the field\n // array. So we iterate over the string length and deserialize each character as u8 in the recursive call\n // to `generate_deserialize_from_fields`.\n let length_type = typ.as_str().unwrap();\n let str_len = length_type.as_constant().unwrap();\n let mut byte_list = &[];\n\n // Iterate over each character in the string\n for _ in 0..str_len {\n // Recursively call `generate_deserialize_from_fields` for each character in the string\n let (deserialized_field, num_consumed_in_recursion) = generate_deserialize_from_fields(\n name,\n quote {u8}.as_type(),\n field_array_name,\n consumed_counter + num_already_consumed,\n should_unpack,\n );\n\n // We should consume just one field in the recursion so we sanity check that\n assert_eq(\n num_consumed_in_recursion,\n 1,\n \"Incorrect number of fields consumed in string deserialization\",\n );\n\n // We increment the consumed counter by 1 as we have consumed one field\n consumed_counter += 1;\n\n // We add the deserialized field to the list of deserialized fields.\n // E.g. `fields[6] as u8`\n byte_list = byte_list.push_back(deserialized_field);\n }\n\n // We construct the string from the deserialized fields\n let bytes = byte_list.join(quote {,});\n result = quote { [ $bytes ].as_str_unchecked() };\n } else {\n panic(\n f\"Unsupported type for serialization of argument {name} and type {typ}\",\n )\n }\n\n (result, consumed_counter)\n}\n\n/// Generates code that serializes a type into an array of fields. Also generates auxiliary variables if necessary\n/// for serialization. If `should_pack` is true, we check if the type implements the `Packable` trait and pack it\n/// if it does.\n///\n/// # Parameters\n/// - `name`: The base identifier (e.g., `self`, `some_var`).\n/// - `typ`: The type being serialized (e.g., a custom struct, array, or primitive type).\n/// - `omit`: A list of field names (as `Quoted`) to be excluded from the serialized output.\n/// - `should_pack`: A boolean indicating whether the type should be packed.\n///\n/// # Returns\n/// A tuple containing:\n/// - A flattened array of `Quoted` field references representing the serialized fields.\n/// - An array of `Quoted` auxiliary variables needed for serialization, such as byte arrays for strings.\n///\n/// # Examples\n///\n/// ## Struct\n/// Given the following struct:\n/// ```rust\n/// struct MockStruct {\n/// a: Field,\n/// b: Field,\n/// }\n/// ```\n///\n/// Serializing the struct:\n/// ```rust\n/// generate_serialize_to_fields(quote { my_mock_struct }, MockStruct, &[], false)\n/// // Returns:\n/// // ([`my_mock_struct.a`, `my_mock_struct.b`], [])\n/// ```\n///\n/// ## Nested Struct\n/// For a more complex struct:\n/// ```rust\n/// struct NestedStruct {\n/// m1: MockStruct,\n/// m2: MockStruct,\n/// }\n/// ```\n///\n/// Serialization output:\n/// ```rust\n/// generate_serialize_to_fields(quote { self }, NestedStruct, &[], false)\n/// // Returns:\n/// // ([`self.m1.a`, `self.m1.b`, `self.m2.a`, `self.m2.b`], [])\n/// ```\n///\n/// ## Array\n/// For an array type:\n/// ```rust\n/// generate_serialize_to_fields(quote { my_array }, [Field; 3], &[], false)\n/// // Returns:\n/// // ([`my_array[0]`, `my_array[1]`, `my_array[2]`], [])\n/// ```\n///\n/// ## String\n/// For a string field, where each character is serialized as a `Field`:\n/// ```rust\n/// generate_serialize_to_fields(quote { my_string }, StringType, &[], false)\n/// // Returns:\n/// // ([`my_string_as_bytes[0] as Field`, `my_string_as_bytes[1] as Field`, ...],\n/// // [`let my_string_as_bytes = my_string.as_bytes()`])\n/// ```\n///\n/// ## Nested Struct with Omitted Field and packing enabled\n/// - u128 has a `Packable` implementation hence it will be packed.\n///\n/// For a more complex struct:\n/// ```rust\n/// struct MyStruct {\n/// value: u128,\n/// value2: Field,\n/// }\n/// ```\n///\n/// Serializing while omitting `value2`:\n/// ```rust\n/// generate_serialize_to_fields(quote { self }, MyStruct, &[quote { self.value2 }], true)\n/// // Returns:\n/// // ([`value_packed[0]`], [`let value_packed = self.value.pack()`])\n/// ```\n///\n/// # Panics\n/// - If the type is unsupported for serialization.\n/// - If the provided `typ` contains invalid constants or incompatible structures.\npub comptime fn generate_serialize_to_fields(\n name: Quoted,\n typ: Type,\n omit: [Quoted],\n should_pack: bool,\n) -> ([Quoted], [Quoted]) {\n let mut fields = &[];\n let mut aux_vars = &[];\n\n // Proceed if none of the omit rules omits this name\n if !omit.any(|to_omit| to_omit == name) {\n // If the type implements `Packable`, its length will be assigned to the `maybe_packed_len_typ` variable.\n let maybe_packed_len_typ = std::meta::typ::fresh_type_variable();\n let packable_constraint =\n quote { crate::traits::Packable<$maybe_packed_len_typ> }.as_trait_constraint();\n\n if (should_pack & typ.implements(packable_constraint)) {\n // Packing is enabled and the given type implements the `Packable` trait so we call the `pack()`\n // method, add the resulting field array to `aux_vars` and each field to `fields`.\n let packed_len = maybe_packed_len_typ.as_constant().unwrap();\n\n // We collapse the name to a one that gets tokenized as a single token (e.g. \"self.value\" -> \"self_value\").\n let name_at_one_token = collapse_to_one_token(name);\n let packed_struct_name = f\"{name_at_one_token}_aux_var\".quoted_contents();\n\n // We add the individual fields to the fields array\n let pack_method = get_trait_impl_method(\n typ,\n quote { crate::traits::Packable<$packed_len> },\n quote { pack },\n );\n let packed_struct = quote { let $packed_struct_name = $pack_method($name) };\n for i in 0..packed_len {\n fields = fields.push_back(quote { $packed_struct_name[$i] });\n }\n\n // We add the new auxiliary variable to the aux_vars array\n aux_vars = aux_vars.push_back(packed_struct);\n } else if typ.is_field() {\n // For field we just add the value to fields\n fields = fields.push_back(name);\n } else if typ.as_integer().is_some() | typ.is_bool() {\n // For integer and bool we just cast to Field and add the value to fields\n fields = fields.push_back(quote { $name as Field });\n } else if typ.as_struct().is_some() {\n // For struct we pref\n let nested_struct = typ.as_struct().unwrap();\n let params = nested_struct.0.fields(nested_struct.1);\n let struct_flattened = params.map(|(param_name, param_type): (Quoted, Type)| {\n let maybe_prefixed_name = if name == quote {} {\n // Triggered when the param name is of a value available in the current scope (e.g. a function\n // argument) --> then we don't prefix the name with anything.\n param_name\n } else {\n // Triggered when we want to prefix the param name with the `name` from function input. This\n // can typically be `self` when implementing a method on a struct.\n quote { $name.$param_name }\n };\n generate_serialize_to_fields(\n quote {$maybe_prefixed_name},\n param_type,\n omit,\n should_pack,\n )\n });\n let struct_flattened_fields = struct_flattened.fold(\n &[],\n |acc: [Quoted], (fields, _): (_, [Quoted])| acc.append(fields),\n );\n let struct_flattened_aux_vars = struct_flattened.fold(\n &[],\n |acc: [Quoted], (_, aux_vars): ([Quoted], _)| acc.append(aux_vars),\n );\n fields = fields.append(struct_flattened_fields);\n aux_vars = aux_vars.append(struct_flattened_aux_vars);\n } else if typ.as_array().is_some() {\n // For array we recursively call `generate_serialize_to_fields(...)` for each element\n let (element_type, array_len) = typ.as_array().unwrap();\n let array_len = array_len.as_constant().unwrap();\n for i in 0..array_len {\n let (element_fields, element_aux_vars) = generate_serialize_to_fields(\n quote { $name[$i] },\n element_type,\n omit,\n should_pack,\n );\n fields = fields.append(element_fields);\n aux_vars = aux_vars.append(element_aux_vars);\n }\n } else if typ.as_str().is_some() {\n // For string we convert the value to bytes, we store the `as_bytes` in an auxiliary variables and\n // then we add each byte to fields as a Field\n let length_type = typ.as_str().unwrap();\n let str_len = length_type.as_constant().unwrap();\n let as_member = name.as_expr().unwrap().as_member_access();\n let var_name = if as_member.is_some() {\n as_member.unwrap().1\n } else {\n name\n };\n let as_bytes_name = f\"{var_name}_as_bytes\".quoted_contents();\n let as_bytes = quote { let $as_bytes_name = $name.as_bytes() };\n for i in 0..str_len {\n fields = fields.push_back(quote { $as_bytes_name[$i] as Field });\n }\n aux_vars = aux_vars.push_back(as_bytes);\n } else {\n panic(\n f\"Unsupported type for serialization of argument {name} and type {typ}\",\n )\n }\n }\n (fields, aux_vars)\n}\n\n/// From a quote that gets tokenized to a multiple tokens we collapse it to a single token by replacing all `.` with `_`.\n/// E.g. \"self.values[0]\" -> \"self_values_0_\"\ncomptime fn collapse_to_one_token(q: Quoted) -> Quoted {\n let tokens = q.tokens();\n\n let mut single_token = quote {};\n for token in tokens {\n let new_token = if ((token == quote {.}) | (token == quote {[}) | (token == quote {]})) {\n quote {_}\n } else {\n token\n };\n single_token = f\"{single_token}{new_token}\".quoted_contents();\n }\n single_token\n}\n\npub(crate) comptime fn derive_serialize(s: StructDefinition) -> Quoted {\n let typ = s.as_type();\n let (fields, aux_vars) = generate_serialize_to_fields(quote { self }, typ, &[], false);\n let aux_vars_for_serialization = if aux_vars.len() > 0 {\n let joint = aux_vars.join(quote {;});\n quote { $joint; }\n } else {\n quote {}\n };\n\n let field_serializations = fields.join(quote {,});\n let serialized_len = fields.len();\n quote {\n impl Serialize<$serialized_len> for $typ {\n fn serialize(self) -> [Field; $serialized_len] {\n $aux_vars_for_serialization\n [ $field_serializations ]\n }\n }\n }\n}\n\npub(crate) comptime fn derive_deserialize(s: StructDefinition) -> Quoted {\n let typ = s.as_type();\n let (fields, _) = generate_serialize_to_fields(quote { self }, typ, &[], false);\n let serialized_len = fields.len();\n let (deserialized, _) =\n generate_deserialize_from_fields(quote { self }, typ, quote { serialized }, 0, false);\n quote {\n impl Deserialize<$serialized_len> for $typ {\n fn deserialize(serialized: [Field; $serialized_len]) -> Self {\n $deserialized\n }\n }\n }\n}\n\n/// Generates `Packable` implementation for a given struct and returns the packed length.\n///\n/// Note: We are having this function separate from `derive_packable` because we use this in the note macros to get\n/// the packed length of a note as well as the `Packable` implementation. We need the length to be able to register\n/// the note in the global `NOTES` map. There the length is used to generate partial note helper functions.\npub comptime fn derive_packable_and_get_packed_len(s: StructDefinition) -> (Quoted, u32) {\n let packing_enabled = true;\n\n let typ = s.as_type();\n let (fields, aux_vars) =\n generate_serialize_to_fields(quote { self }, typ, &[], packing_enabled);\n let aux_vars_for_packing = if aux_vars.len() > 0 {\n let joint = aux_vars.join(quote {;});\n quote { $joint; }\n } else {\n quote {}\n };\n\n let (unpacked, _) =\n generate_deserialize_from_fields(quote { self }, typ, quote { packed }, 0, packing_enabled);\n\n let field_packings = fields.join(quote {,});\n let packed_len = fields.len();\n let packable_trait: TraitConstraint = quote { Packable<$packed_len> }.as_trait_constraint();\n (\n quote {\n impl $packable_trait for $typ {\n fn pack(self) -> [Field; $packed_len] {\n $aux_vars_for_packing\n [ $field_packings ]\n }\n\n fn unpack(packed: [Field; $packed_len]) -> Self {\n $unpacked\n }\n }\n },\n packed_len,\n )\n}\n\npub(crate) comptime fn derive_packable(s: StructDefinition) -> Quoted {\n let (packable_impl, _) = derive_packable_and_get_packed_len(s);\n packable_impl\n}\n\n#[derive(Packable, Serialize, Deserialize, Eq)]\npub struct Smol {\n a: Field,\n b: Field,\n}\n\n#[derive(Serialize, Deserialize, Eq)]\npub struct HasArray {\n a: [Field; 2],\n b: bool,\n}\n\n#[derive(Serialize, Deserialize, Eq)]\npub struct Fancier {\n a: Smol,\n b: [Field; 2],\n c: [u8; 3],\n d: str<16>,\n}\n\nfn main() {\n assert(false);\n}\n\n#[test]\nfn smol_test() {\n let smol = Smol { a: 1, b: 2 };\n let serialized = smol.serialize();\n assert(serialized == [1, 2], serialized);\n let deserialized = Smol::deserialize(serialized);\n assert(deserialized == smol);\n\n // None of the struct members implements the `Packable` trait so the packed and serialized data should be the same\n let packed = smol.pack();\n assert_eq(packed, serialized, \"Packed does not match serialized\");\n}\n\n#[test]\nfn has_array_test() {\n let has_array = HasArray { a: [1, 2], b: true };\n let serialized = has_array.serialize();\n assert(serialized == [1, 2, 1], serialized);\n let deserialized = HasArray::deserialize(serialized);\n assert(deserialized == has_array);\n}\n\n#[test]\nfn fancier_test() {\n let fancier =\n Fancier { a: Smol { a: 1, b: 2 }, b: [0, 1], c: [1, 2, 3], d: \"metaprogramming!\" };\n let serialized = fancier.serialize();\n assert(\n serialized\n == [\n 1, 2, 0, 1, 1, 2, 3, 0x6d, 0x65, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61,\n 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x21,\n ],\n serialized,\n );\n let deserialized = Fancier::deserialize(serialized);\n assert(deserialized == fancier);\n}\n"
|
|
2993
|
+
"286": {
|
|
2994
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/meta/mod.nr",
|
|
2995
|
+
"source": "use super::traits::{Deserialize, Packable, Serialize};\n\n/// Returns the typed expression of a trait method implementation.\n///\n/// This helper function is preferred over directly inlining with `$typ::target_method()` in a quote,\n/// as direct inlining would result in missing import warnings in the generated code (specifically,\n/// warnings that the trait implementation is not in scope).\n///\n/// # Note\n/// A copy of this function exists in `aztec-nr/aztec/src/macros/utils.nr`. We maintain separate copies\n/// because importing it there from here would cause the `target_trait` to be interpreted in the context\n/// of this crate, making it impossible to compile code for traits from that crate (e.g. NoteType).\ncomptime fn get_trait_impl_method(\n typ: Type,\n target_trait: Quoted,\n target_method: Quoted,\n) -> TypedExpr {\n let trait_constraint = target_trait.as_trait_constraint();\n typ\n .get_trait_impl(trait_constraint)\n .expect(f\"Could not find impl for {target_trait} for type {typ}\")\n .methods()\n .filter(|m| m.name() == target_method)[0]\n .as_typed_expr()\n}\n\n/// Generates code that deserializes a struct, primitive type, array or string from a field array.\n///\n/// # Parameters\n/// - `name`: The name of the current field being processed, used to identify fields for replacement.\n/// - `typ`: The type of the struct or field being deserialized (e.g., a custom struct, array, or primitive).\n/// - `field_array_name`: The name of the field array containing serialized field data (e.g., `\"values\"`).\n/// - `num_already_consumed`: The number of fields already processed in previous recursion calls.\n/// - `should_unpack`: A boolean indicating whether the type should be unpacked (see description of `Packable`\n/// and `Serialize` trait for more information about the difference between packing and serialization).\n///\n/// # Returns\n/// A tuple containing:\n/// - `Quoted`: A code that deserializes a given struct, primitive type, array, or string from the field array.\n/// - `u32`: The total number of fields consumed during deserialization (used for recursion).\n///\n/// # Nested Struct Example\n/// Given the following setup:\n/// ```\n/// struct UintNote {\n/// value: u128,\n/// owner: AztecAddress,\n/// randomness: Field,\n/// }\n///\n/// struct AztecAddress {\n/// inner: Field,\n/// }\n/// ```\n///\n/// If `UintNote` is the input type, the function will generate the following deserialization code:\n/// ```\n/// UintNote {\n/// value: fields[0] as u128,\n/// owner: AztecAddress {\n/// inner: fields[1],\n/// },\n/// randomness: fields[2],\n/// }\n/// ```\n/// # Nested Struct Example with Unpacking\n/// - given the same setup as above and given that u128, AztecAddress and Field implement the `Packable` trait\n/// the result we get is:\n/// ```\n/// UintNote {\n/// value: aztec::protocol_types::traits::Packable::unpack([fields[0]]),\n/// owner: aztec::protocol_types::traits::Packable::unpack([fields[1]]),\n/// randomness: aztec::protocol_types::traits::Packable::unpack([fields[2]]),\n/// }\n/// ```\n///\n/// # Panics\n/// - If the deserialization logic encounters a type it does not support.\n/// - If an incorrect number of fields are consumed when deserializing a string.\npub comptime fn generate_deserialize_from_fields(\n name: Quoted,\n typ: Type,\n field_array_name: Quoted,\n num_already_consumed: u32,\n should_unpack: bool,\n) -> (Quoted, u32) {\n let mut result = quote {};\n // Counter for the number of fields consumed\n let mut consumed_counter: u32 = 0;\n\n // If the type implements `Packable`, its length will be assigned to the `maybe_packed_len_typ` variable.\n let maybe_packed_len_typ = std::meta::typ::fresh_type_variable();\n let packable_constraint = quote { Packable<$maybe_packed_len_typ> }.as_trait_constraint();\n\n if (should_unpack & typ.implements(packable_constraint)) {\n // Unpacking is enabled and the given type implements the `Packable` trait so we call the `unpack()`\n // method, add the resulting field array to `aux_vars` and each field to `fields`.\n let packed_len = maybe_packed_len_typ.as_constant().unwrap();\n\n // We copy the packed fields into a new array and pass that to the unpack function in a quote\n let mut packed_fields_quotes = &[];\n for i in 0..packed_len {\n let index_in_field_array = i + num_already_consumed;\n packed_fields_quotes =\n packed_fields_quotes.push_back(quote { $field_array_name[$index_in_field_array] });\n }\n let packed_fields = packed_fields_quotes.join(quote {,});\n\n // Now we call unpack on the type\n let unpack_method = get_trait_impl_method(typ, quote { Packable<_> }, quote { unpack });\n result = quote { $unpack_method([ $packed_fields ]) };\n\n consumed_counter = packed_len;\n } else if typ.is_field() | typ.as_integer().is_some() | typ.is_bool() {\n // The field is a primitive so we just reference it in the field array\n result = quote { $field_array_name[$num_already_consumed] as $typ };\n consumed_counter = 1;\n } else if typ.as_data_type().is_some() {\n // The field is a struct so we iterate over each struct field and recursively call\n // `generate_deserialize_from_fields`\n let (nested_def, generics) = typ.as_data_type().unwrap();\n let nested_name = nested_def.name();\n let mut deserialized_fields_list = &[];\n\n // Iterate over each field in the struct\n for field in nested_def.fields(generics) {\n let (field_name, field_type) = field;\n // Recursively call `generate_deserialize_from_fields` for each field in the struct\n let (deserialized_field, num_consumed_in_recursion) = generate_deserialize_from_fields(\n field_name,\n field_type,\n field_array_name,\n consumed_counter + num_already_consumed,\n should_unpack,\n );\n // We increment the consumed counter by the number of fields consumed in the recursion\n consumed_counter += num_consumed_in_recursion;\n // We add the deserialized field to the list of deserialized fields.\n // E.g. `value: u128 { lo: fields[0], hi: fields[1] }`\n deserialized_fields_list =\n deserialized_fields_list.push_back(quote { $field_name: $deserialized_field });\n }\n\n // We can construct the struct from the deserialized fields\n let deserialized_fields = deserialized_fields_list.join(quote {,});\n result = quote {\n $nested_name {\n $deserialized_fields\n }\n };\n } else if typ.as_array().is_some() {\n // The field is an array so we iterate over each element and recursively call\n // `generate_deserialize_from_fields`\n let (element_type, array_len) = typ.as_array().unwrap();\n let array_len = array_len.as_constant().unwrap();\n let mut array_fields_list = &[];\n\n // Iterate over each element in the array\n for _ in 0..array_len {\n // Recursively call `generate_deserialize_from_fields` for each element in the array\n let (deserialized_field, num_consumed_in_recursion) = generate_deserialize_from_fields(\n name,\n element_type,\n field_array_name,\n consumed_counter + num_already_consumed,\n should_unpack,\n );\n // We increment the consumed counter by the number of fields consumed in the recursion\n consumed_counter += num_consumed_in_recursion;\n // We add the deserialized field to the list of deserialized fields.\n array_fields_list = array_fields_list.push_back(deserialized_field);\n }\n\n // We can construct the array from the deserialized fields\n let array_fields = array_fields_list.join(quote {,});\n result = quote { [ $array_fields ] };\n } else if typ.as_str().is_some() {\n // The field is a string and we expect each byte of the string to be represented as 1 field in the field\n // array. So we iterate over the string length and deserialize each character as u8 in the recursive call\n // to `generate_deserialize_from_fields`.\n let length_type = typ.as_str().unwrap();\n let str_len = length_type.as_constant().unwrap();\n let mut byte_list = &[];\n\n // Iterate over each character in the string\n for _ in 0..str_len {\n // Recursively call `generate_deserialize_from_fields` for each character in the string\n let (deserialized_field, num_consumed_in_recursion) = generate_deserialize_from_fields(\n name,\n quote {u8}.as_type(),\n field_array_name,\n consumed_counter + num_already_consumed,\n should_unpack,\n );\n\n // We should consume just one field in the recursion so we sanity check that\n assert_eq(\n num_consumed_in_recursion,\n 1,\n \"Incorrect number of fields consumed in string deserialization\",\n );\n\n // We increment the consumed counter by 1 as we have consumed one field\n consumed_counter += 1;\n\n // We add the deserialized field to the list of deserialized fields.\n // E.g. `fields[6] as u8`\n byte_list = byte_list.push_back(deserialized_field);\n }\n\n // We construct the string from the deserialized fields\n let bytes = byte_list.join(quote {,});\n result = quote { [ $bytes ].as_str_unchecked() };\n } else {\n panic(\n f\"Unsupported type for serialization of argument {name} and type {typ}\",\n )\n }\n\n (result, consumed_counter)\n}\n\n/// Generates code that serializes a type into an array of fields. Also generates auxiliary variables if necessary\n/// for serialization. If `should_pack` is true, we check if the type implements the `Packable` trait and pack it\n/// if it does.\n///\n/// # Parameters\n/// - `name`: The base identifier (e.g., `self`, `some_var`).\n/// - `typ`: The type being serialized (e.g., a custom struct, array, or primitive type).\n/// - `omit`: A list of field names (as `Quoted`) to be excluded from the serialized output.\n/// - `should_pack`: A boolean indicating whether the type should be packed.\n///\n/// # Returns\n/// A tuple containing:\n/// - A flattened array of `Quoted` field references representing the serialized fields.\n/// - An array of `Quoted` auxiliary variables needed for serialization, such as byte arrays for strings.\n///\n/// # Examples\n///\n/// ## Struct\n/// Given the following struct:\n/// ```rust\n/// struct MockStruct {\n/// a: Field,\n/// b: Field,\n/// }\n/// ```\n///\n/// Serializing the struct:\n/// ```rust\n/// generate_serialize_to_fields(quote { my_mock_struct }, MockStruct, &[], false)\n/// // Returns:\n/// // ([`my_mock_struct.a`, `my_mock_struct.b`], [])\n/// ```\n///\n/// ## Nested Struct\n/// For a more complex struct:\n/// ```rust\n/// struct NestedStruct {\n/// m1: MockStruct,\n/// m2: MockStruct,\n/// }\n/// ```\n///\n/// Serialization output:\n/// ```rust\n/// generate_serialize_to_fields(quote { self }, NestedStruct, &[], false)\n/// // Returns:\n/// // ([`self.m1.a`, `self.m1.b`, `self.m2.a`, `self.m2.b`], [])\n/// ```\n///\n/// ## Array\n/// For an array type:\n/// ```rust\n/// generate_serialize_to_fields(quote { my_array }, [Field; 3], &[], false)\n/// // Returns:\n/// // ([`my_array[0]`, `my_array[1]`, `my_array[2]`], [])\n/// ```\n///\n/// ## String\n/// For a string field, where each character is serialized as a `Field`:\n/// ```rust\n/// generate_serialize_to_fields(quote { my_string }, StringType, &[], false)\n/// // Returns:\n/// // ([`my_string_as_bytes[0] as Field`, `my_string_as_bytes[1] as Field`, ...],\n/// // [`let my_string_as_bytes = my_string.as_bytes()`])\n/// ```\n///\n/// ## Nested Struct with Omitted Field and packing enabled\n/// - u128 has a `Packable` implementation hence it will be packed.\n///\n/// For a more complex struct:\n/// ```rust\n/// struct MyStruct {\n/// value: u128,\n/// value2: Field,\n/// }\n/// ```\n///\n/// Serializing while omitting `value2`:\n/// ```rust\n/// generate_serialize_to_fields(quote { self }, MyStruct, &[quote { self.value2 }], true)\n/// // Returns:\n/// // ([`value_packed[0]`], [`let value_packed = self.value.pack()`])\n/// ```\n///\n/// # Panics\n/// - If the type is unsupported for serialization.\n/// - If the provided `typ` contains invalid constants or incompatible structures.\npub comptime fn generate_serialize_to_fields(\n name: Quoted,\n typ: Type,\n omit: [Quoted],\n should_pack: bool,\n) -> ([Quoted], [Quoted]) {\n let mut fields = &[];\n let mut aux_vars = &[];\n\n // Proceed if none of the omit rules omits this name\n if !omit.any(|to_omit| to_omit == name) {\n // If the type implements `Packable`, its length will be assigned to the `maybe_packed_len_typ` variable.\n let maybe_packed_len_typ = std::meta::typ::fresh_type_variable();\n let packable_constraint =\n quote { crate::traits::Packable<$maybe_packed_len_typ> }.as_trait_constraint();\n\n if (should_pack & typ.implements(packable_constraint)) {\n // Packing is enabled and the given type implements the `Packable` trait so we call the `pack()`\n // method, add the resulting field array to `aux_vars` and each field to `fields`.\n let packed_len = maybe_packed_len_typ.as_constant().unwrap();\n\n // We collapse the name to a one that gets tokenized as a single token (e.g. \"self.value\" -> \"self_value\").\n let name_at_one_token = collapse_to_one_token(name);\n let packed_struct_name = f\"{name_at_one_token}_aux_var\".quoted_contents();\n\n // We add the individual fields to the fields array\n let pack_method = get_trait_impl_method(\n typ,\n quote { crate::traits::Packable<$packed_len> },\n quote { pack },\n );\n let packed_struct = quote { let $packed_struct_name = $pack_method($name) };\n for i in 0..packed_len {\n fields = fields.push_back(quote { $packed_struct_name[$i] });\n }\n\n // We add the new auxiliary variable to the aux_vars array\n aux_vars = aux_vars.push_back(packed_struct);\n } else if typ.is_field() {\n // For field we just add the value to fields\n fields = fields.push_back(name);\n } else if typ.as_integer().is_some() | typ.is_bool() {\n // For integer and bool we just cast to Field and add the value to fields\n fields = fields.push_back(quote { $name as Field });\n } else if typ.as_data_type().is_some() {\n // For struct we pref\n let nested_struct = typ.as_data_type().unwrap();\n let params = nested_struct.0.fields(nested_struct.1);\n let struct_flattened = params.map(|(param_name, param_type): (Quoted, Type)| {\n let maybe_prefixed_name = if name == quote {} {\n // Triggered when the param name is of a value available in the current scope (e.g. a function\n // argument) --> then we don't prefix the name with anything.\n param_name\n } else {\n // Triggered when we want to prefix the param name with the `name` from function input. This\n // can typically be `self` when implementing a method on a struct.\n quote { $name.$param_name }\n };\n generate_serialize_to_fields(\n quote {$maybe_prefixed_name},\n param_type,\n omit,\n should_pack,\n )\n });\n let struct_flattened_fields = struct_flattened.fold(\n &[],\n |acc: [Quoted], (fields, _): (_, [Quoted])| acc.append(fields),\n );\n let struct_flattened_aux_vars = struct_flattened.fold(\n &[],\n |acc: [Quoted], (_, aux_vars): ([Quoted], _)| acc.append(aux_vars),\n );\n fields = fields.append(struct_flattened_fields);\n aux_vars = aux_vars.append(struct_flattened_aux_vars);\n } else if typ.as_array().is_some() {\n // For array we recursively call `generate_serialize_to_fields(...)` for each element\n let (element_type, array_len) = typ.as_array().unwrap();\n let array_len = array_len.as_constant().unwrap();\n for i in 0..array_len {\n let (element_fields, element_aux_vars) = generate_serialize_to_fields(\n quote { $name[$i] },\n element_type,\n omit,\n should_pack,\n );\n fields = fields.append(element_fields);\n aux_vars = aux_vars.append(element_aux_vars);\n }\n } else if typ.as_str().is_some() {\n // For string we convert the value to bytes, we store the `as_bytes` in an auxiliary variables and\n // then we add each byte to fields as a Field\n let length_type = typ.as_str().unwrap();\n let str_len = length_type.as_constant().unwrap();\n let as_member = name.as_expr().unwrap().as_member_access();\n let var_name = if as_member.is_some() {\n as_member.unwrap().1\n } else {\n name\n };\n let as_bytes_name = f\"{var_name}_as_bytes\".quoted_contents();\n let as_bytes = quote { let $as_bytes_name = $name.as_bytes() };\n for i in 0..str_len {\n fields = fields.push_back(quote { $as_bytes_name[$i] as Field });\n }\n aux_vars = aux_vars.push_back(as_bytes);\n } else {\n panic(\n f\"Unsupported type for serialization of argument {name} and type {typ}\",\n )\n }\n }\n (fields, aux_vars)\n}\n\n/// From a quote that gets tokenized to a multiple tokens we collapse it to a single token by replacing all `.` with `_`.\n/// E.g. \"self.values[0]\" -> \"self_values_0_\"\ncomptime fn collapse_to_one_token(q: Quoted) -> Quoted {\n let tokens = q.tokens();\n\n let mut single_token = quote {};\n for token in tokens {\n let new_token = if ((token == quote {.}) | (token == quote {[}) | (token == quote {]})) {\n quote {_}\n } else {\n token\n };\n single_token = f\"{single_token}{new_token}\".quoted_contents();\n }\n single_token\n}\n\npub(crate) comptime fn derive_serialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let (fields, aux_vars) = generate_serialize_to_fields(quote { self }, typ, &[], false);\n let aux_vars_for_serialization = if aux_vars.len() > 0 {\n let joint = aux_vars.join(quote {;});\n quote { $joint; }\n } else {\n quote {}\n };\n\n let field_serializations = fields.join(quote {,});\n let serialized_len = fields.len();\n quote {\n impl Serialize<$serialized_len> for $typ {\n fn serialize(self) -> [Field; $serialized_len] {\n $aux_vars_for_serialization\n [ $field_serializations ]\n }\n }\n }\n}\n\npub(crate) comptime fn derive_deserialize(s: TypeDefinition) -> Quoted {\n let typ = s.as_type();\n let (fields, _) = generate_serialize_to_fields(quote { self }, typ, &[], false);\n let serialized_len = fields.len();\n let (deserialized, _) =\n generate_deserialize_from_fields(quote { self }, typ, quote { serialized }, 0, false);\n quote {\n impl Deserialize<$serialized_len> for $typ {\n fn deserialize(serialized: [Field; $serialized_len]) -> Self {\n $deserialized\n }\n }\n }\n}\n\n/// Generates `Packable` implementation for a given struct and returns the packed length.\n///\n/// Note: We are having this function separate from `derive_packable` because we use this in the note macros to get\n/// the packed length of a note as well as the `Packable` implementation. We need the length to be able to register\n/// the note in the global `NOTES` map. There the length is used to generate partial note helper functions.\npub comptime fn derive_packable_and_get_packed_len(s: TypeDefinition) -> (Quoted, u32) {\n let packing_enabled = true;\n\n let typ = s.as_type();\n let (fields, aux_vars) =\n generate_serialize_to_fields(quote { self }, typ, &[], packing_enabled);\n let aux_vars_for_packing = if aux_vars.len() > 0 {\n let joint = aux_vars.join(quote {;});\n quote { $joint; }\n } else {\n quote {}\n };\n\n let (unpacked, _) =\n generate_deserialize_from_fields(quote { self }, typ, quote { packed }, 0, packing_enabled);\n\n let field_packings = fields.join(quote {,});\n let packed_len = fields.len();\n let packable_trait: TraitConstraint = quote { Packable<$packed_len> }.as_trait_constraint();\n (\n quote {\n impl $packable_trait for $typ {\n fn pack(self) -> [Field; $packed_len] {\n $aux_vars_for_packing\n [ $field_packings ]\n }\n\n fn unpack(packed: [Field; $packed_len]) -> Self {\n $unpacked\n }\n }\n },\n packed_len,\n )\n}\n\npub(crate) comptime fn derive_packable(s: TypeDefinition) -> Quoted {\n let (packable_impl, _) = derive_packable_and_get_packed_len(s);\n packable_impl\n}\n\n#[derive(Packable, Serialize, Deserialize, Eq)]\npub struct Smol {\n a: Field,\n b: Field,\n}\n\n#[derive(Serialize, Deserialize, Eq)]\npub struct HasArray {\n a: [Field; 2],\n b: bool,\n}\n\n#[derive(Serialize, Deserialize, Eq)]\npub struct Fancier {\n a: Smol,\n b: [Field; 2],\n c: [u8; 3],\n d: str<16>,\n}\n\nfn main() {\n assert(false);\n}\n\n#[test]\nfn smol_test() {\n let smol = Smol { a: 1, b: 2 };\n let serialized = smol.serialize();\n assert(serialized == [1, 2], serialized);\n let deserialized = Smol::deserialize(serialized);\n assert(deserialized == smol);\n\n // None of the struct members implements the `Packable` trait so the packed and serialized data should be the same\n let packed = smol.pack();\n assert_eq(packed, serialized, \"Packed does not match serialized\");\n}\n\n#[test]\nfn has_array_test() {\n let has_array = HasArray { a: [1, 2], b: true };\n let serialized = has_array.serialize();\n assert(serialized == [1, 2, 1], serialized);\n let deserialized = HasArray::deserialize(serialized);\n assert(deserialized == has_array);\n}\n\n#[test]\nfn fancier_test() {\n let fancier =\n Fancier { a: Smol { a: 1, b: 2 }, b: [0, 1], c: [1, 2, 3], d: \"metaprogramming!\" };\n let serialized = fancier.serialize();\n assert(\n serialized\n == [\n 1, 2, 0, 1, 1, 2, 3, 0x6d, 0x65, 0x74, 0x61, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61,\n 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x21,\n ],\n serialized,\n );\n let deserialized = Fancier::deserialize(serialized);\n assert(deserialized == fancier);\n}\n"
|
|
2914
2996
|
},
|
|
2915
|
-
"
|
|
2916
|
-
"path": "/
|
|
2997
|
+
"289": {
|
|
2998
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/poseidon2.nr",
|
|
2917
2999
|
"source": "use crate::constants::TWO_POW_64;\n\n// NB: This is a clone of noir/noir-repo/noir_stdlib/src/hash/poseidon2.nr\n// It exists as we sometimes need to perform custom absorption, but the stdlib version\n// has a private absorb() method (it's also designed to just be a hasher)\n// Can be removed when standalone noir poseidon lib exists: See noir#6679\n\ncomptime global RATE: u32 = 3;\n\npub struct Poseidon2Sponge {\n pub cache: [Field; 3],\n pub state: [Field; 4],\n pub cache_size: u32,\n pub squeeze_mode: bool, // 0 => absorb, 1 => squeeze\n}\n\nimpl Poseidon2Sponge {\n #[no_predicates]\n pub fn hash<let N: u32>(input: [Field; N], message_size: u32) -> Field {\n Poseidon2Sponge::hash_internal(input, message_size, message_size != N)\n }\n\n pub(crate) fn new(iv: Field) -> Poseidon2Sponge {\n let mut result =\n Poseidon2Sponge { 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 for i in 0..RATE {\n // We effectively zero-pad the cache by only adding to the state\n // cache that is less than the specified `cache_size`\n if i < self.cache_size {\n self.state[i] += self.cache[i];\n }\n }\n self.state = std::hash::poseidon2_permutation(self.state, 4);\n }\n\n pub 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 pub 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>(\n input: [Field; N],\n in_len: u32,\n is_variable_length: bool,\n ) -> Field {\n let iv: Field = (in_len as Field) * TWO_POW_64;\n let mut sponge = Poseidon2Sponge::new(iv);\n for i in 0..input.len() {\n if i < in_len {\n sponge.absorb(input[i]);\n }\n }\n\n // In the case where the hash preimage is variable-length, we append `1` to the end of the input, to distinguish\n // from fixed-length hashes. (the combination of this additional field element + the hash IV ensures\n // fixed-length and variable-length hashes do not collide)\n if is_variable_length {\n sponge.absorb(1);\n }\n sponge.squeeze()\n }\n}\n"
|
|
2918
3000
|
},
|
|
2919
|
-
"
|
|
2920
|
-
"path": "/
|
|
3001
|
+
"298": {
|
|
3002
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr",
|
|
2921
3003
|
"source": "use crate::{\n address::public_keys_hash::PublicKeysHash,\n constants::{\n DEFAULT_IVPK_M_X, DEFAULT_IVPK_M_Y, DEFAULT_NPK_M_X, DEFAULT_NPK_M_Y, DEFAULT_OVPK_M_X,\n DEFAULT_OVPK_M_Y, DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y, GENERATOR_INDEX__PUBLIC_KEYS_HASH,\n },\n hash::poseidon2_hash_with_separator,\n point::POINT_LENGTH,\n traits::{Deserialize, Hash, Serialize, ToField},\n};\n\nuse dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point;\nuse std::default::Default;\n\npub global PUBLIC_KEYS_LENGTH: u32 = 12;\n\npub struct PublicKeys {\n pub npk_m: NpkM,\n pub ivpk_m: IvpkM,\n pub ovpk_m: OvpkM,\n pub tpk_m: TpkM,\n}\n\npub trait ToPoint {\n fn to_point(self) -> Point;\n}\n\npub struct NpkM {\n pub inner: Point,\n}\n\nimpl ToPoint for NpkM {\n fn to_point(self) -> Point {\n self.inner\n }\n}\n\nimpl Serialize<POINT_LENGTH> for NpkM {\n fn serialize(self) -> [Field; POINT_LENGTH] {\n self.inner.serialize()\n }\n}\n\n// Note: If we store npk_m_hash directly we can remove this trait implementation. See #8091\nimpl Hash for NpkM {\n fn hash(self) -> Field {\n self.inner.hash()\n }\n}\n\npub struct IvpkM {\n pub inner: Point,\n}\n\nimpl ToPoint for IvpkM {\n fn to_point(self) -> Point {\n self.inner\n }\n}\n\nimpl Serialize<POINT_LENGTH> for IvpkM {\n fn serialize(self) -> [Field; POINT_LENGTH] {\n self.inner.serialize()\n }\n}\n\npub struct OvpkM {\n pub inner: Point,\n}\n\nimpl Hash for OvpkM {\n fn hash(self) -> Field {\n self.inner.hash()\n }\n}\n\nimpl ToPoint for OvpkM {\n fn to_point(self) -> Point {\n self.inner\n }\n}\n\nimpl Serialize<POINT_LENGTH> for OvpkM {\n fn serialize(self) -> [Field; POINT_LENGTH] {\n self.inner.serialize()\n }\n}\n\npub struct TpkM {\n pub inner: Point,\n}\n\nimpl ToPoint for TpkM {\n fn to_point(self) -> Point {\n self.inner\n }\n}\n\nimpl Serialize<POINT_LENGTH> for TpkM {\n fn serialize(self) -> [Field; POINT_LENGTH] {\n self.inner.serialize()\n }\n}\n\nimpl Default for PublicKeys {\n fn default() -> Self {\n PublicKeys {\n npk_m: NpkM {\n inner: Point { x: DEFAULT_NPK_M_X, y: DEFAULT_NPK_M_Y, is_infinite: false },\n },\n ivpk_m: IvpkM {\n inner: Point { x: DEFAULT_IVPK_M_X, y: DEFAULT_IVPK_M_Y, is_infinite: false },\n },\n ovpk_m: OvpkM {\n inner: Point { x: DEFAULT_OVPK_M_X, y: DEFAULT_OVPK_M_Y, is_infinite: false },\n },\n tpk_m: TpkM {\n inner: Point { x: DEFAULT_TPK_M_X, y: DEFAULT_TPK_M_Y, is_infinite: false },\n },\n }\n }\n}\n\nimpl Eq for PublicKeys {\n fn eq(self, other: PublicKeys) -> bool {\n (self.npk_m.inner == other.npk_m.inner)\n & (self.ivpk_m.inner == other.ivpk_m.inner)\n & (self.ovpk_m.inner == other.ovpk_m.inner)\n & (self.tpk_m.inner == other.tpk_m.inner)\n }\n}\n\nimpl PublicKeys {\n pub fn hash(self) -> PublicKeysHash {\n PublicKeysHash::from_field(poseidon2_hash_with_separator(\n self.serialize(),\n GENERATOR_INDEX__PUBLIC_KEYS_HASH as Field,\n ))\n }\n}\n\nimpl Serialize<PUBLIC_KEYS_LENGTH> for PublicKeys {\n fn serialize(self) -> [Field; PUBLIC_KEYS_LENGTH] {\n [\n self.npk_m.inner.x,\n self.npk_m.inner.y,\n self.npk_m.inner.is_infinite as Field,\n self.ivpk_m.inner.x,\n self.ivpk_m.inner.y,\n self.ivpk_m.inner.is_infinite as Field,\n self.ovpk_m.inner.x,\n self.ovpk_m.inner.y,\n self.ovpk_m.inner.is_infinite as Field,\n self.tpk_m.inner.x,\n self.tpk_m.inner.y,\n self.tpk_m.inner.is_infinite as Field,\n ]\n }\n}\n\nimpl Deserialize<PUBLIC_KEYS_LENGTH> for PublicKeys {\n fn deserialize(serialized: [Field; PUBLIC_KEYS_LENGTH]) -> PublicKeys {\n PublicKeys {\n npk_m: NpkM {\n inner: Point {\n x: serialized[0],\n y: serialized[1],\n is_infinite: serialized[2] as bool,\n },\n },\n ivpk_m: IvpkM {\n inner: Point {\n x: serialized[3],\n y: serialized[4],\n is_infinite: serialized[5] as bool,\n },\n },\n ovpk_m: OvpkM {\n inner: Point {\n x: serialized[6],\n y: serialized[7],\n is_infinite: serialized[8] as bool,\n },\n },\n tpk_m: TpkM {\n inner: Point {\n x: serialized[9],\n y: serialized[10],\n is_infinite: serialized[11] as bool,\n },\n },\n }\n }\n}\n\npub struct AddressPoint {\n pub inner: Point,\n}\n\nimpl ToPoint for AddressPoint {\n fn to_point(self) -> Point {\n self.inner\n }\n}\n\n#[test]\nunconstrained fn compute_public_keys_hash() {\n let keys = PublicKeys {\n npk_m: NpkM { inner: Point { x: 1, y: 2, is_infinite: false } },\n ivpk_m: IvpkM { inner: Point { x: 3, y: 4, is_infinite: false } },\n ovpk_m: OvpkM { inner: Point { x: 5, y: 6, is_infinite: false } },\n tpk_m: TpkM { inner: Point { x: 7, y: 8, is_infinite: false } },\n };\n\n let actual = keys.hash();\n let expected_public_keys_hash =\n 0x0fecd9a32db731fec1fded1b9ff957a1625c069245a3613a2538bd527068b0ad;\n\n assert(actual.to_field() == expected_public_keys_hash);\n}\n\n#[test]\nunconstrained fn compute_default_hash() {\n let keys = PublicKeys::default();\n\n let actual = keys.hash();\n let test_data_default_hash = 0x1d3bf1fb93ae0e9cda83b203dd91c3bfb492a9aecf30ec90e1057eced0f0e62d;\n\n assert(actual.to_field() == test_data_default_hash);\n}\n\n#[test]\nunconstrained fn test_public_keys_serialization() {\n let keys = PublicKeys {\n npk_m: NpkM { inner: Point { x: 1, y: 2, is_infinite: false } },\n ivpk_m: IvpkM { inner: Point { x: 3, y: 4, is_infinite: false } },\n ovpk_m: OvpkM { inner: Point { x: 5, y: 6, is_infinite: false } },\n tpk_m: TpkM { inner: Point { x: 7, y: 8, is_infinite: false } },\n };\n\n let serialized = keys.serialize();\n let deserialized = PublicKeys::deserialize(serialized);\n\n assert_eq(keys.npk_m.inner.x, deserialized.npk_m.inner.x);\n assert_eq(keys.npk_m.inner.y, deserialized.npk_m.inner.y);\n assert_eq(keys.ivpk_m.inner.x, deserialized.ivpk_m.inner.x);\n assert_eq(keys.ivpk_m.inner.y, deserialized.ivpk_m.inner.y);\n assert_eq(keys.ovpk_m.inner.x, deserialized.ovpk_m.inner.x);\n assert_eq(keys.ovpk_m.inner.y, deserialized.ovpk_m.inner.y);\n assert_eq(keys.tpk_m.inner.x, deserialized.tpk_m.inner.x);\n assert_eq(keys.tpk_m.inner.y, deserialized.tpk_m.inner.y);\n}\n"
|
|
2922
3004
|
},
|
|
2923
|
-
"
|
|
2924
|
-
"path": "/
|
|
3005
|
+
"302": {
|
|
3006
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/scheduled_delay_change.nr",
|
|
2925
3007
|
"source": "use crate::traits::Empty;\nuse std::cmp::min;\n\nmod test;\n\n// This data structure is used by SharedMutable to store the minimum delay with which a ScheduledValueChange object can\n// 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: u32> {\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<u32>,\n pub(crate) post: Option<u32>,\n // Block at which `post` value is used instead of `pre`\n pub(crate) block_of_change: u32,\n}\n\nimpl<let INITIAL_DELAY: u32> ScheduledDelayChange<INITIAL_DELAY> {\n pub fn new(pre: Option<u32>, post: Option<u32>, block_of_change: u32) -> Self {\n Self { pre, post, block_of_change }\n }\n\n /// Returns the current value of the delay stored in the data structure.\n /// This function only returns a meaningful value when called in public with the current block number - for\n /// historical private reads use `get_effective_minimum_delay_at` instead.\n pub fn get_current(self, current_block_number: u32) -> u32 {\n // The post value becomes the current one at the block of change, so any transaction that is included in the\n // block of change will use the post value.\n if current_block_number < self.block_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 block at which it will become the current\n /// delay. Note that this block 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) -> (u32, u32) {\n (self.post.unwrap_or(INITIAL_DELAY), self.block_of_change)\n }\n\n /// Mutates the delay change by scheduling a change at the current block number. This function is only meaningful\n /// when called in public with the current block number.\n /// The block 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: u32, current_block_number: u32) {\n let current = self.get_current(current_block_number);\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 blocks_until_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 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 // current delay earliest value block of change\n // block block of change if delay remained unchanged\n // =======N=========================|================================X=================>\n // ^ ^ ^\n // |-------------------------|--------------------------------|\n // | blocks until change new delay |\n // ------------------------------------------------------------\n // current delay\n current - new\n };\n\n self.pre = Option::some(current);\n self.post = Option::some(new);\n self.block_of_change = current_block_number + blocks_until_change;\n }\n\n /// Returns the minimum delay before a value might mutate due to a scheduled change, from the perspective of some\n /// historical block number. It only returns a meaningful value when called in private with historical blocks. This\n /// function can be used alongside `ScheduledValueChange.get_block_horizon` to properly constrain the\n /// `max_block_number` transaction property when reading mutable shared state.\n /// This value typically equals the current delay at the block following the historical one (the earliest one in\n /// 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 pub fn get_effective_minimum_delay_at(self, historical_block_number: u32) -> u32 {\n if self.block_of_change <= historical_block_number {\n // If no delay changes were scheduled, then the delay value at the historical block (post) is guaranteed to\n // hold due to how further delay changes would be scheduled by `schedule_change`.\n self.post.unwrap_or(INITIAL_DELAY)\n } else {\n // If a change is scheduled, then the effective delay might be lower than the current one (pre). At the\n // block of change the current delay will be the scheduled one, with an overall delay from the historical\n // block number equal to the number of blocks 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 // historical\n // block delay actual earliest value\n // v block of change block of change\n // =========NS=====================|=============================X===========Y=====>\n // ^ ^ ^ ^\n // earliest block in | | |\n // which to schedule change | | |\n // | | | |\n // |----------------------|------------------------------ |\n // | blocks new delay |\n // | until change |\n // | |\n // |----------------------------------------------------------------|\n // current delay at the earliest block in\n // which to scheduled value change\n let blocks_until_change = self.block_of_change - (historical_block_number + 1);\n\n min(\n self.pre.unwrap_or(INITIAL_DELAY),\n blocks_until_change + self.post.unwrap_or(INITIAL_DELAY),\n )\n }\n }\n}\n\nimpl<let INITIAL_DELAY: u32> Eq for ScheduledDelayChange<INITIAL_DELAY> {\n fn eq(self, other: Self) -> bool {\n (self.pre == other.pre)\n & (self.post == other.post)\n & (self.block_of_change == other.block_of_change)\n }\n}\n\nimpl<let INITIAL_DELAY: u32> Empty for ScheduledDelayChange<INITIAL_DELAY> {\n fn empty() -> Self {\n Self { pre: Option::none(), post: Option::none(), block_of_change: 0 }\n }\n}\n"
|
|
2926
3008
|
},
|
|
2927
|
-
"
|
|
2928
|
-
"path": "/
|
|
3009
|
+
"304": {
|
|
3010
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/scheduled_value_change.nr",
|
|
2929
3011
|
"source": "use crate::traits::Empty;\nuse std::cmp::min;\n\nmod test;\n\n// This data structure is used by SharedMutable to represent a value that changes from `pre` to `post` at some block\n// called the `block_of_change`. The value can only be made to change by scheduling a change event at some future block\n// of change after some minimum delay measured in blocks has elapsed. This means that at any given block number we know\n// both the current value and the smallest block number at which the value might change - this is called the\n// 'block horizon'.\npub struct ScheduledValueChange<T> {\n pub(crate) pre: T,\n pub(crate) post: T,\n // Block at which `post` value is used instead of `pre`\n pub(crate) block_of_change: u32,\n}\n\nimpl<T> ScheduledValueChange<T> {\n pub fn new(pre: T, post: T, block_of_change: u32) -> Self {\n Self { pre, post, block_of_change }\n }\n\n /// Returns the value stored in the data structure at a given block. This function can be called both in public\n /// (where `block_number` is simply the current block number, i.e. the number of the block in which the current\n /// transaction will be included) and in private (where `block_number` is the historical block number that is used\n /// to construct the proof).\n /// Reading in private is only safe if the transaction's `max_block_number` property is set to a value lower or\n /// equal to the block horizon (see `get_block_horizon()`).\n pub fn get_current_at(self, block_number: u32) -> T {\n // The post value becomes the current one at the block of change. This means different things in each realm:\n // - in public, any transaction that is included in the block of change will use the post value\n // - in private, any transaction that includes the block of change as part of the historical state will use the\n // post value (barring any follow-up changes)\n if block_number < self.block_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 block at which it will become the current\n /// value. Note that this block 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, u32) {\n (self.post, self.block_of_change)\n }\n\n // Returns the previous value. This is the value that is current up until the block of change. Note that this value\n // might not be the current anymore since block of change might have already passed.\n pub fn get_previous(self) -> (T, u32) {\n (self.pre, self.block_of_change)\n }\n\n /// Returns the largest block number at which the value returned by `get_current_at` is known to remain the current\n /// value. This value is only meaningful in private when constructing a proof at some `historical_block_number`,\n /// since 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 number of blocks that need to\n /// elapse from the next block until the value changes, regardless of further delay changes.\n /// The value returned by `get_current_at` in private when called with a historical block number is only safe to use\n /// if the transaction's `max_block_number` property is set to a value lower or equal to the block horizon computed\n /// using the same historical block number.\n pub fn get_block_horizon(self, historical_block_number: u32, minimum_delay: u32) -> u32 {\n // The block horizon is the very last block in which the current value is known. Any block past the horizon\n // (i.e. with a block number larger than the block horizon) may have a different current value. Reading the\n // current value in private typically requires constraining the maximum valid block number to be equal to the\n // block horizon.\n if historical_block_number >= self.block_of_change {\n // Once the block of change has been mined, the current value (post) will not change unless a new value\n // change is scheduled. This did not happen at the historical block number (or else it would not be\n // greater or equal to the block of change), and therefore could only happen after the historical block\n // number. The earliest would be the immediate next block, and so the smallest possible next block of change\n // equals `historical_block_number + 1 + minimum_delay`. Our block horizon is simply the previous block to\n // that one.\n //\n // block of historical\n // change block block horizon\n // =======|=============N===================H===========>\n // ^ ^\n // ---------------------\n // minimum delay\n historical_block_number + minimum_delay\n } else {\n // If the block of change has not yet been mined however, then there are two possible scenarios.\n // a) It could be so far into the future that the block 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 block of change is in the past: the time horizon is the\n // block prior to the earliest one in which a new block of change might land.\n //\n // historical\n // block block horizon block of change\n // =====N=================================H=================|=========>\n // ^ ^\n // | |\n // -----------------------------------\n // minimum delay\n //\n // b) It could be fewer than `minimum_delay` blocks away from the historical block number, in which case\n // the block of change would become the limiting factor for the time horizon, which would equal the\n // block right before the block of change (since by definition the value changes at the block of\n // change).\n //\n // historical block horizon\n // block block 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 block of change to an arbitrary\n // value, and therefore scenario a) is not currently possible. However implementing #5501 would allow for\n // this to happen.\n // Because historical_block_number < self.block_of_change, then block_of_change > 0 and we can safely\n // subtract 1.\n min(\n self.block_of_change - 1,\n historical_block_number + minimum_delay,\n )\n }\n }\n\n /// Mutates the value by scheduling a change at the current block number. This function is only meaningful when\n /// called in public with the current block number.\n pub fn schedule_change(\n &mut self,\n new_value: T,\n current_block_number: u32,\n minimum_delay: u32,\n block_of_change: u32,\n ) {\n assert(block_of_change >= current_block_number + minimum_delay);\n\n self.pre = self.get_current_at(current_block_number);\n self.post = new_value;\n self.block_of_change = block_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.block_of_change == other.block_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(), block_of_change: 0 }\n }\n}\n"
|
|
2930
3012
|
},
|
|
2931
|
-
"
|
|
2932
|
-
"path": "/
|
|
3013
|
+
"306": {
|
|
3014
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/shared_mutable_values.nr",
|
|
2933
3015
|
"source": "use crate::{\n hash::poseidon2_hash,\n shared_mutable::{\n scheduled_delay_change::ScheduledDelayChange, scheduled_value_change::ScheduledValueChange,\n },\n traits::{Hash, Packable},\n utils::arrays,\n};\nuse std::meta::derive;\n\nmod test;\n\n/// SharedMutableValues 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.block_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 SharedMutableValues<T, let INITIAL_DELAY: u32> {\n pub svc: ScheduledValueChange<T>,\n pub sdc: ScheduledDelayChange<INITIAL_DELAY>,\n}\n\nimpl<T, let INITIAL_DELAY: u32, let N: u32> SharedMutableValues<T, INITIAL_DELAY>\nwhere\n T: Packable<N>,\n{\n pub fn new(svc: ScheduledValueChange<T>, sdc: ScheduledDelayChange<INITIAL_DELAY>) -> Self {\n SharedMutableValues { svc, sdc }\n }\n\n pub fn unpack_value_change(packed: [Field; 2 * N + 1]) -> ScheduledValueChange<T> {\n let svc_pre_packed = arrays::subarray(packed, 1);\n let svc_post_packed = arrays::subarray(packed, N + 1);\n ScheduledValueChange::new(\n T::unpack(svc_pre_packed),\n T::unpack(svc_post_packed),\n packed[0] as u32,\n )\n }\n\n pub fn unpack_delay_change(packed: Field) -> 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 block_of_change. We'll discard the svc component.\n let svc_block_of_change = packed as u32;\n\n let mut tmp = (packed - svc_block_of_change as Field) / TWO_POW_32;\n let sdc_block_of_change = tmp as u32;\n\n tmp = (tmp - sdc_block_of_change as Field) / TWO_POW_32;\n let sdc_post_is_some = tmp as bool;\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 bool;\n\n tmp = (tmp - sdc_pre_is_some as Field) / TWO_POW_8;\n let sdc_pre_inner = tmp as u32;\n\n ScheduledDelayChange {\n pre: if sdc_pre_is_some {\n Option::some(sdc_pre_inner)\n } else {\n Option::none()\n },\n post: if sdc_post_is_some {\n Option::some(sdc_post_inner)\n } else {\n Option::none()\n },\n block_of_change: sdc_block_of_change,\n }\n }\n}\n\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 block_of_change of ScheduledValueChange.\nimpl<T, let INITIAL_DELAY: u32, let N: u32> Packable<2 * N + 1> for SharedMutableValues<T, INITIAL_DELAY>\nwhere\n T: Packable<N>,\n{\n fn pack(self) -> [Field; 2 * N + 1] {\n let mut result = [0; 2 * N + 1];\n\n // We pack sdc.pre, sdc.post, sdc.block_of_change and svc.block_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.block_of_change: u32 | svc.block_of_change: u32 ]\n result[0] = self.svc.block_of_change as Field\n + ((self.sdc.block_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..N {\n result[i + 1] = svc_pre_packed[i];\n result[i + 1 + N] = svc_post_packed[i];\n }\n result\n }\n\n fn unpack(fields: [Field; 2 * N + 1]) -> Self {\n let svc = Self::unpack_value_change(fields);\n let sdc = SharedMutableValues::<T, INITIAL_DELAY>::unpack_delay_change(fields[0]);\n Self::new(svc, sdc)\n }\n}\n\nimpl<T, let INITIAL_DELAY: u32, let N: u32> Hash for SharedMutableValues<T, INITIAL_DELAY>\nwhere\n T: Packable<N>,\n{\n fn hash(self) -> Field {\n poseidon2_hash(self.pack())\n }\n}\n"
|
|
2934
3016
|
},
|
|
2935
|
-
"
|
|
2936
|
-
"path": "/
|
|
3017
|
+
"309": {
|
|
3018
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr",
|
|
2937
3019
|
"source": "use crate::{hash::poseidon2_hash, traits::ToField};\n\npub fn derive_storage_slot_in_map<K>(storage_slot: Field, key: K) -> Field\nwhere\n K: ToField,\n{\n poseidon2_hash([storage_slot, key.to_field()])\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 0x15b9fe39449affd8b377461263e9d2b610b9ad40580553500b4e41d9cbd887ac;\n\n assert_eq(slot, slot_from_typescript);\n }\n}\n"
|
|
2938
3020
|
},
|
|
2939
|
-
"
|
|
2940
|
-
"path": "/
|
|
3021
|
+
"327": {
|
|
3022
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/type_packing.nr",
|
|
2941
3023
|
"source": "use crate::traits::Packable;\n\nglobal BOOL_PACKED_LEN: u32 = 1;\nglobal U8_PACKED_LEN: u32 = 1;\nglobal U16_PACKED_LEN: u32 = 1;\nglobal U32_PACKED_LEN: u32 = 1;\nglobal U64_PACKED_LEN: u32 = 1;\nglobal U128_PACKED_LEN: u32 = 1;\nglobal FIELD_PACKED_LEN: u32 = 1;\nglobal I8_PACKED_LEN: u32 = 1;\nglobal I16_PACKED_LEN: u32 = 1;\nglobal I32_PACKED_LEN: u32 = 1;\nglobal I64_PACKED_LEN: u32 = 1;\n\nimpl Packable<BOOL_PACKED_LEN> for bool {\n fn pack(self) -> [Field; BOOL_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; BOOL_PACKED_LEN]) -> bool {\n fields[0] as bool\n }\n}\n\nimpl Packable<U8_PACKED_LEN> for u8 {\n fn pack(self) -> [Field; U8_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; U8_PACKED_LEN]) -> Self {\n fields[0] as u8\n }\n}\n\nimpl Packable<U16_PACKED_LEN> for u16 {\n fn pack(self) -> [Field; U16_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; U16_PACKED_LEN]) -> Self {\n fields[0] as u16\n }\n}\n\nimpl Packable<U32_PACKED_LEN> for u32 {\n fn pack(self) -> [Field; U32_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; U32_PACKED_LEN]) -> Self {\n fields[0] as u32\n }\n}\n\nimpl Packable<U64_PACKED_LEN> for u64 {\n fn pack(self) -> [Field; U64_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; U64_PACKED_LEN]) -> Self {\n fields[0] as u64\n }\n}\n\nimpl Packable<U128_PACKED_LEN> for u128 {\n fn pack(self) -> [Field; U128_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; U128_PACKED_LEN]) -> Self {\n fields[0] as u128\n }\n}\n\nimpl Packable<FIELD_PACKED_LEN> for Field {\n fn pack(self) -> [Field; FIELD_PACKED_LEN] {\n [self]\n }\n\n fn unpack(fields: [Field; FIELD_PACKED_LEN]) -> Self {\n fields[0]\n }\n}\n\nimpl Packable<I8_PACKED_LEN> for i8 {\n fn pack(self) -> [Field; I8_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; I8_PACKED_LEN]) -> Self {\n fields[0] as i8\n }\n}\n\nimpl Packable<I16_PACKED_LEN> for i16 {\n fn pack(self) -> [Field; I16_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; I16_PACKED_LEN]) -> Self {\n fields[0] as i16\n }\n}\n\nimpl Packable<I32_PACKED_LEN> for i32 {\n fn pack(self) -> [Field; I32_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; I32_PACKED_LEN]) -> Self {\n fields[0] as i32\n }\n}\n\nimpl Packable<I64_PACKED_LEN> for i64 {\n fn pack(self) -> [Field; I64_PACKED_LEN] {\n [self as Field]\n }\n\n fn unpack(fields: [Field; I64_PACKED_LEN]) -> Self {\n fields[0] as i64\n }\n}\n\nimpl<T, let N: u32, let M: u32> Packable<N * M> for [T; N]\nwhere\n T: Packable<M>,\n{\n fn pack(self) -> [Field; N * M] {\n let mut result: [Field; N * M] = std::mem::zeroed();\n let mut serialized: [Field; M] = std::mem::zeroed();\n for i in 0..N {\n serialized = self[i].pack();\n for j in 0..M {\n result[i * M + j] = serialized[j];\n }\n }\n result\n }\n\n fn unpack(fields: [Field; N * M]) -> Self {\n let mut reader = crate::utils::reader::Reader::new(fields);\n let mut result: [T; N] = std::mem::zeroed();\n reader.read_struct_array::<T, M, N>(Packable::unpack, result)\n }\n}\n\n#[test]\nfn test_u16_packing() {\n let a: u16 = 10;\n assert_eq(a, u16::unpack(a.pack()));\n}\n\n#[test]\nfn test_i8_packing() {\n let a: i8 = -10;\n assert_eq(a, i8::unpack(a.pack()));\n}\n\n#[test]\nfn test_i16_packing() {\n let a: i16 = -10;\n assert_eq(a, i16::unpack(a.pack()));\n}\n\n#[test]\nfn test_i32_packing() {\n let a: i32 = -10;\n assert_eq(a, i32::unpack(a.pack()));\n}\n\n#[test]\nfn test_i64_packing() {\n let a: i64 = -10;\n assert_eq(a, i64::unpack(a.pack()));\n}\n"
|
|
2942
3024
|
},
|
|
2943
|
-
"
|
|
2944
|
-
"path": "/
|
|
3025
|
+
"328": {
|
|
3026
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr",
|
|
2945
3027
|
"source": "use crate::traits::{Deserialize, Serialize};\n\nglobal BOOL_SERIALIZED_LEN: u32 = 1;\nglobal U8_SERIALIZED_LEN: u32 = 1;\nglobal U16_SERIALIZED_LEN: u32 = 1;\nglobal U32_SERIALIZED_LEN: u32 = 1;\nglobal U64_SERIALIZED_LEN: u32 = 1;\nglobal U128_SERIALIZED_LEN: u32 = 1;\nglobal FIELD_SERIALIZED_LEN: u32 = 1;\nglobal I8_SERIALIZED_LEN: u32 = 1;\nglobal I16_SERIALIZED_LEN: u32 = 1;\nglobal I32_SERIALIZED_LEN: u32 = 1;\nglobal I64_SERIALIZED_LEN: u32 = 1;\n\nimpl Serialize<BOOL_SERIALIZED_LEN> for bool {\n fn serialize(self) -> [Field; BOOL_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<BOOL_SERIALIZED_LEN> for bool {\n fn deserialize(fields: [Field; BOOL_SERIALIZED_LEN]) -> bool {\n fields[0] as bool\n }\n}\n\nimpl Serialize<U8_SERIALIZED_LEN> for u8 {\n fn serialize(self) -> [Field; U8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<U8_SERIALIZED_LEN> for u8 {\n fn deserialize(fields: [Field; U8_SERIALIZED_LEN]) -> Self {\n fields[0] as u8\n }\n}\n\nimpl Serialize<U16_SERIALIZED_LEN> for u16 {\n fn serialize(self) -> [Field; U16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<U16_SERIALIZED_LEN> for u16 {\n fn deserialize(fields: [Field; U16_SERIALIZED_LEN]) -> Self {\n fields[0] as u16\n }\n}\n\nimpl Serialize<U32_SERIALIZED_LEN> for u32 {\n fn serialize(self) -> [Field; U32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<U32_SERIALIZED_LEN> for u32 {\n fn deserialize(fields: [Field; U32_SERIALIZED_LEN]) -> Self {\n fields[0] as u32\n }\n}\n\nimpl Serialize<U64_SERIALIZED_LEN> for u64 {\n fn serialize(self) -> [Field; U64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<U64_SERIALIZED_LEN> for u64 {\n fn deserialize(fields: [Field; U64_SERIALIZED_LEN]) -> Self {\n fields[0] as u64\n }\n}\n\nimpl Serialize<U128_SERIALIZED_LEN> for u128 {\n fn serialize(self) -> [Field; U128_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<U128_SERIALIZED_LEN> for u128 {\n fn deserialize(fields: [Field; U128_SERIALIZED_LEN]) -> Self {\n fields[0] as u128\n }\n}\n\nimpl Serialize<FIELD_SERIALIZED_LEN> for Field {\n fn serialize(self) -> [Field; FIELD_SERIALIZED_LEN] {\n [self]\n }\n}\n\nimpl Deserialize<FIELD_SERIALIZED_LEN> for Field {\n fn deserialize(fields: [Field; FIELD_SERIALIZED_LEN]) -> Self {\n fields[0]\n }\n}\n\nimpl Serialize<I8_SERIALIZED_LEN> for i8 {\n fn serialize(self) -> [Field; I8_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<I8_SERIALIZED_LEN> for i8 {\n fn deserialize(fields: [Field; I8_SERIALIZED_LEN]) -> Self {\n fields[0] as i8\n }\n}\n\nimpl Serialize<I16_SERIALIZED_LEN> for i16 {\n fn serialize(self) -> [Field; I16_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<I16_SERIALIZED_LEN> for i16 {\n fn deserialize(fields: [Field; I16_SERIALIZED_LEN]) -> Self {\n fields[0] as i16\n }\n}\n\nimpl Serialize<I32_SERIALIZED_LEN> for i32 {\n fn serialize(self) -> [Field; I32_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<I32_SERIALIZED_LEN> for i32 {\n fn deserialize(fields: [Field; I32_SERIALIZED_LEN]) -> Self {\n fields[0] as i32\n }\n}\n\nimpl Serialize<I64_SERIALIZED_LEN> for i64 {\n fn serialize(self) -> [Field; I64_SERIALIZED_LEN] {\n [self as Field]\n }\n}\n\nimpl Deserialize<I64_SERIALIZED_LEN> for i64 {\n fn deserialize(fields: [Field; I64_SERIALIZED_LEN]) -> Self {\n fields[0] as i64\n }\n}\n\nimpl<T, let N: u32, let M: u32> Serialize<N * M> for [T; N]\nwhere\n T: Serialize<M>,\n{\n fn serialize(self) -> [Field; N * M] {\n let mut result: [Field; N * M] = std::mem::zeroed();\n let mut serialized: [Field; M] = std::mem::zeroed();\n for i in 0..N {\n serialized = self[i].serialize();\n for j in 0..M {\n result[i * M + j] = serialized[j];\n }\n }\n result\n }\n}\n\nimpl<T, let N: u32, let M: u32> Deserialize<N * M> for [T; N]\nwhere\n T: Deserialize<M>,\n{\n fn deserialize(fields: [Field; N * M]) -> Self {\n let mut reader = crate::utils::reader::Reader::new(fields);\n let mut result: [T; N] = std::mem::zeroed();\n reader.read_struct_array::<T, M, N>(Deserialize::deserialize, result)\n }\n}\n\n#[test]\nfn test_u16_serialization() {\n let a: u16 = 10;\n assert_eq(a, u16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i8_serialization() {\n let a: i8 = -10;\n assert_eq(a, i8::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i16_serialization() {\n let a: i16 = -10;\n assert_eq(a, i16::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i32_serialization() {\n let a: i32 = -10;\n assert_eq(a, i32::deserialize(a.serialize()));\n}\n\n#[test]\nfn test_i64_serialization() {\n let a: i64 = -10;\n assert_eq(a, i64::deserialize(a.serialize()));\n}\n"
|
|
2946
3028
|
},
|
|
2947
|
-
"
|
|
2948
|
-
"path": "/
|
|
3029
|
+
"344": {
|
|
3030
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr",
|
|
2949
3031
|
"source": "pub mod assert_array_appended;\npub mod assert_array_prepended;\npub mod assert_combined_array;\npub mod assert_combined_transformed_array;\npub mod assert_exposed_sorted_transformed_value_array;\npub mod assert_sorted_array;\npub mod assert_sorted_transformed_value_array;\npub mod assert_split_sorted_transformed_value_arrays;\npub mod assert_split_transformed_value_arrays;\npub mod get_sorted_result;\npub mod get_sorted_tuple;\npub mod sort_by;\npub mod sort_by_counter;\n\n// Re-exports.\npub use assert_array_appended::{\n assert_array_appended, assert_array_appended_and_scoped, assert_array_appended_reversed,\n assert_array_appended_scoped,\n};\npub use assert_array_prepended::assert_array_prepended;\npub use assert_combined_array::{assert_combined_array, combine_arrays};\npub use assert_combined_transformed_array::{\n assert_combined_transformed_array, combine_and_transform_arrays,\n};\npub use assert_exposed_sorted_transformed_value_array::{\n assert_exposed_sorted_transformed_value_array,\n get_order_hints::{get_order_hints_asc, get_order_hints_desc, OrderHint},\n};\npub use assert_sorted_array::assert_sorted_array;\npub use assert_sorted_transformed_value_array::{\n assert_sorted_transformed_value_array, assert_sorted_transformed_value_array_capped_size,\n};\npub use assert_split_sorted_transformed_value_arrays::{\n assert_split_sorted_transformed_value_arrays_asc,\n assert_split_sorted_transformed_value_arrays_desc,\n get_split_order_hints::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints},\n};\npub use assert_split_transformed_value_arrays::assert_split_transformed_value_arrays;\npub use get_sorted_result::{get_sorted_result, SortedResult};\npub use sort_by_counter::{sort_by_counter_asc, sort_by_counter_desc};\n\nuse crate::traits::{Empty, is_empty};\n\npub fn subarray<let SRC_LEN: u32, let DST_LEN: u32>(\n src: [Field; SRC_LEN],\n offset: u32,\n) -> [Field; DST_LEN] {\n assert(offset + DST_LEN <= SRC_LEN, \"offset too large\");\n\n let mut dst: [Field; DST_LEN] = std::mem::zeroed();\n for i in 0..DST_LEN {\n dst[i] = src[i + offset];\n }\n\n dst\n}\n\n// Helper function to convert a validated array to BoundedVec.\n// Important: Only use it for validated arrays: validate_array(array) should be true.\npub unconstrained fn array_to_bounded_vec<T, let N: u32>(array: [T; N]) -> BoundedVec<T, N>\nwhere\n T: Empty + Eq,\n{\n let len = array_length(array);\n BoundedVec::from_parts_unchecked(array, len)\n}\n\n// Helper function to find the index of the first element in an array that satisfies a given predicate. If the element\n// is not found, the function returns N as the index.\npub unconstrained fn find_index_hint<T, let N: u32, Env>(\n array: [T; N],\n find: fn[Env](T) -> bool,\n) -> u32 {\n let mut index = N;\n for i in 0..N {\n // We check `index == N` to ensure that we only update the index if we haven't found a match yet.\n if (index == N) & find(array[i]) {\n index = i;\n }\n }\n index\n}\n\n// Routine which validates that all zero values of an array form a contiguous region at the end, i.e.,\n// of the form: [*,*,*...,0,0,0,0] where any * is non-zero. Note that a full array of non-zero values is\n// valid.\npub fn validate_array<T, let N: u32>(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let mut seen_empty = false;\n let mut length = 0;\n for i in 0..N {\n if is_empty(array[i]) {\n seen_empty = true;\n } else {\n assert(seen_empty == false, \"invalid array\");\n length += 1;\n }\n }\n length\n}\n\n// Helper function to count the number of non-empty elements in a validated array.\n// Important: Only use it for validated arrays where validate_array(array) returns true,\n// which ensures that:\n// 1. All elements before the first empty element are non-empty\n// 2. All elements after and including the first empty element are empty\n// 3. The array forms a contiguous sequence of non-empty elements followed by empty elements\npub fn array_length<T, let N: u32>(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n // We get the length by checking the index of the first empty element.\n\n // Safety: This is safe because we have validated the array (see function doc above) and the emptiness\n // of the element and non-emptiness of the previous element is checked below.\n let length = unsafe { find_index_hint(array, |elem: T| is_empty(elem)) };\n if length != 0 {\n assert(!is_empty(array[length - 1]));\n }\n if length != N {\n assert(is_empty(array[length]));\n }\n length\n}\n\npub fn array_concat<T, let N: u32, let M: u32>(array1: [T; N], array2: [T; M]) -> [T; N + M] {\n let mut result = [array1[0]; N + M];\n for i in 1..N {\n result[i] = array1[i];\n }\n for i in 0..M {\n result[i + N] = array2[i];\n }\n result\n}\n/// This function assumes that `array1` and `array2` contain no more than N non-empty elements between them,\n/// if this is not the case then elements from the end of `array2` will be dropped.\npub fn array_merge<T, let N: u32>(array1: [T; N], array2: [T; N]) -> [T; N]\nwhere\n T: Empty + Eq,\n{\n // Safety: we constrain this array below\n let result = unsafe { array_merge_helper(array1, array2) };\n // We assume arrays have been validated. The only use cases so far are with previously validated arrays.\n let array1_len = array_length(array1);\n let mut add_from_left = true;\n for i in 0..N {\n add_from_left &= i != array1_len;\n if add_from_left {\n assert_eq(result[i], array1[i]);\n } else {\n assert_eq(result[i], array2[i - array1_len]);\n }\n }\n result\n}\n\nunconstrained fn array_merge_helper<T, let N: u32>(array1: [T; N], array2: [T; N]) -> [T; N]\nwhere\n T: Empty + Eq,\n{\n let mut result: [T; N] = [T::empty(); N];\n let mut i = 0;\n for elem in array1 {\n if !is_empty(elem) {\n result[i] = elem;\n i += 1;\n }\n }\n for elem in array2 {\n if !is_empty(elem) {\n result[i] = elem;\n i += 1;\n }\n }\n result\n}\n\n// Helper fn to create a subarray from a given array\npub fn array_splice<T, let N: u32, let M: u32>(array: [T; N], offset: u32) -> [T; M]\nwhere\n T: Empty,\n{\n assert(M + offset <= N, \"Subarray length larger than array length\");\n let mut result: [T; M] = [T::empty(); M];\n for i in 0..M {\n result[i] = array[offset + i];\n }\n result\n}\n\npub fn check_permutation<T, let N: u32>(\n original_array: [T; N],\n permuted_array: [T; N],\n original_indexes: [u32; N],\n)\nwhere\n T: Eq + Empty,\n{\n let mut seen_value = [false; N];\n for i in 0..N {\n let index = original_indexes[i];\n let original_value = original_array[index];\n assert(permuted_array[i].eq(original_value), \"Invalid index\");\n assert(!seen_value[index], \"Duplicated index\");\n seen_value[index] = true;\n }\n}\n\n// Helper function to find the index of the last element in an array, allowing empty elements.\n// e.g. useful for removing trailing 0s from [1, 0, 2, 0, 0, 0] -> [1, 0, 2]\n// Nothing to do with validated arrays. Correctness constrained by padded_array_length.\npub unconstrained fn find_last_value_index<T, let N: u32>(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let mut index = N;\n for i in 0..N {\n let j = N - i - 1;\n // We check `index == N` to ensure that we only update the index if we haven't found a match yet.\n if (index == N) & !is_empty(array[j]) {\n index = j;\n }\n }\n index\n}\n\n// Routine which returns the length of an array right padded by empty elements\n// of the form: [*,*,*...,0,0,0,0] where * is any value (zeroes allowed).\n// See smoke_validate_array_trailing for examples.\n// Nothing to do with validated arrays. Correctness constrained by padded_array_length.\npub unconstrained fn unsafe_padded_array_length<T, let N: u32>(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n let index = find_last_value_index(array);\n if index == N {\n 0\n } else {\n index + 1\n }\n}\n\n// Routine which validates that zero values of an array form a contiguous region at the end, i.e.,\n// of the form: [*,*,*...,0,0,0,0] where * is any value (zeroes allowed).\npub fn padded_array_length<T, let N: u32>(array: [T; N]) -> u32\nwhere\n T: Empty + Eq,\n{\n // Safety: this value is constrained in the below loop.\n let length = unsafe { unsafe_padded_array_length(array) };\n // Check the elt just before length is non-zero:\n if length != 0 {\n assert(!is_empty(array[length - 1]), \"invalid right padded array\");\n }\n // Check all beyond length are zero:\n let mut check_zero = false;\n for i in 0..N {\n check_zero |= i == length;\n if check_zero {\n assert(is_empty(array[i]), \"invalid right padded array\");\n }\n }\n length\n}\n\n#[test]\nfn smoke_validate_array() {\n let valid_array: [Field; 0] = [];\n assert(validate_array(valid_array) == 0);\n\n let valid_array = [0];\n assert(validate_array(valid_array) == 0);\n\n let valid_array = [3];\n assert(validate_array(valid_array) == 1);\n\n let valid_array = [1, 2, 3];\n assert(validate_array(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0];\n assert(validate_array(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0, 0];\n assert(validate_array(valid_array) == 3);\n}\n\n#[test]\nfn smoke_validate_array_trailing() {\n let valid_array: [Field; 0] = [];\n assert(padded_array_length(valid_array) == 0);\n\n let valid_array = [0];\n assert(padded_array_length(valid_array) == 0);\n\n let valid_array = [3];\n assert(padded_array_length(valid_array) == 1);\n\n let valid_array = [1, 0, 3];\n assert(padded_array_length(valid_array) == 3);\n\n let valid_array = [1, 0, 3, 0];\n assert(padded_array_length(valid_array) == 3);\n\n let valid_array = [1, 2, 3, 0, 0];\n assert(padded_array_length(valid_array) == 3);\n\n let valid_array = [0, 0, 3, 0, 0];\n assert(padded_array_length(valid_array) == 3);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case0() {\n let invalid_array = [0, 1];\n let _ = validate_array(invalid_array);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case1() {\n let invalid_array = [1, 0, 0, 1, 0];\n let _ = validate_array(invalid_array);\n}\n\n#[test(should_fail_with = \"invalid array\")]\nfn smoke_validate_array_invalid_case2() {\n let invalid_array = [0, 0, 0, 0, 1];\n let _ = validate_array(invalid_array);\n}\n\n#[test]\nfn test_empty_array_length() {\n assert_eq(array_length([0]), 0);\n assert_eq(array_length([0, 0, 0]), 0);\n}\n\n#[test]\nfn test_array_length() {\n assert_eq(array_length([123]), 1);\n assert_eq(array_length([123, 0, 0]), 1);\n assert_eq(array_length([123, 456]), 2);\n assert_eq(array_length([123, 456, 0]), 2);\n}\n\n#[test]\nfn test_array_length_invalid_arrays() {\n // Result can be misleading (but correct) for invalid arrays.\n assert_eq(array_length([0, 0, 123]), 0);\n assert_eq(array_length([0, 123, 0]), 0);\n assert_eq(array_length([0, 123, 456]), 0);\n assert_eq(array_length([123, 0, 456]), 1);\n}\n\n#[test]\nunconstrained fn find_index_greater_than_min() {\n let values = [10, 20, 30, 40];\n let min = 22;\n let index = find_index_hint(values, |v: Field| min.lt(v));\n assert_eq(index, 2);\n}\n\n#[test]\nunconstrained fn find_index_not_found() {\n let values = [10, 20, 30, 40];\n let min = 100;\n let index = find_index_hint(values, |v: Field| min.lt(v));\n assert_eq(index, 4);\n}\n\n#[test]\nfn test_array_concat() {\n let array0 = [1, 2, 3];\n let array1 = [4, 5];\n let concatenated = array_concat(array0, array1);\n assert_eq(concatenated, [1, 2, 3, 4, 5]);\n}\n\n#[test]\nfn check_permutation_basic_test() {\n let original_array = [1, 2, 3];\n let permuted_array = [3, 1, 2];\n let indexes = [2, 0, 1];\n check_permutation(original_array, permuted_array, indexes);\n}\n\n#[test(should_fail_with = \"Duplicated index\")]\nfn check_permutation_duplicated_index() {\n let original_array = [0, 1, 0];\n let permuted_array = [1, 0, 0];\n let indexes = [1, 0, 0];\n check_permutation(original_array, permuted_array, indexes);\n}\n\n#[test(should_fail_with = \"Invalid index\")]\nfn check_permutation_invalid_index() {\n let original_array = [0, 1, 2];\n let permuted_array = [1, 0, 0];\n let indexes = [1, 0, 2];\n check_permutation(original_array, permuted_array, indexes);\n}\n"
|
|
2950
3032
|
},
|
|
2951
|
-
"
|
|
2952
|
-
"path": "/
|
|
3033
|
+
"347": {
|
|
3034
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr",
|
|
2953
3035
|
"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_bool(&mut self) -> bool {\n self.read() as bool\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 finish(self) {\n assert(self.offset == self.data.len(), \"Reader did not read all data\");\n }\n}\n"
|
|
2954
3036
|
},
|
|
3037
|
+
"46": {
|
|
3038
|
+
"path": "std/option.nr",
|
|
3039
|
+
"source": "use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\npub struct Option<T> {\n _is_some: bool,\n _value: T,\n}\n\nimpl<T> Option<T> {\n /// Constructs a None value\n pub fn none() -> Self {\n Self { _is_some: false, _value: crate::mem::zeroed() }\n }\n\n /// Constructs a Some wrapper around the given value\n pub fn some(_value: T) -> Self {\n Self { _is_some: true, _value }\n }\n\n /// True if this Option is None\n pub fn is_none(self) -> bool {\n !self._is_some\n }\n\n /// True if this Option is Some\n pub fn is_some(self) -> bool {\n self._is_some\n }\n\n /// Asserts `self.is_some()` and returns the wrapped value.\n pub fn unwrap(self) -> T {\n assert(self._is_some);\n self._value\n }\n\n /// Returns the inner value without asserting `self.is_some()`\n /// Note that if `self` is `None`, there is no guarantee what value will be returned,\n /// only that it will be of type `T`.\n pub fn unwrap_unchecked(self) -> T {\n self._value\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, returns the given default value.\n pub fn unwrap_or(self, default: T) -> T {\n if self._is_some {\n self._value\n } else {\n default\n }\n }\n\n /// Returns the wrapped value if `self.is_some()`. Otherwise, calls the given function to return\n /// a default value.\n pub fn unwrap_or_else<Env>(self, default: fn[Env]() -> T) -> T {\n if self._is_some {\n self._value\n } else {\n default()\n }\n }\n\n /// Asserts `self.is_some()` with a provided custom message and returns the contained `Some` value\n pub fn expect<let N: u32, MessageTypes>(self, message: fmtstr<N, MessageTypes>) -> T {\n assert(self.is_some(), message);\n self._value\n }\n\n /// If self is `Some(x)`, this returns `Some(f(x))`. Otherwise, this returns `None`.\n pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> Option<U> {\n if self._is_some {\n Option::some(f(self._value))\n } else {\n Option::none()\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns the given default value.\n pub fn map_or<U, Env>(self, default: U, f: fn[Env](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default\n }\n }\n\n /// If self is `Some(x)`, this returns `f(x)`. Otherwise, this returns `default()`.\n pub fn map_or_else<U, Env1, Env2>(self, default: fn[Env1]() -> U, f: fn[Env2](T) -> U) -> U {\n if self._is_some {\n f(self._value)\n } else {\n default()\n }\n }\n\n /// Returns None if self is None. Otherwise, this returns `other`.\n pub fn and(self, other: Self) -> Self {\n if self.is_none() {\n Option::none()\n } else {\n other\n }\n }\n\n /// If self is None, this returns None. Otherwise, this calls the given function\n /// with the Some value contained within self, and returns the result of that call.\n ///\n /// In some languages this function is called `flat_map` or `bind`.\n pub fn and_then<U, Env>(self, f: fn[Env](T) -> Option<U>) -> Option<U> {\n if self._is_some {\n f(self._value)\n } else {\n Option::none()\n }\n }\n\n /// If self is Some, return self. Otherwise, return `other`.\n pub fn or(self, other: Self) -> Self {\n if self._is_some {\n self\n } else {\n other\n }\n }\n\n /// If self is Some, return self. Otherwise, return `default()`.\n pub fn or_else<Env>(self, default: fn[Env]() -> Self) -> Self {\n if self._is_some {\n self\n } else {\n default()\n }\n }\n\n // If only one of the two Options is Some, return that option.\n // Otherwise, if both options are Some or both are None, None is returned.\n pub fn xor(self, other: Self) -> Self {\n if self._is_some {\n if other._is_some {\n Option::none()\n } else {\n self\n }\n } else if other._is_some {\n other\n } else {\n Option::none()\n }\n }\n\n /// Returns `Some(x)` if self is `Some(x)` and `predicate(x)` is true.\n /// Otherwise, this returns `None`\n pub fn filter<Env>(self, predicate: fn[Env](T) -> bool) -> Self {\n if self._is_some {\n if predicate(self._value) {\n self\n } else {\n Option::none()\n }\n } else {\n Option::none()\n }\n }\n\n /// Flattens an Option<Option<T>> into a Option<T>.\n /// This returns None if the outer Option is None. Otherwise, this returns the inner Option.\n pub fn flatten(option: Option<Option<T>>) -> Option<T> {\n if option._is_some {\n option._value\n } else {\n Option::none()\n }\n }\n}\n\nimpl<T> Default for Option<T> {\n fn default() -> Self {\n Option::none()\n }\n}\n\nimpl<T> Eq for Option<T>\nwhere\n T: Eq,\n{\n fn eq(self, other: Self) -> bool {\n if self._is_some == other._is_some {\n if self._is_some {\n self._value == other._value\n } else {\n true\n }\n } else {\n false\n }\n }\n}\n\nimpl<T> Hash for Option<T>\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self._is_some.hash(state);\n if self._is_some {\n self._value.hash(state);\n }\n }\n}\n\n// For this impl we're declaring Option::none < Option::some\nimpl<T> Ord for Option<T>\nwhere\n T: Ord,\n{\n fn cmp(self, other: Self) -> Ordering {\n if self._is_some {\n if other._is_some {\n self._value.cmp(other._value)\n } else {\n Ordering::greater()\n }\n } else if other._is_some {\n Ordering::less()\n } else {\n Ordering::equal()\n }\n }\n}\n"
|
|
3040
|
+
},
|
|
2955
3041
|
"47": {
|
|
2956
3042
|
"path": "std/panic.nr",
|
|
2957
3043
|
"source": "pub fn panic<T, U, let N: u32>(message: fmtstr<N, T>) -> U {\n assert(false, message);\n crate::mem::zeroed()\n}\n"
|
|
2958
3044
|
},
|
|
2959
3045
|
"54": {
|
|
2960
|
-
"path": "/
|
|
3046
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr",
|
|
2961
3047
|
"source": "use dep::aztec::macros::aztec;\n\n#[aztec]\npub contract ContractInstanceDeployer {\n use dep::aztec::macros::{events::event, functions::{private, public, view}, storage::storage};\n use dep::aztec::prelude::{Map, SharedMutable};\n use dep::aztec::protocol_types::{\n address::{AztecAddress, PartialAddress},\n constants::{\n DEFAULT_UPDATE_DELAY, DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE,\n DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE, MINIMUM_UPDATE_DELAY,\n REGISTERER_CONTRACT_ADDRESS,\n },\n contract_class_id::ContractClassId,\n public_keys::PublicKeys,\n traits::{Serialize, ToField},\n utils::arrays::array_concat,\n };\n use dep::contract_class_registerer::ContractClassRegisterer;\n use std::meta::derive;\n\n #[derive(Serialize)]\n #[event]\n struct ContractInstanceDeployed {\n DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE: Field,\n address: AztecAddress,\n version: u8,\n salt: Field,\n contract_class_id: ContractClassId,\n initialization_hash: Field,\n public_keys: PublicKeys,\n deployer: AztecAddress,\n }\n\n // We need to impl this separately because ts deserializes a point as two fields only.\n // We had issues that:\n // Notice how the 'is_infinite' field is deserialized as the next point.\n // {\n // masterNullifierPublicKey: Point {\n // x: Fr<0x0000000000000000000000000000000000000000000000000000000000000012>,\n // y: Fr<0x0000000000000000000000000000000000000000000000000000000000000034>,\n // isInfinite: false,\n // kind: 'point'\n // },\n // masterIncomingViewingPublicKey: Point {\n // x: Fr<0x0000000000000000000000000000000000000000000000000000000000000000>,\n // y: Fr<0x0000000000000000000000000000000000000000000000000000000000000056>,\n // isInfinite: false,\n // kind: 'point'\n // },\n // masterOutgoingViewingPublicKey: Point {\n // x: Fr<0x0000000000000000000000000000000000000000000000000000000000000078>,\n // y: Fr<0x0000000000000000000000000000000000000000000000000000000000000000>,\n // isInfinite: false,\n // kind: 'point'\n // },\n // masterTaggingPublicKey: Point {\n // x: Fr<0x0000000000000000000000000000000000000000000000000000000000000910>,\n // y: Fr<0x0000000000000000000000000000000000000000000000000000000000001112>,\n // isInfinite: false,\n // kind: 'point'\n // }\n\n impl ContractInstanceDeployed {\n fn serialize_non_standard(self) -> [Field; 15] {\n [\n self.DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_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.public_keys.npk_m.serialize()[0],\n self.public_keys.npk_m.serialize()[1],\n self.public_keys.ivpk_m.serialize()[0],\n self.public_keys.ivpk_m.serialize()[1],\n self.public_keys.ovpk_m.serialize()[0],\n self.public_keys.ovpk_m.serialize()[1],\n self.public_keys.tpk_m.serialize()[0],\n self.public_keys.tpk_m.serialize()[1],\n self.deployer.to_field(),\n ]\n }\n }\n\n #[derive(Serialize)]\n #[event]\n struct ContractInstanceUpdated {\n DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE: Field,\n address: AztecAddress,\n prev_contract_class_id: ContractClassId,\n new_contract_class_id: ContractClassId,\n block_of_change: u32,\n }\n\n #[storage]\n struct Storage<Context> {\n updated_class_ids: Map<AztecAddress, SharedMutable<ContractClassId, DEFAULT_UPDATE_DELAY, Context>, Context>,\n }\n\n #[private]\n fn deploy(\n salt: Field,\n contract_class_id: ContractClassId,\n initialization_hash: Field,\n public_keys: PublicKeys,\n universal_deploy: bool,\n ) {\n // contract class must be registered to deploy an instance\n ContractClassRegisterer::at(REGISTERER_CONTRACT_ADDRESS)\n .assert_class_id_is_registered(contract_class_id)\n .call(&mut context);\n\n let deployer = if universal_deploy {\n AztecAddress::zero()\n } else {\n context.msg_sender()\n };\n\n let partial_address =\n PartialAddress::compute(contract_class_id, salt, initialization_hash, deployer);\n\n let address = AztecAddress::compute(public_keys, partial_address);\n\n // Emit the address as a nullifier to be able to prove that this instance has been (not) deployed\n context.push_nullifier(address.to_field());\n\n // Broadcast the event\n let event = ContractInstanceDeployed {\n DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE,\n contract_class_id,\n address,\n public_keys,\n initialization_hash,\n salt,\n deployer,\n version: 1,\n };\n\n let payload = event.serialize_non_standard();\n dep::aztec::oracle::debug_log::debug_log_format(\"ContractInstanceDeployed: {}\", payload);\n\n let padded_log = array_concat(payload, [0; 3]);\n context.emit_private_log(padded_log);\n }\n\n #[public]\n fn update(new_contract_class_id: ContractClassId) {\n let address = context.msg_sender();\n\n assert(\n context.nullifier_exists(address.to_field(), context.this_address()),\n \"msg.sender is not deployed\",\n );\n\n assert(\n context.nullifier_exists(new_contract_class_id.to_field(), REGISTERER_CONTRACT_ADDRESS),\n \"New contract class is not registered\",\n );\n\n let scheduled_value_update = storage\n .updated_class_ids\n .at(address)\n .schedule_and_return_value_change(new_contract_class_id);\n let (prev_contract_class_id, block_of_change) = scheduled_value_update.get_previous();\n\n let event = ContractInstanceUpdated {\n DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE,\n address,\n prev_contract_class_id,\n new_contract_class_id,\n block_of_change,\n };\n\n context.emit_public_log(event);\n }\n\n #[public]\n fn set_update_delay(new_update_delay: u32) {\n let address = context.msg_sender();\n\n assert(\n context.nullifier_exists(address.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(address).schedule_delay_change(new_update_delay);\n }\n\n #[public]\n #[view]\n fn get_update_delay() -> u32 {\n storage.updated_class_ids.at(context.msg_sender()).get_current_delay()\n }\n}\n"
|
|
2962
3048
|
},
|
|
3049
|
+
"55": {
|
|
3050
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/capsules/mod.nr",
|
|
3051
|
+
"source": "use crate::oracle::capsules;\nuse protocol_types::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\n/// A dynamically sized array backed by PXE's non-volatile database (called capsules). Values are persisted until\n/// deleted, so they can be e.g. stored during simulation of a transaction and later retrieved during witness\n/// generation. All values are scoped per contract address, so external contracts cannot access them.\npub struct CapsuleArray<T> {\n contract_address: AztecAddress,\n /// The base slot is where the array length is stored in capsules. Array elements are stored in consecutive slots\n /// after the base slot. For example, with base slot 5: the length is at slot 5, the first element (index 0) is at\n /// slot 6, the second element (index 1) is at slot 7, and so on.\n base_slot: Field,\n}\n\nimpl<T, let N: u32> CapsuleArray<T>\nwhere\n T: Serialize<N> + Deserialize<N>,\n{\n /// Returns a CapsuleArray connected to a contract's capsules at a base slot. Array elements are stored in\n /// contiguous slots following the base slot, so there should be sufficient space between array base slots to\n /// accommodate elements. A reasonable strategy is to make the base slot a hash of a unique value.\n pub unconstrained fn at(contract_address: AztecAddress, base_slot: Field) -> Self {\n Self { contract_address, base_slot }\n }\n\n /// Returns the number of elements stored in the array.\n pub unconstrained fn len(self) -> u32 {\n // An uninitialized array defaults to a length of 0.\n capsules::load(self.contract_address, self.base_slot).unwrap_or(0) as u32\n }\n\n /// Stores a value at the end of the array.\n pub unconstrained fn push(self, value: T) {\n let current_length = self.len();\n\n // The slot corresponding to the index `current_length` is the first slot immediately after the end of the\n // array, which is where we want to place the new value.\n capsules::store(self.contract_address, self.slot_at(current_length), value);\n\n // Then we simply update the length.\n let new_length = current_length + 1;\n capsules::store(self.contract_address, self.base_slot, new_length);\n }\n\n /// Retrieves the value stored in the array at `index`. Throws if the index is out of bounds.\n pub unconstrained fn get(self, index: u32) -> T {\n assert(index < self.len(), \"Attempted to read past the length of a CapsuleArray\");\n\n capsules::load(self.contract_address, self.slot_at(index)).unwrap()\n }\n\n /// Deletes the value stored in the array at `index`. Throws if the index is out of bounds.\n pub unconstrained fn remove(self, index: u32) {\n let current_length = self.len();\n assert(index < current_length, \"Attempted to delete past the length of a CapsuleArray\");\n\n // In order to be able to remove elements at arbitrary indices, we need to shift the entire contents of the\n // array past the removed element one slot backward so that we don't end up with a gap and preserve the\n // contiguous slots. We can skip this when deleting the last element however.\n if index != current_length - 1 {\n // The source and destination regions overlap, but `copy` supports this.\n capsules::copy(\n self.contract_address,\n self.slot_at(index + 1),\n self.slot_at(index),\n current_length - index - 1,\n );\n }\n\n // We can now delete the last element (which has either been copied to the slot immediately before it, or was\n // the element we meant to delete in the first place) and update the length.\n capsules::delete(self.contract_address, self.slot_at(current_length - 1));\n capsules::store(self.contract_address, self.base_slot, current_length - 1);\n }\n\n unconstrained fn slot_at(self, index: u32) -> Field {\n // Elements are stored immediately after the base slot, so we add 1 to it to compute the slot for the first\n // element.\n self.base_slot + 1 + index as Field\n }\n}\n\nmod test {\n use crate::test::helpers::test_environment::TestEnvironment;\n use super::CapsuleArray;\n use protocol_types::address::AztecAddress;\n\n global SLOT: Field = 1230;\n\n unconstrained fn setup() -> AztecAddress {\n TestEnvironment::new().unkonstrained().this_address()\n }\n\n #[test]\n unconstrained fn empty_array() {\n let contract_address = setup();\n\n let array: CapsuleArray<Field> = CapsuleArray::at(contract_address, SLOT);\n assert_eq(array.len(), 0);\n }\n\n #[test(should_fail_with = \"Attempted to read past the length of a CapsuleArray\")]\n unconstrained fn empty_array_read() {\n let contract_address = setup();\n\n let array = CapsuleArray::at(contract_address, SLOT);\n let _: Field = array.get(0);\n }\n\n #[test]\n unconstrained fn array_push() {\n let contract_address = setup();\n\n let array = CapsuleArray::at(contract_address, SLOT);\n array.push(5);\n\n assert_eq(array.len(), 1);\n assert_eq(array.get(0), 5);\n }\n\n #[test(should_fail_with = \"Attempted to read past the length of a CapsuleArray\")]\n unconstrained fn read_past_len() {\n let contract_address = setup();\n\n let array = CapsuleArray::at(contract_address, SLOT);\n array.push(5);\n\n let _ = array.get(1);\n }\n\n #[test]\n unconstrained fn array_remove_last() {\n let contract_address = setup();\n\n let array = CapsuleArray::at(contract_address, SLOT);\n\n array.push(5);\n array.remove(0);\n\n assert_eq(array.len(), 0);\n }\n\n #[test]\n unconstrained fn array_remove_some() {\n let contract_address = setup();\n\n let array = CapsuleArray::at(contract_address, SLOT);\n\n array.push(7);\n array.push(8);\n array.push(9);\n\n assert_eq(array.len(), 3);\n assert_eq(array.get(0), 7);\n assert_eq(array.get(1), 8);\n assert_eq(array.get(2), 9);\n\n array.remove(1);\n\n assert_eq(array.len(), 2);\n assert_eq(array.get(0), 7);\n assert_eq(array.get(1), 9);\n }\n\n #[test]\n unconstrained fn array_remove_all() {\n let contract_address = setup();\n\n let array = CapsuleArray::at(contract_address, SLOT);\n\n array.push(7);\n array.push(8);\n array.push(9);\n\n array.remove(1);\n array.remove(1);\n array.remove(0);\n\n assert_eq(array.len(), 0);\n }\n}\n"
|
|
3052
|
+
},
|
|
2963
3053
|
"56": {
|
|
2964
|
-
"path": "/
|
|
3054
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr",
|
|
2965
3055
|
"source": "use dep::protocol_types::{\n abis::function_selector::FunctionSelector, address::AztecAddress, traits::Deserialize,\n};\n\nuse crate::context::{gas::GasOpts, private_context::PrivateContext, public_context::PublicContext};\n\nuse crate::hash::hash_args;\nuse crate::oracle::execution_cache;\n\npub trait CallInterface<let N: u32> {\n fn get_args(self) -> [Field];\n fn get_selector(self) -> FunctionSelector;\n fn get_name(self) -> str<N>;\n fn get_contract_address(self) -> AztecAddress;\n fn get_is_static(self) -> bool;\n}\n\n// PrivateCallInterface\n\npub struct PrivateCallInterface<let N: u32, T> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args_hash: Field,\n args: [Field],\n return_type: T,\n is_static: bool,\n}\n\nimpl<let N: u32, T> PrivateCallInterface<N, T> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n is_static: bool,\n ) -> Self {\n let args_hash = hash_args(args);\n Self {\n target_contract,\n selector,\n name,\n args_hash,\n args,\n return_type: std::mem::zeroed(),\n is_static,\n }\n }\n\n pub fn call<let M: u32>(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize<M>,\n {\n execution_cache::store(self.args);\n let returns_hash = context.call_private_function_with_args_hash(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n );\n let returns: T = returns_hash.get_preimage();\n returns\n }\n\n pub fn view<let M: u32>(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize<M>,\n {\n execution_cache::store(self.args);\n let returns_hash = context.call_private_function_with_args_hash(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns_hash.get_preimage()\n }\n}\n\nimpl<let N: u32, T> CallInterface<N> for PrivateCallInterface<N, T> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PrivateVoidCallInterface\n\npub struct PrivateVoidCallInterface<let N: u32> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args_hash: Field,\n args: [Field],\n return_type: (), // Unit type () indicates this interface is for functions that return nothing (void)\n is_static: bool,\n}\n\nimpl<let N: u32> PrivateVoidCallInterface<N> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n is_static: bool,\n ) -> Self {\n let args_hash = hash_args(args);\n Self { target_contract, selector, name, args_hash, args, return_type: (), is_static }\n }\n\n pub fn call(self, context: &mut PrivateContext) {\n execution_cache::store(self.args);\n context\n .call_private_function_with_args_hash(\n self.target_contract,\n self.selector,\n self.args_hash,\n false,\n )\n .assert_empty();\n }\n\n pub fn view(self, context: &mut PrivateContext) {\n execution_cache::store(self.args);\n context\n .call_private_function_with_args_hash(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl<let N: u32> CallInterface<N> for PrivateVoidCallInterface<N> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PrivateStaticCallInterface\n\npub struct PrivateStaticCallInterface<let N: u32, T> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args_hash: Field,\n args: [Field],\n return_type: T,\n is_static: bool,\n}\n\nimpl<let N: u32, T> PrivateStaticCallInterface<N, T> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n ) -> Self {\n let args_hash = hash_args(args);\n Self {\n target_contract,\n selector,\n name,\n args_hash,\n args,\n return_type: std::mem::zeroed(),\n is_static: true,\n }\n }\n\n pub fn view<let M: u32>(self, context: &mut PrivateContext) -> T\n where\n T: Deserialize<M>,\n {\n execution_cache::store(self.args);\n let returns = context.call_private_function_with_args_hash(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n );\n returns.get_preimage()\n }\n}\n\nimpl<let N: u32, T> CallInterface<N> for PrivateStaticCallInterface<N, T> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PrivateStaticVoidCallInterface\n\npub struct PrivateStaticVoidCallInterface<let N: u32> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args_hash: Field,\n args: [Field],\n return_type: (), // Unit type () indicates this interface is for functions that return nothing (void)\n is_static: bool,\n}\n\nimpl<let N: u32> PrivateStaticVoidCallInterface<N> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n ) -> Self {\n let args_hash = hash_args(args);\n Self { target_contract, selector, name, args_hash, args, return_type: (), is_static: true }\n }\n\n pub fn view(self, context: &mut PrivateContext) {\n execution_cache::store(self.args);\n context\n .call_private_function_with_args_hash(\n self.target_contract,\n self.selector,\n self.args_hash,\n true,\n )\n .assert_empty();\n }\n}\n\nimpl<let N: u32> CallInterface<N> for PrivateStaticVoidCallInterface<N> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PublicCallInterface\n\npub struct PublicCallInterface<let N: u32, T> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n gas_opts: GasOpts,\n return_type: T,\n is_static: bool,\n}\n\nimpl<let N: u32, T> PublicCallInterface<N, T> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n is_static: bool,\n ) -> Self {\n Self {\n target_contract,\n selector,\n name,\n args,\n gas_opts: GasOpts::default(),\n return_type: std::mem::zeroed(),\n is_static,\n }\n }\n\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call<let M: u32>(self, context: &mut PublicContext) -> T\n where\n T: Deserialize<M>,\n {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::<M>())\n }\n\n pub unconstrained fn view<let M: u32>(self, context: &mut PublicContext) -> T\n where\n T: Deserialize<M>,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::<M>())\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.call_public_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.call_public_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl<let N: u32, T> CallInterface<N> for PublicCallInterface<N, T> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PublicVoidCallInterface\n\npub struct PublicVoidCallInterface<let N: u32> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n return_type: (), // Unit type () indicates this interface is for functions that return nothing (void)\n is_static: bool,\n gas_opts: GasOpts,\n}\n\nimpl<let N: u32> PublicVoidCallInterface<N> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n is_static: bool,\n ) -> Self {\n Self {\n target_contract,\n selector,\n name,\n args,\n return_type: (),\n is_static,\n gas_opts: GasOpts::default(),\n }\n }\n\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn call(self, context: &mut PublicContext) {\n let returns = context.call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.call_public_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.call_public_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n\n pub fn set_as_teardown(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.set_public_teardown_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n false,\n )\n }\n}\n\nimpl<let N: u32> CallInterface<N> for PublicVoidCallInterface<N> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PublicStaticCallInterface\n\npub struct PublicStaticCallInterface<let N: u32, T> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n return_type: T,\n is_static: bool,\n gas_opts: GasOpts,\n}\n\nimpl<let N: u32, T> PublicStaticCallInterface<N, T> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n ) -> Self {\n Self {\n target_contract,\n selector,\n name,\n args,\n return_type: std::mem::zeroed(),\n is_static: true,\n gas_opts: GasOpts::default(),\n }\n }\n\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view<let M: u32>(self, context: &mut PublicContext) -> T\n where\n T: Deserialize<M>,\n {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n Deserialize::deserialize(returns.as_array::<M>())\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.call_public_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl<let N: u32, T> CallInterface<N> for PublicStaticCallInterface<N, T> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n\n// PublicStaticVoidCallInterface\n\npub struct PublicStaticVoidCallInterface<let N: u32> {\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n return_type: (), // Unit type () indicates this interface is for functions that return nothing (void)\n is_static: bool,\n gas_opts: GasOpts,\n}\n\nimpl<let N: u32> PublicStaticVoidCallInterface<N> {\n pub fn new(\n target_contract: AztecAddress,\n selector: FunctionSelector,\n name: str<N>,\n args: [Field],\n ) -> Self {\n Self {\n target_contract,\n selector,\n name,\n args,\n return_type: (),\n is_static: true,\n gas_opts: GasOpts::default(),\n }\n }\n\n pub fn with_gas(self: &mut Self, gas_opts: GasOpts) -> &mut Self {\n self.gas_opts = gas_opts;\n self\n }\n\n pub unconstrained fn view(self, context: &mut PublicContext) {\n let returns = context.static_call_public_function(\n self.target_contract,\n self.selector,\n self.args,\n self.gas_opts,\n );\n assert(returns.len() == 0);\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let args_hash = hash_args(self.args);\n execution_cache::store(self.args);\n context.call_public_function_with_args_hash(\n self.target_contract,\n self.selector,\n args_hash,\n /*static=*/\n true,\n )\n }\n}\n\nimpl<let N: u32> CallInterface<N> for PublicStaticVoidCallInterface<N> {\n fn get_args(self) -> [Field] {\n self.args\n }\n\n fn get_selector(self) -> FunctionSelector {\n self.selector\n }\n\n fn get_name(self) -> str<N> {\n self.name\n }\n\n fn get_contract_address(self) -> AztecAddress {\n self.target_contract\n }\n\n fn get_is_static(self) -> bool {\n self.is_static\n }\n}\n"
|
|
2966
3056
|
},
|
|
3057
|
+
"6": {
|
|
3058
|
+
"path": "std/collections/bounded_vec.nr",
|
|
3059
|
+
"source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a `Vec<T>` except that it\n/// is bounded with a maximum possible length. Unlike `Vec`, `BoundedVec` is not implemented\n/// via slices and thus is not subject to the same restrictions slices are (notably, nested\n/// slices - and thus nested vectors as well - are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over `Vec<T>` when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should always be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n ///\n /// This defaulting of `MaxLen` (and numeric generics in general) to zero may change in future noir versions\n /// but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a\n /// constraint failure at runtime when the vec is pushed to.\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given slice to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_slice(&[2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_slice(&mut self, slice: [T]) {\n let new_len = self.len + slice.len();\n assert(new_len <= MaxLen, \"extend_from_slice out of bounds\");\n for i in 0..slice.len() {\n self.storage[self.len + i] = slice[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..Len {\n exceeded_len |= i == append_len;\n if !exceeded_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0);\n self.len -= 1;\n\n let elem = self.storage[self.len];\n self.storage[self.len] = crate::mem::zeroed();\n elem\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut ret = false;\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function will zero out any elements at or past index `len` of `array`.\n /// This incurs an extra runtime cost of O(MaxLen). If you are sure your array is\n /// zeroed after that index, you can use `from_parts_unchecked` to remove the extra loop.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n let zeroed = crate::mem::zeroed();\n\n if is_unconstrained() {\n for i in len..MaxLen {\n array[i] = zeroed;\n }\n } else {\n for i in 0..MaxLen {\n if i >= len {\n array[i] = zeroed;\n }\n }\n }\n\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n // TODO: https://github.com/noir-lang/noir/issues/4837\n //\n // We make the assumption that the user has used the proper interface for working with `BoundedVec`s\n // rather than directly manipulating the internal fields as this can result in an inconsistent internal state.\n if self.len == other.len {\n self.storage == other.storage\n } else {\n false\n }\n }\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n crate::println(vec.get(0));\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n\n // Need to use println to avoid DIE removing the write operation.\n crate::println(vec.get(0));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n bounded_vec1.push(1);\n bounded_vec2.push(2);\n\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are zeroed out, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n\n #[test]\n fn from_parts_unchecked() {\n // docs:start:from-parts-unchecked\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // invalid use!\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n\n // both vecs have length 3 so we'd expect them to be equal, but this\n // fails because elements past the length are still checked in eq\n assert(vec1 != vec2);\n // docs:end:from-parts-unchecked\n }\n }\n}\n"
|
|
3060
|
+
},
|
|
2967
3061
|
"63": {
|
|
2968
|
-
"path": "/
|
|
3062
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/private_context.nr",
|
|
2969
3063
|
"source": "use dep::protocol_types::debug_log::debug_log_format;\n\nuse crate::{\n context::{inputs::PrivateContextInputs, returns_hash::ReturnsHash},\n hash::{ArgsHasher, hash_args_array},\n keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators},\n messaging::process_l1_to_l2_message,\n oracle::{\n block_header::get_block_header_at,\n call_private_function::call_private_function_internal,\n enqueue_public_function_call::{\n enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter,\n set_public_teardown_function_call_internal,\n },\n execution_cache,\n key_validation_request::get_key_validation_request,\n notes::{notify_created_nullifier, notify_nullified_note},\n },\n};\nuse dep::protocol_types::{\n abis::{\n call_context::CallContext,\n function_selector::FunctionSelector,\n gas_settings::GasSettings,\n log::Log,\n log_hash::LogHash,\n max_block_number::MaxBlockNumber,\n note_hash::NoteHash,\n nullifier::Nullifier,\n private_call_request::PrivateCallRequest,\n private_circuit_public_inputs::PrivateCircuitPublicInputs,\n private_log::PrivateLogData,\n public_call_request::PublicCallRequest,\n read_request::ReadRequest,\n side_effect::Counted,\n validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator},\n },\n address::{AztecAddress, EthAddress},\n block_header::BlockHeader,\n constants::{\n MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL,\n MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL,\n MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASHES_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 PRIVATE_LOG_SIZE_IN_FIELDS, PUBLIC_DISPATCH_SELECTOR,\n },\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::{Empty, FromField, Hash, ToField},\n};\n\n// When finished, one can call .finish() to convert back to the abi\npub struct PrivateContext {\n // docs:start:private-context\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 max_block_number: MaxBlockNumber,\n\n pub note_hash_read_requests: BoundedVec<ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,\n pub nullifier_read_requests: BoundedVec<ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,\n key_validation_requests_and_generators: BoundedVec<KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,\n\n pub note_hashes: BoundedVec<NoteHash, MAX_NOTE_HASHES_PER_CALL>,\n pub nullifiers: BoundedVec<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<L2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL>,\n // docs:end:private-context\n\n // Header of a block whose state is used during private execution (not the block the transaction is included in).\n pub historical_header: BlockHeader,\n\n pub private_logs: BoundedVec<PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL>,\n pub contract_class_logs_hashes: BoundedVec<LogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL>,\n\n // Contains the last key validation request for each key type. This is used to cache the last request and avoid\n // fetching the same request multiple times.\n // The index of the array corresponds to the key type (0 nullifier, 1 incoming, 2 outgoing, 3 tagging).\n pub last_key_validation_requests: [Option<KeyValidationRequest>; NUM_KEY_TYPES],\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 max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: BoundedVec::new(),\n nullifiers: BoundedVec::new(),\n historical_header: inputs.historical_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 last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n\n pub fn msg_sender(self) -> AztecAddress {\n self.inputs.call_context.msg_sender\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.inputs.call_context.contract_address\n }\n\n pub fn chain_id(self) -> Field {\n self.inputs.tx_context.chain_id\n }\n\n pub fn version(self) -> Field {\n self.inputs.tx_context.version\n }\n\n pub fn gas_settings(self) -> GasSettings {\n self.inputs.tx_context.gas_settings\n }\n\n pub fn selector(self) -> FunctionSelector {\n self.inputs.call_context.function_selector\n }\n\n pub fn get_args_hash(self) -> Field {\n self.args_hash\n }\n\n pub fn push_note_hash(&mut self, note_hash: Field) {\n self.note_hashes.push(NoteHash { value: note_hash, counter: self.next_counter() });\n\n // WARNING(https://github.com/AztecProtocol/aztec-packages/issues/10558): if you delete this debug_log_format line, some tests fail.\n debug_log_format(\n \"Context.note_hashes, after pushing new note hash: {0}\",\n self.note_hashes.storage().map(|nh: NoteHash| nh.value),\n );\n }\n\n pub fn push_nullifier(&mut self, nullifier: Field) {\n notify_created_nullifier(nullifier);\n self.nullifiers.push(\n Nullifier { value: nullifier, note_hash: 0, counter: self.next_counter() },\n );\n }\n\n pub fn push_nullifier_for_note_hash(&mut self, nullifier: Field, nullified_note_hash: Field) {\n let nullifier_counter = self.next_counter();\n notify_nullified_note(nullifier, nullified_note_hash, nullifier_counter);\n self.nullifiers.push(\n Nullifier {\n value: nullifier,\n note_hash: nullified_note_hash,\n counter: nullifier_counter,\n },\n );\n }\n\n // Returns the header of a block whose state is used during private execution (not the block the transaction is\n // included in).\n pub fn get_block_header(self) -> BlockHeader {\n self.historical_header\n }\n\n // Returns the header of an arbitrary block whose block number is less than or equal to the block number\n // of historical header.\n pub fn get_block_header_at(self, block_number: u32) -> BlockHeader {\n get_block_header_at(block_number, self)\n }\n\n pub fn set_return_hash(&mut self, returns_hasher: ArgsHasher) {\n execution_cache::store(returns_hasher.fields);\n self.return_hash = returns_hasher.hash();\n }\n\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 max_block_number: self.max_block_number,\n note_hash_read_requests: self.note_hash_read_requests.storage(),\n nullifier_read_requests: self.nullifier_read_requests.storage(),\n key_validation_requests_and_generators: self\n .key_validation_requests_and_generators\n .storage(),\n note_hashes: self.note_hashes.storage(),\n nullifiers: self.nullifiers.storage(),\n private_call_requests: self.private_call_requests.storage(),\n public_call_requests: self.public_call_requests.storage(),\n public_teardown_call_request: self.public_teardown_call_request,\n l2_to_l1_msgs: self.l2_to_l1_msgs.storage(),\n start_side_effect_counter: self.inputs.start_side_effect_counter,\n end_side_effect_counter: self.side_effect_counter,\n private_logs: self.private_logs.storage(),\n contract_class_logs_hashes: self.contract_class_logs_hashes.storage(),\n historical_header: self.historical_header,\n tx_context: self.inputs.tx_context,\n }\n }\n\n pub fn set_as_fee_payer(&mut self) {\n dep::protocol_types::debug_log::debug_log_format(\n \"Setting {0} as fee payer\",\n [self.this_address().to_field()],\n );\n self.is_fee_payer = true;\n }\n\n pub fn end_setup(&mut self) {\n // dep::protocol_types::debug_log::debug_log_format(\n // \"Ending setup at counter {0}\",\n // [self.side_effect_counter as Field]\n // );\n self.min_revertible_side_effect_counter = self.side_effect_counter;\n notify_set_min_revertible_side_effect_counter(self.min_revertible_side_effect_counter);\n }\n\n // docs:start:max-block-number\n pub fn set_tx_max_block_number(&mut self, max_block_number: u32) {\n // docs:end:max-block-number\n self.max_block_number =\n MaxBlockNumber::min_with_u32(self.max_block_number, max_block_number);\n }\n\n pub fn push_note_hash_read_request(&mut self, note_hash: Field) {\n let side_effect = ReadRequest { value: note_hash, counter: self.next_counter() };\n self.note_hash_read_requests.push(side_effect);\n }\n\n pub fn push_nullifier_read_request(&mut self, nullifier: Field) {\n let request = ReadRequest { value: nullifier, counter: self.next_counter() };\n self.nullifier_read_requests.push(request);\n }\n\n pub fn request_nsk_app(&mut self, npk_m_hash: Field) -> Field {\n self.request_sk_app(npk_m_hash, NULLIFIER_INDEX)\n }\n\n pub fn request_ovsk_app(&mut self, ovpk_m_hash: Field) -> Field {\n self.request_sk_app(ovpk_m_hash, OUTGOING_INDEX)\n }\n\n fn request_sk_app(&mut self, pk_m_hash: Field, key_index: Field) -> Field {\n let cached_request =\n self.last_key_validation_requests[key_index].unwrap_or(KeyValidationRequest::empty());\n\n if cached_request.pk_m.hash() == pk_m_hash {\n // We get a match so the cached request is the latest one\n cached_request.sk_app\n } else {\n // We didn't get a match meaning the cached result is stale\n // Typically we'd validate keys by showing that they are the preimage of `pk_m_hash`, but that'd require\n // the oracle returning the master secret keys, which could cause malicious contracts to leak it or learn\n // about secrets from other contracts. We therefore silo secret keys, and rely on the private kernel to\n // validate that we siloed secret key corresponds to correct siloing of the master secret key that hashes\n // to `pk_m_hash`.\n\n // Safety: Kernels verify that the key validation request is valid and below we verify that a request\n // for the correct public key has been received.\n let request = unsafe { get_key_validation_request(pk_m_hash, key_index) };\n assert_eq(request.pk_m.hash(), pk_m_hash, \"Obtained invalid key validation request\");\n\n self.key_validation_requests_and_generators.push(\n KeyValidationRequestAndGenerator {\n request,\n sk_app_generator: sk_generators[key_index],\n },\n );\n self.last_key_validation_requests[key_index] = Option::some(request);\n request.sk_app\n }\n }\n\n // docs:start:context_message_portal\n pub fn message_portal(&mut self, recipient: EthAddress, content: Field) {\n // docs:end:context_message_portal\n let message = L2ToL1Message { recipient, content, counter: self.next_counter() };\n self.l2_to_l1_msgs.push(message);\n }\n\n // docs:start:context_consume_l1_to_l2_message\n // docs:start:consume_l1_to_l2_message\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 // docs:end:context_consume_l1_to_l2_message\n let nullifier = process_l1_to_l2_message(\n self.historical_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 // docs:end:consume_l1_to_l2_message\n\n pub fn emit_private_log(&mut self, log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS]) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: Log::new(log), note_hash_counter: 0, counter };\n self.private_logs.push(private_log);\n }\n\n pub fn emit_raw_note_log(\n &mut self,\n log: [Field; PRIVATE_LOG_SIZE_IN_FIELDS],\n note_hash_counter: u32,\n ) {\n let counter = self.next_counter();\n let private_log = PrivateLogData { log: Log::new(log), note_hash_counter, counter };\n self.private_logs.push(private_log);\n }\n\n pub fn call_private_function<let ARGS_COUNT: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> ReturnsHash {\n let args_hash = hash_args_array(args);\n execution_cache::store(args);\n self.call_private_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_private_function<let ARGS_COUNT: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) -> ReturnsHash {\n let args_hash = hash_args_array(args);\n execution_cache::store(args);\n self.call_private_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_private_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) -> ReturnsHash {\n self.call_private_function_with_args_hash(contract_address, function_selector, 0, true)\n }\n\n pub 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 (which means that end_side_effect_counter - start_side_effect_counter is\n // the number of side effects that took place), along with the hash of the return values. We validate these\n // by requesting a private kernel iteration in which the return values are constrained to hash\n // to `returns_hash` and the side effects counter to increment from start to end.\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 // TODO (fees) figure out why this crashes the prover and enable it\n // we need this in order to pay fees inside child call contexts\n // assert(\n // (item.public_inputs.min_revertible_side_effect_counter == 0 as u32)\n // | (item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter)\n // );\n // if item.public_inputs.min_revertible_side_effect_counter\n // > self.min_revertible_side_effect_counter {\n // self.min_revertible_side_effect_counter = item.public_inputs.min_revertible_side_effect_counter;\n // }\n self.side_effect_counter = end_side_effect_counter + 1;\n ReturnsHash::new(returns_hash)\n }\n\n pub fn call_public_function<let ARGS_COUNT: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n execution_cache::store(args);\n self.call_public_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn static_call_public_function<let ARGS_COUNT: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n execution_cache::store(args);\n self.call_public_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_args_hash(contract_address, function_selector, 0, false)\n }\n\n pub fn static_call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n self.call_public_function_with_args_hash(contract_address, function_selector, 0, true)\n }\n\n pub fn call_public_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 ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // Safety: TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle hashes the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = unsafe {\n enqueue_public_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n )\n };\n\n // Public calls are rerouted through the dispatch function.\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\n\n self.public_call_requests.push(Counted::new(call_request, counter));\n }\n\n pub fn set_public_teardown_function<let ARGS_COUNT: u32>(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; ARGS_COUNT],\n ) {\n let args_hash = hash_args_array(args);\n execution_cache::store(args);\n self.set_public_teardown_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n false,\n )\n }\n\n pub fn set_public_teardown_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 ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n // Safety: TODO(https://github.com/AztecProtocol/aztec-packages/issues/8985): Fix this.\n // WARNING: This is insecure and should be temporary!\n // The oracle hashes the arguments and returns a new args_hash.\n // new_args = [selector, ...old_args], so as to make it suitable to call the public dispatch function.\n // We don't validate or compute it in the circuit because a) it's harder to do with slices, and\n // b) this is only temporary.\n let args_hash = unsafe {\n set_public_teardown_function_call_internal(\n contract_address,\n function_selector,\n args_hash,\n counter,\n is_static_call,\n )\n };\n\n let function_selector = comptime { FunctionSelector::from_field(PUBLIC_DISPATCH_SELECTOR) };\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n function_selector,\n is_static_call,\n args_hash,\n };\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 max_block_number: MaxBlockNumber::empty(),\n note_hash_read_requests: BoundedVec::new(),\n nullifier_read_requests: BoundedVec::new(),\n key_validation_requests_and_generators: BoundedVec::new(),\n note_hashes: 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 historical_header: BlockHeader::empty(),\n private_logs: BoundedVec::new(),\n contract_class_logs_hashes: BoundedVec::new(),\n last_key_validation_requests: [Option::none(); NUM_KEY_TYPES],\n }\n }\n}\n"
|
|
2970
3064
|
},
|
|
2971
3065
|
"64": {
|
|
2972
|
-
"path": "/
|
|
3066
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/public_context.nr",
|
|
2973
3067
|
"source": "use crate::context::gas::GasOpts;\nuse crate::hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n};\nuse dep::protocol_types::abis::function_selector::FunctionSelector;\nuse dep::protocol_types::address::{AztecAddress, EthAddress};\nuse dep::protocol_types::constants::MAX_FIELD_VALUE;\nuse dep::protocol_types::traits::{Empty, FromField, Packable, Serialize, ToField};\n\npub struct PublicContext {\n pub args_hash: Option<Field>,\n pub compute_args_hash: fn() -> Field,\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 pub fn emit_public_log<T, let N: u32>(_self: &mut Self, log: T)\n where\n T: Serialize<N>,\n {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { emit_public_log(Serialize::serialize(log).as_slice()) };\n }\n\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: Field) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { note_hash_exists(note_hash, leaf_index) } == 1\n }\n\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\n unsafe { l1_to_l2_msg_exists(msg_hash, msg_leaf_index) } == 1\n }\n\n pub fn nullifier_exists(_self: Self, unsiloed_nullifier: Field, address: AztecAddress) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { nullifier_exists(unsiloed_nullifier, address.to_field()) } == 1\n }\n\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 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(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 pub fn message_portal(_self: &mut Self, recipient: EthAddress, content: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { send_l2_to_l1_msg(recipient, content) };\n }\n\n pub unconstrained fn call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n\n call(gas_for_call(gas_opts), contract_address, args);\n // Use success_copy to determine whether the call succeeded\n let success = success_copy();\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub unconstrained fn static_call_public_function(\n _self: &mut Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field],\n gas_opts: GasOpts,\n ) -> [Field] {\n let args = args.push_front(function_selector.to_field());\n\n call_static(gas_for_call(gas_opts), contract_address, args);\n // Use success_copy to determine whether the call succeeded\n let success = success_copy();\n\n let result_data = returndata_copy(0, returndata_size());\n if !success {\n // Rethrow the revert data.\n avm_revert(result_data);\n }\n result_data\n }\n\n pub fn push_note_hash(_self: &mut Self, note_hash: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { emit_note_hash(note_hash) };\n }\n pub fn push_nullifier(_self: &mut Self, nullifier: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { emit_nullifier(nullifier) };\n }\n\n pub fn this_address(_self: Self) -> AztecAddress {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n address()\n }\n }\n pub fn msg_sender(_self: Self) -> AztecAddress {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n sender()\n }\n }\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 { calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\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 pub fn transaction_fee(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n transaction_fee()\n }\n }\n\n pub fn chain_id(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n chain_id()\n }\n }\n pub fn version(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n version()\n }\n }\n pub fn block_number(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n block_number()\n }\n }\n pub fn timestamp(_self: Self) -> u64 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n timestamp()\n }\n }\n pub fn fee_per_l2_gas(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_l2_gas()\n }\n }\n pub fn fee_per_da_gas(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n fee_per_da_gas()\n }\n }\n\n pub fn l2_gas_left(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n l2_gas_left()\n }\n }\n pub fn da_gas_left(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n da_gas_left()\n }\n }\n pub fn is_static_call(_self: Self) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { is_static_call() } == 1\n }\n\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 { storage_read(storage_slot + i as Field) };\n }\n out\n }\n\n pub fn storage_read<T, let N: u32>(self, storage_slot: Field) -> T\n where\n T: Packable<N>,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n\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 { storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n pub fn storage_write<T, let N: u32>(self, storage_slot: Field, value: T)\n where\n T: Packable<N>,\n {\n self.raw_storage_write(storage_slot, value.pack());\n }\n}\n\n// Helper functions\nfn gas_for_call(user_gas: GasOpts) -> [Field; 2] {\n // It's ok to use the max possible gas here, because the gas will be\n // capped by the gas left in the (STATIC)CALL instruction.\n [user_gas.l2_gas.unwrap_or(MAX_FIELD_VALUE), user_gas.da_gas.unwrap_or(MAX_FIELD_VALUE)]\n}\n\n// Unconstrained opcode wrappers (do not use directly).\nunconstrained fn address() -> AztecAddress {\n address_opcode()\n}\nunconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\nunconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\nunconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\nunconstrained fn version() -> Field {\n version_opcode()\n}\nunconstrained fn block_number() -> Field {\n block_number_opcode()\n}\nunconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\nunconstrained fn fee_per_l2_gas() -> Field {\n fee_per_l2_gas_opcode()\n}\nunconstrained fn fee_per_da_gas() -> Field {\n fee_per_da_gas_opcode()\n}\nunconstrained fn l2_gas_left() -> Field {\n l2_gas_left_opcode()\n}\nunconstrained fn da_gas_left() -> Field {\n da_gas_left_opcode()\n}\nunconstrained fn is_static_call() -> Field {\n is_static_call_opcode()\n}\nunconstrained fn note_hash_exists(note_hash: Field, leaf_index: Field) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\nunconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\nunconstrained fn nullifier_exists(nullifier: Field, address: Field) -> u1 {\n nullifier_exists_opcode(nullifier, address)\n}\nunconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\nunconstrained fn emit_public_log(message: [Field]) {\n emit_public_log_opcode(message)\n}\nunconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: Field) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\nunconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\nunconstrained fn call(gas: [Field; 2], address: AztecAddress, args: [Field]) {\n call_opcode(gas, address, args)\n}\n\nunconstrained fn call_static(gas: [Field; 2], address: AztecAddress, args: [Field]) {\n call_static_opcode(gas, address, 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\nunconstrained fn success_copy() -> bool {\n success_copy_opcode()\n}\n\nunconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\nunconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\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\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\nunconstrained fn avm_revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\nunconstrained fn storage_read(storage_slot: Field) -> Field {\n storage_read_opcode(storage_slot)\n}\n\nunconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n\n// AVM oracles (opcodes) follow, do not use directly.\n#[oracle(avmOpcodeAddress)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeSender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(avmOpcodeTransactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(avmOpcodeChainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(avmOpcodeVersion)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(avmOpcodeBlockNumber)]\nunconstrained fn block_number_opcode() -> Field {}\n\n#[oracle(avmOpcodeTimestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(avmOpcodeFeePerL2Gas)]\nunconstrained fn fee_per_l2_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeFeePerDaGas)]\nunconstrained fn fee_per_da_gas_opcode() -> Field {}\n\n#[oracle(avmOpcodeL2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeDaGasLeft)]\nunconstrained fn da_gas_left_opcode() -> Field {}\n\n#[oracle(avmOpcodeIsStaticCall)]\nunconstrained fn is_static_call_opcode() -> Field {}\n\n#[oracle(avmOpcodeNoteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(avmOpcodeNullifierExists)]\nunconstrained fn nullifier_exists_opcode(nullifier: Field, address: Field) -> u1 {}\n\n#[oracle(avmOpcodeEmitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n// TODO(#11124): rename unencrypted to public in avm\n#[oracle(avmOpcodeEmitUnencryptedLog)]\nunconstrained fn emit_public_log_opcode(message: [Field]) {}\n\n#[oracle(avmOpcodeL1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: Field) -> u1 {}\n\n#[oracle(avmOpcodeSendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(avmOpcodeCalldataCopy)]\nunconstrained fn calldata_copy_opcode<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(avmOpcodeReturndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(avmOpcodeReturndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(avmOpcodeReturn)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n// This opcode reverts using the exact data given. In general it should only be used\n// to do rethrows, where the revert data is the same as the original revert data.\n// For normal reverts, use Noir's `assert` which, on top of reverting, will also add\n// an error selector to the revert data.\n#[oracle(avmOpcodeRevert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n#[oracle(avmOpcodeCall)]\nunconstrained fn call_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) {}\n\n#[oracle(avmOpcodeStaticCall)]\nunconstrained fn call_static_opcode(\n gas: [Field; 2], // gas allocation: [l2_gas, da_gas]\n address: AztecAddress,\n args: [Field],\n) {}\n\n#[oracle(avmOpcodeSuccessCopy)]\nunconstrained fn success_copy_opcode() -> bool {}\n\n#[oracle(avmOpcodeStorageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field) -> Field {}\n\n#[oracle(avmOpcodeStorageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n"
|
|
2974
3068
|
},
|
|
2975
3069
|
"65": {
|
|
2976
|
-
"path": "/
|
|
3070
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/returns_hash.nr",
|
|
2977
3071
|
"source": "use crate::{hash::hash_args_array, oracle::execution_cache};\nuse dep::protocol_types::traits::Deserialize;\n\npub struct ReturnsHash {\n hash: Field,\n}\n\nimpl ReturnsHash {\n pub fn new(hash: Field) -> Self {\n ReturnsHash { hash }\n }\n\n pub fn assert_empty(self) {\n assert_eq(self.hash, 0);\n }\n\n pub fn raw(self) -> Field {\n self.hash\n }\n\n /// This is only used during private execution, since in public it is the VM itself that keeps track of return\n /// values.\n pub fn get_preimage<T, let N: u32>(self) -> T\n where\n T: Deserialize<N>,\n {\n // Safety: We verify that the value returned by `load` is the preimage of `hash`, fully constraining it.\n let preimage: [Field; N] = unsafe { execution_cache::load(self.hash) };\n assert_eq(self.hash, hash_args_array(preimage));\n\n Deserialize::deserialize(preimage)\n }\n}\n"
|
|
2978
3072
|
},
|
|
2979
|
-
"
|
|
2980
|
-
"path": "/
|
|
3073
|
+
"66": {
|
|
3074
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/unconstrained_context.nr",
|
|
3075
|
+
"source": "use crate::oracle::{\n execution::{get_block_number, get_chain_id, get_contract_address, get_version},\n storage::storage_read,\n};\nuse dep::protocol_types::{address::AztecAddress, traits::Packable};\n\npub struct UnconstrainedContext {\n block_number: u32,\n contract_address: AztecAddress,\n version: Field,\n chain_id: Field,\n}\n\nimpl UnconstrainedContext {\n pub unconstrained fn new() -> Self {\n // We could call these oracles on the getters instead of at creation, which makes sense given that they might\n // not even be accessed. However any performance gains are minimal, and we'd rather fail early if a user\n // incorrectly attempts to create an UnconstrainedContext in an environment in which these oracles are not\n // available.\n let block_number = get_block_number();\n let contract_address = get_contract_address();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n let block_number = get_block_number();\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub unconstrained fn at_historical(contract_address: AztecAddress, block_number: u32) -> Self {\n let chain_id = get_chain_id();\n let version = get_version();\n Self { block_number, contract_address, version, chain_id }\n }\n\n pub fn block_number(self) -> u32 {\n self.block_number\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n pub fn version(self) -> Field {\n self.version\n }\n\n pub fn chain_id(self) -> Field {\n self.chain_id\n }\n\n pub unconstrained fn raw_storage_read<let N: u32>(\n self: Self,\n storage_slot: Field,\n ) -> [Field; N] {\n storage_read(self.this_address(), storage_slot, self.block_number())\n }\n\n pub unconstrained fn storage_read<T, let N: u32>(self, storage_slot: Field) -> T\n where\n T: Packable<N>,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n}\n"
|
|
3076
|
+
},
|
|
3077
|
+
"68": {
|
|
3078
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/mod.nr",
|
|
3079
|
+
"source": "// TODO(#12750): don't make this value assume we're using AES.\nuse crate::encrypted_logs::log_assembly_strategies::default_aes128::note::encryption::PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS;\nuse dep::protocol_types::{address::AztecAddress, debug_log::debug_log};\n\npub mod private_logs;\npub mod private_notes;\npub mod partial_notes;\npub mod nonce_discovery;\n\n/// We reserve two fields in the note private log that are not part of the note content: one for the storage slot, and\n/// one for the combined log and note type ID.\nglobal PRIVATE_LOG_EXPANDED_METADATA_LEN: u32 = 1;\n\n/// The maximum length of the log's content, i.e. after log type ID and metadata extraction.\npub global MAX_LOG_CONTENT_LEN: u32 =\n PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS - PRIVATE_LOG_EXPANDED_METADATA_LEN;\n\nuse private_notes::MAX_NOTE_PACKED_LEN;\n\npub struct NoteHashAndNullifier {\n /// The result of NoteHash::compute_note_hash\n pub note_hash: Field,\n /// The result of NoteHash::compute_nullifier_unconstrained (since all of message discovery is unconstrained)\n pub inner_nullifier: Field,\n}\n\n/// A function which takes a note's packed content, address of the emitting contract, nonce, storage slot and note type\n/// ID and attempts to compute its note hash (not siloed by nonce nor address) and inner nullifier (not siloed by\n/// address).\n///\n/// This function must be user-provided as its implementation requires knowledge of how note type IDs are allocated in a\n/// contract. The `#[aztec]` macro automatically creates such a contract library method called\n/// `_compute_note_hash_and_nullifier`, which looks something like this:\n///\n/// ```\n/// |packed_note, contract_address, nonce, storage_slot, note_type_id| {\n/// if note_type_id == MyNoteType::get_id() {\n/// assert(packed_note.len() == MY_NOTE_TYPE_SERIALIZATION_LENGTH);\n///\n/// let note = MyNoteType::unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n///\n/// let note_hash = note.compute_note_hash(storage_slot);\n/// let note_hash_for_nullify = aztec::note::utils::compute_note_hash_for_nullify(\n/// RetrievedNote{ note, contract_address, metadata: SettledNoteMetadata::new(nonce).into() },\n/// storage_slot\n/// );\n///\n/// let inner_nullifier = note.compute_nullifier_unconstrained(note_hash_for_nullify);\n///\n/// Option::some(\n/// aztec::discovery::NoteHashAndNullifier {\n/// note_hash, inner_nullifier\n/// }\n/// )\n/// } else if note_type_id == MyOtherNoteType::get_id() {\n/// ... // Similar to above but calling MyOtherNoteType::unpack_content\n/// } else {\n/// Option::none() // Unknown note type ID\n/// };\n/// }\n/// ```\ntype ComputeNoteHashAndNullifier<Env> = unconstrained fn[Env](/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress, /* nonce */ Field) -> Option<NoteHashAndNullifier>;\n\n/// Performs the message discovery process, in which private are downloaded and inspected to find new private notes,\n/// partial notes and events, etc., and pending partial notes are processed to search for their completion logs.\n/// This is the mechanism via which a contract updates its knowldge of its private state.\n///\n/// Receives the address of the contract on which discovery is performed along with its\n/// `compute_note_hash_and_nullifier` function.\npub unconstrained fn discover_new_messages<Env>(\n contract_address: AztecAddress,\n compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,\n) {\n debug_log(\"Performing message discovery\");\n\n private_logs::fetch_and_process_private_tagged_logs(\n contract_address,\n compute_note_hash_and_nullifier,\n );\n\n partial_notes::fetch_and_process_public_partial_note_completion_logs(\n contract_address,\n compute_note_hash_and_nullifier,\n );\n}\n"
|
|
3080
|
+
},
|
|
3081
|
+
"69": {
|
|
3082
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/nonce_discovery.nr",
|
|
3083
|
+
"source": "use crate::{\n discovery::{ComputeNoteHashAndNullifier, private_notes::MAX_NOTE_PACKED_LEN},\n utils::array,\n};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n constants::MAX_NOTE_HASHES_PER_TX,\n debug_log::debug_log_format,\n hash::{compute_note_hash_nonce, compute_siloed_note_hash, compute_unique_note_hash},\n traits::ToField,\n};\n\n/// A struct with the discovered information of a complete note, required for delivery to PXE. Note that this is *not*\n/// the complete note information, since it does not include content, storage slot, etc.\npub struct DiscoveredNoteInfo {\n pub nonce: Field,\n pub note_hash: Field,\n pub inner_nullifier: Field,\n}\n\n/// Searches for note nonces that will result in a note that was emitted in a transaction. While rare, it is possible\n/// for multiple notes to have the exact same packed content and storage slot but different nonces, resulting in\n/// different unique note hashes. Because of this this function returns a *vector* of discovered notes, though in most\n/// cases it will contain a single element.\n///\n/// Due to how nonces are computed, this function requires knowledge of the transaction in which the note was created,\n/// more specifically the list of all unique note hashes in it plus the value of its first nullifier.\npub unconstrained fn attempt_note_nonce_discovery<Env>(\n unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,\n contract_address: AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n) -> BoundedVec<DiscoveredNoteInfo, MAX_NOTE_HASHES_PER_TX> {\n let discovered_notes = &mut BoundedVec::new();\n\n debug_log_format(\n \"Attempting nonce discovery on {0} potential notes on contract {1} for storage slot {2}\",\n [unique_note_hashes_in_tx.len() as Field, contract_address.to_field(), storage_slot],\n );\n\n // We need to find nonces (typically just one) that result in a note hash that, once siloed into a unique note hash,\n // is one of the note hashes created by the transaction.\n array::for_each_in_bounded_vec(\n unique_note_hashes_in_tx,\n |expected_unique_note_hash, i| {\n // Nonces are computed by hashing the first nullifier in the transaction with the index of the note in the\n // new note hashes array. We therefore know for each note in every transaction what its nonce is.\n let candidate_nonce = compute_note_hash_nonce(first_nullifier_in_tx, i);\n\n // Given nonce, note content and metadata, we can compute the note hash and silo it to check if it matches\n // the note hash at the array index we're currently processing.\n // TODO(#11157): handle failed note_hash_and_nullifier computation\n let hashes = compute_note_hash_and_nullifier(\n packed_note,\n storage_slot,\n note_type_id,\n contract_address,\n candidate_nonce,\n )\n .expect(f\"Failed to compute a note hash for note type {note_type_id}\");\n\n let siloed_note_hash = compute_siloed_note_hash(contract_address, hashes.note_hash);\n let unique_note_hash = compute_unique_note_hash(candidate_nonce, siloed_note_hash);\n\n if unique_note_hash == expected_unique_note_hash {\n // Note that while we did check that the note hash is the preimage of the expected unique note hash, we\n // perform no validations on the nullifier - we fundamentally cannot, since only the application knows\n // how to compute nullifiers. We simply trust it to have provided the correct one: if it hasn't, then\n // PXE may fail to realize that a given note has been nullified already, and calls to the application\n // could result in invalid transactions (with duplicate nullifiers). This is not a concern because an\n // application already has more direct means of making a call to it fail the transaction.\n discovered_notes.push(\n DiscoveredNoteInfo {\n nonce: candidate_nonce,\n note_hash: hashes.note_hash,\n inner_nullifier: hashes.inner_nullifier,\n },\n );\n\n // We don't exit the loop - it is possible (though rare) for the exact same note content to be present\n // multiple times in the same transaction with different nonces. This typically doesn't happen due to\n // notes containing random values in order to hide their contents.\n }\n },\n );\n\n debug_log_format(\n \"Discovered a total of {0} notes\",\n [discovered_notes.len() as Field],\n );\n\n *discovered_notes\n}\n"
|
|
3084
|
+
},
|
|
3085
|
+
"70": {
|
|
3086
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/partial_notes.nr",
|
|
3087
|
+
"source": "use crate::{\n capsules::CapsuleArray,\n discovery::{\n ComputeNoteHashAndNullifier,\n MAX_LOG_CONTENT_LEN,\n nonce_discovery::{attempt_note_nonce_discovery, DiscoveredNoteInfo},\n },\n oracle::message_discovery::{deliver_note, get_log_by_tag},\n utils::array,\n};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n constants::PUBLIC_LOG_DATA_SIZE_IN_FIELDS,\n debug_log::debug_log_format,\n traits::{Deserialize, Serialize, ToField},\n};\n\nglobal PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN: u32 = 2;\n\n/// Partial notes have a maximum packed length of their private fields bound by extra content in their private log (e.g.\n/// the storage slot, note completion log tag, etc.).\npub global MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN: u32 =\n MAX_LOG_CONTENT_LEN - PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN;\n\n/// The slot in the PXE capsules where we store a `CapsuleArray` of `DeliveredPendingPartialNote`.\n// TODO(#11630): come up with some sort of slot allocation scheme.\npub global DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT: Field = 77;\n\n/// Public logs contain an extra field at the beginning with the address of the contract that emitted them, and partial\n/// notes emit their completion tag in the log, resulting in the first two fields in the public log not being part of\n/// the packed public content.\n// TODO(#10273): improve how contract log siloing is handled\npub global NON_PACKED_CONTENT_FIELDS_IN_PUBLIC_LOG: u32 = 2;\n\n/// The maximum length of the packed representation of public fields in a partial note. This is limited by public log\n/// size and extra fields in the log (e.g. the tag).\npub global MAX_PUBLIC_PARTIAL_NOTE_PACKED_CONTENT_LENGTH: u32 =\n PUBLIC_LOG_DATA_SIZE_IN_FIELDS - NON_PACKED_CONTENT_FIELDS_IN_PUBLIC_LOG;\n\n/// A partial note that was delivered but is still pending completion. Contains the information necessary to find the\n/// log that will complete it and lead to a note being discovered and delivered.\n#[derive(Serialize, Deserialize)]\npub(crate) struct DeliveredPendingPartialNote {\n pub(crate) note_completion_log_tag: Field,\n pub(crate) storage_slot: Field,\n pub(crate) note_type_id: Field,\n pub(crate) packed_private_note_content: BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>,\n pub(crate) recipient: AztecAddress,\n}\n\npub unconstrained fn process_partial_note_private_log(\n contract_address: AztecAddress,\n recipient: AztecAddress,\n log_metadata: u64,\n log_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN>,\n) {\n let (note_type_id, storage_slot, note_completion_log_tag, packed_private_note_content) =\n decode_partial_note_private_log(log_metadata, log_content);\n\n // We store the information of the partial note we found in a persistent capsule in PXE, so that we can later search\n // for the public log that will complete it.\n let pending = DeliveredPendingPartialNote {\n note_completion_log_tag,\n storage_slot,\n note_type_id,\n packed_private_note_content,\n recipient,\n };\n\n CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n )\n .push(pending);\n}\n\n/// Searches for public logs that would result in the completion of pending partial notes, ultimately resulting in the\n/// notes being delivered to PXE if completed.\npub unconstrained fn fetch_and_process_public_partial_note_completion_logs<Env>(\n contract_address: AztecAddress,\n compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,\n) {\n let pending_partial_notes = CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n );\n\n debug_log_format(\n \"{} pending partial notes\",\n [pending_partial_notes.len() as Field],\n );\n\n let mut i = 0;\n while i < pending_partial_notes.len() {\n let pending_partial_note: DeliveredPendingPartialNote = pending_partial_notes.get(i);\n\n let maybe_log = get_log_by_tag(pending_partial_note.note_completion_log_tag);\n if maybe_log.is_none() {\n debug_log_format(\n \"Found no completion logs for partial note with tag {}\",\n [pending_partial_note.note_completion_log_tag],\n );\n i += 1 as u32;\n // Note that we're not removing the pending partial note from the PXE DB, so we will continue searching\n // for this tagged log when performing message discovery in the future until we either find it or the\n // entry is somehow removed from the PXE DB.\n } else {\n debug_log_format(\n \"Completion log found for partial note with tag {}\",\n [pending_partial_note.note_completion_log_tag],\n );\n let log = maybe_log.unwrap();\n\n // Public logs have an extra field at the beginning with the contract address, which we use to verify\n // that we're getting the logs from the expected contract.\n // TODO(#10273): improve how contract log siloing is handled\n assert_eq(\n log.log_content.get(0),\n contract_address.to_field(),\n \"Got a public log emitted by a different contract\",\n );\n\n // Public fields are assumed to all be placed at the end of the packed representation, so we combine the\n // private and public packed fields (i.e. the contents of the log sans the extra fields) to get the\n // complete packed content.\n let packed_public_note_content: BoundedVec<_, MAX_PUBLIC_PARTIAL_NOTE_PACKED_CONTENT_LENGTH> =\n array::subbvec(log.log_content, NON_PACKED_CONTENT_FIELDS_IN_PUBLIC_LOG);\n let complete_packed_note = array::append(\n pending_partial_note.packed_private_note_content,\n packed_public_note_content,\n );\n\n let discovered_notes = attempt_note_nonce_discovery(\n log.unique_note_hashes_in_tx,\n log.first_nullifier_in_tx,\n compute_note_hash_and_nullifier,\n contract_address,\n pending_partial_note.storage_slot,\n pending_partial_note.note_type_id,\n complete_packed_note,\n );\n\n debug_log_format(\n \"Discovered {0} notes for partial note with tag {1}\",\n [discovered_notes.len() as Field, pending_partial_note.note_completion_log_tag],\n );\n\n array::for_each_in_bounded_vec(\n discovered_notes,\n |discovered_note: DiscoveredNoteInfo, _| {\n // TODO:(#10728): decide how to handle notes that fail delivery. This could be due to e.g. a\n // temporary node connectivity issue - is simply throwing good enough here?\n assert(\n deliver_note(\n contract_address,\n pending_partial_note.storage_slot,\n discovered_note.nonce,\n complete_packed_note,\n discovered_note.note_hash,\n discovered_note.inner_nullifier,\n log.tx_hash,\n pending_partial_note.recipient,\n ),\n \"Failed to deliver note\",\n );\n },\n );\n\n // Because there is only a single log for a given tag, once we've processed the tagged log then we\n // simply delete the pending work entry, regardless of whether it was actually completed or not.\n // TODO(#11627): only remove the pending entry if we actually process a log that results in the note\n // being completed.\n pending_partial_notes.remove(i);\n\n // We don't increment `i` here, because CapsuleArray is contiguous and its `remove(...)` function\n // shifts the elements to the left if the removed element is not the last element.\n }\n }\n}\n\nfn decode_partial_note_private_log(\n log_metadata: u64,\n log_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN>,\n) -> (Field, Field, Field, BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>) {\n let note_type_id = log_metadata as Field; // TODO: make note type id not be a full field\n\n assert(\n log_content.len() > PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN,\n f\"Invalid private note log: all partial note private logs must have at least {PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN} fields\",\n );\n\n // If PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // destructuring of the partial note private log encoding below must be updated as well.\n std::static_assert(\n PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN == 2,\n \"unexpected value for PARTIAL_NOTE_PRIVATE_LOG_CONTENT_NON_NOTE_FIELDS_LEN\",\n );\n\n // We currently have two fields that are not the partial note's packed representation, which are the storage slot\n // and the note completion log tag.\n let storage_slot = log_content.get(0);\n let note_completion_log_tag = log_content.get(1);\n\n let packed_private_note_content = array::subbvec(log_content, 2);\n\n (note_type_id, storage_slot, note_completion_log_tag, packed_private_note_content)\n}\n"
|
|
3088
|
+
},
|
|
3089
|
+
"71": {
|
|
3090
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/private_logs.nr",
|
|
3091
|
+
"source": "use crate::{oracle::message_discovery::sync_notes, utils::array};\n\nuse dep::protocol_types::{\n address::AztecAddress,\n constants::{MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_SIZE_IN_FIELDS},\n debug_log::{debug_log, debug_log_format},\n};\n\nuse crate::discovery::{\n ComputeNoteHashAndNullifier, MAX_LOG_CONTENT_LEN,\n partial_notes::process_partial_note_private_log, PRIVATE_LOG_EXPANDED_METADATA_LEN,\n private_notes::process_private_note_log,\n};\nuse crate::encrypted_logs::log_assembly_strategies::default_aes128::note::encryption::decrypt_log;\n// TODO(#12750): don't make this value assume we're using AES.\nuse crate::encrypted_logs::log_assembly_strategies::default_aes128::note::encryption::PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS;\n\n/// Searches for private logs that signal new private notes that are then delivered to PXE, or new partial notes that\n/// are stored in the PXE capsules so that `fetch_and_process_public_partial_note_completion_logs` can later search for\n/// public logs that will complete them.\npub unconstrained fn fetch_and_process_private_tagged_logs<Env>(\n _contract_address: AztecAddress,\n _compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,\n) {\n // We will eventually fetch tagged logs, decrypt and process them here, but for now we simply call the `syncNotes`\n // oracle. This has PXE perform tag synchronization, log download, decryption, and finally calls to the the\n // `process_log` contract function with the decrypted payload, which will in turn call `do_process_log` with a\n // decrypted log, letting us continue the work outside of PXE.\n sync_notes();\n}\n\n/// Processes a log's ciphertext by decrypting it and then searching the plaintext for private notes or partial notes.\n///\n/// Private notes result in nonce discovery being performed prior to delivery, which requires knowledge of the\n/// transaction hash in which the notes would've been created (typically the same transaction in which the log was\n/// emitted), along with the list of unique note hashes in said transaction and the `compute_note_hash_and_nullifier`\n/// function.\n///\n/// Partial notes result in a pending partial note entry being stored in a PXE capsule, which will later be retrieved to\n/// search for the note's completion public log.\npub unconstrained fn do_process_log<Env>(\n contract_address: AztecAddress,\n log: BoundedVec<Field, PRIVATE_LOG_SIZE_IN_FIELDS>,\n tx_hash: Field,\n unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n recipient: AztecAddress,\n compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,\n) {\n debug_log_format(\"Processing log with tag {0}\", [log.get(0)]);\n\n let log_plaintext = decrypt_log(log, recipient);\n\n // The first thing to do after decrypting the log is to determine what type of private log we're processing. We\n // currently just have two log types: 0 for private notes and 1 for partial notes. This will likely be expanded and\n // improved upon in the future to also handle events, etc.\n\n let (log_type_id, log_metadata, log_content) = decode_log_plaintext(log_plaintext);\n\n if log_type_id == 0 {\n debug_log(\"Processing private note log\");\n\n process_private_note_log(\n contract_address,\n tx_hash,\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n recipient,\n compute_note_hash_and_nullifier,\n log_metadata,\n log_content,\n );\n } else if log_type_id == 1 {\n debug_log(\"Processing partial note private log\");\n\n process_partial_note_private_log(contract_address, recipient, log_metadata, log_content);\n } else {\n // TODO(#11569): handle events\n debug_log_format(\n \"Unknown log type id {0} (probably belonging to an event log)\",\n [log_type_id as Field],\n );\n }\n}\n\n/// Decodes a log's plaintext following aztec-nr's standard log encoding.\n///\n/// The standard private log layout is composed of:\n/// - an initial field called the 'expanded metadata'\n/// - an arbitrary number of fields following that called the 'log content'\n///\n/// ```\n/// log_plainext: [ log_expanded_metadata, ...log_content ]\n/// ```\n///\n/// The expanded metadata itself is (currently) interpreted as a u64, of which:\n/// - the upper 57 bits are the log type id\n/// - the remaining 7 bits are called the 'log metadata'\n///\n/// ```\n/// log_expanded_metadata: [ log_type_id | log_metadata ]\n/// <--- 57 bits --->|<--- 7 bits --->\n/// ```\n///\n/// The meaning of the log metadata and log content depend on the value of the log type id. Note that there is\n/// nothing special about the log metadata, it _can_ be considered part of the content. It just has a different name\n/// to make it distinct from the log content given that it is not a full field.\nunconstrained fn decode_log_plaintext(\n log_plaintext: BoundedVec<Field, PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS>,\n) -> (u64, u64, BoundedVec<Field, MAX_LOG_CONTENT_LEN>) {\n assert(\n log_plaintext.len() >= PRIVATE_LOG_EXPANDED_METADATA_LEN,\n f\"Invalid log plaintext: all logs must be decrypted into at least {PRIVATE_LOG_EXPANDED_METADATA_LEN} fields\",\n );\n\n // If PRIVATE_LOG_EXPANDED_METADATA_LEN is changed, causing the assertion below to fail, then the destructuring of\n // the log encoding below must be updated as well.\n std::static_assert(\n PRIVATE_LOG_EXPANDED_METADATA_LEN == 1,\n \"unexpected value for PRIVATE_LOG_EXPANDED_METADATA_LEN\",\n );\n\n // See the documentation of this function for a description of the log layout\n let expanded_log_metadata = log_plaintext.get(0);\n\n let log_type_id = ((expanded_log_metadata as u64) / 128);\n let log_metadata = ((expanded_log_metadata as u64) % 128);\n\n let log_content = array::subbvec(log_plaintext, PRIVATE_LOG_EXPANDED_METADATA_LEN);\n\n (log_type_id, log_metadata, log_content)\n}\n"
|
|
3092
|
+
},
|
|
3093
|
+
"86": {
|
|
3094
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/hash.nr",
|
|
2981
3095
|
"source": "use dep::protocol_types::{\n address::{AztecAddress, EthAddress},\n constants::{\n GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER,\n GENERATOR_INDEX__SECRET_HASH,\n },\n hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field},\n point::Point,\n traits::{Hash, ToField},\n};\n\npub use dep::protocol_types::hash::{compute_siloed_nullifier, pedersen_hash};\n\npub fn pedersen_commitment<let N: u32>(inputs: [Field; N], hash_index: u32) -> Point {\n std::hash::pedersen_commitment_with_separator(inputs, hash_index)\n}\n\npub fn compute_secret_hash(secret: Field) -> Field {\n poseidon2_hash_with_separator([secret], GENERATOR_INDEX__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], GENERATOR_INDEX__MESSAGE_NULLIFIER)\n}\n\npub struct ArgsHasher {\n pub fields: [Field],\n}\n\nimpl Hash for ArgsHasher {\n fn hash(self) -> Field {\n hash_args(self.fields)\n }\n}\n\nimpl ArgsHasher {\n pub fn new() -> Self {\n Self { fields: [] }\n }\n\n pub fn add(&mut self, field: Field) {\n self.fields = self.fields.push_back(field);\n }\n\n pub fn add_multiple<let N: u32>(&mut self, fields: [Field; N]) {\n for i in 0..N {\n self.fields = self.fields.push_back(fields[i]);\n }\n }\n}\n\npub fn hash_args_array<let N: u32>(args: [Field; N]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\npub fn hash_args(args: [Field]) -> Field {\n if args.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator_slice(args, GENERATOR_INDEX__FUNCTION_ARGS)\n }\n}\n\n#[test]\nunconstrained fn compute_var_args_hash() {\n let mut input = ArgsHasher::new();\n for i in 0..100 {\n input.add(i as Field);\n }\n let hash = input.hash();\n dep::std::println(hash);\n assert(hash == 0x19b0d74feb06ebde19edd85a28986c97063e84b3b351a8b666c7cac963ce655f);\n}\n"
|
|
2982
3096
|
}
|
|
2983
3097
|
}
|