@aztec/protocol-contracts 0.84.0 → 0.85.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 +291 -558
- package/artifacts/ContractClassRegisterer.json +182 -437
- package/artifacts/ContractInstanceDeployer.json +315 -567
- package/artifacts/FeeJuice.json +193 -456
- package/artifacts/MultiCallEntrypoint.json +24 -303
- package/artifacts/Router.json +249 -516
- package/dest/auth-registry/index.d.ts +2 -1
- package/dest/auth-registry/index.d.ts.map +1 -1
- package/dest/class-registerer/utility_function_broadcasted_event.js +4 -4
- package/dest/protocol_contract_data.d.ts +1 -1
- package/dest/protocol_contract_data.d.ts.map +1 -1
- package/dest/protocol_contract_data.js +8 -8
- package/dest/protocol_contract_data_2.d.ts +1 -1
- package/dest/protocol_contract_data_2.d.ts.map +1 -1
- package/dest/protocol_contract_data_2.js +1 -1
- package/dest/scripts/generate_data.js +3 -3
- package/package.json +4 -4
- package/src/auth-registry/index.ts +2 -2
- package/src/class-registerer/utility_function_broadcasted_event.ts +4 -4
- package/src/protocol_contract_data.ts +8 -8
- package/src/protocol_contract_data_2.ts +1 -1
|
@@ -1,210 +1,205 @@
|
|
|
1
1
|
{
|
|
2
2
|
"transpiled": true,
|
|
3
|
-
"noir_version": "1.0.0-beta.
|
|
3
|
+
"noir_version": "1.0.0-beta.4+0000000000000000000000000000000000000000",
|
|
4
4
|
"name": "ContractInstanceDeployer",
|
|
5
5
|
"functions": [
|
|
6
6
|
{
|
|
7
|
-
"name": "
|
|
7
|
+
"name": "get_update_delay",
|
|
8
8
|
"is_unconstrained": true,
|
|
9
9
|
"custom_attributes": [
|
|
10
|
-
"
|
|
10
|
+
"public",
|
|
11
|
+
"view"
|
|
11
12
|
],
|
|
12
13
|
"abi": {
|
|
13
14
|
"parameters": [],
|
|
14
|
-
"return_type":
|
|
15
|
+
"return_type": {
|
|
16
|
+
"abi_type": {
|
|
17
|
+
"kind": "integer",
|
|
18
|
+
"sign": "unsigned",
|
|
19
|
+
"width": 32
|
|
20
|
+
},
|
|
21
|
+
"visibility": "public"
|
|
22
|
+
},
|
|
15
23
|
"error_types": {
|
|
16
|
-
"
|
|
24
|
+
"206160798890201757": {
|
|
17
25
|
"error_kind": "string",
|
|
18
|
-
"string": "
|
|
19
|
-
},
|
|
20
|
-
"2588366281349374274": {
|
|
21
|
-
"error_kind": "fmtstring",
|
|
22
|
-
"length": 136,
|
|
23
|
-
"item_types": [
|
|
24
|
-
{
|
|
25
|
-
"kind": "integer",
|
|
26
|
-
"sign": "unsigned",
|
|
27
|
-
"width": 32
|
|
28
|
-
}
|
|
29
|
-
]
|
|
26
|
+
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
30
27
|
},
|
|
31
|
-
"
|
|
28
|
+
"5019202896831570965": {
|
|
32
29
|
"error_kind": "string",
|
|
33
|
-
"string": "
|
|
30
|
+
"string": "attempt to add with overflow"
|
|
34
31
|
},
|
|
35
|
-
"
|
|
32
|
+
"11343565365413149907": {
|
|
36
33
|
"error_kind": "string",
|
|
37
|
-
"string": "
|
|
34
|
+
"string": "Function get_update_delay can only be called statically"
|
|
38
35
|
},
|
|
39
|
-
"
|
|
36
|
+
"14225679739041873922": {
|
|
40
37
|
"error_kind": "string",
|
|
41
|
-
"string": "
|
|
42
|
-
},
|
|
43
|
-
"3367683922240523006": {
|
|
44
|
-
"error_kind": "fmtstring",
|
|
45
|
-
"length": 58,
|
|
46
|
-
"item_types": [
|
|
47
|
-
{
|
|
48
|
-
"kind": "field"
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
},
|
|
52
|
-
"3473764466780631008": {
|
|
53
|
-
"error_kind": "fmtstring",
|
|
54
|
-
"length": 106,
|
|
55
|
-
"item_types": [
|
|
56
|
-
{
|
|
57
|
-
"kind": "integer",
|
|
58
|
-
"sign": "unsigned",
|
|
59
|
-
"width": 32
|
|
60
|
-
}
|
|
61
|
-
]
|
|
38
|
+
"string": "Index out of bounds"
|
|
62
39
|
},
|
|
63
|
-
"
|
|
40
|
+
"17843811134343075018": {
|
|
64
41
|
"error_kind": "string",
|
|
65
|
-
"string": "
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
"string": "Stack too deep"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"bytecode": "JwACBAEoAAABBIBLJwAABAMnAgEEACcCAgQAHxgAAgABgEolAAAARSUAAAB9LgQAAYBKKAIAAgSASicCAwQBOw0AAgADKgCAQwAAAAABAAAAACgAgEQAAQAoAIBFBAADKACARgEAACgAgEcEAAAoAIBIAQABKACASQQAASYlAAADkR4CAAIJJwIDAAEKOAIDBCQCAAQAAACeJQAAA7oeAgACAScCBAAALQgBBScCBgQEABABBgEnAwUEAQAoBQIGLQwGBy0OBAcAKAcCBy0OBAcAKAcCBy0OBActDQUGACgGAgYtDgYFKwIABgAAAAAAAAAAAgAAAAAAAAAALQgBBycCCAQFABABCAEnAwcEAQAoBwIILQwICS0OBAkAKAkCCS0OBAkAKAkCCS0OBAkAKAkCCS0OBgktDQUGACgGAgYtDgYFLQ0HBgAoBgIGLQ4GBy0IAQYAAAECAS0OBQYtCAEFAAABAgEtDgcFLQgBBwAAAQIBLgqARwAHLQgBCAAAAQIBLgqARgAIJwIJBAotCAAKLQwGCy0MBQwtDAcNLQwIDi0MAw8AEAAJACUAAAPMLQQAACcCAwQJLQgACS0MBgotDAULLQwHDC0MCA0tDAIOABAAAwAlAAADzC0EAAAtDQgCCygAAoBGAAMkAgADAAAB/CcCCQQAPAkBCScCAgQJLQgACS0MBgotDAULLQwHDC0MCA0AEAACACUAAAT1LQQAAC0NBgItDQUDLQ0HCS0OAgYtDgMFLQ4JBy4KgEgACAEoAAOASQAFLQ0FAgo4AgQ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SFYnOy4sc8qOO4UcuvzIdTbFlFb+00lKduE5aKi9R8fP3TVUQqMCgSHXivEqqCR5spQInUiWJCoNEZVGkEtHgp7uaKhFDfnIH7OGuN0tYq6JE5VGk8hIV/8CapsqJVCIaUUQ+iupKIvJJQh6NEalOkPflDjcbq94GT8TllipIVIgiVZSorJWo+JuSmipJXEYnyTeQrEglqotPRUPJlIN/++QdsHz0SuUW5xR8peHbYEPjBJp4vuZEmx3N4QdVkKgsiFReonKiupyoLhLVRaK6vKguL/q9gqiuIDov/pXvTZUTqaJElURXCp9Zj/Yxjh+3pnLfUXKM5vx+6cRDqMfrsQJv/Hi1oUnna/ix6jgDd36feeLxqQ0Nz7pMKr3av7LX8NlwQyOoh7/Oj86H0wjaG/8an4Ymna9J58dOMkagofM1glyABLkACXIBQhRozmwHf4ajf68fN9c327unQbH78Nf97fPm4X5/+Pzfz/zJzeNmu938uPr5+HB79+3X493V9uF299nK7P98tSauLaadl93hMNJaD+Oml8HJ7lNr1tbiUOtQ8/8=",
|
|
48
|
+
"brillig_names": [
|
|
49
|
+
"get_update_delay"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "public_dispatch",
|
|
54
|
+
"is_unconstrained": true,
|
|
55
|
+
"custom_attributes": [
|
|
56
|
+
"public"
|
|
57
|
+
],
|
|
58
|
+
"abi": {
|
|
59
|
+
"parameters": [
|
|
60
|
+
{
|
|
61
|
+
"name": "selector",
|
|
62
|
+
"type": {
|
|
63
|
+
"kind": "field"
|
|
64
|
+
},
|
|
65
|
+
"visibility": "private"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"return_type": null,
|
|
69
|
+
"error_types": {
|
|
70
|
+
"206160798890201757": {
|
|
79
71
|
"error_kind": "string",
|
|
80
|
-
"string": "
|
|
72
|
+
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
81
73
|
},
|
|
82
|
-
"
|
|
74
|
+
"2830029349304997821": {
|
|
83
75
|
"error_kind": "fmtstring",
|
|
84
|
-
"length":
|
|
76
|
+
"length": 27,
|
|
85
77
|
"item_types": [
|
|
86
|
-
{
|
|
87
|
-
"kind": "field"
|
|
88
|
-
},
|
|
89
78
|
{
|
|
90
79
|
"kind": "field"
|
|
91
80
|
}
|
|
92
81
|
]
|
|
93
82
|
},
|
|
94
|
-
"
|
|
95
|
-
"error_kind": "string",
|
|
96
|
-
"string": "call to assert_max_bit_size"
|
|
97
|
-
},
|
|
98
|
-
"6753155520859132764": {
|
|
83
|
+
"2920182694213909827": {
|
|
99
84
|
"error_kind": "string",
|
|
100
|
-
"string": "
|
|
85
|
+
"string": "attempt to subtract with overflow"
|
|
101
86
|
},
|
|
102
|
-
"
|
|
87
|
+
"5019202896831570965": {
|
|
103
88
|
"error_kind": "string",
|
|
104
|
-
"string": "attempt to
|
|
89
|
+
"string": "attempt to add with overflow"
|
|
105
90
|
},
|
|
106
|
-
"
|
|
91
|
+
"6504213605561840204": {
|
|
107
92
|
"error_kind": "string",
|
|
108
|
-
"string": "
|
|
93
|
+
"string": "New contract class is not registered"
|
|
109
94
|
},
|
|
110
|
-
"
|
|
95
|
+
"10019982601749771606": {
|
|
111
96
|
"error_kind": "string",
|
|
112
|
-
"string": "
|
|
97
|
+
"string": "msg.sender is not deployed"
|
|
113
98
|
},
|
|
114
|
-
"
|
|
99
|
+
"11343565365413149907": {
|
|
115
100
|
"error_kind": "string",
|
|
116
|
-
"string": "
|
|
101
|
+
"string": "Function get_update_delay can only be called statically"
|
|
117
102
|
},
|
|
118
103
|
"14225679739041873922": {
|
|
119
104
|
"error_kind": "string",
|
|
120
105
|
"string": "Index out of bounds"
|
|
121
106
|
},
|
|
122
|
-
"
|
|
123
|
-
"error_kind": "string",
|
|
124
|
-
"string": "attempt to bit-shift with overflow"
|
|
125
|
-
},
|
|
126
|
-
"14657895983200220173": {
|
|
127
|
-
"error_kind": "string",
|
|
128
|
-
"string": "Attempted to read past the length of a CapsuleArray"
|
|
129
|
-
},
|
|
130
|
-
"15366650908120444287": {
|
|
131
|
-
"error_kind": "fmtstring",
|
|
132
|
-
"length": 48,
|
|
133
|
-
"item_types": [
|
|
134
|
-
{
|
|
135
|
-
"kind": "field"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
"kind": "field"
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
},
|
|
142
|
-
"16218014537381711836": {
|
|
143
|
-
"error_kind": "string",
|
|
144
|
-
"string": "Value does not fit in field"
|
|
145
|
-
},
|
|
146
|
-
"16446004518090376065": {
|
|
107
|
+
"15573886522241766899": {
|
|
147
108
|
"error_kind": "string",
|
|
148
|
-
"string": "
|
|
109
|
+
"string": "New update delay is too low"
|
|
149
110
|
},
|
|
150
|
-
"
|
|
111
|
+
"17595253152434889169": {
|
|
151
112
|
"error_kind": "string",
|
|
152
|
-
"string": "
|
|
153
|
-
},
|
|
154
|
-
"16775516380094354375": {
|
|
155
|
-
"error_kind": "fmtstring",
|
|
156
|
-
"length": 40,
|
|
157
|
-
"item_types": []
|
|
113
|
+
"string": "offset too large"
|
|
158
114
|
},
|
|
159
|
-
"
|
|
115
|
+
"17843811134343075018": {
|
|
160
116
|
"error_kind": "string",
|
|
161
|
-
"string": "
|
|
162
|
-
}
|
|
117
|
+
"string": "Stack too deep"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"bytecode": "JwACBAEoAAABBIBRJwAABAMnAgIEAScCAwQAHxgAAwACgFAuCIBQAAElAAAARSUAAADFKAIAAQSAUScCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YoAIBFBAAZKgCARgAAAAABAAAAACgAgEcAAQAoAIBIBAADKACASQEAACgAgEoEAAAoAIBLAAAAKACATAEAASgAgE0EAAEoAIBOAAABKACATwQABCYlAAAK8SkCAAIA+pECywo4AQIDJwIEBAAnAgYEAwA4BAYFLQgBAgAQAQUBJwMCBAEAKAICBS0OBA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DAkbLQwOHC0MDx0AEAAQACUAAA/DLQQAAAAoAgIGLQ0GBScCBwQCADgGBwM7DQADAAUjAAAHkykCAAIABVV7+go4AQIDJAIAAwAAB64jAAAJJC0IAQIAAAECAS4KgEkAAi0IAQMAAAECAS4KgEsAAy0IAQUAAAECAScCBgAOLQ4GBR4CAAYJCygABoBOAAckAgAHAAAH+CUAABL2HgIABgEnAgsEDC0IAAwtDAINLQwDDi0MBQ8uCIBOABAtDAQRLQwGEgAQAAsAJQAAC5stBAAALQwNBy0MDggtDA8JLQwQCh4CAAIFHAwCBAQcDAQDABwMAwIEJwIMBA0tCAANLQwHDi0MCA8tDAkQLQwKEQAQAAwAJQAADngtBAAALQwOAy0MDwQtDBAFLQwRBi0MEgsnAggEDC0IAAwtDAMNLQwEDi0MBQ8tDAYQLQwLES0MAhIAEAAIACUAAA9CLQQAAC0MDQccDAcCACcCBAQBJwIGBAMAOAQGBS0IAQMAEAEFAScDAwQBACgDAgUtDgQFACgFAgUtDgQFJwIFBAMAOAMFBC0MBAUtDgIFACgDAgUtDQUEJwIGBAIAOAUGAjsNAAIABCMAAAkkJwICAlUnAgMCbicCBAJrJwIFAm8nAgYCdycCBwIgJwIIAnMnAgkCZScCCgJsJwILAmMnAgwCdCcCDQJyJwIOAnsnAg8CfS0IARAnAhEEHAAQAREBJwMQBAEAKBACES0MERItDgISACgSAhItDgMSACgSAhItDgQSACgSAhItDgMSACgSAhItDgUSACgSAhItDgYSACgSAhItDgMSACgSAhItDgcSACgSAhItDggSACgSAhItDgkSACgSAhItDgoSACgSAhItDgkSACgSAhItDgsSACgSAhItDgwSACgSAhItDgUSACgSAhItDg0SACgSAhItDgcSACgSAhItDg4SACgSAhItDggSACgSAhItDgkSACgSAhItDgoSACgSAhItDgkSACgSAhItDgsSACgSAhItDgwSACgSAhItDgUSACgSAhItDg0SACgSAhItDg8SCyCASYBMAAIkAgACAAAK8CcCAwQeLQgBBCcCBQQeABABBQEtDAQFKgMABQUnRkiy9UEXvQAo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M3igmzxcTl5g8LybPi8XzGKIJZfEGQjChLN5A/SZqkEvWk6ygigV1UCslwQW1uSwb4Q12UMGaMDHB9PeZmzD9Wo0PsM02mwqTYIMVC4wCmWD6WDaGuk9pmURABSYmmL69qQnT7/ZbYHCBkQJjEyzb2PSNwjHUK3aXPyoFoA9p2zA0wcjGRjY2trHpKyYtWNG7SaXURnL54wUG5Q2lT7E3UWhB6ZOKRWLdr7cshm1RyqpWoVpXyqbnXCloOAWOt0KP7q4Uek3oSzHeCh5vBY+3ooy3Qh9R9qUooykk5OEUMLwsJB20UXVtf/lj3KH0WVwJsKZlCYx7lFi46CBaSm3et1sVKqocKKxXx4cYdih9PbCJMnHpI7gWSl+RaaIMXHSw6t9EyQEqXlCwQ0E2oUxcMTVRaW9XPCjlhBWV0w6VUrOm5LxHHXDlcqlfe4X5oJTr9gmlVlJAuL0uLyiyoPRE30Lp+YLrK31M387TLUMpPZ5oHTgL0x5Tbsfos4gNDN2O0bvG19fbF1Q2ocSCyiaubOJCExeauMjExabyYhuXya6DfQQtFFtQB/sIWijDzhSK+mWOV1uLeJDpYm3as4KRm2vxwRvP13mSQdtB/riK0adaGpjbW7J4kG+uYww8B7mmnln8sMF1xeDtGDbwcCs7aRhDvOnvsF7HSDRg+GZM0vf7NDC3Z+gEBh4w2BPBgEED5sY4+GP52/9+/+uX73/4+tNvC+LlH//z84+/f/nl5/e//v5//17/5Ydfv3z9+uVf3/37119+/Okf//n1p+++/vLjy799Cu//+TsA4mcApkXNi8kQl5XFpX8Sl7+/uFpEPsMyCnj555fvl5n+z8uE4Mtf3z+Hz8t/0iJsEff/",
|
|
123
|
+
"brillig_names": [
|
|
124
|
+
"public_dispatch"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "sync_notes",
|
|
129
|
+
"is_unconstrained": true,
|
|
130
|
+
"custom_attributes": [
|
|
131
|
+
"aztec::macros::functions::utility"
|
|
132
|
+
],
|
|
133
|
+
"abi": {
|
|
134
|
+
"parameters": [],
|
|
135
|
+
"return_type": null,
|
|
136
|
+
"error_types": {
|
|
163
137
|
"17843811134343075018": {
|
|
164
138
|
"error_kind": "string",
|
|
165
139
|
"string": "Stack too deep"
|
|
166
140
|
}
|
|
167
141
|
}
|
|
168
142
|
},
|
|
169
|
-
"bytecode": "H4sIAAAAAAAA/+29CZAkx3UlGFmZVd2V3dWVjW70jYuAQAAkqLyqKkuiOEWC4E2QEk+R4JFVmQmi0UADfaHvjqo+AJAUKZGSSIoSdVAHSZGiRIoSD0k8xF3ajrQamoZrMtOMSbu2tJVmtKvV7Mwad2VzdQDxI1+++uEZWfm9OgG0m3VXZLj7+9+////9u4eHRy7oplz8txAMkQRk756n/k7Gv8cgP3/530L8uzxcqkwSXUv8RrkxN6m0z5D/2mSMmfODXxZ8T/Ivb4hxHgu7+NgWobvx8r9NcN0Kuvrhq/3Sfz7bv83RZtGdu8IgSV26lVpjtlZtzFarrXa52Zqd68zX5sq1xZna/NJipVybqTZac81audyutZfq5dbs/Eyr3ZyfqXUWm/Ozgv1SFbvWXrwMNdOcbSxWOs3ZTnmxPteoNTtzc61ma77enpsptypLs5WlaqXTaDRnZppLM/OVSqc9P9NpJNh3h15kVhX8lwF+IbDV+Si93A9+4nNe4Qc/kc8r/cg/4f9VXvArifxf7Yf/uuC/xg9+TfBfG+MHgF1p1KrVudr8XHm+0SpX6q2lauOyBS/Wy0vl5lK1PV+vzHfq1XptqbW02Kg3mpVOudNcmu80ngIX7HsU7PJgqcI3BPt1IJecmVxqiV94/fC8c5oR7B9Px16z6AX7JxTsarO2VJ7vlJszjeZcuzFz2d2WL18sNtqd2Wpz8bLjrbYqlUq7fvm/artVn19szVYWZ9tz1ZnFy+QSmb8BZG5oS0uC/0Zj/Nlmeb49O5vEN28yxl9cnJ1rXpan4L/ZGL+2NNvu1OYSX/kWY/zmTL3Tmak1Bf+txvgzlXJ7pjqX6OZPGuPPL5ZnZhuNRH/eZox/OW6oteabi4L/dmv5LLbLS63K/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57ZQv23na5riudvSudvyqduyPXfbPknZTsY18tTbfdwWzt22T/JWG7bbwuui4JelcNtjbHHZua0wNr+l8i3/dm4L526L527bzxLJsn0Dlr2x5VO3meXcbebcbbbw7d7mzVu/c5s7d5ucC9Kfuy2cuy2euy2dWSf9fnOiett+x6F+mzl3m5xZubw9tXJ5G87dFk/dlncnILp1aFGeHm7dn0GFZfdbk2VdR7L3r/e4E/fIiXv8iXv2ib8/dC8UltPaXenUXfnMXYW1tHaXOXWXPXWXO3WXnLrLn7rrVG6YU7lhTuWGOZUb9lRu7HdJ368W+wfs5WWtJ9nu3HPim7+/AFY+J524J3//nv02buUe830G7sTK7E6szO7E/LgTK/N+17dyTzxxz34ebN2RHO3rPfn79+x3fCv3mBP32BP3uBP3yIl7anmwd8+JPJATebDf6a3ck79/z36ft3LPifXAn1gP/In1wJ9YD/yJ9cCfyAN/Ig/8iTzwJ/IgfDMP/n77X//vP/3HX//pn//2r/95u+OP//h//u1f/uuv//5vX//zv/6//73+l3/+j7/+7W9//V//+L//49//5V//x//5j3/9x7/9+7/88d/+snz9n/9+m7j4Dzeq6RbNH+l1i0j+IYRkb//b/frvzt3+u7g//vsfN9xaFss/3P6P/+P/8esOn253+BRusd3i+/8B",
|
|
143
|
+
"bytecode": "H4sIAAAAAAAA/7WTPQ+CMBCGi2KUjzjgoD+jBAyM+LG4OLpXCkpUSAB3frqQXENtwKjAJU17FJ5736OVUB0SzDLqEAyyglmBecTtj8vhQY67hakIdfvku9i2lQZ/Peq3FGBKw/Ax4w/UfzwFzr6o+bwXVndWDo1b66g+H0P5Z/9vSP+LD5418GpAXnmew/oS5Nt74t+Oz8c5SNnXTR1EgnIxdK5CSd0lcZ4SP99QmgZZJhJGDWTUQlU56pVE8YG26fmRdgrSLEpikSZ/Sav6yu6lXLyr8eA57hCOizHTMAb+BDV3X+b2+feXkKuCJ+bT+1Nn6BAztEhI1oRS2yeGwK+CP38vlizs4eEFAAA=",
|
|
144
|
+
"debug_symbols": "rZLLqoMwEIbfZdYucr/4KuVQosYSCFGiHijiuzeWWKSWduNmyISP4Uvmn6Gx1XS7utB2A5SXGXxXm9F1IXXzUkAVnffudt1fA1oLpk9+6E1Y22E0cYQSI4ZVATY0z7OUaUbrvIVS86U44FKJDCvEXqggH1BOeEY5Ry8UU7n8FYDZCTKKyk2G6+8yjOqMMqEOMvwMGcU2Ga2+ywi0/Ywg4iAjTpDRhGRYU/5DRqGMSvS2piW1/yY6U3mb49VOod6lbbz39i14fexq20zRrhHcpS/VS3oCoWlsGv0A",
|
|
171
145
|
"brillig_names": [
|
|
172
146
|
"sync_notes"
|
|
173
147
|
]
|
|
174
148
|
},
|
|
175
149
|
{
|
|
176
|
-
"name": "
|
|
150
|
+
"name": "update",
|
|
177
151
|
"is_unconstrained": true,
|
|
178
152
|
"custom_attributes": [
|
|
179
|
-
"public"
|
|
180
|
-
"view"
|
|
153
|
+
"public"
|
|
181
154
|
],
|
|
182
155
|
"abi": {
|
|
183
|
-
"parameters": [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
156
|
+
"parameters": [
|
|
157
|
+
{
|
|
158
|
+
"name": "new_contract_class_id",
|
|
159
|
+
"type": {
|
|
160
|
+
"kind": "struct",
|
|
161
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId",
|
|
162
|
+
"fields": [
|
|
163
|
+
{
|
|
164
|
+
"name": "inner",
|
|
165
|
+
"type": {
|
|
166
|
+
"kind": "field"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"visibility": "private"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"return_type": null,
|
|
192
175
|
"error_types": {
|
|
193
176
|
"206160798890201757": {
|
|
194
177
|
"error_kind": "string",
|
|
195
178
|
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
196
179
|
},
|
|
180
|
+
"2920182694213909827": {
|
|
181
|
+
"error_kind": "string",
|
|
182
|
+
"string": "attempt to subtract with overflow"
|
|
183
|
+
},
|
|
197
184
|
"5019202896831570965": {
|
|
198
185
|
"error_kind": "string",
|
|
199
186
|
"string": "attempt to add with overflow"
|
|
200
187
|
},
|
|
201
|
-
"
|
|
188
|
+
"6504213605561840204": {
|
|
202
189
|
"error_kind": "string",
|
|
203
|
-
"string": "
|
|
190
|
+
"string": "New contract class is not registered"
|
|
204
191
|
},
|
|
205
|
-
"
|
|
192
|
+
"10019982601749771606": {
|
|
193
|
+
"error_kind": "string",
|
|
194
|
+
"string": "msg.sender is not deployed"
|
|
195
|
+
},
|
|
196
|
+
"14225679739041873922": {
|
|
197
|
+
"error_kind": "string",
|
|
198
|
+
"string": "Index out of bounds"
|
|
199
|
+
},
|
|
200
|
+
"17595253152434889169": {
|
|
206
201
|
"error_kind": "string",
|
|
207
|
-
"string": "
|
|
202
|
+
"string": "offset too large"
|
|
208
203
|
},
|
|
209
204
|
"17843811134343075018": {
|
|
210
205
|
"error_kind": "string",
|
|
@@ -212,10 +207,10 @@
|
|
|
212
207
|
}
|
|
213
208
|
}
|
|
214
209
|
},
|
|
215
|
-
"bytecode": "
|
|
216
|
-
"debug_symbols": "
|
|
210
|
+
"bytecode": "JwACBAEoAAABBIBQJwAABAMnAgIEAScCAwQAHxgAAwACgE8uCIBPAAElAAAARSUAAAC+KAIAAQSAUCcCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YqAIBFAAAAAAEAAAAAKACARgABACgAgEcEAAMoAIBIAQAAKACASQQAACgAgEoAAAAoAIBLAQABKACATAQAASgAgE0AAAEoAIBOBAAEJiUAAAkiLQgBAwAAAQIBLgqASAADLQgBAwAAAQIBLgqASgADLQgBAwAAAQIBJwIEAAItDgQDHgIAAwEeAgAFADM4AAMABQAGJAIABgAAARIlAAAJSzMoAAGAQwAFJAIABQAAASclAAAJXSsCAAUA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wNuEON+GPZyGvQ4uakBetZU0czgIVHG/ieBZwPAs5Yihrgg83IWf8ipowx9cFbYxR4Rjw9E+MUPJeKKtwcJSfnHn+iZKvJ6ds8UZr8WF4X59qDije8NAED1E9R01xYhYqy5ac006h5Jx2EpVlS9sclFEbKFxQEKNsDspm2bImidIxL7tRyzq8vaNM1A41mWRPWR+1mVEbtoxf+lfsoduo5XB8QuqV2mNGX9be5aDkiT6B2thrdhRO5NPzPJ0mOZRnmhfO7CjG8O0YOcOcwLjbMfJpsP399gllc1BaZaGybJksWybLls2yZbNsUVZ9UZYtl8VLThskUT4HJY8xSRTloOQxZn+0kPe/GMPQbiLMxq75bi92ci/et4MZvsnh7z5GvoCZwNw+kjn5JEoCk2FHftWWwz2uJ3fhZgzdjqEMO5SanQSMy2hv8tnIfYzXGRh/O0aO6xOY22dor0wG5nY+HjADc3v9bOxOb2O+Tz/9992Xh3fvHz9+nRCXX/796cO3h8+ffv747X9/zb95/+Xh8fHhz7d/ffn84ePvf3/5+Pbx84fL7+7Uz//8RsT3xGry5dLwndX3zsHlp8svDZl7Q3z58cdv1b2zOPkw+fF/",
|
|
217
212
|
"brillig_names": [
|
|
218
|
-
"
|
|
213
|
+
"update"
|
|
219
214
|
]
|
|
220
215
|
},
|
|
221
216
|
{
|
|
@@ -254,13 +249,13 @@
|
|
|
254
249
|
"error_kind": "string",
|
|
255
250
|
"string": "msg.sender is not deployed"
|
|
256
251
|
},
|
|
257
|
-
"
|
|
252
|
+
"14225679739041873922": {
|
|
258
253
|
"error_kind": "string",
|
|
259
|
-
"string": "
|
|
254
|
+
"string": "Index out of bounds"
|
|
260
255
|
},
|
|
261
|
-
"
|
|
256
|
+
"15573886522241766899": {
|
|
262
257
|
"error_kind": "string",
|
|
263
|
-
"string": "
|
|
258
|
+
"string": "New update delay is too low"
|
|
264
259
|
},
|
|
265
260
|
"17595253152434889169": {
|
|
266
261
|
"error_kind": "string",
|
|
@@ -272,8 +267,8 @@
|
|
|
272
267
|
}
|
|
273
268
|
}
|
|
274
269
|
},
|
|
275
|
-
"bytecode": "
|
|
276
|
-
"debug_symbols": "
|
|
270
|
+
"bytecode": "JwACBAEoAAABBIBPJwAABAMnAgIEAScCAwQAHxgAAwACgE4dAIBOgE4ELgiATgABJQAAAEwlAAAAoCgCAAEEgE8nAgIEADsNAAEAAigAgEMEABkqAIBEAAAAAAEAAAAAKACARQABACgAgEYEAAMoAIBHAQAAKACASAQAACgAgEkAAAAoAIBKAQABKACASwQAASgAgEwAAAEoAIBNBAAEJiUAAAjKLQgBAwAAAQIBLgqARwADLQgBAwAAAQIBLgqASQADLQgBAwAAAQIBJwIEAAItDgQDHgIAAwEeAgAFADM4AAMABQAGJAIABgAAAPQlAAAI8w0oAAGAQwAFCygABYBHAAYkAgAGAAABESUAAAkFKwIABQAAAAAAAAAAAgAAAAAAAAAAJwIKBAstCAALLQwFDAAQAAoAJQAACRctBAAALQwMBi0MDQctDA4ILQwPCS0NBgUAKAUCBS0OBQYtDQcFACgFAgUtDgUHLQgBBQAAAQIBLQ4GBS0IAQYAAAECAS0OBwYtCAEHAAABAgEtDggHLQgBCAAAAQIBLQ4JCCcCCQQKLQgACi0MBQstDAYMLQwHDS0MCA4uCIBMAA8AEAAJACUAAAm3LQQAACcCCQQKLQgACi0MBQstDAYMLQwHDS0MCA4tDAMPABAACQAlAAAJty0EAAAnAgkECi0IAAotDAULLQwGDC0MBw0tDAgOABAACQAlAAAK4C0EAAAtDAsDCygAA4BJAAULKAAFgEcABiQCAAYAAAI/JQAAC1QvDAADAAUcDAUHBBwMBwYAAjgFBgcJKAAHgEQABRwMBQcEHAwHBgAcDAYHBAI4BQYICSgACIBEAAUcDAUIARwMCAYAHAwGCAECOAUGCQkoAAmARQAFHAwFCgQcDAoJABwMCQoEAjgFCQsJKAALgEQABRwMBQsBHAwLCQAcDAkLAQI4BQkMCSgADIBFAAUcDAUNBBwMDQwAHAwMBQQWDAsMHAwJDQQcDAwOBAQ4DQUMFgwIBRwMBg0EHAwFD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RpOEGZUHsxswvcAohqHKg2Vak+d2xRBgLARAHlTTMJcFozxrlGeN86zJY2QSJg93zoVBcvrn6n2Ue0TJW0qSKMpAbZyVcx7CoUa/3rbnpA1wLrzVepgWYhN8uAl9PAu5jlrUhFwUKmvieBbmeBbmeBZ4PAu5Fl3WhD/chJzfFjXBx8fCb4xRYRvw9E94idrYS+RV2DjqFdsIJb89TNmCjd7iwvC+3tUcUH7DQwwegopQcsU4icqyJVeMUygLWagsW2RzUPJ7nAkFC0rHKJuDclm2HCZRJublNqIc9vl7hXE/9Jh8UtZbbWbUhi10y/MVeWjURpTD9gnpqTQaMp5lozkHJU/0CZSV10VTYfIJNBUbfz5fAxsrL1M8zQtnzxRj/PUYueaTwPD1mI03Rbvv2yeUzUFtVHxTqCxbnGWLs2y5LFsuy5bPipfPsUVKZaEwC+VyUBqyUJSDkseY3dGC5PdEHsLQjjFGrp/sPsUb73v37dgM3+T0dx8jlyMSmOtHMpLrhQlMhh25TuvDOa5nZ+FmDF2P8Rl2fGp2ijGsru9vrOh6jDYZGHc9Rs7rE5jrZ2g2GXZMBh+EDExGfOyV/eDn9NN/P3y7+/Dx/vP3CfHwy7+/fPpx9/XL048//vfX/JuP3+7u7+/+fP/Xt6+fPv/+97fP7++/fnr43Y16+s9vZN0tsZ98eej4E+3baWx9+Onhl2jVLVr78OPlt8bfMurJh8mP/wM=",
|
|
277
272
|
"brillig_names": [
|
|
278
273
|
"set_update_delay"
|
|
279
274
|
]
|
|
@@ -2040,9 +2035,9 @@
|
|
|
2040
2035
|
"error_kind": "string",
|
|
2041
2036
|
"string": "call to assert_max_bit_size"
|
|
2042
2037
|
},
|
|
2043
|
-
"
|
|
2038
|
+
"14225679739041873922": {
|
|
2044
2039
|
"error_kind": "string",
|
|
2045
|
-
"string": "
|
|
2040
|
+
"string": "Index out of bounds"
|
|
2046
2041
|
},
|
|
2047
2042
|
"17843811134343075018": {
|
|
2048
2043
|
"error_kind": "string",
|
|
@@ -2050,8 +2045,8 @@
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Cp/VI714yHy5op3y52zcq9WwrNTaKTTzb+13e/DDMtUzNbvg/OxANngeWvCNWvpcCxP1yQbMVVn4ercsYW27rFiJDm02GlNv6OsSqIeW2vg6BegjWQ6gewvUQqYdoPaTe/VDvfqh33+rdt3r3rd59q3ff6t0vL2WbxiO6ncMZRl+B8a/AhFdgrB6zsMy2BnoaLv+9eri5+nh7Pc49ju/+uPs0TUUOl4//fZvemSYrvz3cf7r+/OPhepy2TDOWo8+EW8YdleFCYCsa5/J2LylsVcf3x1vP3NYw9dLj+yhbcqn72L3kt4TpwT2+BLpFiA/k8XOVtp6mzx1mx7dDLzBUbqjg/w==",
|
|
2055
2050
|
"brillig_names": [
|
|
2056
2051
|
"store_in_execution_cache_oracle_wrapper",
|
|
2057
2052
|
"call_private_function_internal",
|
|
@@ -2059,165 +2054,22 @@
|
|
|
2059
2054
|
"lte_hint",
|
|
2060
2055
|
"notify_created_nullifier_oracle_wrapper",
|
|
2061
2056
|
"debug_log_oracle_wrapper",
|
|
2062
|
-
"directive_integer_quotient",
|
|
2063
2057
|
"directive_invert"
|
|
2064
2058
|
],
|
|
2065
|
-
"verification_key": "
|
|
2066
|
-
}
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
"
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId",
|
|
2080
|
-
"fields": [
|
|
2081
|
-
{
|
|
2082
|
-
"name": "inner",
|
|
2083
|
-
"type": {
|
|
2084
|
-
"kind": "field"
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
]
|
|
2088
|
-
},
|
|
2089
|
-
"visibility": "private"
|
|
2090
|
-
}
|
|
2091
|
-
],
|
|
2092
|
-
"return_type": null,
|
|
2093
|
-
"error_types": {
|
|
2094
|
-
"206160798890201757": {
|
|
2095
|
-
"error_kind": "string",
|
|
2096
|
-
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
2097
|
-
},
|
|
2098
|
-
"2920182694213909827": {
|
|
2099
|
-
"error_kind": "string",
|
|
2100
|
-
"string": "attempt to subtract with overflow"
|
|
2101
|
-
},
|
|
2102
|
-
"5019202896831570965": {
|
|
2103
|
-
"error_kind": "string",
|
|
2104
|
-
"string": "attempt to add with overflow"
|
|
2105
|
-
},
|
|
2106
|
-
"6504213605561840204": {
|
|
2107
|
-
"error_kind": "string",
|
|
2108
|
-
"string": "New contract class is not registered"
|
|
2109
|
-
},
|
|
2110
|
-
"10019982601749771606": {
|
|
2111
|
-
"error_kind": "string",
|
|
2112
|
-
"string": "msg.sender is not deployed"
|
|
2113
|
-
},
|
|
2114
|
-
"16761564377371454734": {
|
|
2115
|
-
"error_kind": "string",
|
|
2116
|
-
"string": "Array index out of bounds"
|
|
2117
|
-
},
|
|
2118
|
-
"17595253152434889169": {
|
|
2119
|
-
"error_kind": "string",
|
|
2120
|
-
"string": "offset too large"
|
|
2121
|
-
},
|
|
2122
|
-
"17843811134343075018": {
|
|
2123
|
-
"error_kind": "string",
|
|
2124
|
-
"string": "Stack too deep"
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
},
|
|
2128
|
-
"bytecode": "JwACBAEoAAABBIBQJwAABAMnAgIEAScCAwQAHxgAAwACgE8uCIBPAAElAAAARSUAAAC+KAIAAQSAUCcCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YqAIBFAAAAAAEAAAAAKACARgABACgAgEcEAAMoAIBIAQAAKACASQQAACgAgEoAAAAoAIBLAQABKACATAQAASgAgE0AAAEoAIBOBAAEJiUAAAncLQgBAwAAAQIBLgqASAADLQgBAwAAAQIBLgqASgADLQgBAwAAAQIBJwIEAAItDgQDHgIAAwEeAgAFADM4AAMABQAGJAIABgAAARIlAAAKBTMoAAGAQwAFJAIABQA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v//v7/kv77/ef/p0/9fbv79++fDxj3++fnz76cuHy9/u1OM/vzvl3jjtJ18uDX8K7N94uH67/HHKlbwhBZevl7+6MJUNYfJh8uP/",
|
|
2130
|
-
"brillig_names": [
|
|
2131
|
-
"update"
|
|
2132
|
-
]
|
|
2133
|
-
},
|
|
2134
|
-
{
|
|
2135
|
-
"name": "public_dispatch",
|
|
2136
|
-
"is_unconstrained": true,
|
|
2137
|
-
"custom_attributes": [
|
|
2138
|
-
"public"
|
|
2139
|
-
],
|
|
2140
|
-
"abi": {
|
|
2141
|
-
"parameters": [
|
|
2142
|
-
{
|
|
2143
|
-
"name": "selector",
|
|
2144
|
-
"type": {
|
|
2145
|
-
"kind": "field"
|
|
2146
|
-
},
|
|
2147
|
-
"visibility": "private"
|
|
2148
|
-
}
|
|
2149
|
-
],
|
|
2150
|
-
"return_type": null,
|
|
2151
|
-
"error_types": {
|
|
2152
|
-
"206160798890201757": {
|
|
2153
|
-
"error_kind": "string",
|
|
2154
|
-
"string": "Storage slot 0 not allowed. Storage slots must start from 1."
|
|
2155
|
-
},
|
|
2156
|
-
"2830029349304997821": {
|
|
2157
|
-
"error_kind": "fmtstring",
|
|
2158
|
-
"length": 27,
|
|
2159
|
-
"item_types": [
|
|
2160
|
-
{
|
|
2161
|
-
"kind": "field"
|
|
2162
|
-
}
|
|
2163
|
-
]
|
|
2164
|
-
},
|
|
2165
|
-
"2920182694213909827": {
|
|
2166
|
-
"error_kind": "string",
|
|
2167
|
-
"string": "attempt to subtract with overflow"
|
|
2168
|
-
},
|
|
2169
|
-
"5019202896831570965": {
|
|
2170
|
-
"error_kind": "string",
|
|
2171
|
-
"string": "attempt to add with overflow"
|
|
2172
|
-
},
|
|
2173
|
-
"6504213605561840204": {
|
|
2174
|
-
"error_kind": "string",
|
|
2175
|
-
"string": "New contract class is not registered"
|
|
2176
|
-
},
|
|
2177
|
-
"10019982601749771606": {
|
|
2178
|
-
"error_kind": "string",
|
|
2179
|
-
"string": "msg.sender is not deployed"
|
|
2180
|
-
},
|
|
2181
|
-
"11343565365413149907": {
|
|
2182
|
-
"error_kind": "string",
|
|
2183
|
-
"string": "Function get_update_delay can only be called statically"
|
|
2184
|
-
},
|
|
2185
|
-
"15573886522241766899": {
|
|
2186
|
-
"error_kind": "string",
|
|
2187
|
-
"string": "New update delay is too low"
|
|
2188
|
-
},
|
|
2189
|
-
"16761564377371454734": {
|
|
2190
|
-
"error_kind": "string",
|
|
2191
|
-
"string": "Array index out of bounds"
|
|
2192
|
-
},
|
|
2193
|
-
"17595253152434889169": {
|
|
2194
|
-
"error_kind": "string",
|
|
2195
|
-
"string": "offset too large"
|
|
2196
|
-
},
|
|
2197
|
-
"17843811134343075018": {
|
|
2198
|
-
"error_kind": "string",
|
|
2199
|
-
"string": "Stack too deep"
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
},
|
|
2203
|
-
"bytecode": "JwACBAEoAAABBIBSJwAABAMnAgIEAScCAwQAHxgAAwACgFEuCIBRAAElAAAARSUAAADMKAIAAQSAUicCAgQAOw0AAQACKACAQwAAAywAgEQAAAAAAA6S+filNOhY/Pd32iBuCLDGIOz53rIdE0eYE/YoAIBFBAAZKgCARgAAAAABAAAAACgAgEcAAQAoAIBIBAADKACASQEAACgAgEoEAAAoAIBLAAAAKACATAEAASgAgE0EAAEoAIBOAAABKACATwQAAigAgFAEAAQmJQAACvgpAgACAPqRAssKOAECAycCBAQAJwIGBAMAOAQGBS0IAQIAEAEFAScDAgQBACgCAgUtDgQFACgFAgUtDgQFJwIFBAMAOAIFBCcCBAArJAIAAwAAASojAAAEcC0IAQMnAgUEAgAQAQUBJwMDBAEAKAMCBR8kgE2ATQAFLQ0DBQAoBQIFLQ4FAy0IAQUAAAECAS0OAwUtCAEDAAABAgEuCoBKAAMnAgcECC0IAAgtDAUJLQwDCgAQAAcAJQAACyEtBAAALQwJBgEoAAaATQAFLQ0FAy0IAQUAAAECAS4KgEkABS0IAQYAAAECAS4KgEsABi0IAQcAAAECA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s4KlvQWhgbs+GNq5da2Bubw8oJAPm9kxtY9tBA2PgiQZ74u2xs7FJoYG5MQ7+mn77/x++fvzhx08ffpsQT3/84/NPv3/88vn119//8+v8lx+/fvz06eMv3//69ctPH37+4+uH7z99+enpb+/C6//+BaD0HiLwpOZJ/rRiK+8hZZp+f3IbhKffp6HR09+fANNq2/tpwefp19fn8/R84knZpO6/",
|
|
2205
|
-
"brillig_names": [
|
|
2206
|
-
"public_dispatch"
|
|
2207
|
-
]
|
|
2208
|
-
}
|
|
2209
|
-
],
|
|
2210
|
-
"outputs": {
|
|
2211
|
-
"globals": {
|
|
2212
|
-
"storage": [
|
|
2213
|
-
{
|
|
2214
|
-
"fields": [
|
|
2215
|
-
{
|
|
2216
|
-
"name": "contract_name",
|
|
2217
|
-
"value": {
|
|
2218
|
-
"kind": "string",
|
|
2219
|
-
"value": "ContractInstanceDeployer"
|
|
2220
|
-
}
|
|
2059
|
+
"verification_key": "AAAAAAAEAAAAAAAAAAAAEgAAAAAAAAAQAAAAAAAAVgkBAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAAAAAAAAAAAAAGOCCpDSiJTBrTNrACftcVIpDP0gAUgOfr61Rf1joqhofgWCThwZt/jv2kereHZxpXZaHfOrQXAJfbaEZK/ySgyOpvxlgUWbPhQeZuL84z3NPBHHNv4I2qhOYG96powtQKsK9LNUUHCDged5eO3NwlJaqCJuSsG4hdiuyOH/SveAS1rb1+8MRm94IDWr6xij8Y38RBu5sriBmS2WnWBeZwy5vl6NShiHV4FPDtfzoWza45O/bO0S+UObSmeaPPs9bCsexgAxe6u62RKgMBSU9aZScX50ygsNCvfSZE71hQbgY1w/KXmDcvlUc02Q2x7M+dnwYyoZijoc921LB3NFziwfytnBJRWekOIby1r7JheYBJgl4kgJBtjPKzXj3HGxTCWsCFXYIf+TdtH6Ak9qGDWdovJ06ccwA5rJGZnhBsgkYnlaCx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|
2061
|
+
],
|
|
2062
|
+
"outputs": {
|
|
2063
|
+
"globals": {
|
|
2064
|
+
"storage": [
|
|
2065
|
+
{
|
|
2066
|
+
"fields": [
|
|
2067
|
+
{
|
|
2068
|
+
"name": "contract_name",
|
|
2069
|
+
"value": {
|
|
2070
|
+
"kind": "string",
|
|
2071
|
+
"value": "ContractInstanceDeployer"
|
|
2072
|
+
}
|
|
2221
2073
|
},
|
|
2222
2074
|
{
|
|
2223
2075
|
"name": "fields",
|
|
@@ -2250,71 +2102,6 @@
|
|
|
2250
2102
|
},
|
|
2251
2103
|
"structs": {
|
|
2252
2104
|
"events": [
|
|
2253
|
-
{
|
|
2254
|
-
"fields": [
|
|
2255
|
-
{
|
|
2256
|
-
"name": "DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE",
|
|
2257
|
-
"type": {
|
|
2258
|
-
"kind": "field"
|
|
2259
|
-
}
|
|
2260
|
-
},
|
|
2261
|
-
{
|
|
2262
|
-
"name": "address",
|
|
2263
|
-
"type": {
|
|
2264
|
-
"fields": [
|
|
2265
|
-
{
|
|
2266
|
-
"name": "inner",
|
|
2267
|
-
"type": {
|
|
2268
|
-
"kind": "field"
|
|
2269
|
-
}
|
|
2270
|
-
}
|
|
2271
|
-
],
|
|
2272
|
-
"kind": "struct",
|
|
2273
|
-
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
2274
|
-
}
|
|
2275
|
-
},
|
|
2276
|
-
{
|
|
2277
|
-
"name": "prev_contract_class_id",
|
|
2278
|
-
"type": {
|
|
2279
|
-
"fields": [
|
|
2280
|
-
{
|
|
2281
|
-
"name": "inner",
|
|
2282
|
-
"type": {
|
|
2283
|
-
"kind": "field"
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
],
|
|
2287
|
-
"kind": "struct",
|
|
2288
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2289
|
-
}
|
|
2290
|
-
},
|
|
2291
|
-
{
|
|
2292
|
-
"name": "new_contract_class_id",
|
|
2293
|
-
"type": {
|
|
2294
|
-
"fields": [
|
|
2295
|
-
{
|
|
2296
|
-
"name": "inner",
|
|
2297
|
-
"type": {
|
|
2298
|
-
"kind": "field"
|
|
2299
|
-
}
|
|
2300
|
-
}
|
|
2301
|
-
],
|
|
2302
|
-
"kind": "struct",
|
|
2303
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2304
|
-
}
|
|
2305
|
-
},
|
|
2306
|
-
{
|
|
2307
|
-
"name": "block_of_change",
|
|
2308
|
-
"type": {
|
|
2309
|
-
"kind": "integer",
|
|
2310
|
-
"sign": "unsigned",
|
|
2311
|
-
"width": 32
|
|
2312
|
-
}
|
|
2313
|
-
}
|
|
2314
|
-
],
|
|
2315
|
-
"kind": "struct",
|
|
2316
|
-
"path": "ContractInstanceDeployer::ContractInstanceUpdated"
|
|
2317
|
-
},
|
|
2318
2105
|
{
|
|
2319
2106
|
"fields": [
|
|
2320
2107
|
{
|
|
@@ -2544,74 +2331,62 @@
|
|
|
2544
2331
|
],
|
|
2545
2332
|
"kind": "struct",
|
|
2546
2333
|
"path": "ContractInstanceDeployer::ContractInstanceDeployed"
|
|
2547
|
-
}
|
|
2548
|
-
],
|
|
2549
|
-
"functions": [
|
|
2334
|
+
},
|
|
2550
2335
|
{
|
|
2551
2336
|
"fields": [
|
|
2552
2337
|
{
|
|
2553
|
-
"name": "
|
|
2338
|
+
"name": "DEPLOYER_CONTRACT_INSTANCE_UPDATED_MAGIC_VALUE",
|
|
2339
|
+
"type": {
|
|
2340
|
+
"kind": "field"
|
|
2341
|
+
}
|
|
2342
|
+
},
|
|
2343
|
+
{
|
|
2344
|
+
"name": "address",
|
|
2554
2345
|
"type": {
|
|
2555
2346
|
"fields": [
|
|
2556
2347
|
{
|
|
2557
|
-
"name": "
|
|
2348
|
+
"name": "inner",
|
|
2558
2349
|
"type": {
|
|
2559
|
-
"kind": "
|
|
2560
|
-
"sign": "unsigned",
|
|
2561
|
-
"width": 32
|
|
2350
|
+
"kind": "field"
|
|
2562
2351
|
}
|
|
2563
2352
|
}
|
|
2564
2353
|
],
|
|
2565
2354
|
"kind": "struct",
|
|
2566
|
-
"path": "
|
|
2355
|
+
"path": "aztec::protocol_types::address::aztec_address::AztecAddress"
|
|
2567
2356
|
}
|
|
2568
|
-
}
|
|
2569
|
-
],
|
|
2570
|
-
"kind": "struct",
|
|
2571
|
-
"path": "ContractInstanceDeployer::set_update_delay_abi"
|
|
2572
|
-
},
|
|
2573
|
-
{
|
|
2574
|
-
"fields": [
|
|
2357
|
+
},
|
|
2575
2358
|
{
|
|
2576
|
-
"name": "
|
|
2359
|
+
"name": "prev_contract_class_id",
|
|
2577
2360
|
"type": {
|
|
2578
2361
|
"fields": [
|
|
2579
2362
|
{
|
|
2580
|
-
"name": "
|
|
2363
|
+
"name": "inner",
|
|
2581
2364
|
"type": {
|
|
2582
|
-
"
|
|
2583
|
-
{
|
|
2584
|
-
"name": "inner",
|
|
2585
|
-
"type": {
|
|
2586
|
-
"kind": "field"
|
|
2587
|
-
}
|
|
2588
|
-
}
|
|
2589
|
-
],
|
|
2590
|
-
"kind": "struct",
|
|
2591
|
-
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2365
|
+
"kind": "field"
|
|
2592
2366
|
}
|
|
2593
2367
|
}
|
|
2594
2368
|
],
|
|
2595
2369
|
"kind": "struct",
|
|
2596
|
-
"path": "
|
|
2370
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2597
2371
|
}
|
|
2598
|
-
}
|
|
2599
|
-
],
|
|
2600
|
-
"kind": "struct",
|
|
2601
|
-
"path": "ContractInstanceDeployer::update_abi"
|
|
2602
|
-
},
|
|
2603
|
-
{
|
|
2604
|
-
"fields": [
|
|
2372
|
+
},
|
|
2605
2373
|
{
|
|
2606
|
-
"name": "
|
|
2374
|
+
"name": "new_contract_class_id",
|
|
2607
2375
|
"type": {
|
|
2608
|
-
"fields": [
|
|
2376
|
+
"fields": [
|
|
2377
|
+
{
|
|
2378
|
+
"name": "inner",
|
|
2379
|
+
"type": {
|
|
2380
|
+
"kind": "field"
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
],
|
|
2609
2384
|
"kind": "struct",
|
|
2610
|
-
"path": "
|
|
2385
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2611
2386
|
}
|
|
2612
2387
|
},
|
|
2613
2388
|
{
|
|
2614
|
-
"name": "
|
|
2389
|
+
"name": "block_of_change",
|
|
2615
2390
|
"type": {
|
|
2616
2391
|
"kind": "integer",
|
|
2617
2392
|
"sign": "unsigned",
|
|
@@ -2620,7 +2395,32 @@
|
|
|
2620
2395
|
}
|
|
2621
2396
|
],
|
|
2622
2397
|
"kind": "struct",
|
|
2623
|
-
"path": "ContractInstanceDeployer::
|
|
2398
|
+
"path": "ContractInstanceDeployer::ContractInstanceUpdated"
|
|
2399
|
+
}
|
|
2400
|
+
],
|
|
2401
|
+
"functions": [
|
|
2402
|
+
{
|
|
2403
|
+
"fields": [
|
|
2404
|
+
{
|
|
2405
|
+
"name": "parameters",
|
|
2406
|
+
"type": {
|
|
2407
|
+
"fields": [
|
|
2408
|
+
{
|
|
2409
|
+
"name": "new_update_delay",
|
|
2410
|
+
"type": {
|
|
2411
|
+
"kind": "integer",
|
|
2412
|
+
"sign": "unsigned",
|
|
2413
|
+
"width": 32
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
],
|
|
2417
|
+
"kind": "struct",
|
|
2418
|
+
"path": "ContractInstanceDeployer::set_update_delay_parameters"
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
],
|
|
2422
|
+
"kind": "struct",
|
|
2423
|
+
"path": "ContractInstanceDeployer::set_update_delay_abi"
|
|
2624
2424
|
},
|
|
2625
2425
|
{
|
|
2626
2426
|
"fields": [
|
|
@@ -2822,274 +2622,222 @@
|
|
|
2822
2622
|
],
|
|
2823
2623
|
"kind": "struct",
|
|
2824
2624
|
"path": "ContractInstanceDeployer::deploy_abi"
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
"fields": [
|
|
2628
|
+
{
|
|
2629
|
+
"name": "parameters",
|
|
2630
|
+
"type": {
|
|
2631
|
+
"fields": [
|
|
2632
|
+
{
|
|
2633
|
+
"name": "new_contract_class_id",
|
|
2634
|
+
"type": {
|
|
2635
|
+
"fields": [
|
|
2636
|
+
{
|
|
2637
|
+
"name": "inner",
|
|
2638
|
+
"type": {
|
|
2639
|
+
"kind": "field"
|
|
2640
|
+
}
|
|
2641
|
+
}
|
|
2642
|
+
],
|
|
2643
|
+
"kind": "struct",
|
|
2644
|
+
"path": "aztec::protocol_types::contract_class_id::ContractClassId"
|
|
2645
|
+
}
|
|
2646
|
+
}
|
|
2647
|
+
],
|
|
2648
|
+
"kind": "struct",
|
|
2649
|
+
"path": "ContractInstanceDeployer::update_parameters"
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
],
|
|
2653
|
+
"kind": "struct",
|
|
2654
|
+
"path": "ContractInstanceDeployer::update_abi"
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
"fields": [
|
|
2658
|
+
{
|
|
2659
|
+
"name": "parameters",
|
|
2660
|
+
"type": {
|
|
2661
|
+
"fields": [],
|
|
2662
|
+
"kind": "struct",
|
|
2663
|
+
"path": "ContractInstanceDeployer::get_update_delay_parameters"
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
{
|
|
2667
|
+
"name": "return_type",
|
|
2668
|
+
"type": {
|
|
2669
|
+
"kind": "integer",
|
|
2670
|
+
"sign": "unsigned",
|
|
2671
|
+
"width": 32
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
],
|
|
2675
|
+
"kind": "struct",
|
|
2676
|
+
"path": "ContractInstanceDeployer::get_update_delay_abi"
|
|
2825
2677
|
}
|
|
2826
2678
|
]
|
|
2827
2679
|
}
|
|
2828
2680
|
},
|
|
2829
2681
|
"file_map": {
|
|
2830
|
-
"
|
|
2831
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec.nr",
|
|
2832
|
-
"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::{check_each_fn_macroified, create_message_discovery_call},\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 `sync_notes` utility function 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 // Functions that don't have #[private], #[public], #[utility], #[contract_library_method], or #[test] are not\n // allowed in contracts.\n check_each_fn_macroified(m);\n\n let contract_library_method_compute_note_hash_and_nullifier =\n generate_contract_library_method_compute_note_hash_and_nullifier();\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 $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_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\n // TODO(https://github.com/noir-lang/noir/issues/7912): Doing the following unfortunately doesn't work. Once\n // the issue is fixed uncomment the following and remove the workaround from TS (look for the issue link in the\n // codebase).\n // let utility: fn(FunctionDefinition) -> () = crate::macros::functions::utility;\n // quote {\n // #[$utility]\n // unconstrained fn sync_notes() {\n // $message_discovery_call\n // }\n // }\n\n quote {\n #[aztec::macros::functions::utility]\n unconstrained fn sync_notes() {\n $message_discovery_call\n }\n }\n}\n"
|
|
2833
|
-
},
|
|
2834
|
-
"112": {
|
|
2835
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch.nr",
|
|
2836
|
-
"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 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 // name of the function is assigned just before the call so debug metadata doesn't span most of this macro when figuring out where the call comes from.\n let name = function.name();\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"
|
|
2837
|
-
},
|
|
2838
|
-
"115": {
|
|
2839
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/functions/call_interface_stubs.nr",
|
|
2840
|
-
"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"
|
|
2841
|
-
},
|
|
2842
|
-
"119": {
|
|
2843
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/functions/utils.nr",
|
|
2844
|
-
"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_contract_library_method,\n is_fn_initializer, is_fn_internal, is_fn_private, is_fn_public, is_fn_test, is_fn_utility,\n 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 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 transform_utility(f: FunctionDefinition) {\n // Check if function is marked as unconstrained\n if !f.is_unconstrained() {\n let name = f.name();\n panic(\n f\"Function {name} is annotated with #[utility] but not marked as unconstrained, add unconstrained keyword\",\n );\n }\n\n // Create utility context\n let context_creation =\n quote { let mut context = dep::aztec::context::utility_context::UtilityContext::new(); };\n let module_has_storage = module_has_storage(f.module());\n\n // Initialize Storage if module has storage\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 utility 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 // Inject context creation, storage initialization, and message discovery call at the beginning of the function\n // body.\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_body(modified_body);\n\n f.set_return_public(true);\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\n/// Checks if each function in the module is marked with either #[private], #[public], #[utility],\n/// #[contract_library_method], or #[test]. Non-macroified functions are not allowed in contracts.\npub(crate) comptime fn check_each_fn_macroified(m: Module) {\n for f in m.functions() {\n let name = f.name();\n if !is_fn_private(f)\n & !is_fn_public(f)\n & !is_fn_utility(f)\n & !is_fn_contract_library_method(f)\n & !is_fn_test(f) {\n panic(\n f\"Function {name} must be marked as either #[private], #[public], #[utility], #[contract_library_method], or #[test]\",\n );\n }\n }\n}\n"
|
|
2845
|
-
},
|
|
2846
|
-
"122": {
|
|
2847
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/storage.nr",
|
|
2848
|
-
"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"
|
|
2849
|
-
},
|
|
2850
|
-
"140": {
|
|
2682
|
+
"134": {
|
|
2851
2683
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/call_private_function.nr",
|
|
2852
2684
|
"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"
|
|
2853
2685
|
},
|
|
2854
|
-
"
|
|
2855
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/capsules.nr",
|
|
2856
|
-
"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"
|
|
2857
|
-
},
|
|
2858
|
-
"143": {
|
|
2686
|
+
"137": {
|
|
2859
2687
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution.nr",
|
|
2860
2688
|
"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"
|
|
2861
2689
|
},
|
|
2862
|
-
"
|
|
2690
|
+
"138": {
|
|
2863
2691
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/execution_cache.nr",
|
|
2864
2692
|
"source": "/// Stores values represented as slice in execution cache to be later obtained by its hash.\npub fn store(values: [Field], hash: 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, hash) };\n}\n\nunconstrained fn store_in_execution_cache_oracle_wrapper(values: [Field], hash: Field) {\n store_in_execution_cache_oracle(values, hash);\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], _hash: Field) {}\n\n#[oracle(loadFromExecutionCache)]\nunconstrained fn load_from_execution_cache_oracle<let N: u32>(_hash: Field) -> [Field; N] {}\n"
|
|
2865
2693
|
},
|
|
2866
|
-
"
|
|
2867
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/logs.nr",
|
|
2868
|
-
"source": "use crate::discovery::MAX_LOG_CONTENT_LEN;\nuse protocol_types::{abis::event_selector::EventSelector, address::AztecAddress};\n\n/// The below only exists to broadcast the raw log, so we can provide it to the base rollup later to be constrained.\npub unconstrained fn notify_created_contract_class_log<let N: u32>(\n contract_address: AztecAddress,\n message: [Field; N],\n counter: u32,\n) {\n notify_created_contract_class_log_private_oracle(contract_address, message, counter)\n}\n\n#[oracle(notifyCreatedContractClassLog)]\nunconstrained fn notify_created_contract_class_log_private_oracle<let N: u32>(\n contract_address: AztecAddress,\n message: [Field; N],\n counter: u32,\n) {}\n\npub unconstrained fn store_private_event_log(\n contract_address: AztecAddress,\n recipient: AztecAddress,\n event_selector: EventSelector,\n log_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN>,\n tx_hash: Field,\n log_index_in_tx: Field,\n) {\n store_private_event_log_oracle(\n contract_address,\n recipient,\n event_selector,\n log_content,\n tx_hash,\n log_index_in_tx,\n )\n}\n\n#[oracle(storePrivateEventLog)]\nunconstrained fn store_private_event_log_oracle(\n contract_address: AztecAddress,\n recipient: AztecAddress,\n event_selector: EventSelector,\n log_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN>,\n tx_hash: Field,\n log_index_in_tx: Field,\n) {}\n"
|
|
2869
|
-
},
|
|
2870
|
-
"153": {
|
|
2871
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/message_discovery.nr",
|
|
2872
|
-
"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 private logs that may have been sent to all registered accounts in PXE in the current contract and makes\n/// them available for later processing in Noir by storing them in a capsule array.\npub unconstrained fn sync_notes(pending_tagged_log_array_base_slot: Field) {\n sync_notes_oracle(pending_tagged_log_array_base_slot);\n}\n\n#[oracle(syncNotes)]\nunconstrained fn sync_notes_oracle(pending_tagged_log_array_base_slot: Field) {}\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"
|
|
2873
|
-
},
|
|
2874
|
-
"155": {
|
|
2694
|
+
"149": {
|
|
2875
2695
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/notes.nr",
|
|
2876
2696
|
"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::IndexedTaggingSecret,\n traits::{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/// Returns the derived app tagging secret ready to be included in a log for a given sender and recipient pair,\n/// siloed for the current contract address.\npub unconstrained fn get_app_tag_as_sender(sender: AztecAddress, recipient: AztecAddress) -> Field {\n get_indexed_tagging_secret_as_sender_oracle(sender, recipient).compute_tag(recipient)\n}\n\n#[oracle(getIndexedTaggingSecretAsSender)]\nunconstrained fn get_indexed_tagging_secret_as_sender_oracle(\n _sender: AztecAddress,\n _recipient: AztecAddress,\n) -> IndexedTaggingSecret {}\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"
|
|
2877
2697
|
},
|
|
2878
|
-
"
|
|
2879
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/
|
|
2880
|
-
"source": "use protocol_types::{
|
|
2698
|
+
"154": {
|
|
2699
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/map.nr",
|
|
2700
|
+
"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"
|
|
2881
2701
|
},
|
|
2882
2702
|
"16": {
|
|
2883
2703
|
"path": "std/embedded_curve_ops.nr",
|
|
2884
|
-
"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// 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 if crate::runtime::is_unconstrained() {\n embedded_curve_add_unsafe(point1, point2)\n } else {\n // In a constrained context we need to do some black magic in order to satisfy the backend's\n // expectations about the inputs to an `embedded_curve_add` opcode.\n //\n // TODO: document this better.\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 =\n 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\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"
|
|
2704
|
+
"source": "use crate::cmp::Eq;\nuse crate::hash::Hash;\nuse crate::ops::arith::{Add, Neg, Sub};\n\n/// A point on the embedded elliptic curve\n/// By definition, the base field of the embedded curve is the scalar field of the proof system curve, i.e the Noir Field.\n/// x and y denotes the Weierstrass coordinates of the point, 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\nimpl Hash for EmbeddedCurvePoint {\n fn hash<H>(self, state: &mut H)\n where\n H: crate::hash::Hasher,\n {\n if self.is_infinite {\n self.is_infinite.hash(state);\n } else {\n self.x.hash(state);\n self.y.hash(state);\n }\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\nimpl Hash for EmbeddedCurveScalar {\n fn hash<H>(self, state: &mut H)\n where\n H: crate::hash::Hasher,\n {\n self.hi.hash(state);\n self.lo.hash(state);\n }\n}\n\n// Computes a multi scalar multiplication over the embedded curve.\n// For bn254, We have Grumpkin 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 multi_scalar_mul_array_return(points, scalars)[0]\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) -> [EmbeddedCurvePoint; 1] {}\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// 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 if crate::runtime::is_unconstrained() {\n // `embedded_curve_add_unsafe` requires the inputs not to be the infinity point, so we check it here.\n // This is because `embedded_curve_add_unsafe` uses the `embedded_curve_add` opcode.\n // For efficiency, the backend does not check the inputs for the infinity point, but it assumes that they are not the infinity point\n // so that it can apply the ec addition formula directly.\n if point1.is_infinite {\n point2\n } else if point2.is_infinite {\n point1\n } else {\n embedded_curve_add_unsafe(point1, point2)\n }\n } else {\n // In a constrained context, we also need to check the inputs are not the infinity point because we also use `embedded_curve_add_unsafe`\n // However we also need to identify the case where the two inputs are the same, because then\n // the addition formula does not work and we need to use the doubling formula instead.\n // In unconstrained context, we can check directly if the input values are the same when solving the opcode, so it is not an issue.\n\n // x_coordinates_match is true if both abscissae are the same\n let x_coordinates_match = point1.x == point2.x;\n // y_coordinates_match is true if both ordinates are the same\n let y_coordinates_match = point1.y == point2.y;\n // double_predicate is true if both abscissae and ordinates are the same\n let double_predicate = (x_coordinates_match & y_coordinates_match);\n // If the abscissae are the same, but not the ordinates, then one point is the opposite of the other\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 // - if x_coordinates_match is 0, that means point1.x != point2.x, and point1_1.x = point1.x + 0\n // - if x_coordinates_match is 1, that means point1.x = point2.x, but point1_1.x = point1.x + 1 in this case\n // Because the abscissa is different, the addition formula is guaranteed to succeed, so we can safely use `embedded_curve_add_unsafe`\n // Note that this computation may be garbage: if x_coordinates_match is 1, or if one of the input is the point at infinity.\n let mut result = embedded_curve_add_unsafe(point1_1, point2);\n\n // `embedded_curve_add_unsafe` is doing a doubling if the input is the same variable, because in this case it is guaranteed (at 'compile time') that the input is the same.\n let double = embedded_curve_add_unsafe(point1, point1);\n // `embedded_curve_add_unsafe` would not perform doubling, even if the inputs point1 and point2 are the same, because it cannot know this without adding some logic (and some constraints)\n // However we did this logic when we computed `double_predicate`, so we set the result to 2*point1 if point1 and point2 are the same\n result = if double_predicate { double } else { result };\n\n // Same logic as above for unconstrained context, we set the proper result when one of the inputs is the infinity point\n if point1.is_infinite {\n result = point2;\n }\n if point2.is_infinite {\n result = point1;\n }\n\n // Finally, we set the is_infinity flag of the result:\n // Opposite points should sum into the infinity point, however, if one of them is point at infinity, their coordinates are not meaningful\n // so we should not use the fact that the inputs are opposite in this case:\n let mut result_is_infinity =\n infinity_predicate & (!point1.is_infinite & !point2.is_infinite);\n // However, if both of them are at infinity, then the result is also at infinity\n result.is_infinite = result_is_infinity | (point1.is_infinite & point2.is_infinite);\n result\n }\n}\n\n#[foreign(embedded_curve_add)]\nfn embedded_curve_add_array_return(\n _point1: EmbeddedCurvePoint,\n _point2: EmbeddedCurvePoint,\n) -> [EmbeddedCurvePoint; 1] {}\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 embedded_curve_add_array_return(point1, point2)[0]\n}\n"
|
|
2885
2705
|
},
|
|
2886
|
-
"
|
|
2887
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/
|
|
2888
|
-
"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"
|
|
2706
|
+
"165": {
|
|
2707
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable.nr",
|
|
2708
|
+
"source": "use dep::protocol_types::{\n shared_mutable::{\n ScheduledDelayChange,\n ScheduledValueChange,\n shared_mutable_values::{unpack_delay_change, unpack_value_change},\n SharedMutableValues,\n },\n traits::Packable,\n};\n\nuse crate::{\n context::{PrivateContext, PublicContext, UtilityContext},\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, Context> SharedMutable<T, INITIAL_DELAY, Context> {\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> SharedMutable<T, INITIAL_DELAY, &mut PublicContext>\nwhere\n T: Eq,\n{\n\n pub fn schedule_value_change<let N: u32>(self, new_value: T)\n where\n T: Packable<N>,\n {\n let _value_change = self.schedule_and_return_value_change(new_value);\n }\n\n pub fn schedule_and_return_value_change<let N: u32>(\n self,\n new_value: T,\n ) -> ScheduledValueChange<T>\n where\n T: Packable<N>,\n {\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<let N: u32>(self, new_delay: u32)\n where\n T: Packable<N>,\n {\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<let N: u32>(self) -> T\n where\n T: Packable<N>,\n {\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<let N: u32>(self) -> u32\n where\n T: Packable<N>,\n {\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<let N: u32>(self) -> (T, u32)\n where\n T: Packable<N>,\n {\n self.read_value_change().get_scheduled()\n }\n\n pub fn get_scheduled_delay<let N: u32>(self) -> (u32, u32)\n where\n T: Packable<N>,\n {\n self.read_delay_change().get_scheduled()\n }\n\n fn read_value_change<let N: u32>(self) -> ScheduledValueChange<T>\n where\n T: Packable<N>,\n {\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 unpack_value_change::<T, N>(packed)\n }\n\n fn read_delay_change<let N: u32>(self) -> ScheduledDelayChange<INITIAL_DELAY>\n where\n T: Packable<N>,\n {\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 unpack_delay_change::<INITIAL_DELAY>(packed)\n }\n\n fn write<let N: u32>(\n self,\n value_change: ScheduledValueChange<T>,\n delay_change: ScheduledDelayChange<INITIAL_DELAY>,\n )\n where\n T: Packable<N>,\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> SharedMutable<T, INITIAL_DELAY, &mut PrivateContext>\nwhere\n T: Eq,\n{\n pub fn get_current_value<let N: u32>(self) -> T\n where\n T: Packable<N>,\n {\n // When reading the current value in private we construct a historical state proof for the public value.\n // However, since this value might change, we must constrain the maximum transaction 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<let N: u32>(\n self,\n ) -> (ScheduledValueChange<T>, ScheduledDelayChange<INITIAL_DELAY>, u32)\n where\n T: Packable<N>,\n {\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> SharedMutable<T, INITIAL_DELAY, UtilityContext>\nwhere\n T: Eq,\n{\n pub unconstrained fn get_current_value<let N: u32>(self) -> T\n where\n T: Packable<N>,\n {\n let smv: SharedMutableValues<T, INITIAL_DELAY> =\n WithHash::utility_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"
|
|
2889
2709
|
},
|
|
2890
2710
|
"17": {
|
|
2891
2711
|
"path": "std/field/bn254.nr",
|
|
2892
|
-
"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;\
|
|
2893
|
-
},
|
|
2894
|
-
"171": {
|
|
2895
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable.nr",
|
|
2896
|
-
"source": "use dep::protocol_types::{\n shared_mutable::{\n ScheduledDelayChange,\n ScheduledValueChange,\n shared_mutable_values::{unpack_delay_change, unpack_value_change},\n SharedMutableValues,\n },\n traits::Packable,\n};\n\nuse crate::{\n context::{PrivateContext, PublicContext, UtilityContext},\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, Context> SharedMutable<T, INITIAL_DELAY, Context> {\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> SharedMutable<T, INITIAL_DELAY, &mut PublicContext>\nwhere\n T: Eq,\n{\n\n pub fn schedule_value_change<let N: u32>(self, new_value: T)\n where\n T: Packable<N>,\n {\n let _value_change = self.schedule_and_return_value_change(new_value);\n }\n\n pub fn schedule_and_return_value_change<let N: u32>(\n self,\n new_value: T,\n ) -> ScheduledValueChange<T>\n where\n T: Packable<N>,\n {\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<let N: u32>(self, new_delay: u32)\n where\n T: Packable<N>,\n {\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<let N: u32>(self) -> T\n where\n T: Packable<N>,\n {\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<let N: u32>(self) -> u32\n where\n T: Packable<N>,\n {\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<let N: u32>(self) -> (T, u32)\n where\n T: Packable<N>,\n {\n self.read_value_change().get_scheduled()\n }\n\n pub fn get_scheduled_delay<let N: u32>(self) -> (u32, u32)\n where\n T: Packable<N>,\n {\n self.read_delay_change().get_scheduled()\n }\n\n fn read_value_change<let N: u32>(self) -> ScheduledValueChange<T>\n where\n T: Packable<N>,\n {\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 unpack_value_change::<T, N>(packed)\n }\n\n fn read_delay_change<let N: u32>(self) -> ScheduledDelayChange<INITIAL_DELAY>\n where\n T: Packable<N>,\n {\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 unpack_delay_change::<INITIAL_DELAY>(packed)\n }\n\n fn write<let N: u32>(\n self,\n value_change: ScheduledValueChange<T>,\n delay_change: ScheduledDelayChange<INITIAL_DELAY>,\n )\n where\n T: Packable<N>,\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> SharedMutable<T, INITIAL_DELAY, &mut PrivateContext>\nwhere\n T: Eq,\n{\n pub fn get_current_value<let N: u32>(self) -> T\n where\n T: Packable<N>,\n {\n // When reading the current value in private we construct a historical state proof for the public value.\n // However, since this value might change, we must constrain the maximum transaction 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<let N: u32>(\n self,\n ) -> (ScheduledValueChange<T>, ScheduledDelayChange<INITIAL_DELAY>, u32)\n where\n T: Packable<N>,\n {\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> SharedMutable<T, INITIAL_DELAY, UtilityContext>\nwhere\n T: Eq,\n{\n pub unconstrained fn get_current_value<let N: u32>(self) -> T\n where\n T: Packable<N>,\n {\n let smv: SharedMutableValues<T, INITIAL_DELAY> =\n WithHash::utility_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"
|
|
2712
|
+
"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;\n\n// Decomposes a single field into two 16 byte fields.\nfn compute_decomposition(x: Field) -> (Field, Field) {\n // Here's we're taking advantage of truncating 128 bit limbs from the input field\n // and then subtracting them from the input such the field division is equivalent to integer division.\n let low = (x as u128) as Field;\n let high = (x - low) / TWO_POW_128;\n\n (low, high)\n}\n\npub(crate) unconstrained fn decompose_hint(x: Field) -> (Field, Field) {\n compute_decomposition(x)\n}\n\nunconstrained fn lte_hint(x: Field, y: Field) -> bool {\n if x == y {\n true\n } else {\n field_less_than(x, y)\n }\n}\n\n// Assert that (alo > blo && ahi >= bhi) || (alo <= blo && ahi > bhi)\nfn assert_gt_limbs(a: (Field, Field), b: (Field, Field)) {\n let (alo, ahi) = a;\n let (blo, bhi) = b;\n // Safety: borrow is enforced to be boolean due to its type.\n // if borrow is 0, it asserts that (alo > blo && ahi >= bhi)\n // if borrow is 1, it asserts that (alo <= blo && ahi > bhi)\n unsafe {\n let borrow = lte_hint(alo, blo);\n\n let rlo = alo - blo - 1 + (borrow as Field) * TWO_POW_128;\n let rhi = ahi - bhi - (borrow as Field);\n\n rlo.assert_max_bit_size::<128>();\n rhi.assert_max_bit_size::<128>();\n }\n}\n\n/// Decompose a single field into two 16 byte fields.\npub fn decompose(x: Field) -> (Field, Field) {\n if is_unconstrained() {\n compute_decomposition(x)\n } else {\n // Safety: decomposition is properly checked below\n unsafe {\n // Take hints of the decomposition\n let (xlo, xhi) = decompose_hint(x);\n\n // Range check the limbs\n xlo.assert_max_bit_size::<128>();\n xhi.assert_max_bit_size::<128>();\n\n // Check that the decomposition is correct\n assert_eq(x, xlo + TWO_POW_128 * xhi);\n\n // Assert that the decomposition of P is greater than the decomposition of x\n assert_gt_limbs((PLO, PHI), (xlo, xhi));\n (xlo, xhi)\n }\n }\n}\n\npub fn assert_gt(a: Field, b: Field) {\n if is_unconstrained() {\n assert(\n // Safety: already unconstrained\n unsafe { field_less_than(b, a) },\n );\n } else {\n // Decompose a and b\n let a_limbs = decompose(a);\n let b_limbs = decompose(b);\n\n // Assert that a_limbs is greater than b_limbs\n assert_gt_limbs(a_limbs, b_limbs)\n }\n}\n\npub fn assert_lt(a: Field, b: Field) {\n assert_gt(b, a);\n}\n\npub fn gt(a: Field, b: Field) -> bool {\n if is_unconstrained() {\n // Safety: unsafe in unconstrained\n unsafe {\n field_less_than(b, a)\n }\n } else if a == b {\n false\n } else {\n // Safety: Take a hint of the comparison and verify it\n unsafe {\n if field_less_than(a, b) {\n assert_gt(b, a);\n false\n } else {\n assert_gt(a, b);\n true\n }\n }\n }\n}\n\npub fn lt(a: Field, b: Field) -> bool {\n gt(b, a)\n}\n\nmod tests {\n // TODO: Allow imports from \"super\"\n use crate::field::bn254::{assert_gt, decompose, gt, 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"
|
|
2897
2713
|
},
|
|
2898
2714
|
"18": {
|
|
2899
2715
|
"path": "std/field/mod.nr",
|
|
2900
2716
|
"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"
|
|
2901
2717
|
},
|
|
2902
|
-
"183": {
|
|
2903
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/append.nr",
|
|
2904
|
-
"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"
|
|
2905
|
-
},
|
|
2906
|
-
"185": {
|
|
2907
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/mod.nr",
|
|
2908
|
-
"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"
|
|
2909
|
-
},
|
|
2910
|
-
"186": {
|
|
2911
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/subarray.nr",
|
|
2912
|
-
"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"
|
|
2913
|
-
},
|
|
2914
|
-
"187": {
|
|
2915
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/array/subbvec.nr",
|
|
2916
|
-
"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"
|
|
2917
|
-
},
|
|
2918
|
-
"189": {
|
|
2919
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/conversion/bytes_to_fields.nr",
|
|
2920
|
-
"source": "use std::static_assert;\n\n// These functions are used to facilitate the conversion of log ciphertext between byte and field representations.\n//\n// `bytes_to_fields` uses fixed-size arrays since encryption contexts have compile-time size information.\n// `bytes_from_fields` uses BoundedVec for flexibility in unconstrained contexts where sizes are dynamic.\n//\n// Together they provide bidirectional conversion between bytes and fields when processing encrypted logs.\n\n/// Converts the input bytes into an array of fields. A Field is ~254 bits meaning that each field can store 31 whole\n/// bytes. Use `bytes_from_fields` to obtain the original bytes array.\n///\n/// The input bytes are chunked into chunks of 31 bytes. Each 31-byte chunk is viewed as big-endian, and is converted\n/// into a Field.\n/// For example, [1, 10, 3, ..., 0] (31 bytes) is encoded as [1 * 256^30 + 10 * 256^29 + 3 * 256^28 + ... + 0]\n/// Note: N must be a multiple of 31 bytes\npub fn bytes_to_fields<let N: u32>(bytes: [u8; N]) -> [Field; N / 31] {\n // Assert that N is a multiple of 31\n static_assert(N % 31 == 0, \"N must be a multiple of 31\");\n\n let mut fields = [0; N / 31];\n\n // Since N is a multiple of 31, we can simply process all chunks fully\n for i in 0..N / 31 {\n let mut field = 0;\n for j in 0..31 {\n // Shift the existing value left by 8 bits and add the new byte\n field = field * 256 + bytes[i * 31 + j] as Field;\n }\n fields[i] = field;\n }\n\n fields\n}\n\n/// Converts an input BoundedVec of fields into a BoundedVec of bytes in big-endian order. Arbitrary Field arrays\n/// are not allowed: this is assumed to be an array obtained via `bytes_to_fields`, i.e. one that actually represents\n/// bytes. To convert a Field array into bytes, use `fields_to_bytes`.\n///\n/// Each input field must contain at most 31 bytes (this is constrained to be so).\n/// Each field is converted into 31 big-endian bytes, and the resulting 31-byte chunks are concatenated\n/// back together in the order of the original fields.\npub fn bytes_from_fields<let N: u32>(fields: BoundedVec<Field, N>) -> BoundedVec<u8, N * 31> {\n let mut bytes = BoundedVec::new();\n\n for i in 0..fields.len() {\n let field = fields.get(i);\n\n // We expect that the field contains at most 31 bytes of information.\n field.assert_max_bit_size::<248>();\n\n // Now we can safely convert the field to 31 bytes.\n let field_as_bytes: [u8; 31] = field.to_be_bytes();\n\n for j in 0..31 {\n bytes.push(field_as_bytes[j]);\n }\n }\n\n bytes\n}\n\nmod tests {\n use crate::utils::array::subarray;\n use super::{bytes_from_fields, bytes_to_fields};\n\n #[test]\n unconstrained fn random_bytes_to_fields_and_back(input: [u8; 93]) {\n let fields = bytes_to_fields(input);\n\n // At this point in production, the log flies through the system and we get a BoundedVec on the other end.\n // So we need to convert the field array to a BoundedVec to be able to feed it to the `bytes_from_fields`\n // function.\n let fields_as_bounded_vec = BoundedVec::<_, 6>::from_array(fields);\n\n let bytes_back = bytes_from_fields(fields_as_bounded_vec);\n\n // Compare the original input with the round-tripped result\n assert_eq(bytes_back.len(), input.len());\n assert_eq(subarray(bytes_back.storage(), 0), input);\n }\n\n #[test(should_fail_with = \"N must be a multiple of 31\")]\n unconstrained fn bytes_to_fields_input_length_not_multiple_of_31() {\n // Try to convert 32 bytes (not a multiple of 31) to fields\n let _fields = bytes_to_fields([0; 32]);\n }\n\n}\n"
|
|
2921
|
-
},
|
|
2922
|
-
"190": {
|
|
2923
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/conversion/fields_to_bytes.nr",
|
|
2924
|
-
"source": "// These functions are used to facilitate the conversion of log plaintext represented as fields into bytes and back.\n//\n// `fields_to_bytes` uses fixed-size arrays since encryption contexts have compile-time size information.\n// `fields_from_bytes` uses BoundedVec for flexibility in unconstrained contexts where sizes are dynamic.\n//\n// Together they provide bidirectional conversion between fields and bytes.\n\n/// Converts an input array of fields into a single array of bytes. Use `fields_from_bytes` to obtain the original\n/// field array.\n/// Each field is converted to a 32-byte big-endian array.\n///\n/// For example, if you have a field array [123, 456], it will be converted to a 64-byte array:\n/// [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123, // First field (32 bytes)\n/// 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,200] // Second field (32 bytes)\n///\n/// Since a field is ~254 bits, you'll end up with a subtle 2-bit \"gap\" at the big end, every 32 bytes. Be careful\n/// that such a gap doesn't leak information! This could happen if you for example expected the output to be\n/// indistinguishable from random bytes.\npub fn fields_to_bytes<let N: u32>(fields: [Field; N]) -> [u8; 32 * N] {\n let mut bytes = [0; 32 * N];\n\n for i in 0..N {\n let field_as_bytes: [u8; 32] = fields[i].to_be_bytes();\n\n for j in 0..32 {\n bytes[i * 32 + j] = field_as_bytes[j];\n }\n }\n\n bytes\n}\n\n/// Converts an input BoundedVec of bytes into a BoundedVec of fields. Arbitrary byte arrays are not allowed: this\n/// is assumed to be an array obtained via `fields_to_bytes`, i.e. one that actually represents fields. To convert\n/// a byte array into Fields, use `bytes_to_fields`.\n///\n/// The input bytes are chunked into chunks of 32 bytes. Each 32-byte chunk is viewed as big-endian, and is converted\n/// into a Field.\n/// For example, [1, 10, 3, ..., 0] (32 bytes) is encoded as [1 * 256^31 + 10 * 256^30 + 3 * 256^29 + ... + 0]\n/// Note 1: N must be a multiple of 32 bytes\n/// Note 2: The max value check code was taken from std::field::to_be_bytes function.\npub fn fields_from_bytes<let N: u32>(bytes: BoundedVec<u8, N>) -> BoundedVec<Field, N / 32> {\n // Assert that input length is a multiple of 32\n assert(bytes.len() % 32 == 0, \"Input length must be a multiple of 32\");\n\n let mut fields = BoundedVec::new();\n\n let p = std::field::modulus_be_bytes();\n\n // Since input length is a multiple of 32, we can simply process all chunks fully\n for i in 0..bytes.len() / 32 {\n let mut field = 0;\n\n // Process each byte in the 32-byte chunk\n let mut ok = false;\n\n for j in 0..32 {\n let next_byte = bytes.get(i * 32 + j);\n field = field * 256 + next_byte as Field;\n\n if !ok {\n if next_byte != p[j] {\n assert(next_byte < p[j], \"Value does not fit in field\");\n ok = true;\n }\n }\n }\n assert(ok, \"Value does not fit in field\");\n\n fields.push(field);\n }\n\n fields\n}\n\nmod tests {\n use crate::utils::array::subarray;\n use super::{fields_from_bytes, fields_to_bytes};\n\n #[test]\n unconstrained fn random_fields_to_bytes_and_back(input: [Field; 3]) {\n // Convert to bytes\n let bytes = fields_to_bytes(input);\n\n // At this point in production, the log flies through the system and we get a BoundedVec on the other end.\n // So we need to convert the field array to a BoundedVec to be able to feed it to the `fields_from_bytes`\n // function.\n // 113 is an arbitrary max length that is larger than the input length of 96.\n let bytes_as_bounded_vec = BoundedVec::<_, 113>::from_array(bytes);\n\n // Convert back to fields\n let fields_back = fields_from_bytes(bytes_as_bounded_vec);\n\n // Compare the original input with the round-tripped result\n assert_eq(fields_back.len(), input.len());\n assert_eq(subarray(fields_back.storage(), 0), input);\n }\n\n #[test(should_fail_with = \"Input length must be a multiple of 32\")]\n unconstrained fn to_fields_assert() {\n // 143 is an arbitrary max length that is larger than 33\n let input = BoundedVec::<_, 143>::from_array([\n 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,\n ]);\n\n // This should fail since 33 is not a multiple of 32\n let _fields = fields_from_bytes(input);\n }\n\n #[test]\n unconstrained fn fields_from_bytes_max_value() {\n let max_field_as_bytes: [u8; 32] = (-1).to_be_bytes();\n let input = BoundedVec::<_, 32>::from_array(max_field_as_bytes);\n\n let fields = fields_from_bytes(input);\n\n // The result should be a largest value storable in a field (-1 since we are modulo-ing)\n assert_eq(fields.get(0), -1);\n }\n\n // In this test we verify that overflow check works by taking the max allowed value, bumping a random byte\n // and then feeding it to `fields_from_bytes` as input.\n #[test(should_fail_with = \"Value does not fit in field\")]\n unconstrained fn fields_from_bytes_overflow(random_value: u8) {\n let index_of_byte_to_bump = random_value % 32;\n\n // Obtain the byte representation of the maximum field value\n let max_field_value_as_bytes: [u8; 32] = (-1).to_be_bytes();\n\n let byte_to_bump = max_field_value_as_bytes[index_of_byte_to_bump];\n\n // Skip test execution if the selected byte is already at maximum value (255).\n // This is acceptable since we are using fuzz testing to generate many test cases.\n if byte_to_bump != 255 {\n let mut input = BoundedVec::<_, 32>::from_array(max_field_value_as_bytes);\n\n // Increment the selected byte to exceed the field's maximum value\n input.set(index_of_byte_to_bump as u32, byte_to_bump + 1);\n\n // Attempt the conversion, which should fail due to the value exceeding the field's capacity\n let _fields = fields_from_bytes(input);\n }\n }\n\n}\n"
|
|
2925
|
-
},
|
|
2926
2718
|
"192": {
|
|
2927
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/field.nr",
|
|
2928
|
-
"source": "use std::option::Option;\n\nglobal KNOWN_NON_RESIDUE: Field = 5; // This is a non-residue in Noir's native Field.\n\nglobal C1: u32 = 28;\nglobal C3: Field = 40770029410420498293352137776570907027550720424234931066070132305055;\nglobal C5: Field = 19103219067921713944291392827692070036145651957329286315305642004821462161904;\n\n// Power function of two Field arguments of arbitrary size.\n// Adapted from std::field::pow_32.\npub fn pow(x: Field, y: Field) -> Field {\n let mut r = 1 as Field;\n let b: [u1; 254] = y.to_le_bits();\n\n for i in 0..254 {\n r *= r;\n r *= (b[254 - 1 - i] as Field) * x + (1 - b[254 - 1 - i] as Field);\n }\n\n r\n}\n\n// Boolean indicating whether Field element is a square, i.e. whether there exists a y in Field s.t. x = y*y.\nunconstrained fn is_square(x: Field) -> bool {\n let v = pow(x, -1 / 2);\n v * (v - 1) == 0\n}\n\n// Tonelli-Shanks algorithm for computing the square root of a Field element.\n// Requires C1 = max{c: 2^c divides (p-1)}, where p is the order of Field\n// as well as C3 = (C2 - 1)/2, where C2 = (p-1)/(2^c1),\n// and C5 = ZETA^C2, where ZETA is a non-square element of Field.\n// These are pre-computed above as globals.\nunconstrained fn tonelli_shanks_sqrt(x: Field) -> Field {\n let mut z = pow(x, C3);\n let mut t = z * z * x;\n z *= x;\n let mut b = t;\n let mut c = C5;\n\n for i in 0..(C1 - 1) {\n for _j in 1..(C1 - i - 1) {\n b *= b;\n }\n\n z *= if b == 1 { 1 } else { c };\n\n c *= c;\n\n t *= if b == 1 { 1 } else { c };\n\n b = t;\n }\n\n z\n}\n\n// NB: this doesn't return an option, because in the case of there _not_ being a square root, we still want to return a field element that allows us to then assert in the _constrained_ sqrt function that there is no sqrt.\npub unconstrained fn __sqrt(x: Field) -> (bool, Field) {\n let is_sq = is_square(x);\n if is_sq {\n let sqrt = tonelli_shanks_sqrt(x);\n (true, sqrt)\n } else {\n // Demonstrate that x is not a square (a.k.a. a \"quadratic non-residue\").\n // Facts:\n // The Legendre symbol (\"LS\") of x, is x^((p-1)/2) (mod p).\n // - If x is a square, LS(x) = 1\n // - If x is not a square, LS(x) = -1\n // - If x = 0, LS(x) = 0.\n //\n // Hence:\n // sq * sq = sq // 1 * 1 = 1\n // non-sq * non-sq = sq // -1 * -1 = 1\n // sq * non-sq = non-sq // -1 * 1 = -1\n //\n // See: https://en.wikipedia.org/wiki/Legendre_symbol\n let demo_x_not_square = x * KNOWN_NON_RESIDUE;\n let not_sqrt = tonelli_shanks_sqrt(demo_x_not_square);\n (false, not_sqrt)\n }\n}\n\n// Returns (false, 0) if there is no square root.\n// Returns (true, sqrt) if there is a square root.\npub fn sqrt(x: Field) -> Option<Field> {\n // Safety: if the hint returns the square root of x, then we simply square it\n // check the result equals x. If x is not square, we return a value that\n // enables us to prove that fact (see the `else` clause below).\n let (is_sq, maybe_sqrt) = unsafe { __sqrt(x) };\n\n if is_sq {\n let sqrt = maybe_sqrt;\n validate_sqrt_hint(x, sqrt);\n Option::some(sqrt)\n } else {\n let not_sqrt_hint = maybe_sqrt;\n validate_not_sqrt_hint(x, not_sqrt_hint);\n Option::none()\n }\n}\n\nfn validate_sqrt_hint(x: Field, hint: Field) {\n assert(hint * hint == x, f\"The claimed_sqrt {hint} is not the sqrt of x {x}\");\n}\n\nfn validate_not_sqrt_hint(x: Field, hint: Field) {\n // We need this assertion, because x = 0 would pass the other assertions in this\n // function, and we don't want people to be able to prove that 0 is not square!\n assert(x != 0, \"0 has a square root; you cannot claim it is not square\");\n // Demonstrate that x is not a square (a.k.a. a \"quadratic non-residue\").\n //\n // Facts:\n // The Legendre symbol (\"LS\") of x, is x^((p-1)/2) (mod p).\n // - If x is a square, LS(x) = 1\n // - If x is not a square, LS(x) = -1\n // - If x = 0, LS(x) = 0.\n //\n // Hence:\n // 1. sq * sq = sq // 1 * 1 = 1\n // 2. non-sq * non-sq = sq // -1 * -1 = 1\n // 3. sq * non-sq = non-sq // -1 * 1 = -1\n //\n // See: https://en.wikipedia.org/wiki/Legendre_symbol\n //\n // We want to demonstrate that this below multiplication falls under bullet-point (2):\n let demo_x_not_square = x * KNOWN_NON_RESIDUE;\n // I.e. we want to demonstrate that `demo_x_not_square` has Legendre symbol 1\n // (i.e. that it is a square), so we prove that it is square below.\n // Why do we want to prove that it has LS 1?\n // Well, since it was computed with a known-non-residue, its squareness implies we're\n // in case 2 (something multiplied by a known-non-residue yielding a result which\n // has a LS of 1), which implies that x must be a non-square. The unconstrained\n // function gave us the sqrt of demo_x_not_square, so all we need to do is\n // assert its squareness:\n assert(\n hint * hint == demo_x_not_square,\n f\"The hint {hint} does not demonstrate that {x} is not a square\",\n );\n}\n\n#[test]\nfn test_sqrt() {\n let x = 9;\n let maybe_sqrt = sqrt(x);\n assert(maybe_sqrt.is_some());\n let sqrt = maybe_sqrt.unwrap_unchecked();\n assert((sqrt == 3) | (sqrt == -3));\n}\n\n#[test]\nfn test_non_square() {\n let x = 5;\n let maybe_sqrt = sqrt(x);\n assert(maybe_sqrt.is_none());\n}\n\n#[test]\nunconstrained fn test_known_non_residue_is_actually_a_non_residue_in_the_field() {\n assert(!is_square(KNOWN_NON_RESIDUE));\n}\n\n#[test]\nfn test_sqrt_0() {\n let x = 0;\n let sqrt = sqrt(x).unwrap();\n assert(sqrt == 0);\n}\n\n#[test]\nfn test_sqrt_1() {\n let x = 1;\n let sqrt = sqrt(x).unwrap();\n assert((sqrt == 1) | (sqrt == -1));\n}\n\n#[test(should_fail_with = \"The claimed_sqrt 0x04 is not the sqrt of x 0x09\")]\nfn test_bad_sqrt_hint_fails() {\n validate_sqrt_hint(9, 4);\n}\n\n#[test(should_fail_with = \"The hint 0x04 does not demonstrate that 0x0a is not a square\")]\nfn test_bad_not_sqrt_hint_fails() {\n validate_not_sqrt_hint(10, 4);\n}\n\n#[test(should_fail_with = \"0 has a square root; you cannot claim it is not square\")]\nfn test_0_not_sqrt_hint_fails() {\n validate_not_sqrt_hint(0, 0);\n}\n\n#[test]\nunconstrained fn test_is_square() {\n assert(is_square(25));\n}\n\n#[test]\nunconstrained fn test_is_not_square() {\n assert(!is_square(10));\n}\n"
|
|
2929
|
-
},
|
|
2930
|
-
"194": {
|
|
2931
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/point.nr",
|
|
2932
|
-
"source": "use crate::utils::field::sqrt;\nuse dep::protocol_types::point::Point;\n\n// I am storing the modulus minus 1 divided by 2 here because full modulus would throw \"String literal too large\" error\n// Full modulus is 21888242871839275222246405745257275088548364400416034343698204186575808495617\nglobal BN254_FR_MODULUS_DIV_2: Field =\n 10944121435919637611123202872628637544274182200208017171849102093287904247808;\n\n/// Converts a point to a byte array.\n///\n/// We don't serialize the point at infinity flag because this function is used in situations where we do not want\n/// to waste the extra byte (encrypted log).\npub fn point_to_bytes(p: Point) -> [u8; 32] {\n // Note that there is 1 more free bit in the 32 bytes (254 bits currently occupied by the x coordinate, 1 bit for\n // the \"sign\") so it's possible to use that last bit as an \"is_infinite\" flag if desired in the future.\n assert(!p.is_infinite, \"Cannot serialize point at infinity as bytes.\");\n\n let mut result: [u8; 32] = p.x.to_be_bytes();\n\n if get_sign_of_point(p) {\n // y is <= (modulus - 1) / 2 so we set the sign bit to 1\n // Here we leverage that field fits into 254 bits (log2(Fr.MODULUS) < 254) and given that we serialize Fr to 32\n // bytes and we use big-endian the 2 most significant bits are never populated. Hence we can use one of\n // the bits as a sign bit.\n result[0] += 128;\n }\n\n result\n}\n\n/**\n * Returns: true if p.y <= MOD_DIV_2, else false.\n */\npub fn get_sign_of_point(p: Point) -> bool {\n // We store only a \"sign\" of the y coordinate because the rest can be derived from the x coordinate. To get\n // the sign we check if the y coordinate is less or equal than the curve's order minus 1 divided by 2.\n // Ideally we'd do `y <= MOD_DIV_2`, but there's no `lte` function, so instead we do `!(y > MOD_DIV_2)`, which is\n // equivalent, and then rewrite that as `!(MOD_DIV_2 < y)`, since we also have no `gt` function.\n !BN254_FR_MODULUS_DIV_2.lt(p.y)\n}\n\npub fn point_from_x_coord(x: Field) -> Point {\n // y ^ 2 = x ^ 3 - 17\n let rhs = x * x * x - 17;\n let y = sqrt(rhs).unwrap();\n Point { x, y, is_infinite: false }\n}\n\n/// Uses the x coordinate and sign flag (+/-) to reconstruct the point.\n/// The y coordinate can be derived from the x coordinate and the \"sign\" flag by solving the grumpkin curve\n/// equation for y.\n/// @param x - The x coordinate of the point\n/// @param sign - The \"sign\" of the y coordinate - determines whether y <= (Fr.MODULUS - 1) / 2\npub fn point_from_x_coord_and_sign(x: Field, sign: bool) -> Point {\n // y ^ 2 = x ^ 3 - 17\n let rhs = x * x * x - 17;\n let y = sqrt(rhs).unwrap();\n\n // If y > MOD_DIV_2 and we want positive sign (or vice versa), negate y\n let y_is_positive = !BN254_FR_MODULUS_DIV_2.lt(y);\n let final_y = if y_is_positive == sign { y } else { -y };\n\n Point { x, y: final_y, is_infinite: false }\n}\n\nmod test {\n use crate::utils::point::{point_from_x_coord_and_sign, point_to_bytes};\n use dep::protocol_types::point::Point;\n\n #[test]\n unconstrained fn test_point_to_bytes_positive_sign() {\n let p = Point {\n x: 0x1af41f5de96446dc3776a1eb2d98bb956b7acd9979a67854bec6fa7c2973bd73,\n y: 0x07fc22c7f2c7057571f137fe46ea9c95114282bc95d37d71ec4bfb88de457d4a,\n is_infinite: false,\n };\n\n let compressed_point = point_to_bytes(p);\n\n let expected_compressed_point_positive_sign = [\n 154, 244, 31, 93, 233, 100, 70, 220, 55, 118, 161, 235, 45, 152, 187, 149, 107, 122,\n 205, 153, 121, 166, 120, 84, 190, 198, 250, 124, 41, 115, 189, 115,\n ];\n assert_eq(expected_compressed_point_positive_sign, compressed_point);\n }\n\n #[test]\n unconstrained fn test_point_to_bytes_negative_sign() {\n let p = Point {\n x: 0x247371652e55dd74c9af8dbe9fb44931ba29a9229994384bd7077796c14ee2b5,\n y: 0x26441aec112e1ae4cee374f42556932001507ad46e255ffb27369c7e3766e5c0,\n is_infinite: false,\n };\n\n let compressed_point = point_to_bytes(p);\n\n let expected_compressed_point_negative_sign = [\n 36, 115, 113, 101, 46, 85, 221, 116, 201, 175, 141, 190, 159, 180, 73, 49, 186, 41, 169,\n 34, 153, 148, 56, 75, 215, 7, 119, 150, 193, 78, 226, 181,\n ];\n\n assert_eq(expected_compressed_point_negative_sign, compressed_point);\n }\n\n #[test]\n unconstrained fn test_point_from_x_coord_and_sign() {\n // Test positive y coordinate\n let x = 0x1af41f5de96446dc3776a1eb2d98bb956b7acd9979a67854bec6fa7c2973bd73;\n let sign = true;\n let p = point_from_x_coord_and_sign(x, sign);\n\n assert_eq(p.x, x);\n assert_eq(p.y, 0x07fc22c7f2c7057571f137fe46ea9c95114282bc95d37d71ec4bfb88de457d4a);\n assert_eq(p.is_infinite, false);\n\n // Test negative y coordinate\n let x2 = 0x247371652e55dd74c9af8dbe9fb44931ba29a9229994384bd7077796c14ee2b5;\n let sign2 = false;\n let p2 = point_from_x_coord_and_sign(x2, sign2);\n\n assert_eq(p2.x, x2);\n assert_eq(p2.y, 0x26441aec112e1ae4cee374f42556932001507ad46e255ffb27369c7e3766e5c0);\n assert_eq(p2.is_infinite, false);\n }\n}\n"
|
|
2933
|
-
},
|
|
2934
|
-
"198": {
|
|
2935
2719
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/utils/with_hash.nr",
|
|
2936
2720
|
"source": "use crate::{\n context::{PublicContext, UtilityContext},\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 utility_public_storage_read(\n context: UtilityContext,\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"
|
|
2937
2721
|
},
|
|
2938
|
-
"
|
|
2939
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/abis/event_selector.nr",
|
|
2940
|
-
"source": "use crate::traits::{Deserialize, Empty, FromField, Serialize, ToField};\n\npub struct EventSelector {\n // 1st 4-bytes (big-endian leftmost) of abi-encoding of an event.\n inner: u32,\n}\n\nimpl Eq for EventSelector {\n fn eq(self, other: EventSelector) -> bool {\n other.inner == self.inner\n }\n}\n\nimpl Serialize<1> for EventSelector {\n fn serialize(self: Self) -> [Field; 1] {\n [self.inner as Field]\n }\n}\n\nimpl Deserialize<1> for EventSelector {\n fn deserialize(fields: [Field; 1]) -> Self {\n Self { inner: fields[0] as u32 }\n }\n}\n\nimpl FromField for EventSelector {\n fn from_field(field: Field) -> Self {\n Self { inner: field as u32 }\n }\n}\n\nimpl ToField for EventSelector {\n fn to_field(self) -> Field {\n self.inner as Field\n }\n}\n\nimpl Empty for EventSelector {\n fn empty() -> Self {\n Self { inner: 0 as u32 }\n }\n}\n\nimpl EventSelector {\n pub fn from_u32(value: u32) -> Self {\n Self { inner: value }\n }\n\n pub fn from_signature<let N: u32>(signature: str<N>) -> Self {\n let bytes = signature.as_bytes();\n let hash = crate::hash::poseidon2_hash_bytes(bytes);\n\n // `hash` is automatically truncated to fit within 32 bits.\n EventSelector::from_field(hash)\n }\n\n pub fn zero() -> Self {\n Self { inner: 0 }\n }\n}\n"
|
|
2941
|
-
},
|
|
2942
|
-
"24": {
|
|
2722
|
+
"20": {
|
|
2943
2723
|
"path": "std/hash/poseidon2.nr",
|
|
2944
|
-
"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"
|
|
2724
|
+
"source": "use crate::default::Default;\nuse crate::hash::Hasher;\n\ncomptime global RATE: u32 = 3;\n\npub(crate) 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(crate) 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(crate) fn new(iv: Field) -> Poseidon2 {\n let mut result =\n Poseidon2 { cache: [0; 3], state: [0; 4], cache_size: 0, squeeze_mode: false };\n result.state[RATE] = iv;\n result\n }\n\n fn perform_duplex(&mut self) {\n // add the cache into sponge state\n 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(crate) 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"
|
|
2945
2725
|
},
|
|
2946
|
-
"
|
|
2726
|
+
"261": {
|
|
2947
2727
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr",
|
|
2948
2728
|
"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"
|
|
2949
2729
|
},
|
|
2950
|
-
"
|
|
2730
|
+
"264": {
|
|
2951
2731
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr",
|
|
2952
2732
|
"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"
|
|
2953
2733
|
},
|
|
2954
|
-
"
|
|
2734
|
+
"266": {
|
|
2955
2735
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/address/salted_initialization_hash.nr",
|
|
2956
2736
|
"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"
|
|
2957
2737
|
},
|
|
2958
|
-
"
|
|
2738
|
+
"270": {
|
|
2959
2739
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/contract_class_id.nr",
|
|
2960
2740
|
"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"
|
|
2961
2741
|
},
|
|
2962
|
-
"
|
|
2742
|
+
"278": {
|
|
2963
2743
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/debug_log.nr",
|
|
2964
2744
|
"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"
|
|
2965
2745
|
},
|
|
2966
|
-
"
|
|
2746
|
+
"279": {
|
|
2967
2747
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr",
|
|
2968
2748
|
"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"
|
|
2969
2749
|
},
|
|
2970
|
-
"
|
|
2750
|
+
"293": {
|
|
2971
2751
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/meta/mod.nr",
|
|
2972
2752
|
"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"
|
|
2973
2753
|
},
|
|
2974
|
-
"
|
|
2754
|
+
"296": {
|
|
2975
2755
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/poseidon2.nr",
|
|
2976
2756
|
"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"
|
|
2977
2757
|
},
|
|
2978
|
-
"
|
|
2758
|
+
"305": {
|
|
2979
2759
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr",
|
|
2980
2760
|
"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"
|
|
2981
2761
|
},
|
|
2982
|
-
"
|
|
2762
|
+
"309": {
|
|
2983
2763
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/scheduled_delay_change.nr",
|
|
2984
2764
|
"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"
|
|
2985
2765
|
},
|
|
2986
|
-
"
|
|
2766
|
+
"311": {
|
|
2987
2767
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/scheduled_value_change.nr",
|
|
2988
2768
|
"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"
|
|
2989
2769
|
},
|
|
2990
|
-
"
|
|
2770
|
+
"313": {
|
|
2991
2771
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/shared_mutable/shared_mutable_values.nr",
|
|
2992
2772
|
"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> SharedMutableValues<T, INITIAL_DELAY> {\n pub fn new(svc: ScheduledValueChange<T>, sdc: ScheduledDelayChange<INITIAL_DELAY>) -> Self {\n SharedMutableValues { svc, sdc }\n }\n}\n\npub fn unpack_value_change<T, let N: u32>(packed: [Field; 2 * N + 1]) -> ScheduledValueChange<T>\nwhere\n T: Packable<N>,\n{\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\npub fn unpack_delay_change<let INITIAL_DELAY: u32>(\n packed: Field,\n) -> ScheduledDelayChange<INITIAL_DELAY> {\n // This function expects to be called with just the first field of the packed representation, which contains sdc\n // and svc 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\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 = unpack_value_change::<T, N>(fields);\n let sdc = unpack_delay_change::<INITIAL_DELAY>(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"
|
|
2993
2773
|
},
|
|
2994
|
-
"
|
|
2774
|
+
"316": {
|
|
2995
2775
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/storage/map.nr",
|
|
2996
2776
|
"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"
|
|
2997
2777
|
},
|
|
2998
|
-
"
|
|
2778
|
+
"334": {
|
|
2999
2779
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/type_packing.nr",
|
|
3000
2780
|
"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"
|
|
3001
2781
|
},
|
|
3002
|
-
"
|
|
2782
|
+
"335": {
|
|
3003
2783
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/type_serialization.nr",
|
|
3004
2784
|
"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"
|
|
3005
2785
|
},
|
|
3006
|
-
"
|
|
2786
|
+
"351": {
|
|
3007
2787
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays.nr",
|
|
3008
2788
|
"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"
|
|
3009
2789
|
},
|
|
3010
|
-
"
|
|
2790
|
+
"354": {
|
|
3011
2791
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/utils/reader.nr",
|
|
3012
2792
|
"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"
|
|
3013
2793
|
},
|
|
3014
|
-
"
|
|
3015
|
-
"path": "/home/aztec-dev/nargo/github.com/noir-lang/sha256/v0.1.2/src/sha256.nr",
|
|
3016
|
-
"source": "use std::hash::sha256_compression;\nuse std::runtime::is_unconstrained;\n\nuse constants::{\n BLOCK_BYTE_PTR, BLOCK_SIZE, HASH, INITIAL_STATE, INT_BLOCK, INT_BLOCK_SIZE, INT_SIZE,\n INT_SIZE_PTR, MSG_BLOCK, MSG_SIZE_PTR, STATE, TWO_POW_16, TWO_POW_24, TWO_POW_32, TWO_POW_8,\n};\n\nmod constants;\nmod tests;\n\n// Implementation of SHA-256 mapping a byte array of variable length to\n// 32 bytes.\n\n// Deprecated in favour of `sha256_var`\n// docs:start:sha256\npub fn sha256<let N: u32>(input: [u8; N]) -> HASH\n// docs:end:sha256\n{\n digest(input)\n}\n\n// SHA-256 hash function\n#[no_predicates]\npub fn digest<let N: u32>(msg: [u8; N]) -> HASH {\n sha256_var(msg, N as u64)\n}\n\n// Variable size SHA-256 hash\npub fn sha256_var<let N: u32>(msg: [u8; N], message_size: u64) -> HASH {\n let message_size = message_size as u32;\n assert(message_size <= N);\n\n if std::runtime::is_unconstrained() {\n // Safety: SHA256 is running as an unconstrained function.\n unsafe {\n __sha256_var(msg, message_size)\n }\n } else {\n let mut msg_block: MSG_BLOCK = [0; INT_BLOCK_SIZE];\n // Intermediate hash, starting with the canonical initial value\n let mut h: STATE = INITIAL_STATE;\n // Pointer into msg_block on a 64 byte scale\n let mut msg_byte_ptr = 0;\n let num_blocks = N / BLOCK_SIZE;\n for i in 0..num_blocks {\n let msg_start = BLOCK_SIZE * i;\n let (new_msg_block, new_msg_byte_ptr) =\n unsafe { build_msg_block(msg, message_size, msg_start) };\n\n if msg_start < message_size {\n msg_block = new_msg_block;\n }\n\n // Verify the block we are compressing was appropriately constructed\n let new_msg_byte_ptr = verify_msg_block(msg, message_size, msg_block, msg_start);\n if msg_start < message_size {\n msg_byte_ptr = new_msg_byte_ptr;\n }\n\n // If the block is filled, compress it.\n // An un-filled block is handled after this loop.\n if (msg_start < message_size) & (msg_byte_ptr == BLOCK_SIZE) {\n h = sha256_compression(msg_block, h);\n }\n }\n\n let modulo = N % BLOCK_SIZE;\n // Handle setup of the final msg block.\n // This case is only hit if the msg is less than the block size,\n // or our message cannot be evenly split into blocks.\n if modulo != 0 {\n let msg_start = BLOCK_SIZE * num_blocks;\n let (new_msg_block, new_msg_byte_ptr) =\n unsafe { build_msg_block(msg, message_size, msg_start) };\n\n if msg_start < message_size {\n msg_block = new_msg_block;\n }\n\n let new_msg_byte_ptr = verify_msg_block(msg, message_size, msg_block, msg_start);\n if msg_start < message_size {\n msg_byte_ptr = new_msg_byte_ptr;\n verify_msg_block_padding(msg_block, msg_byte_ptr);\n }\n }\n\n // If we had modulo == 0 then it means the last block was full,\n // and we can reset the pointer to zero to overwrite it.\n if msg_byte_ptr == BLOCK_SIZE {\n msg_byte_ptr = 0;\n }\n\n // Pad the rest such that we have a [u32; 2] block at the end representing the length\n // of the message, and a block of 1 0 ... 0 following the message (i.e. [1 << 7, 0, ..., 0]).\n // Here we rely on the fact that everything beyond the available input is set to 0.\n let index = msg_byte_ptr / INT_SIZE;\n msg_block[index] = set_item_byte_then_zeros(msg_block[index], msg_byte_ptr, 1 << 7);\n\n msg_byte_ptr = msg_byte_ptr + 1;\n let last_block = msg_block;\n\n // If we don't have room to write the size, compress the block and reset it.\n if msg_byte_ptr > MSG_SIZE_PTR {\n h = sha256_compression(msg_block, h);\n // `attach_len_to_msg_block` will zero out everything after the `msg_byte_ptr`.\n msg_byte_ptr = 0;\n }\n\n msg_block = unsafe { attach_len_to_msg_block(msg_block, msg_byte_ptr, message_size) };\n\n verify_msg_len(msg_block, last_block, msg_byte_ptr, message_size);\n\n hash_final_block(msg_block, h)\n }\n}\n\n// Variable size SHA-256 hash\nunconstrained fn __sha256_var<let N: u32>(msg: [u8; N], message_size: u32) -> HASH {\n let num_full_blocks = message_size / BLOCK_SIZE;\n // Intermediate hash, starting with the canonical initial value\n let mut h: STATE = INITIAL_STATE;\n // Pointer into msg_block on a 64 byte scale\n for i in 0..num_full_blocks {\n let (msg_block, _) = build_msg_block(msg, message_size, BLOCK_SIZE * i);\n h = sha256_compression(msg_block, h);\n }\n\n // Handle setup of the final msg block.\n // This case is only hit if the msg is less than the block size,\n // or our message cannot be evenly split into blocks.\n let modulo = message_size % BLOCK_SIZE;\n let (mut msg_block, mut msg_byte_ptr): (INT_BLOCK, u32) = if modulo != 0 {\n let msg_start = BLOCK_SIZE * num_full_blocks;\n let (new_msg_block, new_msg_byte_ptr) = build_msg_block(msg, message_size, msg_start);\n\n (new_msg_block, new_msg_byte_ptr)\n } else {\n // If we had modulo == 0 then it means the last block was full,\n // and we can reset the pointer to zero to overwrite it.\n ([0; INT_BLOCK_SIZE], 0)\n };\n\n // Pad the rest such that we have a [u32; 2] block at the end representing the length\n // of the message, and a block of 1 0 ... 0 following the message (i.e. [1 << 7, 0, ..., 0]).\n // Here we rely on the fact that everything beyond the available input is set to 0.\n let index = msg_byte_ptr / INT_SIZE;\n msg_block[index] = set_item_byte_then_zeros(msg_block[index], msg_byte_ptr, 1 << 7);\n\n // If we don't have room to write the size, compress the block and reset it.\n let (h, mut msg_byte_ptr): (STATE, u32) = if msg_byte_ptr >= MSG_SIZE_PTR {\n // `attach_len_to_msg_block` will zero out everything after the `msg_byte_ptr`.\n (sha256_compression(msg_block, h), 0)\n } else {\n (h, msg_byte_ptr + 1)\n };\n msg_block = attach_len_to_msg_block(msg_block, msg_byte_ptr, message_size);\n\n hash_final_block(msg_block, h)\n}\n\n// Take `BLOCK_SIZE` number of bytes from `msg` starting at `msg_start`.\n// Returns the block and the length that has been copied rather than padded with zeros.\nunconstrained fn build_msg_block<let N: u32>(\n msg: [u8; N],\n message_size: u32,\n msg_start: u32,\n) -> (MSG_BLOCK, BLOCK_BYTE_PTR) {\n let mut msg_block: MSG_BLOCK = [0; INT_BLOCK_SIZE];\n\n // We insert `BLOCK_SIZE` bytes (or up to the end of the message)\n let block_input = if message_size < msg_start {\n // This function is sometimes called with `msg_start` past the end of the message.\n // In this case we return an empty block and zero pointer to signal that the result should be ignored.\n 0\n } else if message_size < msg_start + BLOCK_SIZE {\n message_size - msg_start\n } else {\n BLOCK_SIZE\n };\n\n // Figure out the number of items in the int array that we have to pack.\n // e.g. if the input is [0,1,2,3,4,5] then we need to pack it as 2 items: [0123, 4500]\n let mut int_input = block_input / INT_SIZE;\n if block_input % INT_SIZE != 0 {\n int_input = int_input + 1;\n };\n\n for i in 0..int_input {\n let mut msg_item: u32 = 0;\n // Always construct the integer as 4 bytes, even if it means going beyond the input.\n for j in 0..INT_SIZE {\n let k = i * INT_SIZE + j;\n let msg_byte = if k < block_input {\n msg[msg_start + k]\n } else {\n 0\n };\n msg_item = lshift8(msg_item, 1) + msg_byte as u32;\n }\n msg_block[i] = msg_item;\n }\n\n // Returning the index as if it was a 64 byte array.\n // We have to project it down to 16 items and bit shifting to get a byte back if we need it.\n (msg_block, block_input)\n}\n\n// Verify the block we are compressing was appropriately constructed by `build_msg_block`\n// and matches the input data. Returns the index of the first unset item.\n// If `message_size` is less than `msg_start` then this is called with the old non-empty block;\n// in that case we can skip verification, ie. no need to check that everything is zero.\nfn verify_msg_block<let N: u32>(\n msg: [u8; N],\n message_size: u32,\n msg_block: MSG_BLOCK,\n msg_start: u32,\n) -> BLOCK_BYTE_PTR {\n let mut msg_byte_ptr = 0;\n let mut msg_end = msg_start + BLOCK_SIZE;\n if msg_end > N {\n msg_end = N;\n }\n // We might have to go beyond the input to pad the fields.\n if msg_end % INT_SIZE != 0 {\n msg_end = msg_end + INT_SIZE - msg_end % INT_SIZE;\n }\n\n // Reconstructed packed item.\n let mut msg_item: u32 = 0;\n\n // Inclusive at the end so that we can compare the last item.\n let mut i: u32 = 0;\n for k in msg_start..=msg_end {\n if k % INT_SIZE == 0 {\n // If we consumed some input we can compare against the block.\n if (msg_start < message_size) & (k > msg_start) {\n assert_eq(msg_block[i], msg_item as u32);\n i = i + 1;\n msg_item = 0;\n }\n }\n // Shift the accumulator\n msg_item = lshift8(msg_item, 1);\n // If we have input to consume, add it at the rightmost position.\n if k < message_size & k < msg_end {\n msg_item = msg_item + msg[k] as u32;\n msg_byte_ptr = msg_byte_ptr + 1;\n }\n }\n\n msg_byte_ptr\n}\n\n// Verify the block we are compressing was appropriately padded with zeros by `build_msg_block`.\n// This is only relevant for the last, potentially partially filled block.\nfn verify_msg_block_padding(msg_block: MSG_BLOCK, msg_byte_ptr: BLOCK_BYTE_PTR) {\n // Check all the way to the end of the block.\n verify_msg_block_zeros(msg_block, msg_byte_ptr, INT_BLOCK_SIZE);\n}\n\n// Verify that a region of ints in the message block are (partially) zeroed,\n// up to an (exclusive) maximum which can either be the end of the block\n// or just where the size is to be written.\nfn verify_msg_block_zeros(\n msg_block: MSG_BLOCK,\n mut msg_byte_ptr: BLOCK_BYTE_PTR,\n max_int_byte_ptr: u32,\n) {\n // This variable is used to get around the compiler under-constrained check giving a warning.\n // We want to check against a constant zero, but if it does not come from the circuit inputs\n // or return values the compiler check will issue a warning.\n let zero = msg_block[0] - msg_block[0];\n\n // First integer which is supposed to be (partially) zero.\n let mut int_byte_ptr = msg_byte_ptr / INT_SIZE;\n\n // Check partial zeros.\n let modulo = msg_byte_ptr % INT_SIZE;\n if modulo != 0 {\n let zeros = INT_SIZE - modulo;\n let mask = if zeros == 3 {\n TWO_POW_24\n } else if zeros == 2 {\n TWO_POW_16\n } else {\n TWO_POW_8\n };\n assert_eq(msg_block[int_byte_ptr] % mask, zero);\n int_byte_ptr = int_byte_ptr + 1;\n }\n\n // Check the rest of the items.\n for i in 0..max_int_byte_ptr {\n if i >= int_byte_ptr {\n assert_eq(msg_block[i], zero);\n }\n }\n}\n\n// Verify that up to the byte pointer the two blocks are equal.\n// At the byte pointer the new block can be partially zeroed.\nfn verify_msg_block_equals_last(\n msg_block: MSG_BLOCK,\n last_block: MSG_BLOCK,\n mut msg_byte_ptr: BLOCK_BYTE_PTR,\n) {\n // msg_byte_ptr is the position at which they are no longer have to be the same.\n // First integer which is supposed to be (partially) zero contains that pointer.\n let mut int_byte_ptr = msg_byte_ptr / INT_SIZE;\n\n // Check partial zeros.\n let modulo = msg_byte_ptr % INT_SIZE;\n if modulo != 0 {\n // Reconstruct the partially zero item from the last block.\n let last_field = last_block[int_byte_ptr];\n let mut msg_item: u32 = 0;\n // Reset to where they are still equal.\n msg_byte_ptr = msg_byte_ptr - modulo;\n for i in 0..INT_SIZE {\n msg_item = lshift8(msg_item, 1);\n if i < modulo {\n msg_item = msg_item + get_item_byte(last_field, msg_byte_ptr) as u32;\n msg_byte_ptr = msg_byte_ptr + 1;\n }\n }\n assert_eq(msg_block[int_byte_ptr], msg_item);\n }\n\n for i in 0..INT_SIZE_PTR {\n if i < int_byte_ptr {\n assert_eq(msg_block[i], last_block[i]);\n }\n }\n}\n\n// Set the rightmost `zeros` number of bytes to 0.\n#[inline_always]\nfn set_item_zeros(item: u32, zeros: u8) -> u32 {\n lshift8(rshift8(item, zeros), zeros)\n}\n\n// Replace one byte in the item with a value, and set everything after it to zero.\nfn set_item_byte_then_zeros(msg_item: u32, msg_byte_ptr: BLOCK_BYTE_PTR, msg_byte: u8) -> u32 {\n let zeros = INT_SIZE - msg_byte_ptr % INT_SIZE;\n let zeroed_item = set_item_zeros(msg_item, zeros as u8);\n let new_item = byte_into_item(msg_byte, msg_byte_ptr);\n zeroed_item + new_item\n}\n\n// Get a byte of a message item according to its overall position in the `BLOCK_SIZE` space.\nfn get_item_byte(mut msg_item: u32, msg_byte_ptr: BLOCK_BYTE_PTR) -> u8 {\n // How many times do we have to shift to the right to get to the position we want?\n let max_shifts = INT_SIZE - 1;\n let shifts = max_shifts - msg_byte_ptr % INT_SIZE;\n msg_item = rshift8(msg_item, shifts as u8);\n // At this point the byte we want is in the rightmost position.\n msg_item as u8\n}\n\n// Project a byte into a position in a field based on the overall block pointer.\n// For example putting 1 into pointer 5 would be 100, because overall we would\n// have [____, 0100] with indexes [0123,4567].\n#[inline_always]\nfn byte_into_item(msg_byte: u8, msg_byte_ptr: BLOCK_BYTE_PTR) -> u32 {\n let mut msg_item = msg_byte as u32;\n // How many times do we have to shift to the left to get to the position we want?\n let max_shifts = INT_SIZE - 1;\n let shifts = max_shifts - msg_byte_ptr % INT_SIZE;\n lshift8(msg_item, shifts as u8)\n}\n\n// Construct a field out of 4 bytes.\n#[inline_always]\nfn make_item(b0: u8, b1: u8, b2: u8, b3: u8) -> u32 {\n let mut item = b0 as u32;\n item = lshift8(item, 1) + b1 as u32;\n item = lshift8(item, 1) + b2 as u32;\n item = lshift8(item, 1) + b3 as u32;\n item\n}\n\n// Shift by 8 bits to the left between 0 and 4 times.\n// Checks `is_unconstrained()` to just use a bitshift if we're running in an unconstrained context,\n// otherwise multiplies by 256.\n#[inline_always]\nfn lshift8(item: u32, shifts: u8) -> u32 {\n if is_unconstrained() {\n // Brillig wouldn't shift 0<<4 without overflow.\n if shifts >= 4 {\n 0\n } else {\n item << (8 * shifts)\n }\n } else {\n // We can do a for loop up to INT_SIZE or an if-else.\n if shifts == 0 {\n item\n } else if shifts == 1 {\n item * TWO_POW_8\n } else if shifts == 2 {\n item * TWO_POW_16\n } else if shifts == 3 {\n item * TWO_POW_24\n } else {\n // Doesn't make sense, but it's most likely called on 0 anyway.\n 0\n }\n }\n}\n\n// Shift by 8 bits to the right between 0 and 4 times.\n// Checks `is_unconstrained()` to just use a bitshift if we're running in an unconstrained context,\n// otherwise divides by 256.\nfn rshift8(item: u32, shifts: u8) -> u32 {\n if is_unconstrained() {\n item >> (8 * shifts)\n } else {\n // Division wouldn't work on `Field`.\n if shifts == 0 {\n item\n } else if shifts == 1 {\n item / TWO_POW_8\n } else if shifts == 2 {\n item / TWO_POW_16\n } else if shifts == 3 {\n item / TWO_POW_24\n } else {\n 0\n }\n }\n}\n\n// Zero out all bytes between the end of the message and where the length is appended,\n// then write the length into the last 8 bytes of the block.\nunconstrained fn attach_len_to_msg_block(\n mut msg_block: MSG_BLOCK,\n mut msg_byte_ptr: BLOCK_BYTE_PTR,\n message_size: u32,\n) -> MSG_BLOCK {\n // We assume that `msg_byte_ptr` is less than 57 because if not then it is reset to zero before calling this function.\n // In any case, fill blocks up with zeros until the last 64 bits (i.e. until msg_byte_ptr = 56).\n // There can be one item which has to be partially zeroed.\n let modulo = msg_byte_ptr % INT_SIZE;\n if modulo != 0 {\n // Index of the block in which we find the item we need to partially zero.\n let i = msg_byte_ptr / INT_SIZE;\n let zeros = INT_SIZE - modulo;\n msg_block[i] = set_item_zeros(msg_block[i], zeros as u8);\n msg_byte_ptr = msg_byte_ptr + zeros;\n }\n\n // The rest can be zeroed without bit shifting anything.\n for i in (msg_byte_ptr / INT_SIZE)..INT_SIZE_PTR {\n msg_block[i] = 0;\n }\n\n // Set the last two 4 byte ints as the first/second half of the 8 bytes of the length.\n let len = 8 * message_size;\n let len_bytes: [u8; 8] = (len as Field).to_be_bytes();\n for i in 0..=1 {\n let shift = i * 4;\n msg_block[INT_SIZE_PTR + i] = make_item(\n len_bytes[shift],\n len_bytes[shift + 1],\n len_bytes[shift + 2],\n len_bytes[shift + 3],\n );\n }\n msg_block\n}\n\n// Verify that the message length was correctly written by `attach_len_to_msg_block`,\n// and that everything between the byte pointer and the size pointer was zeroed,\n// and that everything before the byte pointer was untouched.\nfn verify_msg_len(\n msg_block: MSG_BLOCK,\n last_block: MSG_BLOCK,\n msg_byte_ptr: BLOCK_BYTE_PTR,\n message_size: u32,\n) {\n // Check zeros up to the size pointer.\n verify_msg_block_zeros(msg_block, msg_byte_ptr, INT_SIZE_PTR);\n\n // Check that up to the pointer we match the last block.\n verify_msg_block_equals_last(msg_block, last_block, msg_byte_ptr);\n\n // We verify the message length was inserted correctly by reversing the byte decomposition.\n let mut reconstructed_len: u64 = 0;\n for i in INT_SIZE_PTR..INT_BLOCK_SIZE {\n reconstructed_len = reconstructed_len * TWO_POW_32;\n reconstructed_len = reconstructed_len + msg_block[i] as u64;\n }\n let len = 8 * message_size as u64;\n assert_eq(reconstructed_len, len);\n}\n\n// Perform the final compression, then transform the `STATE` into `HASH`.\nfn hash_final_block(msg_block: MSG_BLOCK, mut state: STATE) -> HASH {\n let mut out_h: HASH = [0; 32]; // Digest as sequence of bytes\n // Hash final padded block\n state = sha256_compression(msg_block, state);\n\n // Return final hash as byte array\n for j in 0..8 {\n let h_bytes: [u8; 4] = (state[j] as Field).to_be_bytes();\n for k in 0..4 {\n out_h[4 * j + k] = h_bytes[k];\n }\n }\n\n out_h\n}\n\nmod equivalence_test {\n\n #[test]\n fn test_implementations_agree(msg: [u8; 100], message_size: u64) {\n let message_size = message_size % 100;\n let unconstrained_sha = unsafe { super::__sha256_var(msg, message_size as u32) };\n let sha = super::sha256_var(msg, message_size);\n assert_eq(sha, unconstrained_sha);\n }\n}\n"
|
|
3017
|
-
},
|
|
3018
|
-
"46": {
|
|
3019
|
-
"path": "std/option.nr",
|
|
3020
|
-
"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"
|
|
3021
|
-
},
|
|
3022
|
-
"47": {
|
|
2794
|
+
"43": {
|
|
3023
2795
|
"path": "std/panic.nr",
|
|
3024
2796
|
"source": "pub fn panic<T, U, let N: u32>(message: fmtstr<N, T>) -> U {\n assert(false, message);\n crate::mem::zeroed()\n}\n"
|
|
3025
2797
|
},
|
|
3026
|
-
"
|
|
3027
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr",
|
|
2798
|
+
"50": {
|
|
2799
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-contracts/contracts/protocol/contract_instance_deployer_contract/src/main.nr",
|
|
3028
2800
|
"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"
|
|
3029
2801
|
},
|
|
3030
|
-
"
|
|
3031
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/capsules/mod.nr",
|
|
3032
|
-
"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> CapsuleArray<T> {\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<let N: u32>(self, value: T)\n where\n T: Serialize<N>,\n {\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<let N: u32>(self, index: u32) -> T\n where\n T: Deserialize<N>,\n {\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().utility().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"
|
|
3033
|
-
},
|
|
3034
|
-
"56": {
|
|
2802
|
+
"52": {
|
|
3035
2803
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/call_interfaces.nr",
|
|
3036
2804
|
"source": "use dep::protocol_types::{\n abis::function_selector::FunctionSelector,\n address::AztecAddress,\n traits::{Deserialize, ToField},\n};\n\nuse crate::context::{gas::GasOpts, private_context::PrivateContext, public_context::PublicContext};\n\nuse crate::hash::{hash_args, hash_calldata};\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, self.args_hash);\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, self.args_hash);\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, self.args_hash);\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, self.args_hash);\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, self.args_hash);\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, self.args_hash);\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 calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.call_public_function_with_calldata_hash(\n self.target_contract,\n calldata_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.call_public_function_with_calldata_hash(\n self.target_contract,\n calldata_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 calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.call_public_function_with_calldata_hash(\n self.target_contract,\n calldata_hash,\n /*static=*/\n false,\n )\n }\n\n pub fn enqueue_view(self, context: &mut PrivateContext) {\n let calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.call_public_function_with_calldata_hash(\n self.target_contract,\n calldata_hash,\n /*static=*/\n true,\n )\n }\n\n pub fn set_as_teardown(self, context: &mut PrivateContext) {\n let calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.set_public_teardown_function_with_calldata_hash(\n self.target_contract,\n calldata_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 calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.call_public_function_with_calldata_hash(\n self.target_contract,\n calldata_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 calldata = self.args.push_front(self.selector.to_field());\n let calldata_hash = hash_calldata(calldata);\n execution_cache::store(calldata, calldata_hash);\n context.call_public_function_with_calldata_hash(\n self.target_contract,\n calldata_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"
|
|
3037
2805
|
},
|
|
3038
|
-
"
|
|
3039
|
-
"path": "std/collections/bounded_vec.nr",
|
|
3040
|
-
"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"
|
|
3041
|
-
},
|
|
3042
|
-
"63": {
|
|
2806
|
+
"59": {
|
|
3043
2807
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/private_context.nr",
|
|
3044
|
-
"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, hash_calldata_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 notify_enqueued_public_function_call, notify_set_min_revertible_side_effect_counter,\n notify_set_public_teardown_function_call,\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,\n },\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::{Empty, Hash, ToField},\n utils::arrays::array_concat,\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 self.return_hash = returns_hasher.hash();\n execution_cache::store(returns_hasher.fields, self.return_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, args_hash);\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, args_hash);\n self.call_private_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n 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 calldata = array_concat([function_selector.to_field()], args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false)\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 calldata = array_concat([function_selector.to_field()], args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true)\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, 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 let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true)\n }\n\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n notify_enqueued_public_function_call(\n contract_address,\n calldata_hash,\n counter,\n is_static_call,\n );\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n is_static_call,\n calldata_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 calldata = array_concat([function_selector.to_field()], args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.set_public_teardown_function_with_calldata_hash(contract_address, calldata_hash, false)\n }\n\n pub fn set_public_teardown_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_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\n notify_set_public_teardown_function_call(\n contract_address,\n calldata_hash,\n counter,\n is_static_call,\n );\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n is_static_call,\n calldata_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"
|
|
2808
|
+
"source": "use crate::{\n context::{inputs::PrivateContextInputs, returns_hash::ReturnsHash},\n hash::{ArgsHasher, hash_args_array, hash_calldata_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 notify_enqueued_public_function_call, notify_set_min_revertible_side_effect_counter,\n notify_set_public_teardown_function_call,\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,\n },\n messaging::l2_to_l1_message::L2ToL1Message,\n traits::{Empty, Hash, ToField},\n utils::arrays::array_concat,\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\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 self.return_hash = returns_hasher.hash();\n execution_cache::store(returns_hasher.fields, self.return_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 = self.last_key_validation_requests[key_index as u32].unwrap_or(\n KeyValidationRequest::empty(),\n );\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 as u32],\n },\n );\n self.last_key_validation_requests[key_index as u32] = 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, args_hash);\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, args_hash);\n self.call_private_function_with_args_hash(\n contract_address,\n function_selector,\n args_hash,\n true,\n )\n }\n\n 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 calldata = array_concat([function_selector.to_field()], args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, false)\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 calldata = array_concat([function_selector.to_field()], args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true)\n }\n\n pub fn call_public_function_no_args(\n &mut self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n ) {\n let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, 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 let calldata_hash = hash_calldata_array([function_selector.to_field()]);\n self.call_public_function_with_calldata_hash(contract_address, calldata_hash, true)\n }\n\n pub fn call_public_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_hash: Field,\n is_static_call: bool,\n ) {\n let counter = self.next_counter();\n\n let mut is_static_call = is_static_call | self.inputs.call_context.is_static_call;\n\n notify_enqueued_public_function_call(\n contract_address,\n calldata_hash,\n counter,\n is_static_call,\n );\n\n let call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n is_static_call,\n calldata_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 calldata = array_concat([function_selector.to_field()], args);\n let calldata_hash = hash_calldata_array(calldata);\n execution_cache::store(calldata, calldata_hash);\n self.set_public_teardown_function_with_calldata_hash(contract_address, calldata_hash, false)\n }\n\n pub fn set_public_teardown_function_with_calldata_hash(\n &mut self,\n contract_address: AztecAddress,\n calldata_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\n notify_set_public_teardown_function_call(\n contract_address,\n calldata_hash,\n counter,\n is_static_call,\n );\n\n self.public_teardown_call_request = PublicCallRequest {\n msg_sender: self.this_address(),\n contract_address,\n is_static_call,\n calldata_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"
|
|
3045
2809
|
},
|
|
3046
|
-
"
|
|
2810
|
+
"60": {
|
|
3047
2811
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/public_context.nr",
|
|
3048
2812
|
"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 calldata = args.push_front(function_selector.to_field());\n\n call(gas_for_call(gas_opts), contract_address, calldata);\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 calldata = args.push_front(function_selector.to_field());\n\n call_static(gas_for_call(gas_opts), contract_address, calldata);\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"
|
|
3049
2813
|
},
|
|
3050
|
-
"
|
|
2814
|
+
"61": {
|
|
3051
2815
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/returns_hash.nr",
|
|
3052
2816
|
"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"
|
|
3053
2817
|
},
|
|
3054
|
-
"
|
|
2818
|
+
"62": {
|
|
3055
2819
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/utility_context.nr",
|
|
3056
2820
|
"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 UtilityContext {\n block_number: u32,\n contract_address: AztecAddress,\n version: Field,\n chain_id: Field,\n}\n\nimpl UtilityContext {\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 a UtilityContext 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"
|
|
3057
2821
|
},
|
|
3058
|
-
"
|
|
3059
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/
|
|
3060
|
-
"source": "use
|
|
3061
|
-
},
|
|
3062
|
-
"69": {
|
|
3063
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/nonce_discovery.nr",
|
|
3064
|
-
"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"
|
|
3065
|
-
},
|
|
3066
|
-
"70": {
|
|
3067
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/partial_notes.nr",
|
|
3068
|
-
"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 hash::sha256_to_field,\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`.\npub global DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT\".as_bytes(),\n);\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"
|
|
3069
|
-
},
|
|
3070
|
-
"72": {
|
|
3071
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/private_logs.nr",
|
|
3072
|
-
"source": "use crate::{\n capsules::CapsuleArray,\n discovery::{\n ComputeNoteHashAndNullifier,\n MAX_LOG_CONTENT_LEN,\n partial_notes::process_partial_note_private_log,\n pending_tagged_log::{PENDING_TAGGED_LOG_ARRAY_BASE_SLOT, PendingTaggedLog},\n PRIVATE_LOG_EXPANDED_METADATA_LEN,\n private_notes::process_private_note_log,\n },\n encrypted_logs::{\n log_assembly_strategies::default_aes128::aes128::AES128,\n log_encryption::LogEncryption,\n log_type::{\n PARTIAL_NOTE_PRIVATE_LOG_TYPE_ID, PRIVATE_EVENT_LOG_TYPE_ID, PRIVATE_NOTE_LOG_TYPE_ID,\n },\n metadata_packing::from_expanded_metadata,\n },\n oracle::{logs::store_private_event_log, message_discovery::sync_notes},\n utils::array,\n};\n\nuse protocol_types::{\n abis::event_selector::EventSelector,\n address::AztecAddress,\n debug_log::{debug_log, debug_log_format},\n traits::FromField,\n};\n\n// TODO(#12750): don't make these values assume we're using AES.\nuse crate::encrypted_logs::log_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 perform log discovery via tagging here, but for now we simply call the `syncNotes` oracle.\n // This makes PXE synchronize tags, download logs and store the pending tagged logs in capsule array which are then\n // retrieved and processed here.\n sync_notes(PENDING_TAGGED_LOG_ARRAY_BASE_SLOT);\n\n // Get logs from capsules\n let logs =\n CapsuleArray::<PendingTaggedLog>::at(contract_address, PENDING_TAGGED_LOG_ARRAY_BASE_SLOT);\n let len = logs.len();\n\n // We iterate over the logs in reverse order to avoid shifting elements.\n let mut i = len;\n while i > 0 {\n i -= 1;\n\n // Get and process each log\n let log = logs.get(i);\n process_log(contract_address, compute_note_hash_and_nullifier, log);\n\n // Remove the log from the capsule array\n logs.remove(i);\n }\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.\nunconstrained fn process_log<Env>(\n contract_address: AztecAddress,\n compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier<Env>,\n pending_tagged_log: PendingTaggedLog,\n) {\n debug_log_format(\n \"Processing log with tag {0}\",\n [pending_tagged_log.log.get(0)],\n );\n\n // The tag is ignored for now.\n let ciphertext = array::subbvec(pending_tagged_log.log, 1);\n\n let log_plaintext = AES128::decrypt_log(ciphertext, pending_tagged_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 // have 3 log types: private note logs, partial note logs and event logs.\n\n let (log_type_id, log_metadata, log_content) = decode_log_plaintext(log_plaintext);\n\n if log_type_id == PRIVATE_NOTE_LOG_TYPE_ID {\n debug_log(\"Processing private note log\");\n\n process_private_note_log(\n contract_address,\n pending_tagged_log.tx_hash,\n pending_tagged_log.unique_note_hashes_in_tx,\n pending_tagged_log.first_nullifier_in_tx,\n pending_tagged_log.recipient,\n compute_note_hash_and_nullifier,\n log_metadata,\n log_content,\n );\n } else if log_type_id == PARTIAL_NOTE_PRIVATE_LOG_TYPE_ID {\n debug_log(\"Processing partial note private log\");\n\n process_partial_note_private_log(\n contract_address,\n pending_tagged_log.recipient,\n log_metadata,\n log_content,\n );\n } else if log_type_id == PRIVATE_EVENT_LOG_TYPE_ID {\n debug_log(\"Processing private event log\");\n\n // In the case of event logs, the log metadata is the event selector.\n let event_selector = EventSelector::from_field(log_metadata as Field);\n\n store_private_event_log(\n contract_address,\n pending_tagged_log.recipient,\n event_selector,\n log_content,\n pending_tagged_log.tx_hash,\n pending_tagged_log.log_index_in_tx,\n );\n } else {\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_plaintext: [ log_expanded_metadata, ...log_content ]\n/// ```\n///\n/// The expanded metadata itself is (currently) interpreted as a u128, of which:\n/// - the upper 64 bits are the log type id\n/// - the lower 64 bits are called the 'log metadata'\n///\n/// ```\n/// log_expanded_metadata: [ log_type_id | log_metadata ]\n/// <--- 64 bits --->|<--- 64 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 let (log_metadata, log_type_id) = from_expanded_metadata(expanded_log_metadata);\n let log_content = array::subbvec(log_plaintext, PRIVATE_LOG_EXPANDED_METADATA_LEN);\n\n (log_type_id, log_metadata, log_content)\n}\n"
|
|
3073
|
-
},
|
|
3074
|
-
"73": {
|
|
3075
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/discovery/private_notes.nr",
|
|
3076
|
-
"source": "use crate::{\n discovery::{\n ComputeNoteHashAndNullifier,\n MAX_LOG_CONTENT_LEN,\n nonce_discovery::{attempt_note_nonce_discovery, DiscoveredNoteInfo},\n },\n oracle,\n utils::array,\n};\nuse protocol_types::{\n address::AztecAddress, constants::MAX_NOTE_HASHES_PER_TX, debug_log::debug_log_format,\n};\n\n/// The number of fields in a private note log content that are not the note's packed representation.\nglobal PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN: u32 = 1;\n\n/// The maximum length of the packed representation of a note's contents. This is limited by private log size,\n/// encryption overhead and extra fields in the log (e.g. log type id, storage slot, etc.).\npub global MAX_NOTE_PACKED_LEN: u32 =\n MAX_LOG_CONTENT_LEN - PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN;\n\npub unconstrained fn process_private_note_log<Env>(\n contract_address: AztecAddress,\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 log_metadata: u64,\n log_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN>,\n) {\n let (note_type_id, storage_slot, packed_note) =\n decode_private_note_log(log_metadata, log_content);\n\n attempt_note_discovery(\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 storage_slot,\n note_type_id,\n packed_note,\n );\n}\n\n/// Attempts discovery of a note given information about its contents and the transaction in which it is\n/// suspected the note was created.\npub unconstrained fn attempt_note_discovery<Env>(\n contract_address: AztecAddress,\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 storage_slot: Field,\n note_type_id: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n) {\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n compute_note_hash_and_nullifier,\n contract_address,\n storage_slot,\n note_type_id,\n packed_note,\n );\n\n debug_log_format(\n \"Discovered {0} notes from a private log\",\n [discovered_notes.len() as Field],\n );\n\n array::for_each_in_bounded_vec(\n discovered_notes,\n |discovered_note: DiscoveredNoteInfo, _| {\n // TODO:(#10728): handle notes that fail delivery. This could be due to e.g. a temporary node connectivity\n // issue, and we should perhaps not have marked the tag index as taken.\n assert(\n oracle::message_discovery::deliver_note(\n contract_address,\n storage_slot,\n discovered_note.nonce,\n packed_note,\n discovered_note.note_hash,\n discovered_note.inner_nullifier,\n tx_hash,\n recipient,\n ),\n \"Failed to deliver note\",\n );\n },\n );\n}\n\nfn decode_private_note_log(\n log_metadata: u64,\n log_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN>,\n) -> (Field, Field, BoundedVec<Field, MAX_NOTE_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() > PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN,\n f\"Invalid private note log: all private note logs must have at least {PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN} fields\",\n );\n\n // If PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN is changed, causing the assertion below to fail, then the destructuring of\n // the private note log encoding below must be updated as well.\n std::static_assert(\n PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN\",\n );\n\n // We currently have a single field that is not the note's packed representation, which is the storage slot.\n let storage_slot = log_content.get(0);\n let packed_note = array::subbvec(log_content, PRIVATE_NOTE_LOG_CONTENT_NON_NOTE_FIELDS_LEN);\n\n (note_type_id, storage_slot, packed_note)\n}\n"
|
|
2822
|
+
"66": {
|
|
2823
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/hash.nr",
|
|
2824
|
+
"source": "use dep::protocol_types::{\n address::{AztecAddress, EthAddress},\n constants::{\n GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER,\n GENERATOR_INDEX__PUBLIC_CALLDATA, 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\n// Computes the hash of input arguments or return values for private functions, or for authwit creation.\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\n// Same as `hash_args_array`, but takes a slice instead of an array.\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// Computes the hash of calldata for public functions.\npub fn hash_calldata_array<let N: u32>(calldata: [Field; N]) -> Field {\n if calldata.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator(calldata, GENERATOR_INDEX__PUBLIC_CALLDATA)\n }\n}\n\n// Same as `hash_calldata_array`, but takes a slice instead of an array.\npub fn hash_calldata(calldata: [Field]) -> Field {\n if calldata.len() == 0 {\n 0\n } else {\n poseidon2_hash_with_separator_slice(calldata, GENERATOR_INDEX__PUBLIC_CALLDATA)\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"
|
|
3077
2825
|
},
|
|
3078
|
-
"
|
|
3079
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/
|
|
3080
|
-
"source": "use
|
|
2826
|
+
"88": {
|
|
2827
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch.nr",
|
|
2828
|
+
"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 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 // name of the function is assigned just before the call so debug metadata doesn't span most of this macro when figuring out where the call comes from.\n let name = function.name();\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"
|
|
3081
2829
|
},
|
|
3082
|
-
"
|
|
3083
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/
|
|
3084
|
-
"source": "use crate::{\n encrypted_logs::{\n encrypt::aes128::derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_sha256,\n log_assembly_strategies::default_aes128::arithmetic_generics_utils::{\n get_arr_of_size__log_bytes__from_PT, get_arr_of_size__log_bytes_padding__from_PT,\n },\n log_encryption::{\n EPH_PK_SIGN_BYTE_SIZE_IN_BYTES, EPH_PK_X_SIZE_IN_FIELDS,\n HEADER_CIPHERTEXT_SIZE_IN_BYTES, LogEncryption, PRIVATE_LOG_CIPHERTEXT_LEN,\n PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS,\n },\n },\n keys::{\n ecdh_shared_secret::derive_ecdh_shared_secret_using_aztec_address,\n ephemeral::generate_ephemeral_key_pair,\n },\n oracle::{aes128_decrypt::aes128_decrypt_oracle, shared_secret::get_shared_secret},\n prelude::AztecAddress,\n utils::{\n array,\n conversion::{\n bytes_to_fields::{bytes_from_fields, bytes_to_fields},\n fields_to_bytes::{fields_from_bytes, fields_to_bytes},\n },\n point::{get_sign_of_point, point_from_x_coord_and_sign},\n random::get_random_bytes,\n },\n};\nuse std::aes128::aes128_encrypt;\n\npub struct AES128 {}\n\nimpl LogEncryption for AES128 {\n fn encrypt_log<let PLAINTEXT_LEN: u32>(\n plaintext: [Field; PLAINTEXT_LEN],\n recipient: AztecAddress,\n ) -> [Field; PRIVATE_LOG_CIPHERTEXT_LEN] {\n // AES 128 operates on bytes, not fields, so we need to convert the fields to bytes.\n // (This process is then reversed when processing the log in `do_process_log`)\n let plaintext_bytes = fields_to_bytes(plaintext);\n\n // *****************************************************************************\n // Compute the shared secret\n // *****************************************************************************\n\n let (eph_sk, eph_pk) = generate_ephemeral_key_pair();\n\n let eph_pk_sign_byte: u8 = get_sign_of_point(eph_pk) as u8;\n\n // (not to be confused with the tagging shared secret)\n let ciphertext_shared_secret =\n derive_ecdh_shared_secret_using_aztec_address(eph_sk, recipient);\n\n // TODO: also use this shared secret for deriving note randomness.\n\n // *****************************************************************************\n // Convert the plaintext into whatever format the encryption function expects\n // *****************************************************************************\n\n // Already done for this strategy: AES expects bytes.\n\n // *****************************************************************************\n // Encrypt the plaintext\n // *****************************************************************************\n\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_sha256(\n ciphertext_shared_secret,\n );\n\n let ciphertext_bytes = aes128_encrypt(plaintext_bytes, iv, sym_key);\n\n // |full_pt| = |pt_length| + |pt|\n // |pt_aes_padding| = 16 - (|full_pt| % 16)\n // or... since a % b is the same as a - b * (a // b) (integer division), so:\n // |pt_aes_padding| = 16 - (|full_pt| - 16 * (|full_pt| // 16))\n // |ct| = |full_pt| + |pt_aes_padding|\n // = |full_pt| + 16 - (|full_pt| - 16 * (|full_pt| // 16))\n // = 16 + 16 * (|full_pt| // 16)\n // = 16 * (1 + |full_pt| // 16)\n assert(ciphertext_bytes.len() == 16 * (1 + (PLAINTEXT_LEN * 32) / 16));\n\n // *****************************************************************************\n // Compute the header ciphertext\n // *****************************************************************************\n\n // Header contains only the length of the ciphertext stored in 2 bytes.\n // TODO: consider nuking the header altogether and just have a fixed-size ciphertext by padding the plaintext.\n // This would be more costly constraint-wise but cheaper DA-wise.\n let mut header_plaintext: [u8; 2] = [0 as u8; 2];\n let ciphertext_bytes_length = ciphertext_bytes.len();\n header_plaintext[0] = (ciphertext_bytes_length >> 8) as u8;\n header_plaintext[1] = ciphertext_bytes_length as u8;\n\n // TODO: this is insecure and wasteful:\n // \"Insecure\", because the esk shouldn't be used twice (once for the header,\n // and again for the proper ciphertext) (at least, I never got the\n // \"go ahead\" that this would be safe, unfortunately).\n // \"Wasteful\", because the exact same computation is happening further down.\n // I'm leaving that 2nd computation where it is, because this 1st computation\n // will be imminently deleted, when the header logic is deleted.\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_sha256(\n ciphertext_shared_secret,\n );\n\n // Note: the aes128_encrypt builtin fn automatically appends bytes to the\n // input, according to pkcs#7; hence why the output `header_ciphertext_bytes` is 16\n // bytes larger than the input in this case.\n let header_ciphertext_bytes = aes128_encrypt(header_plaintext, iv, sym_key);\n // I recall that converting a slice to an array incurs constraints, so I'll check the length this way instead:\n assert(header_ciphertext_bytes.len() == HEADER_CIPHERTEXT_SIZE_IN_BYTES);\n\n // *****************************************************************************\n // Prepend / append more bytes of data to the ciphertext, before converting back\n // to fields.\n // *****************************************************************************\n\n let mut log_bytes_padding_to_mult_31 =\n get_arr_of_size__log_bytes_padding__from_PT::<PLAINTEXT_LEN * 32>();\n // Safety: this randomness won't be constrained to be random. It's in the\n // interest of the executor of this fn to encrypt with random bytes.\n log_bytes_padding_to_mult_31 = unsafe { get_random_bytes() };\n\n let mut log_bytes = get_arr_of_size__log_bytes__from_PT::<PLAINTEXT_LEN * 32>();\n\n assert(\n log_bytes.len() % 31 == 0,\n \"Unexpected error: log_bytes.len() should be divisible by 31, by construction.\",\n );\n\n log_bytes[0] = eph_pk_sign_byte;\n let mut offset = 1;\n for i in 0..header_ciphertext_bytes.len() {\n log_bytes[offset + i] = header_ciphertext_bytes[i];\n }\n offset += header_ciphertext_bytes.len();\n\n for i in 0..ciphertext_bytes.len() {\n log_bytes[offset + i] = ciphertext_bytes[i];\n }\n offset += ciphertext_bytes.len();\n\n for i in 0..log_bytes_padding_to_mult_31.len() {\n log_bytes[offset + i] = log_bytes_padding_to_mult_31[i];\n }\n\n assert(\n offset + log_bytes_padding_to_mult_31.len() == log_bytes.len(),\n \"Something has gone wrong\",\n );\n\n // *****************************************************************************\n // Convert bytes back to fields\n // *****************************************************************************\n\n // TODO(#12749): As Mike pointed out, we need to make logs produced by different encryption schemes\n // indistinguishable from each other and for this reason the output here and in the last for-loop of this function\n // should cover a full field.\n let log_bytes_as_fields = bytes_to_fields(log_bytes);\n\n // *****************************************************************************\n // Prepend / append fields, to create the final log\n // *****************************************************************************\n\n let mut ciphertext: [Field; PRIVATE_LOG_CIPHERTEXT_LEN] = [0; PRIVATE_LOG_CIPHERTEXT_LEN];\n\n ciphertext[0] = eph_pk.x;\n\n let mut offset = 1;\n for i in 0..log_bytes_as_fields.len() {\n ciphertext[offset + i] = log_bytes_as_fields[i];\n }\n offset += log_bytes_as_fields.len();\n\n for i in offset..PRIVATE_LOG_CIPHERTEXT_LEN {\n // We need to get a random value that fits in 31 bytes to not leak information about the size of the log\n // (all the \"real\" log fields contain at most 31 bytes because of the way we convert the bytes to fields).\n // TODO(#12749): Long term, this is not a good solution.\n\n // Safety: we assume that the sender wants for the log to be private - a malicious one could simply reveal its\n // contents publicly. It is therefore fine to trust the sender to provide random padding.\n let field_bytes = unsafe { get_random_bytes::<31>() };\n ciphertext[i] = Field::from_be_bytes::<31>(field_bytes);\n }\n\n ciphertext\n }\n\n unconstrained fn decrypt_log(\n ciphertext: BoundedVec<Field, PRIVATE_LOG_CIPHERTEXT_LEN>,\n recipient: AztecAddress,\n ) -> BoundedVec<Field, PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS> {\n let eph_pk_x = ciphertext.get(0);\n\n let ciphertext_without_eph_pk_x_fields = array::subbvec::<Field, PRIVATE_LOG_CIPHERTEXT_LEN, PRIVATE_LOG_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS>(\n ciphertext,\n EPH_PK_X_SIZE_IN_FIELDS,\n );\n\n // Convert the ciphertext represented as fields to a byte representation (its original format)\n let ciphertext_without_eph_pk_x = bytes_from_fields(ciphertext_without_eph_pk_x_fields);\n\n // First byte of the ciphertext represents the ephemeral public key sign\n let eph_pk_sign_bool = ciphertext_without_eph_pk_x.get(0) as bool;\n // With the sign and the x-coordinate of the ephemeral public key, we can reconstruct the point\n let eph_pk = point_from_x_coord_and_sign(eph_pk_x, eph_pk_sign_bool);\n\n // Derive shared secret and symmetric key\n let ciphertext_shared_secret = get_shared_secret(recipient, eph_pk);\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_ecdh_shared_secret_using_sha256(\n ciphertext_shared_secret,\n );\n\n // Extract the header ciphertext\n let header_start = EPH_PK_SIGN_BYTE_SIZE_IN_BYTES; // Skip eph_pk_sign byte\n let header_ciphertext: [u8; HEADER_CIPHERTEXT_SIZE_IN_BYTES] =\n array::subarray(ciphertext_without_eph_pk_x.storage(), header_start);\n // We need to convert the array to a BoundedVec because the oracle expects a BoundedVec as it's designed to work\n // with logs with unknown length at compile time. This would not be necessary here as the header ciphertext length\n // is fixed. But we do it anyway to not have to have duplicate oracles.\n let header_ciphertext_bvec =\n BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::from_array(header_ciphertext);\n\n // Decrypt header\n let header_plaintext = aes128_decrypt_oracle(header_ciphertext_bvec, iv, sym_key);\n\n // Extract ciphertext length from header (2 bytes, big-endian)\n let ciphertext_length =\n ((header_plaintext.get(0) as u32) << 8) | (header_plaintext.get(1) as u32);\n\n // Extract and decrypt main ciphertext\n let ciphertext_start = header_start + HEADER_CIPHERTEXT_SIZE_IN_BYTES;\n let ciphertext_with_padding: [u8; (PRIVATE_LOG_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS) * 31 - HEADER_CIPHERTEXT_SIZE_IN_BYTES - EPH_PK_SIGN_BYTE_SIZE_IN_BYTES] =\n array::subarray(ciphertext_without_eph_pk_x.storage(), ciphertext_start);\n let ciphertext: BoundedVec<u8, (PRIVATE_LOG_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS) * 31 - HEADER_CIPHERTEXT_SIZE_IN_BYTES - EPH_PK_SIGN_BYTE_SIZE_IN_BYTES> =\n BoundedVec::from_parts(ciphertext_with_padding, ciphertext_length);\n\n // Decrypt main ciphertext and return it\n let plaintext_bytes = aes128_decrypt_oracle(ciphertext, iv, sym_key);\n\n // Each field of the original note log was serialized to 32 bytes so we convert the bytes back to fields.\n fields_from_bytes(plaintext_bytes)\n }\n}\n\nmod test {\n use crate::{\n encrypted_logs::log_encryption::{LogEncryption, PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS},\n keys::ecdh_shared_secret::derive_ecdh_shared_secret_using_aztec_address,\n test::helpers::test_environment::TestEnvironment,\n };\n use super::AES128;\n use protocol_types::{\n address::AztecAddress,\n indexed_tagging_secret::IndexedTaggingSecret,\n traits::{Deserialize, FromField},\n };\n use std::{embedded_curve_ops::EmbeddedCurveScalar, test::OracleMock};\n\n #[test]\n unconstrained fn encrypt_decrypt_log() {\n let mut env = TestEnvironment::new();\n // Advance 1 block so we can read historic state from private\n env.advance_block_by(1);\n\n let plaintext = [1, 2, 3];\n\n let recipient = AztecAddress::from_field(\n 0x25afb798ea6d0b8c1618e50fdeafa463059415013d3b7c75d46abf5e242be70c,\n );\n\n // Mock random values for deterministic test\n let eph_sk = 0x1358d15019d4639393d62b97e1588c095957ce74a1c32d6ec7d62fe6705d9538;\n let _ = OracleMock::mock(\"getRandomField\").returns(eph_sk).times(1);\n\n let randomness = 0x0101010101010101010101010101010101010101010101010101010101010101;\n let _ = OracleMock::mock(\"getRandomField\").returns(randomness).times(1000000);\n\n let _ = OracleMock::mock(\"getIndexedTaggingSecretAsSender\").returns(\n IndexedTaggingSecret::deserialize([69420, 1337]),\n );\n let _ = OracleMock::mock(\"incrementAppTaggingSecretIndexAsSender\").returns(());\n\n // Encrypt the log\n let encrypted_log = BoundedVec::from_array(AES128::encrypt_log(plaintext, recipient));\n\n // Mock shared secret for deterministic test\n let shared_secret = derive_ecdh_shared_secret_using_aztec_address(\n EmbeddedCurveScalar::from_field(eph_sk),\n recipient,\n );\n let _ = OracleMock::mock(\"getSharedSecret\").returns(shared_secret);\n\n // Decrypt the log\n let decrypted = AES128::decrypt_log(encrypted_log, recipient);\n\n // The decryption function spits out a BoundedVec because it's designed to work with logs with unknown length\n // at compile time. For this reason we need to convert the original input to a BoundedVec.\n let plaintext_bvec =\n BoundedVec::<Field, PRIVATE_LOG_PLAINTEXT_SIZE_IN_FIELDS>::from_array(plaintext);\n\n // Verify decryption matches original plaintext\n assert_eq(decrypted, plaintext_bvec, \"Decrypted bytes should match original plaintext\");\n\n // The following is a workaround of \"struct is never constructed\" Noir compilation error (we only ever use\n // static methods of the struct).\n let _ = AES128 {};\n }\n}\n"
|
|
2830
|
+
"91": {
|
|
2831
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/functions/call_interface_stubs.nr",
|
|
2832
|
+
"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"
|
|
3085
2833
|
},
|
|
3086
|
-
"
|
|
3087
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/
|
|
3088
|
-
"source": "global U64_SHIFT_MULTIPLIER: Field = 2.pow_32(64);\n\npub fn to_expanded_metadata(log_metadata: u64, log_type: u64) -> Field {\n let metadata_field = log_metadata as Field;\n // We use multiplication instead of bit shifting operations to shift the type bits as bit shift operations are\n // expensive in circuits.\n let type_field: Field = (log_type as Field) * U64_SHIFT_MULTIPLIER;\n type_field + metadata_field\n}\n\npub fn from_expanded_metadata(input: Field) -> (u64, u64) {\n input.assert_max_bit_size::<128>();\n let metadata = (input as u64);\n // Use division instead of bit shift since bit shifts are expensive in circuits\n let log_type = ((input - (metadata as Field)) / U64_SHIFT_MULTIPLIER) as u64;\n (metadata, log_type)\n}\n\nmod tests {\n use super::{from_expanded_metadata, to_expanded_metadata};\n\n global U64_MAX: Field = 2.pow_32(64) - 1;\n global U128_MAX: Field = 2.pow_32(128) - 1;\n\n #[test]\n fn packing_metadata() {\n // Test case 1: All bits set\n let packed = to_expanded_metadata(U64_MAX as u64, U64_MAX as u64);\n let (metadata, log_type) = from_expanded_metadata(packed);\n assert(metadata == U64_MAX as u64, \"Metadata bits should be all 1s\");\n assert(log_type == U64_MAX as u64, \"Log type bits should be all 1s\");\n\n // Test case 2: Only log type bits set\n let packed = to_expanded_metadata(0, U64_MAX as u64);\n let (metadata, log_type) = from_expanded_metadata(packed);\n assert(metadata == 0, \"Metadata bits should be 0\");\n assert(log_type == U64_MAX as u64, \"Log type bits should be all 1s\");\n\n // Test case 3: Only metadata bits set\n let packed = to_expanded_metadata(U64_MAX as u64, 0);\n let (metadata, log_type) = from_expanded_metadata(packed);\n assert(metadata == U64_MAX as u64, \"Metadata bits should be all 1s\");\n assert(log_type == 0, \"Log type bits should be 0\");\n\n // Test case 4: Zero\n let packed = to_expanded_metadata(0, 0);\n let (metadata, log_type) = from_expanded_metadata(packed);\n assert(metadata == 0, \"Metadata bits should be 0\");\n assert(log_type == 0, \"Log type bits should be 0\");\n }\n\n #[test]\n fn unpacking_metadata() {\n // Test case 1: All bits set\n let input = U128_MAX;\n let (metadata, log_type) = from_expanded_metadata(input);\n assert(metadata == U64_MAX as u64, \"Metadata bits should be all 1s\");\n assert(log_type == U64_MAX as u64, \"Log type bits should be all 1s\");\n\n // Test case 2: Only log type bits set\n let input = U128_MAX - U64_MAX;\n let (metadata, log_type) = from_expanded_metadata(input);\n assert(metadata == 0, \"Metadata bits should be 0\");\n assert(log_type == U64_MAX as u64, \"Log type bits should be all 1s\");\n\n // Test case 3: Only metadata bits set\n let input = U64_MAX;\n let (metadata, log_type) = from_expanded_metadata(input);\n assert(metadata == U64_MAX as u64, \"Metadata bits should be all 1s\");\n assert(log_type == 0, \"Log type bits should be 0\");\n\n // Test case 4: Zero\n let input = 0;\n let (metadata, log_type) = from_expanded_metadata(input);\n assert(metadata == 0, \"Metadata bits should be 0\");\n assert(log_type == 0, \"Log type bits should be 0\");\n }\n\n #[test]\n fn roundtrip_metadata(original_metadata: u64, original_type: u64) {\n let packed = to_expanded_metadata(original_metadata, original_type);\n let (unpacked_metadata, unpacked_type) = from_expanded_metadata(packed);\n assert(original_type == unpacked_type, \"Log type bits should match after roundtrip\");\n assert(\n original_metadata == unpacked_metadata,\n \"Metadata bits should match after roundtrip\",\n );\n }\n}\n"
|
|
2834
|
+
"95": {
|
|
2835
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/functions/utils.nr",
|
|
2836
|
+
"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_contract_library_method,\n is_fn_initializer, is_fn_internal, is_fn_private, is_fn_public, is_fn_test, is_fn_utility,\n 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 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 transform_utility(f: FunctionDefinition) {\n // Check if function is marked as unconstrained\n if !f.is_unconstrained() {\n let name = f.name();\n panic(\n f\"Function {name} is annotated with #[utility] but not marked as unconstrained, add unconstrained keyword\",\n );\n }\n\n // Create utility context\n let context_creation =\n quote { let mut context = dep::aztec::context::utility_context::UtilityContext::new(); };\n let module_has_storage = module_has_storage(f.module());\n\n // Initialize Storage if module has storage\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 utility 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 // Inject context creation, storage initialization, and message discovery call at the beginning of the function\n // body.\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_body(modified_body);\n\n f.set_return_public(true);\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::messages::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::messages::discovery::discover_new_messages(\n context.this_address(),\n _compute_note_hash_and_nullifier,\n );\n };\n }\n}\n\n/// Checks if each function in the module is marked with either #[private], #[public], #[utility],\n/// #[contract_library_method], or #[test]. Non-macroified functions are not allowed in contracts.\npub(crate) comptime fn check_each_fn_macroified(m: Module) {\n for f in m.functions() {\n let name = f.name();\n if !is_fn_private(f)\n & !is_fn_public(f)\n & !is_fn_utility(f)\n & !is_fn_contract_library_method(f)\n & !is_fn_test(f) {\n panic(\n f\"Function {name} must be marked as either #[private], #[public], #[utility], #[contract_library_method], or #[test]\",\n );\n }\n }\n}\n"
|
|
3089
2837
|
},
|
|
3090
|
-
"
|
|
3091
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/
|
|
3092
|
-
"source": "use
|
|
2838
|
+
"98": {
|
|
2839
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/storage.nr",
|
|
2840
|
+
"source": "use poseidon::poseidon2::Poseidon2Hasher;\nuse std::{collections::umap::UHashMap, hash::BuildHasherDefault};\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"
|
|
3093
2841
|
}
|
|
3094
2842
|
}
|
|
3095
2843
|
}
|