@aztec/protocol-contracts 0.0.1-commit.f5d02921e → 0.0.1-commit.f650c0a5c
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 +541 -521
- package/artifacts/ContractClassRegistry.json +56 -56
- package/artifacts/ContractInstanceRegistry.json +62 -216
- package/artifacts/FeeJuice.json +64 -222
- package/artifacts/MultiCallEntrypoint.json +487 -365
- package/artifacts/PublicChecks.json +503 -381
- package/dest/protocol_contract_data.js +39 -39
- package/package.json +4 -4
- package/src/protocol_contract_data.ts +38 -38
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"transpiled": true,
|
|
3
|
-
"noir_version": "1.0.0-beta.19+
|
|
3
|
+
"noir_version": "1.0.0-beta.19+c09ce9a7dbec1708a8b167fad7411ece61d8b9ea",
|
|
4
4
|
"name": "PublicChecks",
|
|
5
5
|
"functions": [
|
|
6
6
|
{
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"bytecode": "JwACBAEoAAABBIBLJwAABEslAAAATycCBAQCJwIFBAAfCgAEAAUASRwASUkCHABKSgQtCEkCLQhKAyUAAABuJwICBEsnAgMEADsOAAMAAicAQwIBJwBEAgInAEUCAycARgIEJwBHAgUnAEgCBiYeAgAFAB4CAAUAHgIABQknAgYBASQCAAUAAACPJQAAAu4eAgAFBRwKBQcAHAoDBQAKKgcFAwwqBwUICiICQwUkAgAFAAAC1yMAAAC6CiICRAcWCgMJJAIABwAAAsUjAAAA0AoiAkUKJAIACgAAArMjAAAA4goiAkYLJAIACwAAAqAjAAAA9AoiAkcLFgoIDCQCAAsAAAKNIwAAAQoKIgJICCQCAAgAAAJ/IwAAARwnAgICSScCAwJuJwIEAnYnAgUCYScCBwJsJwIIAmknAgkCZCcCCgIgJwILAm8nAgwCcCcCDQJlJwIOAnInAg8CdC0IARAnAhEEEgAIAREBJwMQBAEAIhACES0KERItDgISACISAhItDgMSACISAhItDgQSACISAhItDgUSACISAhItDgcSACISAhItDggSACISAhItDgkSACISAhItDgoSACISAhItDgsSACISAhItDgwSACISAhItDg0SACISAhItDg4SACISAhItDgUSACISAhItDg8SACISAhItDggSACISAhItDgsSACISAhItDgMSJwICAQAnAgMAAAoqAgYEJAIABAAAAn8nAgUEEy0IAQcnAggEEwAIAQgBLQoHCCoDAAgFUig2LZqNse0AIggCCAAiEAIJJwIKBBEtAgkDLQIIBC0CCgUlAAADACcCCQQRACoICQgtDgMIACIIAgg8DgUHIwAAAoQtCgwDIwAAApcEKgwJAyMAAAKXLQoDCiMAAAKqEioIAwojAAACqi0KCgcjAAACvC0KCAcjAAACvC0KBwUjAAACzi0KCQUjAAACzi0KBQQjAAAC4C0KAwQjAAAC4CQCAAQAAALtJQAAAzImKgEAAQVkvsvHipP/cjwEAgEmAAADBQctAAMILQAECSMAAAMkLQEIBi0EBgkAAAgCCAAACQIJDAAIBwokAAAKAAADEiYqAQABBS/SUCsOkdCZPAQCASY=",
|
|
52
|
-
"debug_symbols": "tZfdbuJADIXfJddcjD2ev75KVVWUphVSBCiFlVYV7742zAmkUiKU3b0hJyfJN/aMnSHfzXv7dvp83e4+9l/N0/N389Zvu277+drtN+vjdr9T97tx9kOkB7/SY2iekh5Zz8mZUINIhXcQuQrxKsSEOUFFMCeaMCeriOqwgaM6bDfnqMJuLnQV7OySPsVsl3R0FlGRTZQqol0qKrJAlCoKnFId7wQCDsEhOAyH4Xg4Ho7AETiW4FXkKiKcCCfBSamKTBA1C18cRICoQwiCF1eBQh6iAoUZogLFE0QFijgIAJGFIAtBFhIBjBgiAZgwRAYwYwgsgWAJpFRgcB6iAgMxRAUGJggFeq2oYDV2FXAEjtXYRVjwV5GqsOCvAo4FfxFWLVdRqihwSnWi8xD18UgEEatgOAwHoUaEGi+BsYpk8WjNJ683k9ZzsiWgdD6vGrTe67FvW+u8u17UDj2s+3Z3bJ52p65bNb/W3ely09dhvbscj+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estamp",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
"bytecode": "JwACBAEoAAABBIBLJwAABEslAAAATycCBAQCJwIFBAAfCgAEAAUASRwASUkCHABKSgUtCEkCLQhKAyUAAABuJwICBEsnAgMEADsOAAMAAicAQwIBJwBEAgInAEUCAycARgIEJwBHAgUnAEgCBiYeAgAFAB4CAAUAHgIABQknAgYBASQCAAUAAACPJQAAAu4eAgAFBhwKBQcAHAoDBQAKKgcFAwwqBwUICiICQwUkAgAFAAAC1yMAAAC6CiICRAcWCgMJJAIABwAAAsUjAAAA0AoiAkUKJAIACgAAArMjAAAA4goiAkYLJAIACwAAAqAjAAAA9AoiAkcLFgoIDCQCAAsAAAKNIwAAAQoKIgJICCQCAAgAAAJ/IwAAARwnAgICSScCAwJuJwIEAnYnAgUCYScCBwJsJwIIAmknAgkCZCcCCgIgJwILAm8nAgwCcCcCDQJlJwIOAnInAg8CdC0IARAnAhEEEgAIAREBJwMQBAEAIhACES0KERItDgISACISAhItDgMSACISAhItDgQSACISAhItDgUSACISAhItDgcSACISAhItDggSACISAhItDgkSACISAhItDgoSACISAhItDgsSACISAhItDgwSACISAhItDg0SACISAhItDg4SACISAhItDgUSACISAhItDg8SACISAhItDggSACISAhItDgsSACISAhItDgMSJwICAQAnAgMAAAoqAgYEJAIABAAAAn8nAgUEEy0IAQcnAggEEwAIAQgBLQoHCCoDAAgFUig2LZqNse0AIggCCAAiEAIJJwIKBBEtAgkDLQIIBC0CCgUlAAADACcCCQQRACoICQgtDgMIACIIAgg8DgUHIwAAAoQtCgwDIwAAApcEKgwJAyMAAAKXLQoDCiMAAAKqEioIAwojAAACqi0KCgcjAAACvC0KCAcjAAACvC0KBwUjAAACzi0KCQUjAAACzi0KBQQjAAAC4C0KAwQjAAAC4CQCAAQAAALtJQAAAzImKgEAAQVhALr8hC+iUjwEAgEmAAADBQctAAMILQAECSMAAAMkLQEIBi0EBgkAAAgCCAAACQIJDAA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102
|
{
|
|
103
103
|
"name": "offchain_receive",
|
|
@@ -234,8 +234,8 @@
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
|
-
"bytecode": "H4sIAAAAAAAA/+
|
|
238
|
-
"debug_symbols": "
|
|
237
|
+
"bytecode": "H4sIAAAAAAAA/+2dd3xUxRbHk9300El200xBwV6QYlcggIIgSoioqLgmS1gJSUg2SECEFbCiJgHsFUhAERt2sHc5Y++CitixY8X2JsjuTu69M7t38+P5ee8z/HWS2fmec+fMnJkzezlxNjddeWf1pEllkz2+qom13jKvb7qXxQ9qCqwaUuurrPRVFHsqKxfHNQdaBtfWeho2xA9a1NjU/FRhnPpffFzEj8RFB4pHgRwokBMFSkCBElGgJBQoGQVKQYFSUaA0FCgdBeqEAnVGgbqgQF1RoG4oUHcUqAcK1BMFykCBMlEgFwrkRoGyUKBsFCgHBcpFgfJQoF1QoHwUqAAFKkSBilCgXijQrijQbihQbxSoDwq0Owq0Bwq0Jwq0Fwq0Nwq0Dwq0Lwq0Hwq0Pwp0AArUFwU6EAXqhwL1R4EGoEADUaCDUKCDUaBDUKBDUaDDUKDDUaAjUKAjUaCjUKBBKNBgFGgIClSMAg1FgYahQMNRoKNRoGNQoBEo0EgU6FgUaBQKNBoFOg4FGoMCHY8CnYACjUWBSlCgcShQKQp0Igo0HgU6CQU6GQU6BQWagAKdigKdhgKdjgJNRIHOQIE8KNCZKFAZClSOAnlRoEkoUAUKNBkF8qFAZ6FAU1CgShRoKgpUhQJVo0A1KNA0FKgWBapDgfwoUD0KNB0FOhsFmoECNaBAM1GgWSjQOSjQbBToXBRoDgpEc2GkAIx0How0D0aaDyMtgJHOh5EugJEuhJEugpEuhpEugZEWwkiXwkiXwUiXw0iNMFITjNQMIy2CkRbDSEtgpCtgpCthpKtgpKthpGtgpGthpOtgpOthpBtgpBthpJtgpJthpKUw0jIYaTmM1AIjtcJIK2CklTDSLTDSrTDSKhjpNhhpNYx0O4x0B4x0J4x0F4x0N4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f0c8a5Sp/3252Fn3cfX48PFpy//PuMT/JzxfHp62P16Pe1U6fybRn8L/0b9OySS8l2/KtJuD6ffh76/q/f/AA=="
|
|
292
292
|
},
|
|
293
293
|
{
|
|
294
294
|
"name": "sync_state",
|
|
@@ -424,8 +424,8 @@
|
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
},
|
|
427
|
-
"bytecode": "H4sIAAAAAAAA/+29eYAcR3Uwvppj575ndmZ2Zm9JPjhtjGPAl3wDtiws+QNDgrS21pKwLMnalbENOF5ZkmVhHbsr2ZYNBDA+EjAQMNcXvpAfEBzAQyABTAhOICQQCIe5b/Jb2Ts1r7vqvarqqd7t9o7+am1PvXr97nr16lVweuquvxq/cctVa8cnRifGuqYm333O9k2bN2/acO7o5s2HZ///wOpNWzZsHps5NDX96cEu+t+SLulPug7NHDokBzTVdejQ7IwAtW8s/c3k/edu3TI+MTP5wHmbto9dNRGYfPClWybGNoxtv+/yF5wsB2ofv0Rr/C1vt4/v0pv/7ZPvOkbUqSSD89BlY5tHJzZdPxZ0+iUMQkgPQtfke47hsn50YvTcrdtuZJ/02F9ApAD0+y7Zev106w8BMODpr9rE4xTQpU+7dOmafNfqia3bpiyIAmA2/p17/wWbxjavnwX7xFXP33rbkbHfPPSaVxy64Y6NjYv/anX3D/75hb+9f+O3P/vxj//UPvA8NvBQ9j+f98RJ3//Nhz9/yov+bXr1J9b+17kvK3W96qPvv/Dou97x+i/YB57PBj62fuTbXzt81iVf2V9cddOzvvqJnf8aPTf/4bt/fum3X/LQ+psm7QMvYAOz73vplqte8r4XPf/w4ZuPu+zRuz73iV9/csefTW2b/tS9f/HIyj/YB14IKHjqKRIKLrmWk/GL2MQ/H3/8gc/v/+CnH5p48P47c19PHU08O/7nu3f/uPaj+j1P7r7PPvClbOJ3Xn6alHMcb16mNbzbPvzlDO0zPxJ89ca//u3WxIW3vu/1X/+XlTtS9dFPDuy9/9V/PzXwvbV77AMvZgP/+457/zzzvum3Dz6r8YvuCw/+Y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Z/asHHxwVs/ywtLOnu6Jswp9ywb6x97s6d5NCriLXNW5DpWMS8rJuV3Z29q+cNV005N/9wV/eObjn/Qt4E+ksoLeijlkiqJPK4rOio0EBsweWEgO8FWkoGw2Hi+rsGIbFWzUDzwVIGVmafH2aJ/4IItbHqn9IlC2dXwRc4Cf6fe9xPCy1y8PKLZ/pcSd/x8nMbMbmrYFAA==",
|
|
428
|
+
"debug_symbols": "vf3bjuVMcmYBvktd64JuBz/oVRqNhlqtbhRQkBpqaYCBoHef7UbSl2X+Cg9G7PjnpnJVVaYtbift48lJ/sdf/tc//c9//z//46///L//5f/95e//23/85X/+61//9re//p//8bd/+cd/+Le//ss/v/7X//jLMf9jtL/8vf7dX0b/y9/7648Rf5TjuP4s159y/anXn3b96def9fqzXX/268+rXrnqlateueqVq1656pWrXrnqlateueqVq55c9eSqJ1c9uerJVU+uenLVk6ueXPXkqqdXPb3q6VVPr3p61dOrnl719KqnVz296tlVz656dtWzq55d9eyqZ1c9u+rZVc+uen7V86ueX/X8qudXPb/q+VXPr3p+1fOrXr3q1ateverVq1696tWrXr3q1ateverVq1676rWrXrvqtateu+q1q1676rWrXrvqtatev+r1q16/6vWrXr/q9atev+r1q16/6vVXvfb6cxzXn+X6U64/X/VKmWA3+A2vkkUnvGqW+nd/kdkMpU14/WU5Jrz+ssiE118Wn9Bu6DeMC2YPnFBueC2Flgl6g93gN7wq61TMVjihXzA3etUJ8y/PgnMz17mEczvXPqHfMC6Ym/oJr8WwqZgbsc2Cc6u1WWdurjZ/cmyf85fGBhrQbug3jAtiIw2Ya23+89hMA/QGu2FWnosam2rArDwXLDbWgHFBbK4B5Qa5QW94Va7TPrfZE+oN7YZ+w7hgbrgnlBvkBr3hrtzuyu2u3O7K7a7c7sr9rtzvyv2u3O/K/a7c78r9rtzvyv2u3O/K46487srjrjzuyuOuPO7K46487srjrjyuynocN5Qb5Aa9wW7wG+oN7YZ+w1253JXLXbnclctdudyVy1253JXLXbnclctdWe7KcleWu7LcleWuL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a/LW5K3JW5O3Jm9N3pq8LXlb8rbkbcnbkrclb0velrwteVvy9uTtyduTtydvT96evD15e/L25O3JO5J3JO9I3pG8I3lH8o7kHck7kncsbzuOI3FJLIk1sSX2xDVxS9wTJ29J3pK8JXlL8pbkLclbkrckb0nekrySvJK8krySvJK8krySvJK8krySvJq8mryavJq8mryavJq8mryavJq8lryWvJa8lryWvJa8lryWvJa8lryevJ68nryevJ68nryevJ68nryevDV5a/LW5K3JW5O3Jm9N3pq8NXlr8rbkbcnbkrclb0velrwteVvytuRtyduTtydvT96evD15e/L25O3Je+VVDx7wlVcnn64RrIktsSeuiVvinngsLldGnRy/cc4efbEk1sSW2BPXxC1xTzzgM6MuTt6SvCV5S/KW5C3JW5K3JG9JXkleSV5JXkleSV5JXkleSV5JXkleTV5NXk1eTV5NXk1eTV5NXk1eTV5LXkteS15LXkteS15LXkteS15LXk9eT15PXk9eT15PXk9eT15PXk/emrw1eWvy1uStyVuTtyZvTd6avDV5W/K25G3J25K3JW9L3pa8LXlb8rbk7cnbk7cnb0/enrw9eXvy9uTtyduTdyTvSN6RvCN5R/KO5B3JO5J3JO/AK8eRuCSWxJrYEnvimrgl7omTN+WVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLySlFeS8kpSXknKK0l5JSmvJOWVpLzSlFea8kpTXmnKK015pSmvNOWVprzSlFea8kpTXmnKK015pSmvNOWVprzSlFea8kpTXmnKK015pSmvNOWVprzSlFea8kqvvPLglrjDZ0a5BYdrfnqi6ZlRF2tiS+yJa+KWuCce8JlRFyev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3HLKF3t5htjR/YYl4joeRt9WP3e/Tt2x/7Gs9uf3xS48PbH//99V/+4R//+q//42//8o//8G9//Zd//n+vf/efs9S//vUf/uff/un6r//73//5H9P/+2//3/97/z//81//+re//fX//I//+6//8o//9L/+/V//aVaa/99fjus//tur6ezvpHX573/3l/L6772/DrZ6H/767/r67/oKmb97nVzW+f+X8x+Uv5vvt/jv/zmX8P8H"
|
|
429
429
|
}
|
|
430
430
|
],
|
|
431
431
|
"outputs": {
|
|
@@ -644,77 +644,7 @@
|
|
|
644
644
|
}
|
|
645
645
|
},
|
|
646
646
|
"file_map": {
|
|
647
|
-
"
|
|
648
|
-
"function_locations": [
|
|
649
|
-
{
|
|
650
|
-
"name": "log_prefix",
|
|
651
|
-
"start": 525
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
"name": "aztecnr_fatal_log",
|
|
655
|
-
"start": 717
|
|
656
|
-
},
|
|
657
|
-
{
|
|
658
|
-
"name": "aztecnr_error_log",
|
|
659
|
-
"start": 943
|
|
660
|
-
},
|
|
661
|
-
{
|
|
662
|
-
"name": "aztecnr_warn_log",
|
|
663
|
-
"start": 1168
|
|
664
|
-
},
|
|
665
|
-
{
|
|
666
|
-
"name": "aztecnr_info_log",
|
|
667
|
-
"start": 1392
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
"name": "aztecnr_verbose_log",
|
|
671
|
-
"start": 1619
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
"name": "aztecnr_debug_log",
|
|
675
|
-
"start": 1847
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
"name": "aztecnr_trace_log",
|
|
679
|
-
"start": 2073
|
|
680
|
-
},
|
|
681
|
-
{
|
|
682
|
-
"name": "aztecnr_fatal_log_format",
|
|
683
|
-
"start": 2367
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
"name": "aztecnr_error_log_format",
|
|
687
|
-
"start": 2622
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
"name": "aztecnr_warn_log_format",
|
|
691
|
-
"start": 2876
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
"name": "aztecnr_info_log_format",
|
|
695
|
-
"start": 3129
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
"name": "aztecnr_verbose_log_format",
|
|
699
|
-
"start": 3385
|
|
700
|
-
},
|
|
701
|
-
{
|
|
702
|
-
"name": "aztecnr_debug_log_format",
|
|
703
|
-
"start": 3642
|
|
704
|
-
},
|
|
705
|
-
{
|
|
706
|
-
"name": "aztecnr_trace_log_format",
|
|
707
|
-
"start": 3897
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
"name": "resolve_fn",
|
|
711
|
-
"start": 4151
|
|
712
|
-
}
|
|
713
|
-
],
|
|
714
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/logging.nr",
|
|
715
|
-
"source": "// Not all log levels are currently used, but we provide the full set so that new call sites can use any level. Because\n// of that we tag all with `#[allow(dead_code)]` to prevent warnings.\n//\n// All wrappers resolve function paths at comptime via `resolve_fn` so that the emitted `Quoted` code works both inside\n// aztec-nr (where `crate::` = aztec) and inside macro-generated contract code (where `crate::` = the contract).\n\nuse std::meta::ctstring::AsCtString;\n\ncomptime fn log_prefix<let N: u32>(msg: str<N>) -> CtString {\n \"[aztec-nr] \".as_ctstring().append_str(msg)\n}\n\n// --- No-args variants (direct call) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log });\n quote { $f($msg) }\n}\n\n// --- Format variants (return lambda for runtime args) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n// See module-level comment for why this is needed.\ncomptime fn resolve_fn(path: Quoted) -> TypedExpr {\n path.as_expr().unwrap().resolve(Option::none())\n}\n"
|
|
716
|
-
},
|
|
717
|
-
"102": {
|
|
647
|
+
"101": {
|
|
718
648
|
"function_locations": [
|
|
719
649
|
{
|
|
720
650
|
"name": "generate_contract_library_methods_compute_note_hash_and_nullifier",
|
|
@@ -732,7 +662,7 @@
|
|
|
732
662
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec/compute_note_hash_and_nullifier.nr",
|
|
733
663
|
"source": "use crate::logging;\nuse crate::macros::{notes::NOTES, utils::get_trait_impl_method};\n\n/// Generates two contract library methods called `_compute_note_hash` and `_compute_note_nullifier`, plus a\n/// (deprecated) wrapper called `_compute_note_hash_and_nullifier`, which are used for note discovery (i.e. these are\n/// of the `aztec::messages::discovery::ComputeNoteHash` and `aztec::messages::discovery::ComputeNoteNullifier` types).\npub(crate) comptime fn generate_contract_library_methods_compute_note_hash_and_nullifier() -> Quoted {\n let compute_note_hash = generate_contract_library_method_compute_note_hash();\n let compute_note_nullifier = generate_contract_library_method_compute_note_nullifier();\n\n quote {\n $compute_note_hash\n $compute_note_nullifier\n\n /// Unpacks an array into a note corresponding to `note_type_id` and then computes its note hash (non-siloed) and inner nullifier (non-siloed) assuming the note has been inserted into the note hash tree with `note_nonce`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n #[allow(dead_code)]\n unconstrained fn _compute_note_hash_and_nullifier(\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n contract_address: aztec::protocol::address::AztecAddress,\n randomness: Field,\n note_nonce: Field,\n ) -> Option<aztec::messages::discovery::NoteHashAndNullifier> {\n _compute_note_hash(packed_note, owner, storage_slot, note_type_id, contract_address, randomness).map(|note_hash| {\n\n let siloed_note_hash = aztec::protocol::hash::compute_siloed_note_hash(contract_address, note_hash);\n let unique_note_hash = aztec::protocol::hash::compute_unique_note_hash(note_nonce, siloed_note_hash);\n \n let inner_nullifier = _compute_note_nullifier(unique_note_hash, packed_note, owner, storage_slot, note_type_id, contract_address, randomness);\n\n aztec::messages::discovery::NoteHashAndNullifier {\n note_hash,\n inner_nullifier,\n }\n })\n }\n }\n}\n\ncomptime fn generate_contract_library_method_compute_note_hash() -> Quoted {\n if NOTES.len() == 0 {\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 unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_hash(\n _packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n _owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n panic(f\"This contract does not use private notes\")\n }\n }\n } else {\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 the correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the note hash (non-siloed).\n\n // We resolve the log format calls here so that the resulting Quoted values can be spliced into the quote\n // block below.\n let warn_length_mismatch = logging::aztecnr_warn_log_format(\n \"Packed note length mismatch for note type id {0}: expected {1} fields, got {2}. Skipping note.\",\n );\n let warn_unknown_note_type = logging::aztecnr_warn_log_format(\"Unknown note type id {0}. Skipping note.\");\n\n let mut if_note_type_id_match_statements_list = @[];\n for i in 0..NOTES.len() {\n let typ = NOTES.get(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::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 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 its raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = <$typ as $crate::protocol::traits::Packable>::N;\n let actual_len = packed_note.len();\n if actual_len != expected_len {\n $warn_length_mismatch([note_type_id, expected_len as Field, actual_len as Field]);\n Option::none()\n } else {\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n Option::some($compute_note_hash(note, owner, storage_slot, randomness))\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 (non-siloed).\n ///\n /// The signature of this function notably matches the `aztec::messages::discovery::ComputeNoteHash` type, and so it can be used to call functions from that module such as `do_sync_state` 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(\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n randomness: Field,\n ) -> Option<Field> {\n $if_note_type_id_match_statements\n else {\n $warn_unknown_note_type([note_type_id]);\n Option::none()\n }\n }\n }\n }\n}\n\ncomptime fn generate_contract_library_method_compute_note_nullifier() -> Quoted {\n if NOTES.len() == 0 {\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 unconditionally fail.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_nullifier(\n _unique_note_hash: Field,\n _packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n _owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n panic(f\"This contract does not use private notes\")\n }\n }\n } else {\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 the correct `unpack` method from the `Packable` trait to obtain the underlying note type, and\n // compute the inner nullifier (non-siloed).\n\n // We resolve the log format calls here so that the resulting Quoted values can be spliced into the quote\n // block below.\n let warn_length_mismatch = logging::aztecnr_warn_log_format(\n \"Packed note length mismatch for note type id {0}: expected {1} fields, got {2}. Skipping note.\",\n );\n let warn_unknown_note_type = logging::aztecnr_warn_log_format(\"Unknown note type id {0}. Skipping note.\");\n\n let mut if_note_type_id_match_statements_list = @[];\n for i in 0..NOTES.len() {\n let typ = NOTES.get(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::traits::Packable },\n quote { unpack },\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 its raw storage as a fixed-size array by calling the\n // unpack function on it.\n let expected_len = <$typ as $crate::protocol::traits::Packable>::N;\n let actual_len = packed_note.len();\n if actual_len != expected_len {\n $warn_length_mismatch([note_type_id, expected_len as Field, actual_len as Field]);\n Option::none()\n } else {\n let note = $unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n\n // The message discovery process finds settled notes, that is, notes that were created in\n // prior transactions and are therefore already part of the note hash tree. The note hash\n // for nullification is hence the unique note hash.\n $compute_nullifier_unconstrained(note, owner, unique_note_hash)\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 /// Computes a note's inner nullifier (non-siloed) given its unique note hash, preimage and extra data.\n ///\n /// The signature of this function notably matches the `aztec::messages::discovery::ComputeNoteNullifier` type, and so it can be used to call functions from that module such as `do_sync_state` and `attempt_note_discovery`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[contract_library_method]\n unconstrained fn _compute_note_nullifier(\n unique_note_hash: Field,\n packed_note: BoundedVec<Field, aztec::messages::logs::note::MAX_NOTE_PACKED_LEN>,\n owner: aztec::protocol::address::AztecAddress,\n _storage_slot: Field,\n note_type_id: Field,\n _contract_address: aztec::protocol::address::AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n $if_note_type_id_match_statements\n else {\n $warn_unknown_note_type([note_type_id]);\n Option::none()\n }\n }\n }\n }\n}\n"
|
|
734
664
|
},
|
|
735
|
-
"
|
|
665
|
+
"102": {
|
|
736
666
|
"function_locations": [
|
|
737
667
|
{
|
|
738
668
|
"name": "AztecConfig::new",
|
|
@@ -766,7 +696,7 @@
|
|
|
766
696
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/aztec.nr",
|
|
767
697
|
"source": "mod compute_note_hash_and_nullifier;\n\nuse crate::{\n macros::{\n calls_generation::{\n external_functions::{generate_external_function_calls, generate_external_function_self_calls_structs},\n internal_functions::generate_call_internal_struct,\n },\n dispatch::generate_public_dispatch,\n emit_public_init_nullifier::generate_emit_public_init_nullifier,\n internals_functions_generation::{create_fn_abi_exports, process_functions},\n storage::STORAGE_LAYOUT_NAME,\n utils::{is_fn_contract_library_method, is_fn_external, is_fn_internal, is_fn_test, module_has_storage},\n },\n messages::discovery::CustomMessageHandler,\n};\n\nuse compute_note_hash_and_nullifier::generate_contract_library_methods_compute_note_hash_and_nullifier;\n\n/// Configuration for the [`aztec`] macro.\n///\n/// This type lets users override different parts of the default aztec-nr contract behavior, such\n/// as message handling. These are advanced features that require careful understanding of\n/// the behavior of these systems.\n///\n/// ## Examples\n///\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyContract { ... }\n/// ```\npub struct AztecConfig {\n custom_message_handler: Option<CustomMessageHandler<()>>,\n}\n\nimpl AztecConfig {\n /// Creates a new `AztecConfig` with default values.\n ///\n /// Calling `new` is equivalent to invoking the [`aztec`] macro with no parameters. The different methods\n /// (e.g. [`AztecConfig::custom_message_handler`]) can then be used to change the default behavior.\n pub comptime fn new() -> Self {\n Self { custom_message_handler: Option::none() }\n }\n\n /// Sets a handler for custom messages.\n ///\n /// This enables contracts to process non-standard messages (i.e. any with a message type that is not in\n /// [`crate::messages::msg_type`]).\n ///\n /// `handler` must be a function that conforms to the\n /// [`crate::messages::discovery::CustomMessageHandler`] type signature.\n pub comptime fn custom_message_handler(_self: Self, handler: CustomMessageHandler<()>) -> Self {\n Self { custom_message_handler: Option::some(handler) }\n }\n}\n\n/// Enables aztec-nr features on a `contract`.\n///\n/// All aztec-nr contracts should have this macro invoked on them, as it is the one that processes all contract\n/// functions, notes, storage, generates interfaces for external calls, and creates the message processing\n/// boilerplate.\n///\n/// ## Examples\n///\n/// Most contracts can simply invoke the macro with no parameters, resulting in default aztec-nr behavior:\n/// ```noir\n/// #[aztec]\n/// contract MyContract { ... }\n/// ```\n///\n/// Advanced contracts can use [`AztecConfig`] to customize parts of its behavior, such as message\n/// processing.\n/// ```noir\n/// #[aztec(aztec::macros::AztecConfig::new().custom_message_handler(my_handler))]\n/// contract MyAdvancedContract { ... }\n/// ```\n#[varargs]\npub comptime fn aztec(m: Module, args: [AztecConfig]) -> Quoted {\n let num_args = args.len();\n let config = if num_args == 0 {\n AztecConfig::new()\n } else if num_args == 1 {\n args[0]\n } else {\n panic(f\"#[aztec] expects 0 or 1 arguments, got {num_args}\")\n };\n\n // Functions that don't have #[external(...)], #[contract_library_method], or #[test] are not allowed in contracts.\n check_each_fn_macroified(m);\n\n // We generate new functions prefixed with `__aztec_nr_internals__` and we replace the original functions' bodies\n // with `static_assert(false, ...)` to prevent them from being called directly from within the contract.\n let functions = process_functions(m);\n\n // We generate structs and their implementations necessary for convenient functions calls.\n let interface = generate_contract_interface(m);\n let self_call_structs = generate_external_function_self_calls_structs(m);\n let call_internal_struct = generate_call_internal_struct(m);\n\n // We generate ABI exports for all the external functions in the contract.\n let fn_abi_exports = create_fn_abi_exports(m);\n\n // We generate `_compute_note_hash`, `_compute_note_nullifier` (and the deprecated\n // `_compute_note_hash_and_nullifier` wrapper) and `sync_state` functions only if they are not already implemented.\n // If they are implemented we just insert empty quotes.\n let contract_library_method_compute_note_hash_and_nullifier = if !m.functions().any(|f| {\n // Note that we don't test for `_compute_note_hash` or `_compute_note_nullifier` in order to make this simpler\n // - users must either implement all three or none.\n // Down the line we'll remove this check and use `AztecConfig`.\n f.name() == quote { _compute_note_hash_and_nullifier }\n }) {\n generate_contract_library_methods_compute_note_hash_and_nullifier()\n } else {\n quote {}\n };\n let process_custom_message_option = if config.custom_message_handler.is_some() {\n let handler = config.custom_message_handler.unwrap();\n quote { Option::some($handler) }\n } else {\n quote { Option::<aztec::messages::discovery::CustomMessageHandler<()>>::none() }\n };\n\n let offchain_inbox_sync_option = quote {\n Option::some(aztec::messages::processing::offchain::sync_inbox)\n };\n\n let sync_state_fn_and_abi_export = if !m.functions().any(|f| f.name() == quote { sync_state }) {\n generate_sync_state(process_custom_message_option, offchain_inbox_sync_option)\n } else {\n quote {}\n };\n\n if m.functions().any(|f| f.name() == quote { offchain_receive }) {\n panic(\n \"User-defined 'offchain_receive' is not allowed. The function is auto-injected by the #[aztec] macro. See https://docs.aztec.network/errors/7\",\n );\n }\n let offchain_receive_fn_and_abi_export = generate_offchain_receive();\n\n let (has_public_init_nullifier_fn, emit_public_init_nullifier_fn_body) = generate_emit_public_init_nullifier(m);\n let public_dispatch = generate_public_dispatch(m, has_public_init_nullifier_fn);\n\n quote {\n $interface\n $self_call_structs\n $call_internal_struct\n $functions\n $fn_abi_exports\n $contract_library_method_compute_note_hash_and_nullifier\n $public_dispatch\n $sync_state_fn_and_abi_export\n $emit_public_init_nullifier_fn_body\n $offchain_receive_fn_and_abi_export\n }\n}\n\ncomptime fn generate_contract_interface(m: Module) -> Quoted {\n let calls = generate_external_function_calls(m);\n\n let module_name = m.name();\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: aztec::protocol::address::AztecAddress\n }\n\n impl $module_name {\n $calls\n\n pub fn at(\n addr: aztec::protocol::address::AztecAddress\n ) -> Self {\n Self { target_contract: addr }\n }\n\n pub fn interface() -> Self {\n Self { target_contract: aztec::protocol::address::AztecAddress::zero() }\n }\n\n $storage_layout_getter\n }\n\n #[contract_library_method]\n pub fn at(\n addr: aztec::protocol::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::address::AztecAddress::zero() }\n }\n\n $library_storage_layout_getter\n\n }\n}\n\n/// Generates the `sync_state` utility function that performs message discovery.\ncomptime fn generate_sync_state(process_custom_message_option: Quoted, offchain_inbox_sync_option: Quoted) -> Quoted {\n quote {\n pub struct sync_state_parameters {\n pub scope: aztec::protocol::address::AztecAddress,\n }\n\n #[abi(functions)]\n pub struct sync_state_abi {\n parameters: sync_state_parameters,\n }\n\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn sync_state(scope: aztec::protocol::address::AztecAddress) {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::discovery::do_sync_state(\n address,\n _compute_note_hash,\n _compute_note_nullifier,\n $process_custom_message_option,\n $offchain_inbox_sync_option,\n scope,\n );\n }\n }\n}\n\n/// Generates an `offchain_receive` utility function that lets callers add messages to the offchain message inbox.\n///\n/// For more details, see `aztec::messages::processing::offchain::receive`.\ncomptime fn generate_offchain_receive() -> Quoted {\n quote {\n pub struct offchain_receive_parameters {\n pub messages: BoundedVec<\n aztec::messages::processing::offchain::OffchainMessage,\n aztec::messages::processing::offchain::MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL,\n >,\n }\n\n #[abi(functions)]\n pub struct offchain_receive_abi {\n parameters: offchain_receive_parameters,\n }\n\n /// Receives offchain messages into this contract's offchain inbox for subsequent processing.\n ///\n /// Each message is routed to the inbox scoped to its `recipient` field.\n ///\n /// For more details, see `aztec::messages::processing::offchain::receive`.\n ///\n /// This function is automatically injected by the `#[aztec]` macro.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_utility]\n unconstrained fn offchain_receive(\n messages: BoundedVec<\n aztec::messages::processing::offchain::OffchainMessage,\n aztec::messages::processing::offchain::MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL,\n >,\n ) {\n let address = aztec::context::UtilityContext::new().this_address();\n aztec::messages::processing::offchain::receive(address, messages);\n }\n }\n}\n\n/// Checks that all functions in the module have a context macro applied.\n///\n/// Non-macroified functions are not allowed in contracts. They must all be one of\n/// [`crate::macros::functions::external`], [`crate::macros::functions::internal`] or `test`.\ncomptime fn check_each_fn_macroified(m: Module) {\n for f in m.functions() {\n let name = f.name();\n if !is_fn_external(f) & !is_fn_contract_library_method(f) & !is_fn_internal(f) & !is_fn_test(f) {\n // We don't suggest that #[contract_library_method] is allowed because we don't want to introduce another\n // concept\n panic(\n f\"Function {name} must be marked as either #[external(...)], #[internal(...)], or #[test]\",\n );\n }\n }\n}\n"
|
|
768
698
|
},
|
|
769
|
-
"
|
|
699
|
+
"107": {
|
|
770
700
|
"function_locations": [
|
|
771
701
|
{
|
|
772
702
|
"name": "generate_public_dispatch",
|
|
@@ -780,7 +710,7 @@
|
|
|
780
710
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/dispatch.nr",
|
|
781
711
|
"source": "use crate::macros::internals_functions_generation::external_functions_registry::get_public_functions;\nuse crate::protocol::meta::utils::get_params_len_quote;\nuse crate::utils::cmap::CHashMap;\nuse super::functions::initialization_utils::EMIT_PUBLIC_INIT_NULLIFIER_FN_NAME;\nuse super::utils::compute_fn_selector;\nuse std::panic;\n\n/// Generates a `public_dispatch` function for an Aztec contract module `m`.\n///\n/// The generated function dispatches public calls based on selector to the appropriate contract function. If\n/// `generate_emit_public_init_nullifier` is true, it also handles dispatch to the macro-generated\n/// `__emit_public_init_nullifier` function.\npub comptime fn generate_public_dispatch(m: Module, generate_emit_public_init_nullifier: bool) -> Quoted {\n let functions = get_public_functions(m);\n\n let unit = get_type::<()>();\n\n let seen_selectors = &mut CHashMap::<Field, Quoted>::new();\n\n let mut ifs = functions.map(|function: FunctionDefinition| {\n let parameters = function.parameters();\n let return_type = function.return_type();\n\n let fn_name = function.name();\n let selector: Field = compute_fn_selector(fn_name, parameters);\n\n // Since function selectors are computed as the first 4 bytes of the hash of the function signature, it's\n // possible to have collisions. With the following check, we ensure it doesn't happen within the same contract.\n let existing_fn = seen_selectors.get(selector);\n if existing_fn.is_some() {\n let existing_fn = existing_fn.unwrap();\n panic(\n f\"Public function selector collision detected between functions '{fn_name}' and '{existing_fn}'\",\n );\n }\n seen_selectors.insert(selector, fn_name);\n\n let params_len_quote = get_params_len_quote(parameters);\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 The expected calldata is the\n // serialization of\n // - FunctionSelector: the selector of the function intended to dispatch\n // - Parameters: the parameters of the function intended to dispatch That is, exactly what is expected for\n // a call to the target function, but with a selector added at the beginning.\n quote {\n let input_calldata: [Field; $params_len_quote] = aztec::oracle::avm::calldata_copy(1, $params_len_quote);\n let mut reader = aztec::protocol::utils::reader::Reader::new(input_calldata);\n }\n };\n\n let parameter_index: &mut u32 = &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 = aztec::protocol::traits::Deserialize::stream_deserialize(&mut reader);\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 // We call a function whose name is prefixed with `__aztec_nr_internals__`. This is necessary because the\n // original function is intentionally made uncallable, preventing direct invocation within the contract.\n // Instead, a new function with the same name, but prefixed by `__aztec_nr_internals__`, has been generated to\n // be called here. For more details see the `process_functions` function.\n let name = f\"__aztec_nr_internals__{fn_name}\".quoted_contents();\n let args = args.join(quote { , });\n let call = quote { $name($args) };\n\n let return_code = if return_type == unit {\n quote {\n $call;\n // Force early return.\n aztec::oracle::avm::avm_return([]);\n }\n } else {\n quote {\n let return_value = aztec::protocol::traits::Serialize::serialize($call);\n aztec::oracle::avm::avm_return(return_value.as_vector());\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 we injected the auto-generated public function to emit the public initialization nullifier, then\n // we'll also need to handle its dispatch.\n if generate_emit_public_init_nullifier {\n let name = EMIT_PUBLIC_INIT_NULLIFIER_FN_NAME;\n let init_nullifier_selector: Field = compute_fn_selector(name, @[]);\n\n ifs = ifs.push_back(\n quote {\n if selector == $init_nullifier_selector {\n $name();\n aztec::oracle::avm::avm_return([]);\n }\n },\n );\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 functions having this attribute.\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n pub unconstrained fn public_dispatch(selector: Field) {\n $dispatch\n }\n };\n\n body\n }\n}\n\ncomptime fn get_type<T>() -> Type {\n let t: T = std::mem::zeroed();\n std::meta::type_of(t)\n}\n"
|
|
782
712
|
},
|
|
783
|
-
"
|
|
713
|
+
"118": {
|
|
784
714
|
"function_locations": [
|
|
785
715
|
{
|
|
786
716
|
"name": "generate_public_external",
|
|
@@ -790,29 +720,29 @@
|
|
|
790
720
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/macros/internals_functions_generation/external/public.nr",
|
|
791
721
|
"source": "use crate::macros::{\n internals_functions_generation::external::helpers::{create_authorize_once_check, get_abi_relevant_attributes},\n utils::{\n fn_has_authorize_once, fn_has_noinitcheck, is_fn_initializer, is_fn_only_self, is_fn_view,\n module_has_initializer, module_has_storage,\n },\n};\n\npub(crate) comptime fn generate_public_external(f: FunctionDefinition) -> Quoted {\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\n let args_len_quote = if original_params.len() == 0 {\n // If the function has no parameters, we set the args_len to 0.\n quote { 0 }\n } else {\n // The following will give us <type_of_struct_member_1 as Serialize>::N + <type_of_struct_member_2 as\n // Serialize>::N + ...\n original_params\n .map(|(_, param_type): (Quoted, Type)| {\n quote {\n <$param_type as $crate::protocol::traits::Serialize>::N\n }\n })\n .join(quote {+})\n };\n\n let storage_init = if module_has_storage {\n quote {\n let storage = Storage::init(context);\n }\n } else {\n // Contract does not have Storage defined, so we set storage to the unit type `()`. ContractSelfPublic requires\n // a storage struct in its constructor. Using an Option type would lead to worse developer experience and\n // higher constraint counts so we use the unit type `()` instead.\n quote {\n let storage = ();\n }\n };\n\n // Unlike in the private case, in public the `context` does not need to receive the hash of the original params.\n let contract_self_creation = quote {\n #[allow(unused_variables)]\n let mut self = {\n let context = aztec::context::PublicContext::new(|| {\n // We start from 1 because we skip the selector for the dispatch function.\n let serialized_args : [Field; $args_len_quote] = aztec::oracle::avm::calldata_copy(1, $args_len_quote);\n aztec::hash::hash_args(serialized_args)\n });\n $storage_init\n let self_address = context.this_address();\n let call_self: CallSelf<aztec::context::PublicContext> = CallSelf { address: self_address, context };\n let call_self_static: CallSelfStatic<aztec::context::PublicContext> = CallSelfStatic { address: self_address, context };\n let internal: CallInternal<aztec::context::PublicContext> = CallInternal { context };\n aztec::contract_self::ContractSelfPublic::new(context, storage, call_self, call_self_static, internal)\n };\n };\n\n let original_function_name = f.name();\n\n // Modifications introduced by the different marker attributes.\n let internal_check = if is_fn_only_self(f) {\n let assertion_message = f\"Function {original_function_name} can only be called by the same contract\";\n quote { assert(self.msg_sender() == self.address, $assertion_message); }\n } else {\n quote {}\n };\n\n let view_check = if is_fn_view(f) {\n let assertion_message = f\"Function {original_function_name} can only be called statically\".as_quoted_str();\n quote { assert(self.context.is_static_call(), $assertion_message); }\n } else {\n quote {}\n };\n\n let (assert_initializer, mark_as_initialized) = if is_fn_initializer(f) {\n (\n quote { aztec::macros::functions::initialization_utils::assert_initialization_matches_address_preimage_public(self.context); },\n quote { aztec::macros::functions::initialization_utils::mark_as_initialized_from_public_initializer(self.context); },\n )\n } else {\n (quote {}, 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 quote { aztec::macros::functions::initialization_utils::assert_is_initialized_public(self.context); }\n } else {\n quote {}\n };\n\n // Inject the authwit check if the function is marked with #[authorize_once].\n let authorize_once_check = if fn_has_authorize_once(f) {\n create_authorize_once_check(f, false)\n } else {\n quote {}\n };\n\n let to_prepend = quote {\n $contract_self_creation\n $assert_initializer\n $init_check\n $internal_check\n $view_check\n $authorize_once_check\n };\n\n // `mark_as_initialized` is placed after the user's function body. If it ran at the beginning, the contract\n // would appear initialized while the initializer is still running, allowing contracts called by the initializer\n // to re-enter into a half-initialized contract.\n let to_append = quote {\n $mark_as_initialized\n };\n\n let fn_name = f\"__aztec_nr_internals__{original_function_name}\".quoted_contents();\n let body = f.body();\n let return_type = f.return_type();\n\n // New function parameters are the same as the original function's ones.\n let params = original_params.map(|(param_name, param_type)| quote { $param_name: $param_type }).join(quote {, });\n\n // Preserve all attributes that are relevant to the function's ABI.\n let abi_relevant_attributes = get_abi_relevant_attributes(f);\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 quote {\n #[aztec::macros::internals_functions_generation::abi_attributes::abi_public]\n $abi_relevant_attributes\n unconstrained fn $fn_name($params) -> pub $return_type {\n $to_prepend\n $body\n $to_append\n }\n }\n}\n"
|
|
792
722
|
},
|
|
793
|
-
"
|
|
723
|
+
"128": {
|
|
794
724
|
"function_locations": [
|
|
795
725
|
{
|
|
796
726
|
"name": "do_sync_state",
|
|
797
|
-
"start":
|
|
727
|
+
"start": 6465
|
|
798
728
|
},
|
|
799
729
|
{
|
|
800
730
|
"name": "test::do_sync_state_does_not_panic_on_empty_logs",
|
|
801
|
-
"start":
|
|
731
|
+
"start": 9175
|
|
802
732
|
},
|
|
803
733
|
{
|
|
804
734
|
"name": "test::dummy_compute_note_hash",
|
|
805
|
-
"start":
|
|
735
|
+
"start": 10673
|
|
806
736
|
},
|
|
807
737
|
{
|
|
808
738
|
"name": "test::dummy_compute_note_nullifier",
|
|
809
|
-
"start":
|
|
739
|
+
"start": 11034
|
|
810
740
|
}
|
|
811
741
|
],
|
|
812
742
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/mod.nr",
|
|
813
|
-
"source": "use crate::logging::{aztecnr_debug_log, aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::address::AztecAddress;\n\npub(crate) mod nonce_discovery;\npub(crate) mod partial_notes;\npub(crate) mod private_events;\npub mod private_notes;\npub mod process_message;\n\nuse crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::process_message::process_message_ciphertext,\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::note::MAX_NOTE_PACKED_LEN,\n processing::{\n get_private_logs, MessageContext, offchain::OffchainInboxSync, OffchainMessageWithContext,\n pending_tagged_log::PendingTaggedLog, validate_and_store_enqueued_notes_and_events,\n },\n },\n utils::array,\n};\n\npub struct NoteHashAndNullifier {\n /// The result of [`crate::note::note_interface::NoteHash::compute_note_hash`].\n pub note_hash: Field,\n /// The result of [`crate::note::note_interface::NoteHash::compute_nullifier_unconstrained`].\n ///\n /// This value is unconstrained, as all of message discovery is unconstrained. It is `None` if the nullifier\n /// cannot be computed (e.g. because the nullifier hiding key is not available).\n pub inner_nullifier: Option<Field>,\n}\n\n/// A contract's way of computing note hashes.\n///\n/// Each contract in the network is free to compute their note's hash as they see fit - the hash function itself is not\n/// enshrined or standardized. Some aztec-nr functions however do need to know the details of this computation (e.g.\n/// when finding new notes), which is what this type represents.\n///\n/// This function takes a note's packed content, storage slot, note type ID, address of the emitting contract and\n/// randomness, and attempts to compute its inner note hash (not siloed by address nor uniqued by nonce).\n///\n/// ## Transient Notes\n///\n/// This function is meant to always be used on **settled** notes, i.e. those that have been inserted into the trees\n/// and for which the nonce is known. It is never invoked in the context of a transient note, as those are not involved\n/// in message processing.\n///\n/// ## Automatic Implementation\n///\n/// The [`[#aztec]`](crate::macros::aztec::aztec) macro automatically creates a correct implementation of this function\n/// for each contract by inspecting all note types in use and the storage layout. This injected function is a\n/// `#[contract_library_method]` called `_compute_note_hash`, and it looks something like this:\n///\n/// ```noir\n/// |packed_note, owner, storage_slot, note_type_id, _contract_address, randomness| {\n/// if note_type_id == MyNoteType::get_id() {\n/// if packed_note.len() != MY_NOTE_TYPE_SERIALIZATION_LENGTH {\n/// Option::none()\n/// } else {\n/// let note = MyNoteType::unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n/// Option::some(note.compute_note_hash(owner, storage_slot, randomness))\n/// }\n/// } else if note_type_id == MyOtherNoteType::get_id() {\n/// ... // Similar to above but calling MyOtherNoteType::unpack\n/// } else {\n/// Option::none() // Unknown note type ID\n/// };\n/// }\n/// ```\npub type ComputeNoteHash = unconstrained fn(/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>, /*\n owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress, /*\nrandomness */ Field) -> Option<Field>;\n\n/// A contract's way of computing note nullifiers.\n///\n/// Like [`ComputeNoteHash`], each contract is free to derive nullifiers as they see fit. This function takes the\n/// unique note hash (used as the note hash for nullification for settled notes), plus the note's packed content and\n/// metadata, and attempts to compute the inner nullifier (not siloed by address).\n///\n/// ## Automatic Implementation\n///\n/// The [`[#aztec]`](crate::macros::aztec::aztec) macro automatically creates a correct implementation of this function\n/// for each contract called `_compute_note_nullifier`. It dispatches on `note_type_id` similarly to\n/// [`ComputeNoteHash`], then calls the note's\n/// [`compute_nullifier_unconstrained`](crate::note::note_interface::NoteHash::compute_nullifier_unconstrained) method.\npub type ComputeNoteNullifier = unconstrained fn(/* unique_note_hash */Field, /* packed_note */ BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n/* owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress,\n/* randomness */ Field) -> Option<Field>;\n\n/// Deprecated: use [`ComputeNoteHash`] and [`ComputeNoteNullifier`] instead.\npub type ComputeNoteHashAndNullifier<Env> = unconstrained fn[Env](/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n/* owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress,\n/*randomness */ Field, /* note nonce */ Field) -> Option<NoteHashAndNullifier>;\n\n/// A handler for custom messages.\n///\n/// Contracts that emit custom messages (i.e. any with a message type that is not in [`crate::messages::msg_type`])\n/// need to use [`crate::macros::AztecConfig::custom_message_handler`] with a function of this type in order to\n/// process them. They will otherwise be **silently ignored**.\npub type CustomMessageHandler<Env> = unconstrained fn[Env](\n/* contract_address */AztecAddress,\n/* msg_type_id */ u64,\n/* msg_metadata */ u64,\n/* msg_content */ BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n/* message_context */ MessageContext,\n/* scope */ AztecAddress);\n\n/// Synchronizes the contract's private state with the network.\n///\n/// As blocks are mined, it is possible for a contract's private state to change (e.g. with new notes being created),\n/// but because these changes are private they will be invisible to most actors. This is the function that processes\n/// new transactions in order to discover new notes, events, and other kinds of private state changes.\n///\n/// The private state will be synchronized up to the block that will be used for private transactions (i.e. the anchor\n/// block. This will typically be close to the tip of the chain.\npub unconstrained fn do_sync_state<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n offchain_inbox_sync: Option<OffchainInboxSync<()>>,\n scope: AztecAddress,\n) {\n aztecnr_debug_log!(\"Performing state synchronization\");\n\n // First we process all private logs, which can contain different kinds of messages e.g. private notes, partial\n // notes, private events, etc.\n let logs = get_private_logs(contract_address, scope);\n logs.for_each(|i, pending_tagged_log: PendingTaggedLog| {\n if pending_tagged_log.log.len() == 0 {\n aztecnr_warn_log_format!(\"Skipping empty log from tx {0}\")([pending_tagged_log.context.tx_hash]);\n } else {\n aztecnr_debug_log_format!(\"Processing log with tag {0}\")([pending_tagged_log.log.get(0)]);\n\n // We remove the tag from the pending tagged log and process the message ciphertext contained in it.\n let message_ciphertext = array::subbvec(pending_tagged_log.log, 1);\n\n process_message_ciphertext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n message_ciphertext,\n pending_tagged_log.context,\n scope,\n );\n }\n\n // We need to delete each log from the array so that we won't process them again. `CapsuleArray::for_each`\n // allows deletion of the current element during iteration, so this is safe.\n // Note that this (and all other database changes) will only be committed if contract execution succeeds,\n // including any enqueued validation requests.\n logs.remove(i);\n });\n\n if offchain_inbox_sync.is_some() {\n let msgs: CapsuleArray<OffchainMessageWithContext> = offchain_inbox_sync.unwrap()(contract_address, scope);\n msgs.for_each(|i, msg| {\n process_message_ciphertext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n msg.message_ciphertext,\n msg.message_context,\n scope,\n );\n // The inbox sync returns _a copy_ of messages to process, so we clear them as we do so. This is a\n // volatile array with the to-process message, not the actual persistent storage of them.\n msgs.remove(i);\n });\n }\n\n // Then we process all pending partial notes, regardless of whether they were found in the current or previous\n // executions.\n partial_notes::fetch_and_process_partial_note_completion_logs(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n scope,\n );\n\n // Finally we validate all notes and events that were found as part of the previous processes, resulting in them\n // being added to PXE's database and retrievable via oracles (get_notes) and our TS API (PXE::getPrivateEvents).\n validate_and_store_enqueued_notes_and_events(contract_address, scope);\n}\n\nmod test {\n use crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::{CustomMessageHandler, do_sync_state},\n logs::note::MAX_NOTE_PACKED_LEN,\n processing::{\n offchain::OffchainInboxSync, pending_tagged_log::PendingTaggedLog, PENDING_TAGGED_LOG_ARRAY_BASE_SLOT,\n },\n },\n test::helpers::test_environment::TestEnvironment,\n };\n use crate::protocol::address::AztecAddress;\n\n global SCOPE: AztecAddress = AztecAddress { inner: 0xcafe };\n\n #[test]\n unconstrained fn do_sync_state_does_not_panic_on_empty_logs() {\n let env = TestEnvironment::new();\n\n let contract_address = AztecAddress { inner: 0xdeadbeef };\n\n env.utility_context_at(contract_address, |_| {\n let base_slot = PENDING_TAGGED_LOG_ARRAY_BASE_SLOT;\n\n let logs: CapsuleArray<PendingTaggedLog> = CapsuleArray::at(contract_address, base_slot, SCOPE);\n logs.push(PendingTaggedLog { log: BoundedVec::new(), context: std::mem::zeroed() });\n assert_eq(logs.len(), 1);\n\n let no_handler: Option<CustomMessageHandler<()>> = Option::none();\n let no_inbox_sync: Option<OffchainInboxSync<()>> = Option::none();\n do_sync_state(\n contract_address,\n dummy_compute_note_hash,\n dummy_compute_note_nullifier,\n no_handler,\n no_inbox_sync,\n SCOPE,\n );\n\n assert_eq(logs.len(), 0);\n });\n }\n\n unconstrained fn dummy_compute_note_hash(\n _packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n _owner: AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n Option::none()\n }\n\n unconstrained fn dummy_compute_note_nullifier(\n _unique_note_hash: Field,\n _packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n _owner: AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n Option::none()\n }\n}\n"
|
|
743
|
+
"source": "use crate::logging::{aztecnr_debug_log, aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::address::AztecAddress;\n\npub(crate) mod nonce_discovery;\npub(crate) mod partial_notes;\npub(crate) mod private_events;\npub mod private_notes;\npub mod process_message;\n\nuse crate::{\n messages::{\n discovery::process_message::process_message_ciphertext,\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::note::MAX_NOTE_PACKED_LEN,\n processing::{\n MessageContext, offchain::OffchainInboxSync, OffchainMessageWithContext,\n pending_tagged_log::PendingTaggedLog, validate_and_store_enqueued_notes_and_events,\n },\n },\n oracle::message_processing,\n utils::array,\n};\n\npub struct NoteHashAndNullifier {\n /// The result of [`crate::note::note_interface::NoteHash::compute_note_hash`].\n pub note_hash: Field,\n /// The result of [`crate::note::note_interface::NoteHash::compute_nullifier_unconstrained`].\n ///\n /// This value is unconstrained, as all of message discovery is unconstrained. It is `None` if the nullifier\n /// cannot be computed (e.g. because the nullifier hiding key is not available).\n pub inner_nullifier: Option<Field>,\n}\n\n/// A contract's way of computing note hashes.\n///\n/// Each contract in the network is free to compute their note's hash as they see fit - the hash function itself is not\n/// enshrined or standardized. Some aztec-nr functions however do need to know the details of this computation (e.g.\n/// when finding new notes), which is what this type represents.\n///\n/// This function takes a note's packed content, storage slot, note type ID, address of the emitting contract and\n/// randomness, and attempts to compute its inner note hash (not siloed by address nor uniqued by nonce).\n///\n/// ## Transient Notes\n///\n/// This function is meant to always be used on **settled** notes, i.e. those that have been inserted into the trees\n/// and for which the nonce is known. It is never invoked in the context of a transient note, as those are not involved\n/// in message processing.\n///\n/// ## Automatic Implementation\n///\n/// The [`[#aztec]`](crate::macros::aztec::aztec) macro automatically creates a correct implementation of this function\n/// for each contract by inspecting all note types in use and the storage layout. This injected function is a\n/// `#[contract_library_method]` called `_compute_note_hash`, and it looks something like this:\n///\n/// ```noir\n/// |packed_note, owner, storage_slot, note_type_id, _contract_address, randomness| {\n/// if note_type_id == MyNoteType::get_id() {\n/// if packed_note.len() != MY_NOTE_TYPE_SERIALIZATION_LENGTH {\n/// Option::none()\n/// } else {\n/// let note = MyNoteType::unpack(aztec::utils::array::subarray(packed_note.storage(), 0));\n/// Option::some(note.compute_note_hash(owner, storage_slot, randomness))\n/// }\n/// } else if note_type_id == MyOtherNoteType::get_id() {\n/// ... // Similar to above but calling MyOtherNoteType::unpack\n/// } else {\n/// Option::none() // Unknown note type ID\n/// };\n/// }\n/// ```\npub type ComputeNoteHash = unconstrained fn(/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>, /*\n owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress, /*\nrandomness */ Field) -> Option<Field>;\n\n/// A contract's way of computing note nullifiers.\n///\n/// Like [`ComputeNoteHash`], each contract is free to derive nullifiers as they see fit. This function takes the\n/// unique note hash (used as the note hash for nullification for settled notes), plus the note's packed content and\n/// metadata, and attempts to compute the inner nullifier (not siloed by address).\n///\n/// ## Automatic Implementation\n///\n/// The [`[#aztec]`](crate::macros::aztec::aztec) macro automatically creates a correct implementation of this function\n/// for each contract called `_compute_note_nullifier`. It dispatches on `note_type_id` similarly to\n/// [`ComputeNoteHash`], then calls the note's\n/// [`compute_nullifier_unconstrained`](crate::note::note_interface::NoteHash::compute_nullifier_unconstrained) method.\npub type ComputeNoteNullifier = unconstrained fn(/* unique_note_hash */Field, /* packed_note */ BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n/* owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress,\n/* randomness */ Field) -> Option<Field>;\n\n/// Deprecated: use [`ComputeNoteHash`] and [`ComputeNoteNullifier`] instead.\npub type ComputeNoteHashAndNullifier<Env> = unconstrained fn[Env](/* packed_note */BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n/* owner */ AztecAddress, /* storage_slot */ Field, /* note_type_id */ Field, /* contract_address */ AztecAddress,\n/*randomness */ Field, /* note nonce */ Field) -> Option<NoteHashAndNullifier>;\n\n/// A handler for custom messages.\n///\n/// Contracts that emit custom messages (i.e. any with a message type that is not in [`crate::messages::msg_type`])\n/// need to use [`crate::macros::AztecConfig::custom_message_handler`] with a function of this type in order to\n/// process them. They will otherwise be **silently ignored**.\npub type CustomMessageHandler<Env> = unconstrained fn[Env](\n/* contract_address */AztecAddress,\n/* msg_type_id */ u64,\n/* msg_metadata */ u64,\n/* msg_content */ BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n/* message_context */ MessageContext,\n/* scope */ AztecAddress);\n\n/// Synchronizes the contract's private state with the network.\n///\n/// As blocks are mined, it is possible for a contract's private state to change (e.g. with new notes being created),\n/// but because these changes are private they will be invisible to most actors. This is the function that processes\n/// new transactions in order to discover new notes, events, and other kinds of private state changes.\n///\n/// The private state will be synchronized up to the block that will be used for private transactions (i.e. the anchor\n/// block. This will typically be close to the tip of the chain.\npub unconstrained fn do_sync_state<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n offchain_inbox_sync: Option<OffchainInboxSync<()>>,\n scope: AztecAddress,\n) {\n aztecnr_debug_log!(\"Performing state synchronization\");\n\n // First we process all private logs, which can contain different kinds of messages e.g. private notes, partial\n // notes, private events, etc.\n let logs = message_processing::get_pending_tagged_logs(scope);\n logs.for_each(|_i, pending_tagged_log: PendingTaggedLog| {\n if pending_tagged_log.log.len() == 0 {\n aztecnr_warn_log_format!(\"Skipping empty log from tx {0}\")([pending_tagged_log.context.tx_hash]);\n } else {\n aztecnr_debug_log_format!(\"Processing log with tag {0}\")([pending_tagged_log.log.get(0)]);\n\n // We remove the tag from the pending tagged log and process the message ciphertext contained in it.\n let message_ciphertext = array::subbvec(pending_tagged_log.log, 1);\n\n process_message_ciphertext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n message_ciphertext,\n pending_tagged_log.context,\n scope,\n );\n }\n });\n\n if offchain_inbox_sync.is_some() {\n let msgs = offchain_inbox_sync.unwrap()(contract_address, scope);\n msgs.for_each(|_i, msg: OffchainMessageWithContext| {\n process_message_ciphertext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n msg.message_ciphertext,\n msg.message_context,\n scope,\n );\n });\n }\n\n // Then we process all pending partial notes, regardless of whether they were found in the current or previous\n // executions.\n partial_notes::fetch_and_process_partial_note_completion_logs(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n scope,\n );\n\n // Finally we validate all notes and events that were found as part of the previous processes, resulting in them\n // being added to PXE's database and retrievable via oracles (get_notes) and our TS API (PXE::getPrivateEvents).\n validate_and_store_enqueued_notes_and_events(scope);\n}\n\nmod test {\n use crate::ephemeral::EphemeralArray;\n use crate::messages::{\n discovery::{CustomMessageHandler, do_sync_state},\n logs::note::MAX_NOTE_PACKED_LEN,\n processing::{offchain::OffchainInboxSync, pending_tagged_log::PendingTaggedLog},\n };\n use crate::protocol::address::AztecAddress;\n use crate::test::helpers::test_environment::TestEnvironment;\n\n #[test]\n unconstrained fn do_sync_state_does_not_panic_on_empty_logs() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n\n let contract_address = AztecAddress { inner: 0xdeadbeef };\n\n env.utility_context_at(contract_address, |_| {\n // Mock the oracle call to return a known base slot, then populate an ephemeral\n // array at that slot so do_sync_state processes a non-empty log list.\n let base_slot = 42;\n let mock = std::test::OracleMock::mock(\"aztec_utl_getPendingTaggedLogs_v2\");\n let _ = mock.returns(base_slot);\n\n let logs: EphemeralArray<PendingTaggedLog> = EphemeralArray::at(base_slot);\n logs.push(PendingTaggedLog { log: BoundedVec::new(), context: std::mem::zeroed() });\n assert_eq(logs.len(), 1);\n\n let no_handler: Option<CustomMessageHandler<()>> = Option::none();\n let no_inbox_sync: Option<OffchainInboxSync<()>> = Option::none();\n do_sync_state(\n contract_address,\n dummy_compute_note_hash,\n dummy_compute_note_nullifier,\n no_handler,\n no_inbox_sync,\n scope,\n );\n });\n }\n\n unconstrained fn dummy_compute_note_hash(\n _packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n _owner: AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n Option::none()\n }\n\n unconstrained fn dummy_compute_note_nullifier(\n _unique_note_hash: Field,\n _packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n _owner: AztecAddress,\n _storage_slot: Field,\n _note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n Option::none()\n }\n}\n"
|
|
814
744
|
},
|
|
815
|
-
"
|
|
745
|
+
"129": {
|
|
816
746
|
"function_locations": [
|
|
817
747
|
{
|
|
818
748
|
"name": "attempt_note_nonce_discovery",
|
|
@@ -870,7 +800,7 @@
|
|
|
870
800
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/nonce_discovery.nr",
|
|
871
801
|
"source": "use crate::messages::{discovery::{ComputeNoteHash, ComputeNoteNullifier}, logs::note::MAX_NOTE_PACKED_LEN};\n\nuse crate::logging::{aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::{\n address::AztecAddress,\n constants::MAX_NOTE_HASHES_PER_TX,\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(crate) struct DiscoveredNoteInfo {\n pub(crate) note_nonce: Field,\n pub(crate) note_hash: Field,\n pub(crate) 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(crate) unconstrained fn attempt_note_nonce_discovery(\n unique_note_hashes_in_tx: BoundedVec<Field, MAX_NOTE_HASHES_PER_TX>,\n first_nullifier_in_tx: Field,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n contract_address: AztecAddress,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: 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 aztecnr_debug_log_format!(\n \"Attempting nonce discovery on {0} potential notes on contract {1} for storage slot {2}\",\n )(\n [unique_note_hashes_in_tx.len() as Field, contract_address.to_field(), storage_slot],\n );\n\n let maybe_note_hash = compute_note_hash(\n packed_note,\n owner,\n storage_slot,\n note_type_id,\n contract_address,\n randomness,\n );\n\n if maybe_note_hash.is_none() {\n aztecnr_warn_log_format!(\n \"Unable to compute note hash for note of id {0} with packed length {1}, skipping nonce discovery\",\n )(\n [note_type_id, packed_note.len() as Field],\n );\n } else {\n let note_hash = maybe_note_hash.unwrap();\n let siloed_note_hash = compute_siloed_note_hash(contract_address, note_hash);\n\n // We need to find nonces (typically just one) that result in the siloed note hash that being uniqued into one\n // of the transaction's effects.\n // The nonce is meant to be derived from the index of the note hash in the transaction effects array. However,\n // due to an issue in the kernels the nonce might actually use any of the possible note hash indices - not\n // necessarily the one that corresponds to the note hash. Hence, we need to try them all.\n for i in 0..MAX_NOTE_HASHES_PER_TX {\n let nonce_for_i = compute_note_hash_nonce(first_nullifier_in_tx, i);\n let unique_note_hash_for_i = compute_unique_note_hash(nonce_for_i, siloed_note_hash);\n\n let matching_notes = bvec_filter(\n unique_note_hashes_in_tx,\n |unique_note_hash_in_tx| unique_note_hash_in_tx == unique_note_hash_for_i,\n );\n if matching_notes.len() > 1 {\n let identical_note_hashes = matching_notes.len();\n // Note that we don't actually check that the note hashes array contains unique values, only that the\n // note we found is unique. We don't expect for this to ever happen (it'd indicate a malicious node or\n // PXE, which are both assumed to be cooperative) so testing for it just in case is unnecessary, but we\n // _do_ need to handle it if we find a duplicate.\n panic(\n f\"Received {identical_note_hashes} identical note hashes for a transaction - these should all be unique\",\n )\n } else if matching_notes.len() == 1 {\n let maybe_inner_nullifier_for_i = compute_note_nullifier(\n unique_note_hash_for_i,\n packed_note,\n owner,\n storage_slot,\n note_type_id,\n contract_address,\n randomness,\n );\n\n if maybe_inner_nullifier_for_i.is_none() {\n // TODO: down the line we want to be able to store notes for which we don't know their nullifier,\n // e.g. notes that belong to someone that is not us (and for which we therefore don't know their\n // associated app-siloed nullifer hiding secret key).\n // https://linear.app/aztec-labs/issue/F-265/store-external-notes\n aztecnr_warn_log_format!(\n \"Unable to compute nullifier of unique note {0} with note type id {1} and owner {2}, skipping PXE insertion\",\n )(\n [unique_note_hash_for_i, note_type_id, owner.to_field()],\n );\n } else {\n // Note that while we did check that the note hash is the preimage of a unique note hash, we\n // perform no validations on the nullifier - we fundamentally cannot, since only the application\n // knows how to compute nullifiers. We simply trust it to have provided the correct one: if it\n // hasn't, then PXE may fail to realize that a given note has been nullified already, and calls to\n // the application could result in invalid transactions (with duplicate nullifiers). This is not a\n // concern because an application already has more direct means of making a call to it fail the\n // transaction.\n discovered_notes.push(\n DiscoveredNoteInfo {\n note_nonce: nonce_for_i,\n note_hash,\n inner_nullifier: maybe_inner_nullifier_for_i.unwrap(),\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 *discovered_notes\n}\n\n// There is no BoundedVec::filter in the stdlib, so we use this until that is implemented.\nunconstrained fn bvec_filter<Env, T, let MAX_LEN: u32>(\n bvec: BoundedVec<T, MAX_LEN>,\n filter: fn[Env](T) -> bool,\n) -> BoundedVec<T, MAX_LEN> {\n let filtered = &mut BoundedVec::new();\n\n bvec.for_each(|value| {\n if filter(value) {\n filtered.push(value);\n }\n });\n\n *filtered\n}\n\nmod test {\n use crate::{\n messages::logs::note::MAX_NOTE_PACKED_LEN,\n note::{\n note_interface::{NoteHash, NoteType},\n note_metadata::SettledNoteMetadata,\n utils::compute_note_hash_for_nullification,\n },\n oracle::random::random,\n test::mocks::mock_note::MockNote,\n utils::array,\n };\n\n use crate::protocol::{\n address::AztecAddress,\n hash::{compute_note_hash_nonce, compute_siloed_note_hash, compute_unique_note_hash},\n traits::{FromField, Packable},\n };\n\n use super::attempt_note_nonce_discovery;\n\n // This implementation could be simpler, but this serves as a nice example of the expected flow in a real\n // implementation, and as a sanity check that the interface is sufficient.\n\n unconstrained fn compute_note_hash(\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n owner: AztecAddress,\n storage_slot: Field,\n note_type_id: Field,\n _contract_address: AztecAddress,\n randomness: Field,\n ) -> Option<Field> {\n if (note_type_id == MockNote::get_id()) & (packed_note.len() == <MockNote as Packable>::N) {\n let note = MockNote::unpack(array::subarray(packed_note.storage(), 0));\n Option::some(note.compute_note_hash(owner, storage_slot, randomness))\n } else {\n Option::none()\n }\n }\n\n unconstrained fn compute_note_nullifier(\n unique_note_hash: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n owner: AztecAddress,\n _storage_slot: Field,\n note_type_id: Field,\n _contract_address: AztecAddress,\n _randomness: Field,\n ) -> Option<Field> {\n if (note_type_id == MockNote::get_id()) & (packed_note.len() == <MockNote as Packable>::N) {\n let note = MockNote::unpack(array::subarray(packed_note.storage(), 0));\n note.compute_nullifier_unconstrained(owner, unique_note_hash)\n } else {\n Option::none()\n }\n }\n\n global VALUE: Field = 7;\n global FIRST_NULLIFIER_IN_TX: Field = 47;\n global CONTRACT_ADDRESS: AztecAddress = AztecAddress::from_field(13);\n global OWNER: AztecAddress = AztecAddress::from_field(14);\n global STORAGE_SLOT: Field = 99;\n global RANDOMNESS: Field = 99;\n\n #[test]\n unconstrained fn no_note_hashes() {\n let unique_note_hashes_in_tx = BoundedVec::new();\n let packed_note = BoundedVec::new();\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n packed_note,\n );\n\n assert_eq(discovered_notes.len(), 0);\n }\n\n #[test]\n unconstrained fn failed_hash_computation_is_ignored() {\n let unique_note_hashes_in_tx = BoundedVec::from_array([random()]);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n |_, _, _, _, _, _| Option::none(),\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::new(),\n );\n\n assert_eq(discovered_notes.len(), 0);\n }\n\n #[test]\n unconstrained fn failed_nullifier_computation_is_ignored() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n unique_note_hashes_in_tx.set(note_index_in_tx, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n |_, _, _, _, _, _, _| Option::none(),\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 0);\n }\n\n struct NoteAndData {\n note: MockNote,\n note_nonce: Field,\n note_hash: Field,\n unique_note_hash: Field,\n inner_nullifier: Field,\n }\n\n unconstrained fn construct_note(value: Field, note_index_in_tx: u32) -> NoteAndData {\n let note_nonce = compute_note_hash_nonce(FIRST_NULLIFIER_IN_TX, note_index_in_tx);\n\n let hinted_note = MockNote::new(value)\n .contract_address(CONTRACT_ADDRESS)\n .owner(OWNER)\n .randomness(RANDOMNESS)\n .storage_slot(STORAGE_SLOT)\n .note_metadata(SettledNoteMetadata::new(note_nonce).into())\n .build_hinted_note();\n let note = hinted_note.note;\n\n let note_hash = note.compute_note_hash(OWNER, STORAGE_SLOT, RANDOMNESS);\n let unique_note_hash = compute_unique_note_hash(\n note_nonce,\n compute_siloed_note_hash(CONTRACT_ADDRESS, note_hash),\n );\n let inner_nullifier = note\n .compute_nullifier_unconstrained(OWNER, compute_note_hash_for_nullification(hinted_note))\n .expect(f\"Could not compute nullifier for note owned by {OWNER}\");\n\n NoteAndData { note, note_nonce, note_hash, unique_note_hash, inner_nullifier }\n }\n\n #[test]\n unconstrained fn single_note() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n unique_note_hashes_in_tx.set(note_index_in_tx, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 1);\n let discovered_note = discovered_notes.get(0);\n\n assert_eq(discovered_note.note_nonce, note_and_data.note_nonce);\n assert_eq(discovered_note.note_hash, note_and_data.note_hash);\n assert_eq(discovered_note.inner_nullifier, note_and_data.inner_nullifier);\n }\n\n #[test]\n unconstrained fn multiple_notes_same_preimage() {\n let first_note_index_in_tx = 3;\n let first_note_and_data = construct_note(VALUE, first_note_index_in_tx);\n\n let second_note_index_in_tx = 5;\n let second_note_and_data = construct_note(VALUE, second_note_index_in_tx);\n\n // Both notes have the same preimage (and therefore packed representation), so both should be found in the same\n // call.\n assert_eq(first_note_and_data.note, second_note_and_data.note);\n let packed_note = first_note_and_data.note.pack();\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n unique_note_hashes_in_tx.set(first_note_index_in_tx, first_note_and_data.unique_note_hash);\n unique_note_hashes_in_tx.set(second_note_index_in_tx, second_note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(packed_note),\n );\n\n assert_eq(discovered_notes.len(), 2);\n\n assert(discovered_notes.any(|discovered_note| {\n (discovered_note.note_nonce == first_note_and_data.note_nonce)\n & (discovered_note.note_hash == first_note_and_data.note_hash)\n & (discovered_note.inner_nullifier == first_note_and_data.inner_nullifier)\n }));\n\n assert(discovered_notes.any(|discovered_note| {\n (discovered_note.note_nonce == second_note_and_data.note_nonce)\n & (discovered_note.note_hash == second_note_and_data.note_hash)\n & (discovered_note.inner_nullifier == second_note_and_data.inner_nullifier)\n }));\n }\n\n #[test]\n unconstrained fn single_note_misaligned_nonce() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n\n // The note is not at the correct index\n unique_note_hashes_in_tx.set(note_index_in_tx + 1, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 1);\n let discovered_note = discovered_notes.get(0);\n\n assert_eq(discovered_note.note_nonce, note_and_data.note_nonce);\n assert_eq(discovered_note.note_hash, note_and_data.note_hash);\n assert_eq(discovered_note.inner_nullifier, note_and_data.inner_nullifier);\n }\n\n #[test]\n unconstrained fn single_note_nonce_with_index_past_note_hashes_in_tx() {\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n\n // The nonce is computed with an index that does not exist in the tx\n let note_index_in_tx = unique_note_hashes_in_tx.len() + 5;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n // The note is inserted at an arbitrary index - its true index is out of the array's bounds\n unique_note_hashes_in_tx.set(2, note_and_data.unique_note_hash);\n\n let discovered_notes = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n\n assert_eq(discovered_notes.len(), 1);\n let discovered_note = discovered_notes.get(0);\n\n assert_eq(discovered_note.note_nonce, note_and_data.note_nonce);\n assert_eq(discovered_note.note_hash, note_and_data.note_hash);\n assert_eq(discovered_note.inner_nullifier, note_and_data.inner_nullifier);\n }\n\n #[test(should_fail_with = \"identical note hashes for a transaction\")]\n unconstrained fn duplicate_unique_note_hashes() {\n let note_index_in_tx = 2;\n let note_and_data = construct_note(VALUE, note_index_in_tx);\n\n let mut unique_note_hashes_in_tx = BoundedVec::from_array([\n random(), random(), random(), random(), random(), random(), random(),\n ]);\n\n // The same unique note hash is present in two indices in the array, which is not allowed. Note that we don't\n // test all note hashes for uniqueness, only those that we actually find.\n unique_note_hashes_in_tx.set(note_index_in_tx, note_and_data.unique_note_hash);\n unique_note_hashes_in_tx.set(note_index_in_tx + 1, note_and_data.unique_note_hash);\n\n let _ = attempt_note_nonce_discovery(\n unique_note_hashes_in_tx,\n FIRST_NULLIFIER_IN_TX,\n compute_note_hash,\n compute_note_nullifier,\n CONTRACT_ADDRESS,\n OWNER,\n STORAGE_SLOT,\n RANDOMNESS,\n MockNote::get_id(),\n BoundedVec::from_array(note_and_data.note.pack()),\n );\n }\n}\n"
|
|
872
802
|
},
|
|
873
|
-
"
|
|
803
|
+
"130": {
|
|
874
804
|
"function_locations": [
|
|
875
805
|
{
|
|
876
806
|
"name": "process_partial_note_private_msg",
|
|
@@ -882,33 +812,33 @@
|
|
|
882
812
|
}
|
|
883
813
|
],
|
|
884
814
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/partial_notes.nr",
|
|
885
|
-
"source": "use crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, nonce_discovery::attempt_note_nonce_discovery},\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::partial_note::{decode_partial_note_private_message, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN},\n processing::{\n enqueue_note_for_validation,\n get_pending_partial_notes_completion_logs,\n log_retrieval_response::{LogRetrievalResponse, MAX_LOG_CONTENT_LEN},\n },\n },\n utils::array,\n};\n\nuse crate::logging::{aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::{address::AztecAddress, hash::sha256_to_field, traits::{Deserialize, Serialize}};\n\n/// The slot in the PXE capsules where we store a `CapsuleArray` of `DeliveredPendingPartialNote`.\npub(crate) 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/// 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) owner: AztecAddress,\n pub(crate) randomness: Field,\n pub(crate) note_completion_log_tag: Field,\n pub(crate) note_type_id: Field,\n pub(crate) packed_private_note_content: BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>,\n}\n\npub(crate) unconstrained fn process_partial_note_private_msg(\n contract_address: AztecAddress,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n let decoded = decode_partial_note_private_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n // We store the information of the partial note we found in a persistent capsule in PXE, so that we can later\n // search for the public log that will complete it.\n let (owner, randomness, note_completion_log_tag, note_type_id, packed_private_note_content) = decoded.unwrap();\n\n let pending = DeliveredPendingPartialNote {\n owner,\n randomness,\n note_completion_log_tag,\n note_type_id,\n packed_private_note_content,\n };\n\n CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n scope,\n )\n .push(pending);\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode partial note private message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n\n/// Searches for logs that would result in the completion of pending partial notes, ultimately resulting in the notes\n/// being delivered to PXE if completed.\npub(crate) unconstrained fn fetch_and_process_partial_note_completion_logs(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n scope: AztecAddress,\n) {\n let pending_partial_notes = CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n scope,\n );\n\n aztecnr_debug_log_format!(\"{} pending partial notes\")([pending_partial_notes.len() as Field]);\n\n // Each of the pending partial notes might get completed by a log containing its public values. For performance\n // reasons, we fetch all of these logs concurrently and then process them one by one, minimizing the amount of time\n // waiting for the node roundtrip.\n let maybe_completion_logs
|
|
815
|
+
"source": "use crate::{\n capsules::CapsuleArray,\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, nonce_discovery::attempt_note_nonce_discovery},\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::partial_note::{decode_partial_note_private_message, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN},\n processing::{\n enqueue_note_for_validation,\n get_pending_partial_notes_completion_logs,\n log_retrieval_response::{LogRetrievalResponse, MAX_LOG_CONTENT_LEN},\n },\n },\n utils::array,\n};\n\nuse crate::logging::{aztecnr_debug_log_format, aztecnr_warn_log_format};\nuse crate::protocol::{address::AztecAddress, hash::sha256_to_field, traits::{Deserialize, Serialize}};\n\n/// The slot in the PXE capsules where we store a `CapsuleArray` of `DeliveredPendingPartialNote`.\npub(crate) 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/// 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) owner: AztecAddress,\n pub(crate) randomness: Field,\n pub(crate) note_completion_log_tag: Field,\n pub(crate) note_type_id: Field,\n pub(crate) packed_private_note_content: BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>,\n}\n\npub(crate) unconstrained fn process_partial_note_private_msg(\n contract_address: AztecAddress,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n let decoded = decode_partial_note_private_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n // We store the information of the partial note we found in a persistent capsule in PXE, so that we can later\n // search for the public log that will complete it.\n let (owner, randomness, note_completion_log_tag, note_type_id, packed_private_note_content) = decoded.unwrap();\n\n let pending = DeliveredPendingPartialNote {\n owner,\n randomness,\n note_completion_log_tag,\n note_type_id,\n packed_private_note_content,\n };\n\n CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n scope,\n )\n .push(pending);\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode partial note private message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n\n/// Searches for logs that would result in the completion of pending partial notes, ultimately resulting in the notes\n/// being delivered to PXE if completed.\npub(crate) unconstrained fn fetch_and_process_partial_note_completion_logs(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n scope: AztecAddress,\n) {\n let pending_partial_notes = CapsuleArray::at(\n contract_address,\n DELIVERED_PENDING_PARTIAL_NOTE_ARRAY_LENGTH_CAPSULES_SLOT,\n scope,\n );\n\n aztecnr_debug_log_format!(\"{} pending partial notes\")([pending_partial_notes.len() as Field]);\n\n // Each of the pending partial notes might get completed by a log containing its public values. For performance\n // reasons, we fetch all of these logs concurrently and then process them one by one, minimizing the amount of time\n // waiting for the node roundtrip.\n let maybe_completion_logs = get_pending_partial_notes_completion_logs(contract_address, pending_partial_notes);\n\n // Each entry in the maybe completion logs array corresponds to the entry in the pending partial notes array at the\n // same index. This means we can use the same index as we iterate through the responses to get both the partial\n // note and the log that might complete it.\n assert_eq(maybe_completion_logs.len(), pending_partial_notes.len());\n\n maybe_completion_logs.for_each(|i, maybe_log: Option<LogRetrievalResponse>| {\n let pending_partial_note = pending_partial_notes.get(i);\n\n if maybe_log.is_none() {\n aztecnr_debug_log_format!(\"Found no completion logs for partial note with tag {}\")(\n [pending_partial_note.note_completion_log_tag],\n );\n\n // Note that we're not removing the pending partial note from the capsule array, so we will continue\n // searching for this tagged log when performing message discovery in the future until we either find it or\n // the entry is somehow removed from the array.\n } else {\n aztecnr_debug_log_format!(\"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 // The first field in the completion log payload is the storage slot, followed by the public note\n // content fields.\n let storage_slot = log.log_payload.get(0);\n let public_note_content: BoundedVec<Field, MAX_LOG_CONTENT_LEN - 1> = array::subbvec(log.log_payload, 1);\n\n // Public fields are assumed to all be placed at the end of the packed representation, so we combine\n // the private and public packed fields (i.e. the contents of the private message and public log\n // plaintext) to get the complete packed content.\n let complete_packed_note = array::append(\n pending_partial_note.packed_private_note_content,\n 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,\n compute_note_nullifier,\n contract_address,\n pending_partial_note.owner,\n storage_slot,\n pending_partial_note.randomness,\n pending_partial_note.note_type_id,\n complete_packed_note,\n );\n\n // TODO(#11627): is there anything reasonable we can do if we get a log but it doesn't result in a note\n // being found?\n if discovered_notes.len() == 0 {\n panic(\n f\"A partial note's completion log did not result in any notes being found - this should never happen\",\n );\n }\n\n aztecnr_debug_log_format!(\"Discovered {0} notes for partial note with tag {1}\")([\n discovered_notes.len() as Field,\n pending_partial_note.note_completion_log_tag,\n ]);\n\n discovered_notes.for_each(|discovered_note| {\n enqueue_note_for_validation(\n contract_address,\n pending_partial_note.owner,\n storage_slot,\n pending_partial_note.randomness,\n discovered_note.note_nonce,\n complete_packed_note,\n discovered_note.note_hash,\n discovered_note.inner_nullifier,\n log.tx_hash,\n );\n });\n\n // Because there is only a single log for a given tag, once we've processed the tagged log then we simply\n // delete the pending work entry, regardless of whether it was actually completed or not.\n pending_partial_notes.remove(i);\n }\n });\n}\n"
|
|
886
816
|
},
|
|
887
|
-
"
|
|
817
|
+
"131": {
|
|
888
818
|
"function_locations": [
|
|
889
819
|
{
|
|
890
820
|
"name": "process_private_event_msg",
|
|
891
|
-
"start":
|
|
821
|
+
"start": 547
|
|
892
822
|
}
|
|
893
823
|
],
|
|
894
824
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/private_events.nr",
|
|
895
|
-
"source": "use crate::{\n event::event_interface::compute_private_serialized_event_commitment,\n logging::aztecnr_warn_log_format,\n messages::{\n encoding::MAX_MESSAGE_CONTENT_LEN, logs::event::decode_private_event_message,\n processing::enqueue_event_for_validation,\n },\n};\nuse crate::protocol::{address::AztecAddress, traits::ToField};\n\npub(crate) unconstrained fn process_private_event_msg(\n contract_address: AztecAddress,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n tx_hash: Field,\n
|
|
825
|
+
"source": "use crate::{\n event::event_interface::compute_private_serialized_event_commitment,\n logging::aztecnr_warn_log_format,\n messages::{\n encoding::MAX_MESSAGE_CONTENT_LEN, logs::event::decode_private_event_message,\n processing::enqueue_event_for_validation,\n },\n};\nuse crate::protocol::{address::AztecAddress, traits::ToField};\n\npub(crate) unconstrained fn process_private_event_msg(\n contract_address: AztecAddress,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n tx_hash: Field,\n) {\n let decoded = decode_private_event_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n let (event_type_id, randomness, serialized_event) = decoded.unwrap();\n\n let event_commitment =\n compute_private_serialized_event_commitment(serialized_event, randomness, event_type_id.to_field());\n\n enqueue_event_for_validation(\n contract_address,\n event_type_id,\n randomness,\n serialized_event,\n event_commitment,\n tx_hash,\n );\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode private event message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n"
|
|
896
826
|
},
|
|
897
|
-
"
|
|
827
|
+
"132": {
|
|
898
828
|
"function_locations": [
|
|
899
829
|
{
|
|
900
830
|
"name": "process_private_note_msg",
|
|
901
|
-
"start":
|
|
831
|
+
"start": 861
|
|
902
832
|
},
|
|
903
833
|
{
|
|
904
834
|
"name": "attempt_note_discovery",
|
|
905
|
-
"start":
|
|
835
|
+
"start": 2185
|
|
906
836
|
}
|
|
907
837
|
],
|
|
908
838
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/private_notes.nr",
|
|
909
|
-
"source": "use crate::{\n logging::{aztecnr_debug_log_format, aztecnr_warn_log_format},\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, nonce_discovery::attempt_note_nonce_discovery},\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::note::{decode_private_note_message, MAX_NOTE_PACKED_LEN},\n processing::enqueue_note_for_validation,\n },\n protocol::{address::AztecAddress, constants::MAX_NOTE_HASHES_PER_TX, traits::ToField},\n};\n\npub(crate) unconstrained fn process_private_note_msg(\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 compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n
|
|
839
|
+
"source": "use crate::{\n logging::{aztecnr_debug_log_format, aztecnr_warn_log_format},\n messages::{\n discovery::{ComputeNoteHash, ComputeNoteNullifier, nonce_discovery::attempt_note_nonce_discovery},\n encoding::MAX_MESSAGE_CONTENT_LEN,\n logs::note::{decode_private_note_message, MAX_NOTE_PACKED_LEN},\n processing::enqueue_note_for_validation,\n },\n protocol::{address::AztecAddress, constants::MAX_NOTE_HASHES_PER_TX, traits::ToField},\n};\n\npub(crate) unconstrained fn process_private_note_msg(\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 compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) {\n let decoded = decode_private_note_message(msg_metadata, msg_content);\n\n if decoded.is_some() {\n let (note_type_id, owner, storage_slot, randomness, packed_note) = decoded.unwrap();\n\n attempt_note_discovery(\n contract_address,\n tx_hash,\n unique_note_hashes_in_tx,\n first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n owner,\n storage_slot,\n randomness,\n note_type_id,\n packed_note,\n );\n } else {\n aztecnr_warn_log_format!(\n \"Could not decode private note message from tx {0}, ignoring\",\n )(\n [tx_hash],\n );\n }\n}\n\n/// Attempts discovery of a note given information about its contents and the transaction in which it is suspected the\n/// note was created.\npub unconstrained fn attempt_note_discovery(\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 compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: 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,\n compute_note_nullifier,\n contract_address,\n owner,\n storage_slot,\n randomness,\n note_type_id,\n packed_note,\n );\n\n if discovered_notes.len() == 0 {\n // A private note message that results in no discovered notes means none of the computed note hashes matched\n // any unique note hash in the transaction. This could indicate a malformed or malicious message (e.g. a sender\n // providing bogus note content).\n aztecnr_warn_log_format!(\n \"Discarding private note message from tx {0} for contract {1}: no matching note hash found in the tx\",\n )(\n [tx_hash, contract_address.to_field()],\n );\n } else {\n aztecnr_debug_log_format!(\n \"Discovered {0} notes from a private message for contract {1}\",\n )(\n [discovered_notes.len() as Field, contract_address.to_field()],\n );\n }\n\n discovered_notes.for_each(|discovered_note| {\n enqueue_note_for_validation(\n contract_address,\n owner,\n storage_slot,\n randomness,\n discovered_note.note_nonce,\n packed_note,\n discovered_note.note_hash,\n discovered_note.inner_nullifier,\n tx_hash,\n );\n });\n}\n"
|
|
910
840
|
},
|
|
911
|
-
"
|
|
841
|
+
"133": {
|
|
912
842
|
"function_locations": [
|
|
913
843
|
{
|
|
914
844
|
"name": "process_message_ciphertext",
|
|
@@ -920,9 +850,9 @@
|
|
|
920
850
|
}
|
|
921
851
|
],
|
|
922
852
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/discovery/process_message.nr",
|
|
923
|
-
"source": "use crate::messages::{\n discovery::{\n ComputeNoteHash, ComputeNoteNullifier, CustomMessageHandler, partial_notes::process_partial_note_private_msg,\n private_events::process_private_event_msg, private_notes::process_private_note_msg,\n },\n encoding::{decode_message, MESSAGE_CIPHERTEXT_LEN, MESSAGE_PLAINTEXT_LEN},\n encryption::{aes128::AES128, message_encryption::MessageEncryption},\n msg_type::{\n MIN_CUSTOM_MSG_TYPE_ID, PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID, PRIVATE_EVENT_MSG_TYPE_ID, PRIVATE_NOTE_MSG_TYPE_ID,\n },\n processing::MessageContext,\n};\n\nuse crate::logging::{aztecnr_debug_log, aztecnr_warn_log_format};\nuse crate::protocol::address::AztecAddress;\n\n/// Processes a message that can contain notes, partial notes, or events.\n///\n/// Notes result in nonce discovery being performed prior to delivery, which requires knowledge of the transaction hash\n/// in which the notes would've been created (typically the same transaction in which the log was emitted), along with\n/// the list of unique note hashes in said transaction and the `compute_note_hash` and `compute_note_nullifier`\n/// functions. Once discovered, the notes are enqueued for validation.\n///\n/// Partial notes result in a pending partial note entry being stored in a PXE capsule, which will later be retrieved\n/// to search for the note's completion public log.\n///\n/// Events are processed by computing an event commitment from the serialized event data and its randomness field, then\n/// enqueueing the event data and commitment for validation.\npub unconstrained fn process_message_ciphertext<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n message_ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n message_context: MessageContext,\n recipient: AztecAddress,\n) {\n let message_plaintext_option = AES128::decrypt(message_ciphertext, recipient, contract_address);\n\n if message_plaintext_option.is_some() {\n process_message_plaintext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n message_plaintext_option.unwrap(),\n message_context,\n recipient,\n );\n } else {\n aztecnr_warn_log_format!(\"Could not decrypt message ciphertext from tx {0}, ignoring\")([message_context.tx_hash]);\n }\n}\n\npub(crate) unconstrained fn process_message_plaintext<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n message_plaintext: BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>,\n message_context: MessageContext,\n recipient: AztecAddress,\n) {\n // The first thing to do after decrypting the message is to determine what type of message we're processing. We\n // have 3 message types: private notes, partial notes and events.\n\n // We decode the message to obtain the message type id, metadata and content.\n let decoded = decode_message(message_plaintext);\n\n if decoded.is_some() {\n let (msg_type_id, msg_metadata, msg_content) = decoded.unwrap();\n\n if msg_type_id == PRIVATE_NOTE_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing private note msg\");\n\n process_private_note_msg(\n contract_address,\n message_context.tx_hash,\n message_context.unique_note_hashes_in_tx,\n message_context.first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n msg_metadata,\n msg_content,\n
|
|
853
|
+
"source": "use crate::messages::{\n discovery::{\n ComputeNoteHash, ComputeNoteNullifier, CustomMessageHandler, partial_notes::process_partial_note_private_msg,\n private_events::process_private_event_msg, private_notes::process_private_note_msg,\n },\n encoding::{decode_message, MESSAGE_CIPHERTEXT_LEN, MESSAGE_PLAINTEXT_LEN},\n encryption::{aes128::AES128, message_encryption::MessageEncryption},\n msg_type::{\n MIN_CUSTOM_MSG_TYPE_ID, PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID, PRIVATE_EVENT_MSG_TYPE_ID, PRIVATE_NOTE_MSG_TYPE_ID,\n },\n processing::MessageContext,\n};\n\nuse crate::logging::{aztecnr_debug_log, aztecnr_warn_log_format};\nuse crate::protocol::address::AztecAddress;\n\n/// Processes a message that can contain notes, partial notes, or events.\n///\n/// Notes result in nonce discovery being performed prior to delivery, which requires knowledge of the transaction hash\n/// in which the notes would've been created (typically the same transaction in which the log was emitted), along with\n/// the list of unique note hashes in said transaction and the `compute_note_hash` and `compute_note_nullifier`\n/// functions. Once discovered, the notes are enqueued for validation.\n///\n/// Partial notes result in a pending partial note entry being stored in a PXE capsule, which will later be retrieved\n/// to search for the note's completion public log.\n///\n/// Events are processed by computing an event commitment from the serialized event data and its randomness field, then\n/// enqueueing the event data and commitment for validation.\npub unconstrained fn process_message_ciphertext<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n message_ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n message_context: MessageContext,\n recipient: AztecAddress,\n) {\n let message_plaintext_option = AES128::decrypt(message_ciphertext, recipient, contract_address);\n\n if message_plaintext_option.is_some() {\n process_message_plaintext(\n contract_address,\n compute_note_hash,\n compute_note_nullifier,\n process_custom_message,\n message_plaintext_option.unwrap(),\n message_context,\n recipient,\n );\n } else {\n aztecnr_warn_log_format!(\"Could not decrypt message ciphertext from tx {0}, ignoring\")([message_context.tx_hash]);\n }\n}\n\npub(crate) unconstrained fn process_message_plaintext<CustomMessageHandlerEnv>(\n contract_address: AztecAddress,\n compute_note_hash: ComputeNoteHash,\n compute_note_nullifier: ComputeNoteNullifier,\n process_custom_message: Option<CustomMessageHandler<CustomMessageHandlerEnv>>,\n message_plaintext: BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>,\n message_context: MessageContext,\n recipient: AztecAddress,\n) {\n // The first thing to do after decrypting the message is to determine what type of message we're processing. We\n // have 3 message types: private notes, partial notes and events.\n\n // We decode the message to obtain the message type id, metadata and content.\n let decoded = decode_message(message_plaintext);\n\n if decoded.is_some() {\n let (msg_type_id, msg_metadata, msg_content) = decoded.unwrap();\n\n if msg_type_id == PRIVATE_NOTE_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing private note msg\");\n\n process_private_note_msg(\n contract_address,\n message_context.tx_hash,\n message_context.unique_note_hashes_in_tx,\n message_context.first_nullifier_in_tx,\n compute_note_hash,\n compute_note_nullifier,\n msg_metadata,\n msg_content,\n );\n } else if msg_type_id == PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing partial note private msg\");\n\n process_partial_note_private_msg(\n contract_address,\n msg_metadata,\n msg_content,\n message_context.tx_hash,\n recipient,\n );\n } else if msg_type_id == PRIVATE_EVENT_MSG_TYPE_ID {\n aztecnr_debug_log!(\"Processing private event msg\");\n\n process_private_event_msg(\n contract_address,\n msg_metadata,\n msg_content,\n message_context.tx_hash,\n );\n } else if msg_type_id < MIN_CUSTOM_MSG_TYPE_ID {\n // The message type ID falls in the range reserved for aztec.nr built-in types but wasn't matched above.\n // This most likely means the message is malformed or a custom message was incorrectly assigned a reserved\n // ID. Custom message types must use IDs allocated via `custom_msg_type_id`.\n aztecnr_warn_log_format!(\n \"Message type ID {0} is in the reserved range but is not recognized, ignoring. See https://docs.aztec.network/errors/3\",\n )(\n [msg_type_id as Field],\n );\n } else if process_custom_message.is_some() {\n process_custom_message.unwrap()(\n contract_address,\n msg_type_id,\n msg_metadata,\n msg_content,\n message_context,\n recipient,\n );\n } else {\n // A custom message was received but no handler is configured. This likely means the contract emits custom\n // messages but forgot to register a handler via `AztecConfig::custom_message_handler`.\n aztecnr_warn_log_format!(\n \"Received custom message with type id {0} but no handler is configured, ignoring. See https://docs.aztec.network/errors/2\",\n )(\n [msg_type_id as Field],\n );\n }\n } else {\n aztecnr_warn_log_format!(\"Could not decode message plaintext from tx {0}, ignoring\")([message_context.tx_hash]);\n }\n}\n"
|
|
924
854
|
},
|
|
925
|
-
"
|
|
855
|
+
"134": {
|
|
926
856
|
"function_locations": [
|
|
927
857
|
{
|
|
928
858
|
"name": "encode_message",
|
|
@@ -984,7 +914,7 @@
|
|
|
984
914
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/encoding.nr",
|
|
985
915
|
"source": "// TODO(#12750): don't make these values assume we're using AES.\nuse crate::protocol::constants::PRIVATE_LOG_CIPHERTEXT_LEN;\nuse crate::utils::array;\n\n// We reassign to the constant here to communicate the distinction between a log and a message. In Aztec.nr, unlike in\n// protocol circuits, we have a concept of a message that can be emitted either as a private log or as an offchain\n// message. Message is a piece of data that is to be eventually delivered to a contract via the `process_message(...)`\n// utility function function that is injected by the #[aztec] macro. Note: PRIVATE_LOG_CIPHERTEXT_LEN is an amount of\n// fields, so MESSAGE_CIPHERTEXT_LEN is the size of the message in fields.\npub global MESSAGE_CIPHERTEXT_LEN: u32 = PRIVATE_LOG_CIPHERTEXT_LEN;\n\n// TODO(#12750): The global variables below should not be here as they are AES128 specific.\n// The header plaintext is 2 bytes (ciphertext length), padded to the 16-byte AES block size by PKCS#7.\npub(crate) global HEADER_CIPHERTEXT_SIZE_IN_BYTES: u32 = 16;\n// AES PKCS#7 always adds at least one byte of padding. Since each plaintext field is 32 bytes (a multiple of the\n// 16-byte AES block size), a full 16-byte padding block is always appended.\npub(crate) global AES128_PKCS7_EXPANSION_IN_BYTES: u32 = 16;\n\npub global EPH_PK_X_SIZE_IN_FIELDS: u32 = 1;\n\n// (15 - 1) * 31 - 16 - 16 = 402. Note: We multiply by 31 because ciphertext bytes are stored in fields using\n// bytes_to_fields, which packs 31 bytes per field (since a Field is ~254 bits and can safely store 31 whole bytes).\npub(crate) global MESSAGE_PLAINTEXT_SIZE_IN_BYTES: u32 = (MESSAGE_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS) * 31\n - HEADER_CIPHERTEXT_SIZE_IN_BYTES\n - AES128_PKCS7_EXPANSION_IN_BYTES;\n// The plaintext bytes represent Field values that were originally serialized using fields_to_bytes, which converts\n// each Field to 32 bytes. To convert the plaintext bytes back to fields, we divide by 32. 402 / 32 = 12\npub global MESSAGE_PLAINTEXT_LEN: u32 = MESSAGE_PLAINTEXT_SIZE_IN_BYTES / 32;\n\npub global MESSAGE_EXPANDED_METADATA_LEN: u32 = 1;\n\n// The standard message layout is composed of:\n// - an initial field called the 'expanded metadata'\n// - an arbitrary number of fields following that called the 'message content'\n//\n// ```\n// message: [ msg_expanded_metadata, ...msg_content ]\n// ```\n//\n// The expanded metadata itself is interpreted as a u128, of which:\n// - the upper 64 bits are the message type id\n// - the lower 64 bits are called the 'message metadata'\n//\n// ```\n// msg_expanded_metadata: [ msg_type_id | msg_metadata ]\n// <--- 64 bits --->|<--- 64 bits --->\n// ```\n//\n// The meaning of the message metadata and message content depend on the value of the message type id. Note that there\n// is nothing special about the message metadata, it _can_ be considered part of the content. It just has a different\n// name to make it distinct from the message content given that it is not a full field.\n\n/// The maximum length of a message's content, i.e. not including the expanded message metadata.\npub global MAX_MESSAGE_CONTENT_LEN: u32 = MESSAGE_PLAINTEXT_LEN - MESSAGE_EXPANDED_METADATA_LEN;\n\n/// Encodes a message following aztec-nr's standard message encoding. This message can later be decoded with\n/// `decode_message` to retrieve the original values.\n///\n/// - The `msg_type` is an identifier that groups types of messages that are all processed the same way, e.g. private\n/// notes or events. Possible values are defined in `aztec::messages::msg_type`.\n/// - The `msg_metadata` and `msg_content` are the values stored in the message, whose meaning depends on the\n/// `msg_type`. The only special thing about `msg_metadata` that separates it from `msg_content` is that it is a u64\n/// instead of a full Field (due to details of how messages are encoded), allowing applications that can fit values\n/// into this smaller variable to achieve higher data efficiency.\npub fn encode_message<let N: u32>(\n msg_type: u64,\n msg_metadata: u64,\n msg_content: [Field; N],\n) -> [Field; (N + MESSAGE_EXPANDED_METADATA_LEN)] {\n std::static_assert(\n msg_content.len() <= MAX_MESSAGE_CONTENT_LEN,\n \"Invalid message content: it must have a length of at most MAX_MESSAGE_CONTENT_LEN\",\n );\n\n // If MESSAGE_EXPANDED_METADATA_LEN is changed, causing the assertion below to fail, then the destructuring of the\n // message encoding below must be updated as well.\n std::static_assert(\n MESSAGE_EXPANDED_METADATA_LEN == 1,\n \"unexpected value for MESSAGE_EXPANDED_METADATA_LEN\",\n );\n let mut message: [Field; (N + MESSAGE_EXPANDED_METADATA_LEN)] = std::mem::zeroed();\n\n message[0] = to_expanded_metadata(msg_type, msg_metadata);\n for i in 0..msg_content.len() {\n message[MESSAGE_EXPANDED_METADATA_LEN + i] = msg_content[i];\n }\n\n message\n}\n\n/// Decodes a standard aztec-nr message, i.e. one created via `encode_message`, returning the original encoded values.\n///\n/// Returns `None` if the message is empty or has invalid (>128 bit) expanded metadata.\n///\n/// Note that `encode_message` returns a fixed size array while this function takes a `BoundedVec`: this is because\n/// prior to decoding the message type is unknown, and consequentially not known at compile time. If working with\n/// fixed-size messages, consider using `BoundedVec::from_array` to convert them.\npub unconstrained fn decode_message(\n message: BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>,\n) -> Option<(u64, u64, BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>)> {\n Option::some(message)\n .and_then(|message| {\n // If MESSAGE_EXPANDED_METADATA_LEN is changed, causing the assertion below to fail, then the destructuring\n // of the\n // message encoding below must be updated as well.\n std::static_assert(\n MESSAGE_EXPANDED_METADATA_LEN == 1,\n \"unexpected value for MESSAGE_EXPANDED_METADATA_LEN\",\n );\n if message.len() < MESSAGE_EXPANDED_METADATA_LEN {\n Option::none()\n } else {\n Option::some(message.get(0))\n }\n })\n .and_then(|msg_expanded_metadata| from_expanded_metadata(msg_expanded_metadata))\n .map(|(msg_type_id, msg_metadata)| {\n let msg_content = array::subbvec(message, MESSAGE_EXPANDED_METADATA_LEN);\n (msg_type_id, msg_metadata, msg_content)\n })\n}\n\nglobal U64_SHIFT_MULTIPLIER: Field = 2.pow_32(64);\n\nfn to_expanded_metadata(msg_type: u64, msg_metadata: u64) -> 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 = (msg_type as Field) * U64_SHIFT_MULTIPLIER;\n let msg_metadata_field = msg_metadata as Field;\n\n type_field + msg_metadata_field\n}\n\nglobal TWO_POW_128: Field = 2.pow_32(128);\n\n/// Unpacks expanded metadata into (msg_type, msg_metadata). Returns `None` if `input >= 2^128`.\nfn from_expanded_metadata(input: Field) -> Option<(u64, u64)> {\n if input.lt(TWO_POW_128) {\n let msg_metadata = (input as u64);\n let msg_type = ((input - (msg_metadata as Field)) / U64_SHIFT_MULTIPLIER) as u64;\n // Use division instead of bit shift since bit shifts are expensive in circuits\n Option::some((msg_type, msg_metadata))\n } else {\n Option::none()\n }\n}\n\nmod tests {\n use crate::utils::array::subarray::subarray;\n use super::{\n decode_message, encode_message, from_expanded_metadata, MAX_MESSAGE_CONTENT_LEN, to_expanded_metadata,\n TWO_POW_128,\n };\n\n global U64_MAX: u64 = (2.pow_32(64) - 1) as u64;\n global U128_MAX: Field = (2.pow_32(128) - 1);\n\n #[test]\n unconstrained fn encode_decode_empty_message(msg_type: u64, msg_metadata: u64) {\n let encoded = encode_message(msg_type, msg_metadata, []);\n let (decoded_msg_type, decoded_msg_metadata, decoded_msg_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_msg_type, msg_type);\n assert_eq(decoded_msg_metadata, msg_metadata);\n assert_eq(decoded_msg_content.len(), 0);\n }\n\n #[test]\n unconstrained fn encode_decode_short_message(\n msg_type: u64,\n msg_metadata: u64,\n msg_content: [Field; MAX_MESSAGE_CONTENT_LEN / 2],\n ) {\n let encoded = encode_message(msg_type, msg_metadata, msg_content);\n let (decoded_msg_type, decoded_msg_metadata, decoded_msg_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_msg_type, msg_type);\n assert_eq(decoded_msg_metadata, msg_metadata);\n assert_eq(decoded_msg_content.len(), msg_content.len());\n assert_eq(subarray(decoded_msg_content.storage(), 0), msg_content);\n }\n\n #[test]\n unconstrained fn encode_decode_full_message(\n msg_type: u64,\n msg_metadata: u64,\n msg_content: [Field; MAX_MESSAGE_CONTENT_LEN],\n ) {\n let encoded = encode_message(msg_type, msg_metadata, msg_content);\n let (decoded_msg_type, decoded_msg_metadata, decoded_msg_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_msg_type, msg_type);\n assert_eq(decoded_msg_metadata, msg_metadata);\n assert_eq(decoded_msg_content.len(), msg_content.len());\n assert_eq(subarray(decoded_msg_content.storage(), 0), msg_content);\n }\n\n #[test]\n unconstrained fn to_expanded_metadata_packing() {\n // Test case 1: All bits set\n let packed = to_expanded_metadata(U64_MAX, U64_MAX);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 2: Only log type bits set\n let packed = to_expanded_metadata(U64_MAX, 0);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, 0);\n\n // Test case 3: Only msg_metadata bits set\n let packed = to_expanded_metadata(0, U64_MAX);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 4: No bits set\n let packed = to_expanded_metadata(0, 0);\n let (msg_type, msg_metadata) = from_expanded_metadata(packed).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, 0);\n }\n\n #[test]\n unconstrained fn from_expanded_metadata_packing() {\n // Test case 1: All bits set\n let input = U128_MAX as Field;\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 2: Only log type bits set\n let input = (U128_MAX - U64_MAX as Field);\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, U64_MAX);\n assert_eq(msg_metadata, 0);\n\n // Test case 3: Only msg_metadata bits set\n let input = U64_MAX as Field;\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, U64_MAX);\n\n // Test case 4: No bits set\n let input = 0;\n let (msg_type, msg_metadata) = from_expanded_metadata(input).unwrap();\n assert_eq(msg_type, 0);\n assert_eq(msg_metadata, 0);\n }\n\n #[test]\n unconstrained fn to_from_expanded_metadata(original_msg_type: u64, original_msg_metadata: u64) {\n let packed = to_expanded_metadata(original_msg_type, original_msg_metadata);\n let (unpacked_msg_type, unpacked_msg_metadata) = from_expanded_metadata(packed).unwrap();\n\n assert_eq(original_msg_type, unpacked_msg_type);\n assert_eq(original_msg_metadata, unpacked_msg_metadata);\n }\n\n #[test]\n unconstrained fn encode_decode_max_size_message() {\n let msg_type_id: u64 = 42;\n let msg_metadata: u64 = 99;\n let mut msg_content = [0; MAX_MESSAGE_CONTENT_LEN];\n for i in 0..MAX_MESSAGE_CONTENT_LEN {\n msg_content[i] = i as Field;\n }\n\n let encoded = encode_message(msg_type_id, msg_metadata, msg_content);\n let (decoded_type_id, decoded_metadata, decoded_content) =\n decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(decoded_type_id, msg_type_id);\n assert_eq(decoded_metadata, msg_metadata);\n assert_eq(decoded_content, BoundedVec::from_array(msg_content));\n }\n\n #[test(should_fail_with = \"Invalid message content: it must have a length of at most MAX_MESSAGE_CONTENT_LEN\")]\n fn encode_oversized_message_fails() {\n let msg_content = [0; MAX_MESSAGE_CONTENT_LEN + 1];\n let _ = encode_message(0, 0, msg_content);\n }\n\n #[test]\n unconstrained fn decode_empty_message_returns_none() {\n assert(decode_message(BoundedVec::new()).is_none());\n }\n\n #[test]\n unconstrained fn decode_message_with_oversized_metadata_returns_none() {\n let message = BoundedVec::from_array([TWO_POW_128]);\n assert(decode_message(message).is_none());\n }\n}\n"
|
|
986
916
|
},
|
|
987
|
-
"
|
|
917
|
+
"135": {
|
|
988
918
|
"function_locations": [
|
|
989
919
|
{
|
|
990
920
|
"name": "extract_many_close_to_uniformly_random_256_bits_using_poseidon2",
|
|
@@ -1070,7 +1000,7 @@
|
|
|
1070
1000
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/encryption/aes128.nr",
|
|
1071
1001
|
"source": "use crate::protocol::{address::AztecAddress, public_keys::AddressPoint, traits::ToField};\n\nuse crate::{\n keys::{\n ecdh_shared_secret::{\n compute_app_siloed_shared_secret, derive_ecdh_shared_secret, derive_shared_secret_field_mask,\n derive_shared_secret_subkey,\n },\n ephemeral::generate_positive_ephemeral_key_pair,\n },\n logging::aztecnr_warn_log_format,\n messages::{\n encoding::{\n EPH_PK_X_SIZE_IN_FIELDS, HEADER_CIPHERTEXT_SIZE_IN_BYTES, MESSAGE_CIPHERTEXT_LEN, MESSAGE_PLAINTEXT_LEN,\n MESSAGE_PLAINTEXT_SIZE_IN_BYTES,\n },\n encryption::message_encryption::MessageEncryption,\n logs::arithmetic_generics_utils::{\n get_arr_of_size__message_bytes__from_PT, get_arr_of_size__message_bytes_padding__from_PT,\n },\n },\n oracle::{aes128_decrypt::try_aes128_decrypt, random::random, shared_secret::get_shared_secret},\n utils::{\n array,\n conversion::{\n bytes_to_fields::{bytes_from_fields, bytes_to_fields},\n fields_to_bytes::{fields_to_bytes, try_fields_from_bytes},\n },\n point::point_from_x_coord_and_sign,\n },\n};\n\nuse std::aes128::aes128_encrypt;\n\n/// Computes N close-to-uniformly-random 256 bits from a given app-siloed shared secret.\n///\n/// NEVER re-use the same iv and sym_key. DO NOT call this function more than once with the same s_app.\n///\n/// This function is only known to be safe if s_app is derived from combining a random ephemeral key with an\n/// address point and a contract address. See big comment within the body of the function.\nfn extract_many_close_to_uniformly_random_256_bits_using_poseidon2<let N: u32>(s_app: Field) -> [[u8; 32]; N] {\n /*\n * Unsafe because of https://eprint.iacr.org/2010/264.pdf Page 13, Lemma 2 (and the two paragraphs below it).\n *\n * If you call this function, you need to be careful and aware of how the arg `s_app` has been derived.\n *\n * The paper says that the way you derive aes keys and IVs should be fine with poseidon2 (modelled as a RO),\n * as long as you _don't_ use Poseidon2 as a PRG to generate the two exponents x & y which multiply to the\n * shared secret S:\n *\n * S = [x*y]*G.\n *\n * (Otherwise, you would have to \"key\" poseidon2, i.e. generate a uniformly string K which can be public and\n * compute Hash(x) as poseidon(K,x)).\n * In that lemma, k would be 2*254=508, and m would be the number of points on the grumpkin curve (which is\n * close to r according to the Hasse bound).\n *\n * Our shared secret S is [esk * address_sk] * G, and the question is: Can we compute hash(S) using poseidon2\n * instead of sha256?\n *\n * Well, esk is random and not generated with poseidon2, so that's good.\n * What about address_sk?\n * Well, address_sk = poseidon2(stuff) + ivsk, so there was some discussion about whether address_sk is\n * independent of poseidon2. Given that ivsk is random and independent of poseidon2, the address_sk is also\n * independent of poseidon2.\n *\n * Tl;dr: we believe it's safe to hash S = [esk * address_sk] * G using poseidon2, in order to derive a\n * symmetric key.\n *\n * If you're calling this function for a differently-derived `s_app`, be careful.\n */\n \n\n /* The output of this function needs to be 32 random bytes.\n * A single field won't give us 32 bytes of entropy. So we compute two \"random\" fields, by poseidon-hashing\n * with two different indices. We then extract the last 16 (big endian) bytes of each \"random\" field.\n * Note: we use to_be_bytes because it's slightly more efficient. But we have to be careful not to take bytes\n * from the \"big end\", because the \"big\" byte is not uniformly random over the byte: it only has < 6 bits of\n * randomness, because it's the big end of a 254-bit field element.\n */\n\n let mut all_bytes: [[u8; 32]; N] = std::mem::zeroed();\n std::static_assert(N < 256, \"N too large\");\n for k in 0..N {\n let rand1: Field = derive_shared_secret_subkey(s_app, 2 * k);\n let rand2: Field = derive_shared_secret_subkey(s_app, 2 * k + 1);\n\n let rand1_bytes: [u8; 32] = rand1.to_be_bytes();\n let rand2_bytes: [u8; 32] = rand2.to_be_bytes();\n\n let mut bytes: [u8; 32] = [0; 32];\n for i in 0..16 {\n // We take bytes from the \"little end\" of the be-bytes arrays:\n let j = 32 - i - 1;\n bytes[i] = rand1_bytes[j];\n bytes[16 + i] = rand2_bytes[j];\n }\n\n all_bytes[k] = bytes;\n }\n\n all_bytes\n}\n\nfn derive_aes_symmetric_key_and_iv_from_uniformly_random_256_bits<let N: u32>(\n many_random_256_bits: [[u8; 32]; N],\n) -> [([u8; 16], [u8; 16]); N] {\n // Many (sym_key, iv) pairs:\n let mut many_pairs: [([u8; 16], [u8; 16]); N] = std::mem::zeroed();\n for k in 0..N {\n let random_256_bits = many_random_256_bits[k];\n let mut sym_key = [0; 16];\n let mut iv = [0; 16];\n for i in 0..16 {\n sym_key[i] = random_256_bits[i];\n iv[i] = random_256_bits[i + 16];\n }\n many_pairs[k] = (sym_key, iv);\n }\n\n many_pairs\n}\n\npub fn derive_aes_symmetric_key_and_iv_from_shared_secret<let N: u32>(s_app: Field) -> [([u8; 16], [u8; 16]); N] {\n let many_random_256_bits: [[u8; 32]; N] = extract_many_close_to_uniformly_random_256_bits_using_poseidon2(s_app);\n\n derive_aes_symmetric_key_and_iv_from_uniformly_random_256_bits(many_random_256_bits)\n}\n\npub struct AES128 {}\n\nimpl MessageEncryption for AES128 {\n\n /// AES128-CBC encryption for Aztec protocol messages.\n ///\n /// ## Overview\n ///\n /// The plaintext is an array of up to `MESSAGE_PLAINTEXT_LEN` (12) fields. The output is always exactly\n /// `MESSAGE_CIPHERTEXT_LEN` (15) fields, regardless of plaintext size. All output fields except the\n /// ephemeral public key are uniformly random `Field` values to any observer without knowledge of the\n /// shared secret, making all encrypted messages indistinguishable by size or content.\n ///\n /// ## PKCS#7 Padding\n ///\n /// AES operates on 16-byte blocks, so the plaintext must be padded to a multiple of 16. PKCS#7 padding always\n /// adds at least 1 byte (so the receiver can always detect and strip it), which means:\n /// - 1 B plaintext -> 15 B padding -> 16 B total\n /// - 15 B plaintext -> 1 B padding -> 16 B total\n /// - 16 B plaintext -> 16 B padding -> 32 B total (full extra block)\n ///\n /// In general: if the plaintext is already a multiple of 16, a full 16-byte padding block is appended.\n ///\n /// ## Encryption Steps\n ///\n /// **1. Body encryption.** The plaintext fields are serialized to bytes (32 bytes per field) and AES-128-CBC\n /// encrypted. Since 32 is a multiple of 16, PKCS#7 always adds a full 16-byte padding block (see above):\n ///\n /// ```text\n /// +---------------------------------------------+\n /// | body ct |\n /// | PlaintextLen*32 + 16 B |\n /// +-------------------------------+--------------+\n /// | encrypted plaintext fields | PKCS#7 (16B) |\n /// | (serialized at 32 B each) | |\n /// +-------------------------------+--------------+\n /// ```\n ///\n /// **2. Header encryption.** The byte length of `body_ct` is stored as a 2-byte big-endian integer. This 2-byte\n /// header plaintext is then AES-encrypted; PKCS#7 pads the remaining 14 bytes to fill one 16-byte AES block,\n /// producing a 16-byte header ciphertext:\n ///\n /// ```text\n /// +---------------------------+\n /// | header ct |\n /// | 16 B |\n /// +--------+------------------+\n /// | body ct| PKCS#7 (14B) |\n /// | length | |\n /// | (2 B) | |\n /// +--------+------------------+\n /// ```\n ///\n /// ## Wire Format\n ///\n /// Messages are transmitted as fields, not bytes. A field is ~254 bits and can safely store 31 whole bytes, so\n /// we need to pack our byte data into 31-byte chunks. This packing drives the wire format.\n ///\n /// **Step 1 -- Assemble bytes.** The ciphertexts are laid out in a byte array, padded with zero bytes to a\n /// multiple of 31 so it divides evenly into fields:\n ///\n /// ```text\n /// +------------+-------------------------+---------+\n /// | header ct | body ct | byte pad|\n /// | 16 B | PlaintextLen*32 + 16 B | (zeros) |\n /// +------------+-------------------------+---------+\n /// |<-------- padded to a multiple of 31 B -------->|\n /// ```\n ///\n /// **Step 2 -- Pack and mask.** The byte array is split into 31-byte chunks, each stored in one field. A\n /// Poseidon2-derived mask (see `derive_shared_secret_field_mask`) is added to each so that the resulting\n /// fields appear as uniformly random `Field` values to any observer without knowledge of the shared secret,\n /// hiding the fact that the underlying ciphertext consists of 128-bit AES blocks.\n ///\n /// **Step 3 -- Assemble ciphertext.** The ephemeral public key x-coordinate is prepended and random field padding\n /// is appended to fill to 15 fields:\n ///\n /// ```text\n /// +----------+-------------------------+-------------------+\n /// | eph_pk.x | masked message fields | random field pad |\n /// | | (packed 31 B per field) | (fills to 15) |\n /// +----------+-------------------------+-------------------+\n /// |<---------- MESSAGE_CIPHERTEXT_LEN = 15 fields -------->|\n /// ```\n ///\n /// ## Key Derivation\n ///\n /// The raw ECDH shared secret point is first app-siloed into a scalar `s_app` by hashing with the contract\n /// address (see\n /// [`compute_app_siloed_shared_secret`](crate::keys::ecdh_shared_secret::compute_app_siloed_shared_secret)).\n /// Two (key, IV) pairs are then derived from `s_app` via indexed Poseidon2 hashing: one pair for the body\n /// ciphertext and one for the header ciphertext.\n fn encrypt<let PlaintextLen: u32>(\n plaintext: [Field; PlaintextLen],\n recipient: AztecAddress,\n contract_address: AztecAddress,\n ) -> [Field; MESSAGE_CIPHERTEXT_LEN] {\n std::static_assert(\n PlaintextLen <= MESSAGE_PLAINTEXT_LEN,\n \"Plaintext length exceeds MESSAGE_PLAINTEXT_LEN\",\n );\n\n // AES 128 operates on bytes, not fields, so we need to convert the fields to bytes. (This process is then\n // reversed when processing the message in `process_message_ciphertext`)\n let plaintext_bytes = fields_to_bytes(plaintext);\n\n // Derive ECDH shared secret with recipient using a fresh ephemeral keypair.\n let (eph_sk, eph_pk) = generate_positive_ephemeral_key_pair();\n\n let raw_shared_secret = derive_ecdh_shared_secret(\n eph_sk,\n recipient\n .to_address_point()\n .unwrap_or_else(|| {\n aztecnr_warn_log_format!(\n \"Attempted to encrypt message for an invalid recipient ({0})\",\n )(\n [recipient.to_field()],\n );\n\n // Safety: if the recipient is an invalid address, then it is not possible to encrypt a message for\n // them because we cannot establish a shared secret. This is never expected to occur during normal\n // operation. However, it is technically possible for us to receive an invalid address, and we must\n // therefore handle it. We could simply fail, but that'd introduce a potential security issue in\n // which an attacker forces a contract to encrypt a message for an invalid address, resulting in an\n // impossible transaction - this is sometimes called a 'king of the hill' attack. We choose instead\n // to not fail and encrypt the plaintext regardless using the shared secret that results from a\n // random valid address. The sender is free to choose this address and hence shared secret, but\n // this has no security implications as they already know not only the full plaintext but also the\n // ephemeral private key anyway.\n unsafe {\n random_address_point()\n }\n })\n .inner,\n );\n\n let s_app = compute_app_siloed_shared_secret(raw_shared_secret, contract_address);\n\n // It is safe to derive AES keys from `s_app` using Poseidon2 because `s_app` was derived from an ECDH shared\n // secret using an AztecAddress (the recipient). See the block comment in\n // `extract_many_close_to_uniformly_random_256_bits_using_poseidon2` for more info.\n let pairs = derive_aes_symmetric_key_and_iv_from_shared_secret::<2>(s_app);\n let (body_sym_key, body_iv) = pairs[0];\n let (header_sym_key, header_iv) = pairs[1];\n\n let ciphertext_bytes = aes128_encrypt(plaintext_bytes, body_iv, body_sym_key);\n\n // Each plaintext field is 32 bytes (a multiple of the 16-byte AES block\n // size), so PKCS#7 always appends a full 16-byte padding block:\n // |ciphertext| = PlaintextLen*32 + 16 = 16 * (1 + PlaintextLen*32 / 16)\n std::static_assert(\n ciphertext_bytes.len() == 16 * (1 + (PlaintextLen * 32) / 16),\n \"unexpected ciphertext length\",\n );\n\n // Encrypt a 2-byte header containing the body ciphertext length.\n let header_plaintext = encode_header(ciphertext_bytes.len());\n\n // Note: the aes128_encrypt builtin fn automatically appends bytes to the input, according to pkcs#7; hence why\n // the output `header_ciphertext_bytes` is 16 bytes larger than the input in this case.\n let header_ciphertext_bytes = aes128_encrypt(header_plaintext, header_iv, header_sym_key);\n // Verify expected header ciphertext size at compile time.\n std::static_assert(\n header_ciphertext_bytes.len() == HEADER_CIPHERTEXT_SIZE_IN_BYTES,\n \"unexpected ciphertext header length\",\n );\n\n // Assemble the message byte array:\n // [header_ct (16B)] [body_ct] [padding to mult of 31]\n let message_bytes_padding_to_mult_31 = get_arr_of_size__message_bytes_padding__from_PT::<PlaintextLen * 32>();\n\n let mut message_bytes = get_arr_of_size__message_bytes__from_PT::<PlaintextLen * 32>();\n\n std::static_assert(\n message_bytes.len() % 31 == 0,\n \"Unexpected error: message_bytes.len() should be divisible by 31, by construction.\",\n );\n\n let mut offset = 0;\n for i in 0..header_ciphertext_bytes.len() {\n message_bytes[offset + i] = header_ciphertext_bytes[i];\n }\n offset += header_ciphertext_bytes.len();\n\n for i in 0..ciphertext_bytes.len() {\n message_bytes[offset + i] = ciphertext_bytes[i];\n }\n offset += ciphertext_bytes.len();\n\n for i in 0..message_bytes_padding_to_mult_31.len() {\n message_bytes[offset + i] = message_bytes_padding_to_mult_31[i];\n }\n offset += message_bytes_padding_to_mult_31.len();\n\n // Ideally we would be able to have a static assert where we check that the offset would be such that we've\n // written to the entire log_bytes array, but we cannot since Noir does not treat the offset as a comptime\n // value (despite the values that it goes through being known at each stage). We instead check that the\n // computation used to obtain the offset computes the expected value (which we _can_ do in a static check), and\n // then add a cheap runtime check to also validate that the offset matches this.\n std::static_assert(\n header_ciphertext_bytes.len() + ciphertext_bytes.len() + message_bytes_padding_to_mult_31.len()\n == message_bytes.len(),\n \"unexpected message length\",\n );\n assert(offset == message_bytes.len(), \"unexpected encrypted message length\");\n\n // Pack message bytes into fields (31 bytes per field) and prepend eph_pk.x.\n let message_bytes_as_fields = bytes_to_fields(message_bytes);\n\n let mut ciphertext: [Field; MESSAGE_CIPHERTEXT_LEN] = [0; MESSAGE_CIPHERTEXT_LEN];\n\n ciphertext[0] = eph_pk.x;\n\n // Mask each content field with a Poseidon2-derived value, so that they appear as uniformly random `Field`\n // values\n let mut offset = 1;\n for i in 0..message_bytes_as_fields.len() {\n let mask = derive_shared_secret_field_mask(s_app, i as u32);\n ciphertext[offset + i] = message_bytes_as_fields[i] + mask;\n }\n offset += message_bytes_as_fields.len();\n\n // Pad with random fields so that padding is indistinguishable from masked data fields.\n for i in offset..MESSAGE_CIPHERTEXT_LEN {\n // Safety: we assume that the sender wants for the message to be private - a malicious one could simply\n // reveal its contents publicly. It is therefore fine to trust the sender to provide random padding.\n ciphertext[i] = unsafe { random() };\n }\n\n ciphertext\n }\n\n unconstrained fn decrypt(\n ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n recipient: AztecAddress,\n contract_address: AztecAddress,\n ) -> Option<BoundedVec<Field, MESSAGE_PLAINTEXT_LEN>> {\n // Extract the ephemeral public key x-coordinate and masked fields, returning None for empty ciphertext.\n if ciphertext.len() > 0 {\n let masked_fields: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN - EPH_PK_X_SIZE_IN_FIELDS> =\n array::subbvec(ciphertext, EPH_PK_X_SIZE_IN_FIELDS);\n Option::some((ciphertext.get(0), masked_fields))\n } else {\n Option::none()\n }\n .and_then(|(eph_pk_x, masked_fields)| {\n // With the x-coordinate of the ephemeral public key we can reconstruct the point as we know that the\n // y-coordinate must be positive. This may fail however, as not all x-coordinates are on the curve. In\n // that case, we simply return `Option::none`.\n point_from_x_coord_and_sign(eph_pk_x, true).and_then(|eph_pk| {\n let s_app = get_shared_secret(recipient, eph_pk, contract_address);\n\n let unmasked_fields = masked_fields.mapi(|i, field| {\n let unmasked = unmask_field(s_app, i, field);\n // If we failed to unmask the field, we are dealing with the random padding. We'll ignore it\n // later, so we can simply set it to 0\n unmasked.unwrap_or(0)\n });\n let ciphertext_without_eph_pk_x = bytes_from_fields(unmasked_fields);\n\n // Derive symmetric keys:\n let pairs = derive_aes_symmetric_key_and_iv_from_shared_secret::<2>(s_app);\n let (body_sym_key, body_iv) = pairs[0];\n let (header_sym_key, header_iv) = pairs[1];\n\n // Extract the header ciphertext\n let header_start = 0;\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\n // designed to work with messages with unknown length at compile time. This would not be necessary\n // here as the header ciphertext length is fixed. But we do it anyway to not have to have duplicate\n // oracles.\n let header_ciphertext_bvec =\n BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::from_array(header_ciphertext);\n\n try_aes128_decrypt(header_ciphertext_bvec, header_iv, header_sym_key)\n // Extract ciphertext length from header (2 bytes, big-endian)\n .and_then(|header_plaintext| extract_ciphertext_length(header_plaintext))\n .filter(|ciphertext_length| ciphertext_length <= MESSAGE_PLAINTEXT_SIZE_IN_BYTES)\n .map(|ciphertext_length| {\n // Extract and decrypt main ciphertext\n let ciphertext_start = header_start + HEADER_CIPHERTEXT_SIZE_IN_BYTES;\n let ciphertext_with_padding: [u8; MESSAGE_PLAINTEXT_SIZE_IN_BYTES] =\n array::subarray(ciphertext_without_eph_pk_x.storage(), ciphertext_start);\n BoundedVec::from_parts(ciphertext_with_padding, ciphertext_length)\n })\n // Decrypt main ciphertext and return it\n .and_then(|ciphertext| try_aes128_decrypt(ciphertext, body_iv, body_sym_key))\n // Convert bytes back to fields (32 bytes per field). Returns None if the actual bytes are\n // not valid.\n .and_then(|plaintext_bytes| try_fields_from_bytes(plaintext_bytes))\n })\n })\n }\n}\n\n/// Encodes the body ciphertext length into a 2-byte big-endian header.\nfn encode_header(ciphertext_length: u32) -> [u8; 2] {\n [(ciphertext_length >> 8) as u8, ciphertext_length as u8]\n}\n\n/// Extracts the body ciphertext length from a decrypted header as a 2-byte big-endian integer.\n///\n/// Returns `Option::none()` if the header has fewer than 2 bytes.\nunconstrained fn extract_ciphertext_length<let N: u32>(header: BoundedVec<u8, N>) -> Option<u32> {\n if header.len() >= 2 {\n Option::some(((header.get(0) as u32) << 8) | (header.get(1) as u32))\n } else {\n Option::none()\n }\n}\n\n/// 2^248: upper bound for values that fit in 31 bytes\nglobal TWO_POW_248: Field = 2.pow_32(248);\n\n/// Removes the Poseidon2-derived mask from a ciphertext field. Returns the unmasked value if it fits in 31 bytes\n/// (a content field), or `None` if it doesn't (random padding). Unconstrained to prevent accidental use in\n/// constrained context.\nunconstrained fn unmask_field(s_app: Field, index: u32, masked: Field) -> Option<Field> {\n let unmasked = masked - derive_shared_secret_field_mask(s_app, index);\n if unmasked.lt(TWO_POW_248) {\n Option::some(unmasked)\n } else {\n Option::none()\n }\n}\n\n/// Produces a random valid address point, i.e. one that is on the curve. This is equivalent to calling\n/// [`AztecAddress::to_address_point`] on a random valid address.\nunconstrained fn random_address_point() -> AddressPoint {\n let mut result = std::mem::zeroed();\n\n loop {\n // We simply produce random x coordinates until we find one that is on the curve. About half of the x\n // coordinates fulfill this condition, so this should only take a few iterations at most.\n let x_coord = random();\n let point = point_from_x_coord_and_sign(x_coord, true);\n if point.is_some() {\n result = AddressPoint { inner: point.unwrap() };\n break;\n }\n }\n\n result\n}\n\nmod test {\n use crate::{\n keys::ecdh_shared_secret::{compute_app_siloed_shared_secret, derive_ecdh_shared_secret},\n messages::{\n encoding::{HEADER_CIPHERTEXT_SIZE_IN_BYTES, MESSAGE_PLAINTEXT_LEN, MESSAGE_PLAINTEXT_SIZE_IN_BYTES},\n encryption::message_encryption::MessageEncryption,\n },\n test::helpers::test_environment::TestEnvironment,\n };\n use crate::protocol::{address::AztecAddress, traits::FromField};\n use super::{AES128, encode_header, random_address_point};\n use std::{embedded_curve_ops::EmbeddedCurveScalar, test::OracleMock};\n\n #[test]\n unconstrained fn encrypt_decrypt_deterministic() {\n let env = TestEnvironment::new();\n\n // Message decryption requires oracles that are only available during private execution\n env.private_context(|context| {\n let contract_address = context.this_address();\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(\"aztec_utl_getRandomField\").returns(eph_sk).times(1);\n\n let randomness = 0x0101010101010101010101010101010101010101010101010101010101010101;\n let _ = OracleMock::mock(\"aztec_utl_getRandomField\").returns(randomness).times(1000000);\n\n let _ = OracleMock::mock(\"aztec_prv_getNextAppTagAsSender\").returns(42);\n\n // Encrypt the message\n let encrypted_message = BoundedVec::from_array(AES128::encrypt(plaintext, recipient, contract_address));\n\n // Compute the same app-siloed shared secret that the oracle would return\n let raw_shared_secret = derive_ecdh_shared_secret(\n EmbeddedCurveScalar::from_field(eph_sk),\n recipient.to_address_point().unwrap().inner,\n );\n let s_app = compute_app_siloed_shared_secret(raw_shared_secret, contract_address);\n\n let _ = OracleMock::mock(\"aztec_utl_getSharedSecret\").returns(s_app);\n\n // Decrypt the message\n let decrypted = AES128::decrypt(encrypted_message, recipient, contract_address).unwrap();\n\n // The decryption function spits out a BoundedVec because it's designed to work with messages with unknown\n // length at compile time. For this reason we need to convert the original input to a BoundedVec.\n let plaintext_bvec = BoundedVec::<Field, MESSAGE_PLAINTEXT_LEN>::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\n #[test]\n unconstrained fn encrypt_decrypt_random() {\n // Same as `encrypt_decrypt_deterministic`, except we don't mock any of the oracles and rely on\n // `TestEnvironment` instead.\n let mut env = TestEnvironment::new();\n\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n let ciphertext = AES128::encrypt(plaintext, recipient, contract_address);\n\n assert_eq(\n AES128::decrypt(\n BoundedVec::from_array(ciphertext),\n recipient,\n contract_address,\n )\n .unwrap(),\n BoundedVec::from_array(plaintext),\n );\n });\n }\n\n #[test]\n unconstrained fn encrypt_to_invalid_address() {\n // x = 3 is a non-residue for this curve, resulting in an invalid address\n let invalid_address = AztecAddress { inner: 3 };\n let contract_address = AztecAddress { inner: 42 };\n\n let _ = AES128::encrypt([1, 2, 3, 4], invalid_address, contract_address);\n }\n\n // Documents the PKCS#7 padding behavior that `encrypt` relies on (see its static_assert).\n #[test]\n fn pkcs7_padding_always_adds_at_least_one_byte() {\n let key = [0 as u8; 16];\n let iv = [0 as u8; 16];\n\n // 1 byte input + 15 bytes padding = 16 bytes\n assert_eq(std::aes128::aes128_encrypt([0; 1], iv, key).len(), 16);\n\n // 15 bytes input + 1 byte padding = 16 bytes\n assert_eq(std::aes128::aes128_encrypt([0; 15], iv, key).len(), 16);\n\n // 16 bytes input (block-aligned) + full 16-byte padding block = 32 bytes\n assert_eq(std::aes128::aes128_encrypt([0; 16], iv, key).len(), 32);\n }\n\n #[test]\n unconstrained fn encrypt_decrypt_max_size_plaintext() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let mut plaintext = [0; MESSAGE_PLAINTEXT_LEN];\n for i in 0..MESSAGE_PLAINTEXT_LEN {\n plaintext[i] = i as Field;\n }\n let ciphertext = AES128::encrypt(plaintext, recipient, contract_address);\n\n assert_eq(\n AES128::decrypt(\n BoundedVec::from_array(ciphertext),\n recipient,\n contract_address,\n )\n .unwrap(),\n BoundedVec::from_array(plaintext),\n );\n });\n }\n\n #[test(should_fail_with = \"Plaintext length exceeds MESSAGE_PLAINTEXT_LEN\")]\n unconstrained fn encrypt_oversized_plaintext() {\n let address = AztecAddress { inner: 3 };\n let contract_address = AztecAddress { inner: 42 };\n let plaintext: [Field; MESSAGE_PLAINTEXT_LEN + 1] = [0; MESSAGE_PLAINTEXT_LEN + 1];\n let _ = AES128::encrypt(plaintext, address, contract_address);\n }\n\n #[test]\n unconstrained fn random_address_point_produces_valid_points() {\n // About half of random addresses are invalid, so testing just a couple gives us high confidence that\n // `random_address_point` is indeed producing valid addresses.\n for _ in 0..10 {\n let random_address = AztecAddress { inner: random_address_point().inner.x };\n assert(random_address.to_address_point().is_some());\n }\n }\n\n #[test]\n unconstrained fn decrypt_invalid_ephemeral_public_key() {\n let mut env = TestEnvironment::new();\n\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3, 4];\n let ciphertext = AES128::encrypt(plaintext, recipient, contract_address);\n\n // The first field of the ciphertext is the x-coordinate of the ephemeral public key. We set it to a known\n // non-residue (3), causing `decrypt` to fail to produce a decryption shared secret.\n let mut bad_ciphertext = BoundedVec::from_array(ciphertext);\n bad_ciphertext.set(0, 3);\n\n assert(AES128::decrypt(bad_ciphertext, recipient, contract_address).is_none());\n });\n }\n\n #[test]\n unconstrained fn decrypt_returns_none_on_empty_ciphertext() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n assert(AES128::decrypt(BoundedVec::new(), recipient, contract_address).is_none());\n });\n }\n\n // Mocks the header AES decrypt oracle to return an empty result. The TS oracle never throws on invalid\n // input: it decrypts to garbage bytes or returns empty\n #[test]\n unconstrained fn decrypt_returns_none_on_empty_header() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n let ciphertext = BoundedVec::from_array(AES128::encrypt(plaintext, recipient, contract_address));\n\n let empty_header = BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::new();\n let _ = OracleMock::mock(\"aztec_utl_decryptAes128\").returns(Option::some(empty_header)).times(1);\n\n assert(AES128::decrypt(ciphertext, recipient, contract_address).is_none());\n });\n }\n\n // Mocks the header oracle to return a 2-byte header that decodes to a ciphertext_length one past the maximum\n // allowed value, verifying the edge case is handled correctly.\n #[test]\n unconstrained fn decrypt_returns_none_on_oversized_ciphertext_length() {\n let mut env = TestEnvironment::new();\n let recipient = env.create_light_account();\n\n env.private_context(|context| {\n let contract_address = context.this_address();\n let plaintext = [1, 2, 3];\n let ciphertext = BoundedVec::from_array(AES128::encrypt(plaintext, recipient, contract_address));\n\n let bad_header = BoundedVec::<u8, HEADER_CIPHERTEXT_SIZE_IN_BYTES>::from_array(encode_header(\n MESSAGE_PLAINTEXT_SIZE_IN_BYTES + 1,\n ));\n let _ = OracleMock::mock(\"aztec_utl_decryptAes128\").returns(Option::some(bad_header)).times(1);\n\n assert(AES128::decrypt(ciphertext, recipient, contract_address).is_none());\n });\n }\n\n}\n"
|
|
1072
1002
|
},
|
|
1073
|
-
"
|
|
1003
|
+
"140": {
|
|
1074
1004
|
"function_locations": [
|
|
1075
1005
|
{
|
|
1076
1006
|
"name": "encode_private_event_message",
|
|
@@ -1078,25 +1008,25 @@
|
|
|
1078
1008
|
},
|
|
1079
1009
|
{
|
|
1080
1010
|
"name": "decode_private_event_message",
|
|
1081
|
-
"start":
|
|
1011
|
+
"start": 3755
|
|
1082
1012
|
},
|
|
1083
1013
|
{
|
|
1084
1014
|
"name": "test::encode_decode",
|
|
1085
|
-
"start":
|
|
1015
|
+
"start": 5127
|
|
1086
1016
|
},
|
|
1087
1017
|
{
|
|
1088
1018
|
"name": "test::decode_empty_content_returns_none",
|
|
1089
|
-
"start":
|
|
1019
|
+
"start": 5869
|
|
1090
1020
|
},
|
|
1091
1021
|
{
|
|
1092
1022
|
"name": "test::decode_with_only_reserved_fields_returns_none",
|
|
1093
|
-
"start":
|
|
1023
|
+
"start": 6064
|
|
1094
1024
|
}
|
|
1095
1025
|
],
|
|
1096
1026
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/logs/event.nr",
|
|
1097
|
-
"source": "use crate::{\n event::{event_interface::EventInterface, EventSelector},\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PRIVATE_EVENT_MSG_TYPE_ID,\n },\n utils::array,\n};\nuse crate::protocol::traits::{FromField, Serialize, ToField};\n\n/// The number of fields in a private event message content that are not the event's serialized representation (1 field\n/// for randomness).\npub(crate) global PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 1;\npub(crate) global PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 0;\n\n/// The maximum length of the packed representation of an event's contents. This is limited by private log size,\n/// encryption overhead and extra fields in the message (e.g. message type id, randomness, etc.).\npub global MAX_EVENT_SERIALIZED_LEN: u32 = MAX_MESSAGE_CONTENT_LEN - PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_private_event_message`].\npub fn encode_private_event_message<Event>(\n event: Event,\n randomness: Field,\n) -> [Field; PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Event as Serialize>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n Event: EventInterface + Serialize,\n{\n // We use `Serialize` because we want for events to be processable by off-chain actors, e.g. block explorers,\n // wallets and apps, without having to rely on contract invocation. If we used `Packable` we'd need to call utility\n // functions in order to unpack events, which would introduce a level of complexity we don't currently think is\n // worth the savings in DA (for public events) and proving time (when encrypting private event messages).\n let serialized_event = event.serialize();\n\n // If PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // encoding below must be updated as well.\n std::static_assert(\n PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let mut msg_plaintext = [0; PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Event as Serialize>::N];\n msg_plaintext[PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n\n for i in 0..serialized_event.len() {\n msg_plaintext[PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = serialized_event[i];\n }\n\n // The event type id is stored in the message metadata\n encode_message(\n PRIVATE_EVENT_MSG_TYPE_ID,\n Event::get_event_type_id().to_field() as u64,\n msg_plaintext,\n )\n}\n\n/// Decodes the plaintext from a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_private_event_message`].\n///\n/// Note that while [`encode_private_event_message`] returns a fixed-size array, this function takes a [`BoundedVec`]\n/// instead. This is because when decoding we're typically processing runtime-sized plaintexts, more specifically,\n/// those that originate from [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_private_event_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(EventSelector, Field, BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>)> {\n if msg_content.len() <= PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let event_type_id = EventSelector::from_field(msg_metadata as Field);\n\n // If PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // destructuring of the private event message encoding below must be updated as well.\n std::static_assert(\n PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let randomness = msg_content.get(PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let serialized_event = array::subbvec(msg_content, PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN);\n\n Option::some((event_type_id, randomness, serialized_event))\n }\n}\n\nmod test {\n use crate::{\n event::event_interface::EventInterface,\n messages::{\n encoding::decode_message,\n logs::event::{decode_private_event_message, encode_private_event_message},\n msg_type::PRIVATE_EVENT_MSG_TYPE_ID,\n },\n };\n use crate::protocol::traits::Serialize;\n use crate::test::mocks::mock_event::MockEvent;\n\n global VALUE: Field = 7;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn encode_decode() {\n let event = MockEvent::new(VALUE).build_event();\n\n let message_plaintext = encode_private_event_message(event, RANDOMNESS);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_EVENT_MSG_TYPE_ID);\n\n let (event_type_id, randomness, serialized_event) =\n decode_private_event_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(event_type_id, MockEvent::get_event_type_id());\n assert_eq(randomness, RANDOMNESS);\n assert_eq(serialized_event, BoundedVec::from_array(event.serialize()));\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_private_event_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_with_only_reserved_fields_returns_none() {\n let content = BoundedVec::from_array([0]);\n assert(decode_private_event_message(0, content).is_none());\n }\n}\n"
|
|
1027
|
+
"source": "use crate::{\n event::{event_interface::EventInterface, EventSelector},\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PRIVATE_EVENT_MSG_TYPE_ID,\n },\n utils::array,\n};\nuse crate::protocol::traits::{FromField, Serialize, ToField};\n\n/// The number of fields in a private event message content that are not the event's serialized representation (1 field\n/// for randomness).\npub(crate) global PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 1;\npub(crate) global PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 0;\n\n/// The maximum length of the packed representation of an event's contents. This is limited by private log size,\n/// encryption overhead and extra fields in the message (e.g. message type id, randomness, etc.).\npub global MAX_EVENT_SERIALIZED_LEN: u32 = MAX_MESSAGE_CONTENT_LEN - PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_private_event_message`].\npub fn encode_private_event_message<Event>(\n event: Event,\n randomness: Field,\n) -> [Field; PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Event as Serialize>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n Event: EventInterface + Serialize,\n{\n std::static_assert(\n <Event as Serialize>::N <= MAX_EVENT_SERIALIZED_LEN,\n \"event's serialized length exceeds the maximum allowed for private events\",\n );\n\n // We use `Serialize` because we want for events to be processable by off-chain actors, e.g. block explorers,\n // wallets and apps, without having to rely on contract invocation. If we used `Packable` we'd need to call utility\n // functions in order to unpack events, which would introduce a level of complexity we don't currently think is\n // worth the savings in DA (for public events) and proving time (when encrypting private event messages).\n let serialized_event = event.serialize();\n\n // If PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // encoding below must be updated as well.\n std::static_assert(\n PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let mut msg_plaintext = [0; PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Event as Serialize>::N];\n msg_plaintext[PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n\n for i in 0..serialized_event.len() {\n msg_plaintext[PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = serialized_event[i];\n }\n\n // The event type id is stored in the message metadata\n encode_message(\n PRIVATE_EVENT_MSG_TYPE_ID,\n Event::get_event_type_id().to_field() as u64,\n msg_plaintext,\n )\n}\n\n/// Decodes the plaintext from a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_private_event_message`].\n///\n/// Note that while [`encode_private_event_message`] returns a fixed-size array, this function takes a [`BoundedVec`]\n/// instead. This is because when decoding we're typically processing runtime-sized plaintexts, more specifically,\n/// those that originate from [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_private_event_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(EventSelector, Field, BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>)> {\n if msg_content.len() <= PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let event_type_id = EventSelector::from_field(msg_metadata as Field);\n\n // If PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // destructuring of the private event message encoding below must be updated as well.\n std::static_assert(\n PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 1,\n \"unexpected value for PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let randomness = msg_content.get(PRIVATE_EVENT_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let serialized_event = array::subbvec(msg_content, PRIVATE_EVENT_MSG_PLAINTEXT_RESERVED_FIELDS_LEN);\n\n Option::some((event_type_id, randomness, serialized_event))\n }\n}\n\nmod test {\n use crate::{\n event::event_interface::EventInterface,\n messages::{\n encoding::decode_message,\n logs::event::{decode_private_event_message, encode_private_event_message},\n msg_type::PRIVATE_EVENT_MSG_TYPE_ID,\n },\n };\n use crate::protocol::traits::Serialize;\n use crate::test::mocks::mock_event::MockEvent;\n\n global VALUE: Field = 7;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn encode_decode() {\n let event = MockEvent::new(VALUE).build_event();\n\n let message_plaintext = encode_private_event_message(event, RANDOMNESS);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_EVENT_MSG_TYPE_ID);\n\n let (event_type_id, randomness, serialized_event) =\n decode_private_event_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(event_type_id, MockEvent::get_event_type_id());\n assert_eq(randomness, RANDOMNESS);\n assert_eq(serialized_event, BoundedVec::from_array(event.serialize()));\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_private_event_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_with_only_reserved_fields_returns_none() {\n let content = BoundedVec::from_array([0]);\n assert(decode_private_event_message(0, content).is_none());\n }\n}\n"
|
|
1098
1028
|
},
|
|
1099
|
-
"
|
|
1029
|
+
"142": {
|
|
1100
1030
|
"function_locations": [
|
|
1101
1031
|
{
|
|
1102
1032
|
"name": "encode_private_note_message",
|
|
@@ -1138,7 +1068,7 @@
|
|
|
1138
1068
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/logs/note.nr",
|
|
1139
1069
|
"source": "use crate::{\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PRIVATE_NOTE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n utils::array,\n};\nuse crate::protocol::{address::AztecAddress, traits::{FromField, Packable, ToField}};\n\n/// The number of fields in a private note message content that are not the note's packed representation.\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 3;\n\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_OWNER_INDEX: u32 = 0;\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_STORAGE_SLOT_INDEX: u32 = 1;\npub(crate) global PRIVATE_NOTE_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 2;\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 message (e.g. message type id, storage slot, randomness, etc.).\npub global MAX_NOTE_PACKED_LEN: u32 = MAX_MESSAGE_CONTENT_LEN - PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a private note message (i.e. one of type [`PRIVATE_NOTE_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_private_note_message`].\npub fn encode_private_note_message<Note>(\n note: Note,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n) -> [Field; PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Note as Packable>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n Note: NoteType + Packable,\n{\n let packed_note = note.pack();\n\n // If PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // encoding below must be updated as well.\n std::static_assert(\n PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let mut msg_content = [0; PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <Note as Packable>::N];\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_OWNER_INDEX] = owner.to_field();\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_STORAGE_SLOT_INDEX] = storage_slot;\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n for i in 0..packed_note.len() {\n msg_content[PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = packed_note[i];\n }\n\n // Notes use the note type id for metadata\n encode_message(PRIVATE_NOTE_MSG_TYPE_ID, Note::get_id() as u64, msg_content)\n}\n\n/// Decodes the plaintext from a private note message (i.e. one of type [`PRIVATE_NOTE_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_private_note_message`].\n///\n/// Note that while [`encode_private_note_message`] returns a fixed-size array, this function takes a [`BoundedVec`]\n/// instead. This is because when decoding we're typically processing runtime-sized plaintexts, more specifically,\n/// those that originate from [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_private_note_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(Field, AztecAddress, Field, Field, BoundedVec<Field, MAX_NOTE_PACKED_LEN>)> {\n if msg_content.len() <= PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let note_type_id = msg_metadata as Field; // TODO: make note type id not be a full field\n\n // If PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN is changed, causing the assertion below to fail, then the\n // decoding below must be updated as well.\n std::static_assert(\n PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN\",\n );\n\n let owner = AztecAddress::from_field(msg_content.get(PRIVATE_NOTE_MSG_PLAINTEXT_OWNER_INDEX));\n let storage_slot = msg_content.get(PRIVATE_NOTE_MSG_PLAINTEXT_STORAGE_SLOT_INDEX);\n let randomness = msg_content.get(PRIVATE_NOTE_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let packed_note = array::subbvec(msg_content, PRIVATE_NOTE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN);\n\n Option::some((note_type_id, owner, storage_slot, randomness, packed_note))\n }\n}\n\nmod test {\n use crate::{\n messages::{\n encoding::decode_message,\n logs::note::{decode_private_note_message, encode_private_note_message, MAX_NOTE_PACKED_LEN},\n msg_type::PRIVATE_NOTE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, Packable}};\n use crate::test::mocks::mock_note::MockNote;\n\n global VALUE: Field = 7;\n global OWNER: AztecAddress = AztecAddress::from_field(8);\n global STORAGE_SLOT: Field = 9;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn encode_decode() {\n let note = MockNote::new(VALUE).build_note();\n\n let message_plaintext = encode_private_note_message(note, OWNER, STORAGE_SLOT, RANDOMNESS);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_NOTE_MSG_TYPE_ID);\n\n let (note_type_id, owner, storage_slot, randomness, packed_note) =\n decode_private_note_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(note_type_id, MockNote::get_id());\n assert_eq(owner, OWNER);\n assert_eq(storage_slot, STORAGE_SLOT);\n assert_eq(randomness, RANDOMNESS);\n assert_eq(packed_note, BoundedVec::from_array(note.pack()));\n }\n\n #[derive(Packable)]\n struct MaxSizeNote {\n data: [Field; MAX_NOTE_PACKED_LEN],\n }\n\n impl NoteType for MaxSizeNote {\n fn get_id() -> Field {\n 0\n }\n }\n\n #[test]\n unconstrained fn encode_decode_max_size_note() {\n let mut data = [0; MAX_NOTE_PACKED_LEN];\n for i in 0..MAX_NOTE_PACKED_LEN {\n data[i] = i as Field;\n }\n let note = MaxSizeNote { data };\n\n let encoded = encode_private_note_message(note, OWNER, STORAGE_SLOT, RANDOMNESS);\n let (msg_type_id, msg_metadata, msg_content) = decode_message(BoundedVec::from_array(encoded)).unwrap();\n\n assert_eq(msg_type_id, PRIVATE_NOTE_MSG_TYPE_ID);\n\n let (note_type_id, owner, storage_slot, randomness, packed_note) =\n decode_private_note_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(note_type_id, MaxSizeNote::get_id());\n assert_eq(owner, OWNER);\n assert_eq(storage_slot, STORAGE_SLOT);\n assert_eq(randomness, RANDOMNESS);\n assert_eq(packed_note, BoundedVec::from_array(data));\n }\n\n #[derive(Packable)]\n struct OversizedNote {\n data: [Field; MAX_NOTE_PACKED_LEN + 1],\n }\n\n impl NoteType for OversizedNote {\n fn get_id() -> Field {\n 0\n }\n }\n\n #[test(should_fail_with = \"Invalid message content: it must have a length of at most MAX_MESSAGE_CONTENT_LEN\")]\n fn encode_oversized_note_fails() {\n let note = OversizedNote { data: [0; MAX_NOTE_PACKED_LEN + 1] };\n let _ = encode_private_note_message(note, OWNER, STORAGE_SLOT, RANDOMNESS);\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_private_note_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_with_only_reserved_fields_returns_none() {\n let content = BoundedVec::from_array([0, 0, 0]);\n assert(decode_private_note_message(0, content).is_none());\n }\n}\n"
|
|
1140
1070
|
},
|
|
1141
|
-
"
|
|
1071
|
+
"143": {
|
|
1142
1072
|
"function_locations": [
|
|
1143
1073
|
{
|
|
1144
1074
|
"name": "encode_partial_note_private_message",
|
|
@@ -1164,85 +1094,81 @@
|
|
|
1164
1094
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/logs/partial_note.nr",
|
|
1165
1095
|
"source": "use crate::{\n messages::{\n encoding::{encode_message, MAX_MESSAGE_CONTENT_LEN, MESSAGE_EXPANDED_METADATA_LEN},\n msg_type::PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n utils::array,\n};\nuse crate::protocol::{address::AztecAddress, traits::{FromField, Packable, ToField}};\n\n/// The number of fields in a private note message content that are not the note's packed representation.\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN: u32 = 3;\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_OWNER_INDEX: u32 = 0;\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RANDOMNESS_INDEX: u32 = 1;\npub(crate) global PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NOTE_COMPLETION_LOG_TAG_INDEX: u32 = 2;\n\n/// Partial notes have a maximum packed length of their private fields bound by extra content in their private message\n/// (e.g. the storage slot, note completion log tag, etc.).\npub global MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN: u32 =\n MAX_MESSAGE_CONTENT_LEN - PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN;\n\n/// Creates the plaintext for a partial note private message (i.e. one of type [`PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID`]).\n///\n/// This plaintext is meant to be decoded via [`decode_partial_note_private_message`].\npub fn encode_partial_note_private_message<PartialNotePrivateContent>(\n partial_note_private_content: PartialNotePrivateContent,\n owner: AztecAddress,\n randomness: Field,\n note_completion_log_tag: Field,\n ) -> [Field; PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <PartialNotePrivateContent as Packable>::N + MESSAGE_EXPANDED_METADATA_LEN]\nwhere\n PartialNotePrivateContent: NoteType + Packable,\n{\n let packed_private_content = partial_note_private_content.pack();\n\n // If PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN is changed, causing the assertion below to fail, then\n // the encoding below must be updated as well.\n std::static_assert(\n PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN\",\n );\n\n let mut msg_content =\n [0; PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + <PartialNotePrivateContent as Packable>::N];\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_OWNER_INDEX] = owner.to_field();\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RANDOMNESS_INDEX] = randomness;\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NOTE_COMPLETION_LOG_TAG_INDEX] = note_completion_log_tag;\n\n for i in 0..packed_private_content.len() {\n msg_content[PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN + i] = packed_private_content[i];\n }\n\n encode_message(\n PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID,\n // Notes use the note type id for metadata\n PartialNotePrivateContent::get_id() as u64,\n msg_content,\n )\n}\n\n/// Decodes the plaintext from a partial note private message (i.e. one of type\n/// [`PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID`]).\n///\n/// Returns `None` if `msg_content` has too few fields. This plaintext is meant to have originated\n/// from [`encode_partial_note_private_message`].\n///\n/// Note that while [`encode_partial_note_private_message`] returns a fixed-size array, this function takes a\n/// [`BoundedVec`] instead. This is because when decoding we're typically processing runtime-sized plaintexts, more\n/// specifically, those that originate from\n/// [`crate::messages::encryption::message_encryption::MessageEncryption::decrypt`].\npub(crate) unconstrained fn decode_partial_note_private_message(\n msg_metadata: u64,\n msg_content: BoundedVec<Field, MAX_MESSAGE_CONTENT_LEN>,\n) -> Option<(AztecAddress, Field, Field, Field, BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN>)> {\n if msg_content.len() < PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN {\n Option::none()\n } else {\n let note_type_id: Field = msg_metadata as Field; // TODO: make note type id not be a full field\n\n // If PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN is changed, causing the assertion below to fail,\n // then the destructuring of the partial note private message encoding below must be updated as well.\n std::static_assert(\n PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN == 3,\n \"unexpected value for PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NON_NOTE_FIELDS_LEN\",\n );\n\n // We currently have three fields that are not the partial note's packed representation, which are the owner,\n // the randomness, and the note completion log tag.\n let owner = AztecAddress::from_field(\n msg_content.get(PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_OWNER_INDEX),\n );\n let randomness = msg_content.get(PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RANDOMNESS_INDEX);\n let note_completion_log_tag = msg_content.get(PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_NOTE_COMPLETION_LOG_TAG_INDEX);\n\n let packed_private_note_content: BoundedVec<Field, MAX_PARTIAL_NOTE_PRIVATE_PACKED_LEN> = array::subbvec(\n msg_content,\n PARTIAL_NOTE_PRIVATE_MSG_PLAINTEXT_RESERVED_FIELDS_LEN,\n );\n\n Option::some(\n (owner, randomness, note_completion_log_tag, note_type_id, packed_private_note_content),\n )\n }\n}\n\nmod test {\n use crate::{\n messages::{\n encoding::decode_message,\n logs::partial_note::{decode_partial_note_private_message, encode_partial_note_private_message},\n msg_type::PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID,\n },\n note::note_interface::NoteType,\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, Packable}};\n use crate::test::mocks::mock_note::MockNote;\n\n global VALUE: Field = 7;\n global OWNER: AztecAddress = AztecAddress::from_field(8);\n global RANDOMNESS: Field = 10;\n global NOTE_COMPLETION_LOG_TAG: Field = 11;\n\n #[test]\n unconstrained fn encode_decode() {\n // Note that here we use MockNote as the private fields of a partial note\n let note = MockNote::new(VALUE).build_note();\n\n let message_plaintext = encode_partial_note_private_message(note, OWNER, RANDOMNESS, NOTE_COMPLETION_LOG_TAG);\n\n let (msg_type_id, msg_metadata, msg_content) =\n decode_message(BoundedVec::from_array(message_plaintext)).unwrap();\n\n assert_eq(msg_type_id, PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID);\n\n let (owner, randomness, note_completion_log_tag, note_type_id, packed_note) =\n decode_partial_note_private_message(msg_metadata, msg_content).unwrap();\n\n assert_eq(note_type_id, MockNote::get_id());\n assert_eq(owner, OWNER);\n assert_eq(randomness, RANDOMNESS);\n assert_eq(note_completion_log_tag, NOTE_COMPLETION_LOG_TAG);\n assert_eq(packed_note, BoundedVec::from_array(note.pack()));\n }\n\n #[test]\n unconstrained fn decode_empty_content_returns_none() {\n let empty = BoundedVec::new();\n assert(decode_partial_note_private_message(0, empty).is_none());\n }\n\n #[test]\n unconstrained fn decode_succeeds_with_only_reserved_fields() {\n let content = BoundedVec::from_array([0, 0, 0]);\n let (_, _, _, _, packed_note) = decode_partial_note_private_message(0, content).unwrap();\n assert_eq(packed_note.len(), 0);\n }\n}\n"
|
|
1166
1096
|
},
|
|
1167
|
-
"
|
|
1097
|
+
"153": {
|
|
1168
1098
|
"function_locations": [
|
|
1169
|
-
{
|
|
1170
|
-
"name": "get_private_logs",
|
|
1171
|
-
"start": 2409
|
|
1172
|
-
},
|
|
1173
1099
|
{
|
|
1174
1100
|
"name": "enqueue_note_for_validation",
|
|
1175
|
-
"start":
|
|
1101
|
+
"start": 3763
|
|
1176
1102
|
},
|
|
1177
1103
|
{
|
|
1178
1104
|
"name": "enqueue_event_for_validation",
|
|
1179
|
-
"start":
|
|
1105
|
+
"start": 5177
|
|
1180
1106
|
},
|
|
1181
1107
|
{
|
|
1182
1108
|
"name": "validate_and_store_enqueued_notes_and_events",
|
|
1183
|
-
"start":
|
|
1184
|
-
},
|
|
1185
|
-
{
|
|
1186
|
-
"name": "get_message_contexts_by_tx_hash",
|
|
1187
|
-
"start": 8520
|
|
1109
|
+
"start": 5884
|
|
1188
1110
|
},
|
|
1189
1111
|
{
|
|
1190
1112
|
"name": "get_pending_partial_notes_completion_logs",
|
|
1191
|
-
"start":
|
|
1113
|
+
"start": 7412
|
|
1192
1114
|
}
|
|
1193
1115
|
],
|
|
1194
1116
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/processing/mod.nr",
|
|
1195
|
-
"source": "pub(crate) mod event_validation_request;\npub mod offchain;\n\nmod message_context;\npub use message_context::MessageContext;\n\npub(crate) mod note_validation_request;\npub(crate) mod log_retrieval_request;\npub(crate) mod log_retrieval_response;\npub(crate) mod pending_tagged_log;\n\nuse crate::{\n capsules::CapsuleArray,\n event::EventSelector,\n messages::{\n discovery::partial_notes::DeliveredPendingPartialNote,\n encoding::MESSAGE_CIPHERTEXT_LEN,\n logs::{event::MAX_EVENT_SERIALIZED_LEN, note::MAX_NOTE_PACKED_LEN},\n processing::{\n log_retrieval_request::LogRetrievalRequest, log_retrieval_response::LogRetrievalResponse,\n note_validation_request::NoteValidationRequest, pending_tagged_log::PendingTaggedLog,\n },\n },\n oracle,\n};\nuse crate::protocol::{\n address::AztecAddress,\n constants::DOM_SEP__NOTE_COMPLETION_LOG_TAG,\n hash::{compute_log_tag, sha256_to_field},\n traits::{Deserialize, Serialize},\n};\nuse event_validation_request::EventValidationRequest;\n\n// Base slot for the pending tagged log array to which the fetch_tagged_logs oracle inserts found private logs.\npub(crate) global PENDING_TAGGED_LOG_ARRAY_BASE_SLOT: Field =\n sha256_to_field(\"AZTEC_NR::PENDING_TAGGED_LOG_ARRAY_BASE_SLOT\".as_bytes());\n\nglobal NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\n/// An offchain-delivered message with resolved context, ready for processing during sync.\n#[derive(Serialize, Deserialize)]\npub struct OffchainMessageWithContext {\n pub message_ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n pub message_context: MessageContext,\n}\n\n/// Searches for private logs emitted by `contract_address` that might contain messages for the given `scope`.\npub(crate) unconstrained fn get_private_logs(\n contract_address: AztecAddress,\n scope: AztecAddress,\n) -> CapsuleArray<PendingTaggedLog> {\n // We will eventually perform log discovery via tagging here, but for now we simply call the `fetchTaggedLogs`\n // oracle. This makes PXE synchronize tags, download logs and store the pending tagged logs in a capsule array.\n oracle::message_processing::fetch_tagged_logs(PENDING_TAGGED_LOG_ARRAY_BASE_SLOT, scope);\n\n CapsuleArray::at(contract_address, PENDING_TAGGED_LOG_ARRAY_BASE_SLOT, scope)\n}\n\n/// Enqueues a note for validation and storage by PXE.\n///\n/// Once validated, the note becomes retrievable via the `get_notes` oracle. The note will be scoped to\n/// `contract_address`, meaning other contracts will not be able to access it unless authorized.\n///\n/// In order for the note validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be\n/// later called. For optimal performance, accumulate as many note validation requests as possible and then validate\n/// them all at the end (which results in PXE minimizing the number of network round-trips).\n///\n/// The `packed_note` is what `getNotes` will later return. PXE indexes notes by `storage_slot`, so this value is\n/// typically used to filter notes that correspond to different state variables. `note_hash` and `nullifier` are the\n/// inner hashes, i.e. the raw hashes returned by `NoteHash::compute_note_hash` and `NoteHash::compute_nullifier`. PXE\n/// will verify that the siloed unique note hash was inserted into the tree at `tx_hash`, and will store the nullifier\n/// to later check for nullification.\n///\n/// `owner` is the address used in note hash and nullifier computation, often requiring knowledge of their nullifier\n/// secret key.\n///\n/// `scope` is the account to which the note message was delivered (i.e. the address the message was encrypted to).\n/// This determines which PXE account can see the note - other accounts will not be able to access it (e.g. other\n/// accounts will not be able to see one another's token balance notes, even in the same PXE) unless authorized. In\n/// most cases `recipient` equals `owner`, but they can differ in scenarios like delegated discovery.\npub unconstrained fn enqueue_note_for_validation(\n contract_address: AztecAddress,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n note_nonce: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n note_hash: Field,\n nullifier: Field,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n // We store requests in a `CapsuleArray`, which PXE will later read from and deserialize into its version of the\n // Noir `NoteValidationRequest`\n CapsuleArray::at(\n contract_address,\n NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n scope,\n )\n .push(\n NoteValidationRequest {\n contract_address,\n owner,\n storage_slot,\n randomness,\n note_nonce,\n packed_note,\n note_hash,\n nullifier,\n tx_hash,\n },\n )\n}\n\n/// Enqueues an event for validation and storage by PXE.\n///\n/// This is the primary way for custom message handlers (registered via\n/// [`crate::macros::AztecConfig::custom_message_handler`]) to deliver reassembled events back to PXE after processing\n/// application-specific message formats.\n///\n/// In order for the event validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be\n/// later called. For optimal performance, accumulate as many event validation requests as possible and then validate\n/// them all at the end (which results in PXE minimizing the number of network round-trips).\n///\n/// Note that `validate_and_store_enqueued_notes_and_events` is called by Aztec.nr after processing messages, so custom\n/// message processors do not need to be concerned with this.\npub unconstrained fn enqueue_event_for_validation(\n contract_address: AztecAddress,\n event_type_id: EventSelector,\n randomness: Field,\n serialized_event: BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>,\n event_commitment: Field,\n tx_hash: Field,\n scope: AztecAddress,\n) {\n // We store requests in a `CapsuleArray`, which PXE will later read from and deserialize into its version of the\n // Noir `EventValidationRequest`\n CapsuleArray::at(\n contract_address,\n EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n scope,\n )\n .push(\n EventValidationRequest {\n contract_address,\n event_type_id,\n randomness,\n serialized_event,\n event_commitment,\n tx_hash,\n },\n )\n}\n\n/// Validates and stores all enqueued notes and events.\n///\n/// Processes all requests enqueued via [`enqueue_note_for_validation`] and [`enqueue_event_for_validation`], inserting\n/// them into the note database and event store respectively, making them queryable via `get_notes` oracle and our TS\n/// API (PXE::getPrivateEvents).\n///\n/// This automatically clears both validation request queues, so no further work needs to be done by the caller.\npub unconstrained fn validate_and_store_enqueued_notes_and_events(contract_address: AztecAddress, scope: AztecAddress) {\n oracle::message_processing::validate_and_store_enqueued_notes_and_events(\n contract_address,\n NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n MAX_NOTE_PACKED_LEN as Field,\n MAX_EVENT_SERIALIZED_LEN as Field,\n scope,\n );\n}\n\n/// Resolves message contexts for a list of tx hashes stored in a CapsuleArray.\n///\n/// The `message_context_requests_array_base_slot` must point to a CapsuleArray<Field> containing tx hashes.\n/// PXE will store `Option<MessageContextResponse>` values into the responses array at\n/// `message_context_responses_array_base_slot`.\npub unconstrained fn get_message_contexts_by_tx_hash(\n contract_address: AztecAddress,\n message_context_requests_array_base_slot: Field,\n message_context_responses_array_base_slot: Field,\n scope: AztecAddress,\n) {\n oracle::message_processing::get_message_contexts_by_tx_hash(\n contract_address,\n message_context_requests_array_base_slot,\n message_context_responses_array_base_slot,\n scope,\n );\n}\n\n/// Efficiently queries the node for logs that result in the completion of all `DeliveredPendingPartialNote`s stored in\n/// a `CapsuleArray` by performing all node communication concurrently. Returns a second `CapsuleArray` with Options\n/// for the responses that correspond to the pending partial notes at the same index.\n///\n/// For example, given an array with pending partial notes `[ p1, p2, p3 ]`, where `p1` and `p3` have corresponding\n/// completion logs but `p2` does not, the returned `CapsuleArray` will have contents `[some(p1_log), none(),\n/// some(p3_log)]`.\npub(crate) unconstrained fn get_pending_partial_notes_completion_logs(\n contract_address: AztecAddress,\n pending_partial_notes: CapsuleArray<DeliveredPendingPartialNote>,\n scope: AztecAddress,\n) -> CapsuleArray<Option<LogRetrievalResponse>> {\n let log_retrieval_requests = CapsuleArray::at(\n contract_address,\n LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT,\n scope,\n );\n\n // We create a LogRetrievalRequest for each PendingPartialNote in the CapsuleArray. Because we need the indices in\n // the request array to match the indices in the partial note array, we can't use CapsuleArray::for_each, as that\n // function has arbitrary iteration order. Instead, we manually iterate the array from the beginning and push into\n // the requests array, which we expect to be empty.\n let mut i = 0;\n let pending_partial_notes_count = pending_partial_notes.len();\n while i < pending_partial_notes_count {\n let pending_partial_note = pending_partial_notes.get(i);\n // Partial note completion logs are emitted with a domain-separated tag. To find matching logs, we apply the\n // same domain separation to the stored raw tag.\n let log_tag = compute_log_tag(\n pending_partial_note.note_completion_log_tag,\n DOM_SEP__NOTE_COMPLETION_LOG_TAG,\n );\n log_retrieval_requests.push(LogRetrievalRequest { contract_address, unsiloed_tag: log_tag });\n i += 1;\n }\n\n oracle::message_processing::get_logs_by_tag(\n contract_address,\n LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT,\n LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT,\n scope,\n );\n\n CapsuleArray::at(\n contract_address,\n LOG_RETRIEVAL_RESPONSES_ARRAY_BASE_SLOT,\n scope,\n )\n}\n"
|
|
1117
|
+
"source": "pub(crate) mod event_validation_request;\npub mod offchain;\n\nmod message_context;\npub use message_context::MessageContext;\n\npub(crate) mod note_validation_request;\npub(crate) mod log_retrieval_request;\npub(crate) mod log_retrieval_response;\npub(crate) mod pending_tagged_log;\n\nuse crate::{\n capsules::CapsuleArray,\n ephemeral::EphemeralArray,\n event::EventSelector,\n messages::{\n discovery::partial_notes::DeliveredPendingPartialNote,\n encoding::MESSAGE_CIPHERTEXT_LEN,\n logs::{event::MAX_EVENT_SERIALIZED_LEN, note::MAX_NOTE_PACKED_LEN},\n processing::{\n log_retrieval_request::LogRetrievalRequest, log_retrieval_response::LogRetrievalResponse,\n note_validation_request::NoteValidationRequest,\n },\n },\n oracle::message_processing,\n};\nuse crate::protocol::{\n address::AztecAddress,\n constants::DOM_SEP__NOTE_COMPLETION_LOG_TAG,\n hash::{compute_log_tag, sha256_to_field},\n traits::{Deserialize, Serialize},\n};\nuse event_validation_request::EventValidationRequest;\n\nglobal NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\nglobal LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT: Field = sha256_to_field(\n \"AZTEC_NR::LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT\".as_bytes(),\n);\n\n/// An offchain-delivered message with resolved context, ready for processing during sync.\n#[derive(Serialize, Deserialize)]\npub struct OffchainMessageWithContext {\n pub message_ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n pub message_context: MessageContext,\n}\n\n/// Enqueues a note for validation and storage by PXE.\n///\n/// Once validated, the note becomes retrievable via the `get_notes` oracle. The note will be scoped to\n/// `contract_address`, meaning other contracts will not be able to access it unless authorized.\n///\n/// In order for the note validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be\n/// later called. For optimal performance, accumulate as many note validation requests as possible and then validate\n/// them all at the end (which results in PXE minimizing the number of network round-trips).\n///\n/// The `packed_note` is what `getNotes` will later return. PXE indexes notes by `storage_slot`, so this value is\n/// typically used to filter notes that correspond to different state variables. `note_hash` and `nullifier` are the\n/// inner hashes, i.e. the raw hashes returned by `NoteHash::compute_note_hash` and `NoteHash::compute_nullifier`. PXE\n/// will verify that the siloed unique note hash was inserted into the tree at `tx_hash`, and will store the nullifier\n/// to later check for nullification.\n///\n/// `owner` is the address used in note hash and nullifier computation, often requiring knowledge of their nullifier\n/// secret key.\n///\n/// `scope` is the account to which the note message was delivered (i.e. the address the message was encrypted to).\n/// This determines which PXE account can see the note - other accounts will not be able to access it (e.g. other\n/// accounts will not be able to see one another's token balance notes, even in the same PXE) unless authorized. In\n/// most cases `recipient` equals `owner`, but they can differ in scenarios like delegated discovery.\npub unconstrained fn enqueue_note_for_validation(\n contract_address: AztecAddress,\n owner: AztecAddress,\n storage_slot: Field,\n randomness: Field,\n note_nonce: Field,\n packed_note: BoundedVec<Field, MAX_NOTE_PACKED_LEN>,\n note_hash: Field,\n nullifier: Field,\n tx_hash: Field,\n) {\n EphemeralArray::at(NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT).push(\n NoteValidationRequest {\n contract_address,\n owner,\n storage_slot,\n randomness,\n note_nonce,\n packed_note,\n note_hash,\n nullifier,\n tx_hash,\n },\n )\n}\n\n/// Enqueues an event for validation and storage by PXE.\n///\n/// This is the primary way for custom message handlers (registered via\n/// [`crate::macros::AztecConfig::custom_message_handler`]) to deliver reassembled events back to PXE after processing\n/// application-specific message formats.\n///\n/// In order for the event validation and insertion to occur, `validate_and_store_enqueued_notes_and_events` must be\n/// later called. For optimal performance, accumulate as many event validation requests as possible and then validate\n/// them all at the end (which results in PXE minimizing the number of network round-trips).\n///\n/// Note that `validate_and_store_enqueued_notes_and_events` is called by Aztec.nr after processing messages, so custom\n/// message processors do not need to be concerned with this.\npub unconstrained fn enqueue_event_for_validation(\n contract_address: AztecAddress,\n event_type_id: EventSelector,\n randomness: Field,\n serialized_event: BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>,\n event_commitment: Field,\n tx_hash: Field,\n) {\n EphemeralArray::at(EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT).push(\n EventValidationRequest {\n contract_address,\n event_type_id,\n randomness,\n serialized_event,\n event_commitment,\n tx_hash,\n },\n )\n}\n\n/// Validates and stores all enqueued notes and events.\n///\n/// Processes all requests enqueued via [`enqueue_note_for_validation`] and [`enqueue_event_for_validation`], inserting\n/// them into the note database and event store respectively, making them queryable via `get_notes` oracle and our TS\n/// API (PXE::getPrivateEvents).\npub unconstrained fn validate_and_store_enqueued_notes_and_events(scope: AztecAddress) {\n message_processing::validate_and_store_enqueued_notes_and_events(\n NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT,\n MAX_NOTE_PACKED_LEN as Field,\n MAX_EVENT_SERIALIZED_LEN as Field,\n scope,\n );\n\n // Defensive clearing: purge the queues after processing to prevent double-processing if this function is called\n // more than once in the same call frame. It is currently defensive because we only call this once per sync run.\n let _ = EphemeralArray::<NoteValidationRequest>::at(NOTE_VALIDATION_REQUESTS_ARRAY_BASE_SLOT).clear();\n let _ = EphemeralArray::<EventValidationRequest>::at(EVENT_VALIDATION_REQUESTS_ARRAY_BASE_SLOT).clear();\n}\n\n/// Efficiently queries the node for logs that result in the completion of all `DeliveredPendingPartialNote`s stored in\n/// a `CapsuleArray` by performing all node communication concurrently. Returns an `EphemeralArray` with Options\n/// for the responses that correspond to the pending partial notes at the same index.\n///\n/// For example, given an array with pending partial notes `[ p1, p2, p3 ]`, where `p1` and `p3` have corresponding\n/// completion logs but `p2` does not, the returned `EphemeralArray` will have contents `[some(p1_log), none(),\n/// some(p3_log)]`.\npub(crate) unconstrained fn get_pending_partial_notes_completion_logs(\n contract_address: AztecAddress,\n pending_partial_notes: CapsuleArray<DeliveredPendingPartialNote>,\n) -> EphemeralArray<Option<LogRetrievalResponse>> {\n let log_retrieval_requests = EphemeralArray::at(LOG_RETRIEVAL_REQUESTS_ARRAY_BASE_SLOT);\n\n // We create a LogRetrievalRequest for each PendingPartialNote in the EphemeralArray. Because we need the indices in\n // the request array to match the indices in the partial note array, we can't use EphemeralArray::for_each, as that\n // function has arbitrary iteration order. Instead, we manually iterate the array from the beginning and push into\n // the requests array, which we expect to be empty.\n let mut i = 0;\n let pending_partial_notes_count = pending_partial_notes.len();\n while i < pending_partial_notes_count {\n let pending_partial_note = pending_partial_notes.get(i);\n // Partial note completion logs are emitted with a domain-separated tag. To find matching logs, we apply the\n // same domain separation to the stored raw tag.\n let log_tag = compute_log_tag(\n pending_partial_note.note_completion_log_tag,\n DOM_SEP__NOTE_COMPLETION_LOG_TAG,\n );\n log_retrieval_requests.push(LogRetrievalRequest { contract_address, unsiloed_tag: log_tag });\n i += 1;\n }\n\n let responses = message_processing::get_logs_by_tag(log_retrieval_requests);\n\n // Defensive clearing: prevent stale requests if this function is called more than once in the same call frame.\n let _ = log_retrieval_requests.clear();\n\n responses\n}\n"
|
|
1196
1118
|
},
|
|
1197
|
-
"
|
|
1119
|
+
"155": {
|
|
1198
1120
|
"function_locations": [
|
|
1199
1121
|
{
|
|
1200
1122
|
"name": "receive",
|
|
1201
|
-
"start":
|
|
1123
|
+
"start": 5298
|
|
1202
1124
|
},
|
|
1203
1125
|
{
|
|
1204
1126
|
"name": "sync_inbox",
|
|
1205
|
-
"start":
|
|
1127
|
+
"start": 6741
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
"name": "test::setup",
|
|
1131
|
+
"start": 11111
|
|
1206
1132
|
},
|
|
1207
1133
|
{
|
|
1208
1134
|
"name": "test::make_msg",
|
|
1209
|
-
"start":
|
|
1135
|
+
"start": 11441
|
|
1210
1136
|
},
|
|
1211
1137
|
{
|
|
1212
1138
|
"name": "test::advance_by",
|
|
1213
|
-
"start":
|
|
1139
|
+
"start": 11724
|
|
1214
1140
|
},
|
|
1215
1141
|
{
|
|
1216
1142
|
"name": "test::empty_inbox_returns_empty_result",
|
|
1217
|
-
"start":
|
|
1143
|
+
"start": 11915
|
|
1218
1144
|
},
|
|
1219
1145
|
{
|
|
1220
1146
|
"name": "test::tx_bound_msg_expires_after_max_msg_ttl",
|
|
1221
|
-
"start":
|
|
1147
|
+
"start": 12378
|
|
1222
1148
|
},
|
|
1223
1149
|
{
|
|
1224
1150
|
"name": "test::tx_bound_msg_not_expired_before_max_msg_ttl",
|
|
1225
|
-
"start":
|
|
1151
|
+
"start": 13343
|
|
1226
1152
|
},
|
|
1227
1153
|
{
|
|
1228
1154
|
"name": "test::tx_less_msg_expires_after_max_msg_ttl",
|
|
1229
|
-
"start":
|
|
1155
|
+
"start": 14301
|
|
1230
1156
|
},
|
|
1231
1157
|
{
|
|
1232
1158
|
"name": "test::unresolved_tx_stays_in_inbox",
|
|
1233
|
-
"start":
|
|
1159
|
+
"start": 15243
|
|
1234
1160
|
},
|
|
1235
1161
|
{
|
|
1236
1162
|
"name": "test::multiple_messages_mixed_expiration",
|
|
1237
|
-
"start":
|
|
1163
|
+
"start": 16137
|
|
1238
1164
|
},
|
|
1239
1165
|
{
|
|
1240
1166
|
"name": "test::resolved_msg_is_ready_to_process",
|
|
1241
|
-
"start":
|
|
1167
|
+
"start": 17876
|
|
1242
1168
|
}
|
|
1243
1169
|
],
|
|
1244
1170
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/messages/processing/offchain.nr",
|
|
1245
|
-
"source": "use crate::{\n capsules::CapsuleArray,\n context::UtilityContext,\n messages::{\n encoding::MESSAGE_CIPHERTEXT_LEN,\n processing::{get_message_contexts_by_tx_hash, MessageContext, OffchainMessageWithContext},\n },\n oracle::contract_sync::set_contract_sync_cache_invalid,\n protocol::{\n address::AztecAddress,\n constants::MAX_TX_LIFETIME,\n hash::sha256_to_field,\n traits::{Deserialize, Serialize},\n },\n};\n\n/// Base capsule slot for the persistent inbox of [`PendingOffchainMsg`] entries.\n///\n/// This is the slot where we accumulate messages received through [`receive`].\nglobal OFFCHAIN_INBOX_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_INBOX_SLOT\".as_bytes());\n\n/// Capsule array slot used by [`sync_inbox`] to pass tx hash resolution requests to PXE.\nglobal OFFCHAIN_CONTEXT_REQUESTS_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_CONTEXT_REQUESTS_SLOT\".as_bytes());\n\n/// Capsule array slot used by [`sync_inbox`] to read tx context responses from PXE.\nglobal OFFCHAIN_CONTEXT_RESPONSES_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_CONTEXT_RESPONSES_SLOT\".as_bytes());\n\n/// Capsule array slot used by [`sync_inbox`] to collect messages ready for processing.\nglobal OFFCHAIN_READY_MESSAGES_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_READY_MESSAGES_SLOT\".as_bytes());\n\n/// Maximum number of offchain messages accepted by `offchain_receive` in a single call.\npub global MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL: u32 = 16;\n\n/// Tolerance added to the `MAX_TX_LIFETIME` cap for message expiration.\nglobal TX_EXPIRATION_TOLERANCE: u64 = 7200; // 2 hours\n\n/// Maximum time-to-live for a tx-bound offchain message.\n///\n/// After `anchor_block_timestamp + MAX_MSG_TTL`, the message is evicted from the inbox.\nglobal MAX_MSG_TTL: u64 = MAX_TX_LIFETIME + TX_EXPIRATION_TOLERANCE;\n\n/// A function that manages offchain-delivered messages for processing during sync.\n///\n/// Offchain messages are messages that are not broadcasted via onchain logs. They are instead delivered to the\n/// recipient by calling the `offchain_receive` utility function (injected by the `#[aztec]` macro). Message transport\n/// is the app's responsibility. Typical examples of transport methods are: messaging apps, email, QR codes, etc.\n///\n/// Once offchain messages are delivered to the recipient's private environment via `offchain_receive`, messages are\n/// locally stored in a persistent inbox.\n///\n/// This function determines when each message in said inbox is ready for processing, when it can be safely disposed\n/// of, etc.\n///\n/// The only current implementation of an `OffchainInboxSync` is [`sync_inbox`], which manages an inbox with expiration\n/// based eviction and automatic transaction context resolution.\npub(crate) type OffchainInboxSync<Env> = unconstrained fn[Env](\n/* contract_address */AztecAddress, /* scope */ AztecAddress) -> CapsuleArray<OffchainMessageWithContext>;\n\n/// A message delivered via the `offchain_receive` utility function.\npub struct OffchainMessage {\n /// The encrypted message payload.\n pub ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n /// The intended recipient of the message.\n pub recipient: AztecAddress,\n /// The hash of the transaction that produced this message. `Option::none` indicates a tx-less message.\n pub tx_hash: Option<Field>,\n /// Anchor block timestamp at message emission.\n pub anchor_block_timestamp: u64,\n}\n\n/// An offchain message awaiting processing (or re-processing) in the inbox.\n///\n/// Messages remain in the inbox until they expire, even if they have already been processed. This is necessary to\n/// handle reorgs: a processed message may need to be re-processed if the transaction that provided its context is\n/// reverted. On each sync, resolved messages are promoted to [`OffchainMessageWithContext`] for processing.\n#[derive(Serialize, Deserialize)]\nstruct PendingOffchainMsg {\n /// The encrypted message payload.\n ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n /// The intended recipient of the message.\n recipient: AztecAddress,\n /// The hash of the transaction that produced this message. A value of 0 indicates a tx-less message.\n tx_hash: Field,\n /// Anchor block timestamp at message emission. Used to compute the effective expiration: messages are evicted\n /// after `anchor_block_timestamp + MAX_MSG_TTL`.\n anchor_block_timestamp: u64,\n}\n\n/// Delivers offchain messages to the given contract's offchain inbox for subsequent processing.\n///\n/// Offchain messages are transaction effects that are not broadcasted via onchain logs. Instead, the sender shares the\n/// message to the recipient through an external channel (e.g. a URL accessible by the recipient). The recipient then\n/// calls this function to hand the messages to the contract so they can be processed through the same mechanisms as\n/// onchain messages.\n///\n/// Each message is routed to the inbox scoped to its `recipient` field, so messages for different accounts are\n/// automatically isolated.\n///\n/// Messages are processed when their originating transaction is found onchain (providing the context needed to\n/// validate resulting notes and events).\n///\n/// Messages are kept in the inbox until they expire. The effective expiration is\n/// `anchor_block_timestamp + MAX_MSG_TTL`.\n///\n/// Processing order is not guaranteed.\npub unconstrained fn receive(\n contract_address: AztecAddress,\n messages: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL>,\n) {\n // May contain duplicates if multiple messages target the same recipient. This is harmless since\n // cache invalidation on the TS side is idempotent (deleting an already-deleted key is a no-op).\n let mut scopes: BoundedVec<AztecAddress, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n let mut i = 0;\n let messages_len = messages.len();\n while i < messages_len {\n let msg = messages.get(i);\n let tx_hash = if msg.tx_hash.is_some() {\n msg.tx_hash.unwrap()\n } else {\n 0\n };\n let inbox: CapsuleArray<PendingOffchainMsg> =\n CapsuleArray::at(contract_address, OFFCHAIN_INBOX_SLOT, msg.recipient);\n inbox.push(\n PendingOffchainMsg {\n ciphertext: msg.ciphertext,\n recipient: msg.recipient,\n tx_hash,\n anchor_block_timestamp: msg.anchor_block_timestamp,\n },\n );\n scopes.push(msg.recipient);\n i += 1;\n }\n\n set_contract_sync_cache_invalid(contract_address, scopes);\n}\n\n/// Returns offchain-delivered messages to process during sync.\n///\n/// Messages remain in the inbox and are reprocessed on each sync until their originating transaction is no longer at\n/// risk of being dropped by a reorg.\npub unconstrained fn sync_inbox(\n contract_address: AztecAddress,\n scope: AztecAddress,\n) -> CapsuleArray<OffchainMessageWithContext> {\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(contract_address, OFFCHAIN_INBOX_SLOT, scope);\n let context_resolution_requests: CapsuleArray<Field> =\n CapsuleArray::at(contract_address, OFFCHAIN_CONTEXT_REQUESTS_SLOT, scope);\n let resolved_contexts: CapsuleArray<Option<MessageContext>> =\n CapsuleArray::at(contract_address, OFFCHAIN_CONTEXT_RESPONSES_SLOT, scope);\n let ready_to_process: CapsuleArray<OffchainMessageWithContext> =\n CapsuleArray::at(contract_address, OFFCHAIN_READY_MESSAGES_SLOT, scope);\n\n // Clear any stale ready messages from a previous run.\n ready_to_process.for_each(|i, _| { ready_to_process.remove(i); });\n\n // Clear any stale context resolution requests/responses from a previous run.\n context_resolution_requests.for_each(|i, _| { context_resolution_requests.remove(i); });\n resolved_contexts.for_each(|i, _| { resolved_contexts.remove(i); });\n\n // Build a request list aligned with the inbox indices.\n let mut i = 0;\n let inbox_len = inbox.len();\n while i < inbox_len {\n let msg = inbox.get(i);\n context_resolution_requests.push(msg.tx_hash);\n i += 1;\n }\n\n // Ask PXE to resolve contexts for all requested tx hashes.\n get_message_contexts_by_tx_hash(\n contract_address,\n OFFCHAIN_CONTEXT_REQUESTS_SLOT,\n OFFCHAIN_CONTEXT_RESPONSES_SLOT,\n scope,\n );\n\n assert_eq(resolved_contexts.len(), inbox_len);\n\n let now = UtilityContext::new().timestamp();\n\n let mut j = inbox_len;\n while j > 0 {\n // This loop decides what to do with each message in the offchain message inbox. We need to handle 3\n // different scenarios for each message.\n //\n // 1. The TX that emitted this message is still not known to PXE: in this case we can't yet process this\n // message, as any notes or events discovered will fail to be validated. So we leave the message in the inbox,\n // awaiting for future syncs to detect that the TX became available.\n //\n // 2. The message is not associated to a TX to begin with. The current version of offchain message processing\n // does not support this case, but in the future it will. Right now, a message without an associated TX will\n // sit in the inbox until it expires.\n //\n // 3. The TX that emitted this message has been found by PXE. That gives us all the information needed to\n // process the message. We add the message to the `ready_to_process` CapsuleArray so that the `sync_state` loop\n // processes it.\n //\n // In all cases, if the message has expired (i.e. `now > anchor_block_timestamp + MAX_MSG_TTL`), we remove it\n // from the inbox.\n //\n // Note: the loop runs backwards because it might call `inbox.remove(j)` to purge expired messages and we also\n // need to align it with `resolved_contexts.get(j)`. Going from last to first simplifies the algorithm as\n // not yet visited element indexes remain stable.\n j -= 1;\n let maybe_ctx = resolved_contexts.get(j);\n let msg = inbox.get(j);\n\n // Compute the message's effective expiration timestamp to determine if we can purge it from the inbox.\n let effective_expiration = msg.anchor_block_timestamp + MAX_MSG_TTL;\n\n // Message expired. We remove it from the inbox.\n if now > effective_expiration {\n inbox.remove(j);\n }\n\n // Scenario 1: associated TX not yet available. We keep the message in the inbox, as it might become\n // processable as new blocks get mined.\n // Scenario 2: no TX associated to message. The message will sit in the inbox until it expires.\n if maybe_ctx.is_none() {\n continue;\n }\n\n // Scenario 3: Message is ready to process, add to result array. Note we still keep it in the inbox unless we\n // consider it has expired: this is because we need to account for reorgs. If reorg occurs after we processed\n // a message, the effects of processing the message get rewind. However, the associated TX can be included in\n // a subsequent block. Should that happen, the message must be re-processed to ensure consistency.\n let message_context = maybe_ctx.unwrap();\n ready_to_process.push(OffchainMessageWithContext { message_ciphertext: msg.ciphertext, message_context });\n }\n\n ready_to_process\n}\n\nmod test {\n use crate::{\n capsules::CapsuleArray, oracle::random::random, protocol::address::AztecAddress,\n test::helpers::test_environment::TestEnvironment,\n };\n use super::{\n MAX_MSG_TTL, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL, OFFCHAIN_INBOX_SLOT, OffchainMessage, PendingOffchainMsg,\n receive, sync_inbox,\n };\n\n global SCOPE: AztecAddress = AztecAddress { inner: 0xcafe };\n\n /// Creates an `OffchainMessage` with dummy ciphertext and `SCOPE` as recipient.\n fn make_msg(tx_hash: Option<Field>, anchor_block_timestamp: u64) -> OffchainMessage {\n OffchainMessage { ciphertext: BoundedVec::new(), recipient: SCOPE, tx_hash, anchor_block_timestamp }\n }\n\n /// Advances the TXE block timestamp by `offset` seconds and returns the resulting timestamp.\n unconstrained fn advance_by(env: TestEnvironment, offset: u64) -> u64 {\n env.advance_next_block_timestamp_by(offset);\n env.mine_block();\n env.last_block_timestamp()\n }\n\n #[test]\n unconstrained fn empty_inbox_returns_empty_result() {\n let env = TestEnvironment::new();\n env.utility_context(|context| {\n let result = sync_inbox(context.this_address(), SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> =\n CapsuleArray::at(context.this_address(), OFFCHAIN_INBOX_SLOT, SCOPE);\n\n assert_eq(result.len(), 0);\n assert_eq(inbox.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn tx_bound_msg_expires_after_max_msg_ttl() {\n let env = TestEnvironment::new();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(Option::some(random()), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n // Advance past anchor_ts + MAX_MSG_TTL.\n let _now = advance_by(env, MAX_MSG_TTL + 1);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, SCOPE);\n\n assert_eq(result.len(), 0); // context is None, not ready\n assert_eq(inbox.len(), 0); // expired, removed\n });\n }\n\n #[test]\n unconstrained fn tx_bound_msg_not_expired_before_max_msg_ttl() {\n let env = TestEnvironment::new();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(Option::some(random()), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n // Advance, but not past anchor_ts + MAX_MSG_TTL.\n let _now = advance_by(env, 100);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, SCOPE);\n\n assert_eq(result.len(), 0); // context is None, not ready\n assert_eq(inbox.len(), 1); // not expired, stays\n });\n }\n\n #[test]\n unconstrained fn tx_less_msg_expires_after_max_msg_ttl() {\n let env = TestEnvironment::new();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(Option::none(), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n // Advance past anchor_ts + MAX_MSG_TTL.\n let _now = advance_by(env, MAX_MSG_TTL + 1);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, SCOPE);\n\n assert_eq(result.len(), 0); // context is None, not ready\n assert_eq(inbox.len(), 0); // expired, removed\n });\n }\n\n #[test]\n unconstrained fn unresolved_tx_stays_in_inbox() {\n let env = TestEnvironment::new();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(Option::some(random()), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n let _now = advance_by(env, 100);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, SCOPE);\n\n assert_eq(result.len(), 0); // not resolved, not ready\n assert_eq(inbox.len(), 1); // not expired, stays\n });\n }\n\n #[test]\n unconstrained fn multiple_messages_mixed_expiration() {\n let env = TestEnvironment::new();\n let anchor_ts = advance_by(env, 10);\n\n let survivor_tx_hash = random();\n\n env.utility_context(|context| {\n let address = context.this_address();\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n // Message 0: tx-bound, anchor_ts in the past so it expires at\n // anchor_ts + MAX_MSG_TTL. We set anchor to 0 so it expires quickly.\n msgs.push(make_msg(Option::some(random()), 0));\n // Message 1: tx-bound, anchor_ts is recent so it survives.\n msgs.push(make_msg(Option::some(survivor_tx_hash), anchor_ts));\n // Message 2: tx-less, anchor_ts=0 so it also expires.\n msgs.push(make_msg(Option::none(), 0));\n receive(address, msgs);\n });\n\n // Advance past MAX_MSG_TTL for anchor_ts=0, but not for anchor_ts=anchor_ts.\n let _now = advance_by(env, MAX_MSG_TTL);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, SCOPE);\n\n assert_eq(result.len(), 0); // all contexts are None\n // Message 0 expired (anchor=0), message 1 survived (anchor=anchor_ts),\n // Message 2 expired (anchor=0).\n assert_eq(inbox.len(), 1);\n assert_eq(inbox.get(0).tx_hash, survivor_tx_hash);\n });\n }\n\n // -- Resolved context (ready to process) ------------------------------\n\n #[test]\n unconstrained fn resolved_msg_is_ready_to_process() {\n let env = TestEnvironment::new();\n // TestEnvironment::new() deploys protocol contracts, creating blocks with tx effects.\n // In TXE, tx hashes equal Fr(blockNumber), so Fr(1) is the tx effect from block 1.\n // We use this as a \"known resolvable\" tx hash.\n let known_tx_hash: Field = 1;\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(Option::some(known_tx_hash), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n let _now = advance_by(env, 100);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, SCOPE);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, SCOPE);\n\n // The message should be ready to process since its tx context was resolved.\n assert_eq(result.len(), 1);\n\n let ctx = result.get(0).message_context;\n assert_eq(ctx.tx_hash, known_tx_hash);\n assert(ctx.first_nullifier_in_tx != 0, \"resolved context must have a first nullifier\");\n\n // Message stays in inbox (not expired) for potential reorg reprocessing.\n assert_eq(inbox.len(), 1);\n });\n }\n}\n"
|
|
1171
|
+
"source": "use crate::{\n capsules::CapsuleArray,\n context::UtilityContext,\n ephemeral::EphemeralArray,\n messages::{encoding::MESSAGE_CIPHERTEXT_LEN, processing::OffchainMessageWithContext},\n oracle::contract_sync::set_contract_sync_cache_invalid,\n protocol::{\n address::AztecAddress,\n constants::MAX_TX_LIFETIME,\n hash::sha256_to_field,\n traits::{Deserialize, Serialize},\n },\n};\n\n/// Base capsule slot for the persistent inbox of [`PendingOffchainMsg`] entries.\n///\n/// This is the slot where we accumulate messages received through [`receive`].\nglobal OFFCHAIN_INBOX_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_INBOX_SLOT\".as_bytes());\n\n/// Ephemeral array slot used by [`sync_inbox`] to pass tx hash resolution requests to PXE.\nglobal OFFCHAIN_CONTEXT_REQUESTS_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_CONTEXT_REQUESTS_SLOT\".as_bytes());\n\n/// Ephemeral array slot used by [`sync_inbox`] to collect messages ready for processing.\nglobal OFFCHAIN_READY_MESSAGES_SLOT: Field = sha256_to_field(\"AZTEC_NR::OFFCHAIN_READY_MESSAGES_SLOT\".as_bytes());\n\n/// Maximum number of offchain messages accepted by `offchain_receive` in a single call.\npub global MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL: u32 = 16;\n\n/// Tolerance added to the `MAX_TX_LIFETIME` cap for message expiration.\nglobal TX_EXPIRATION_TOLERANCE: u64 = 7200; // 2 hours\n\n/// Maximum time-to-live for a tx-bound offchain message.\n///\n/// After `anchor_block_timestamp + MAX_MSG_TTL`, the message is evicted from the inbox.\nglobal MAX_MSG_TTL: u64 = MAX_TX_LIFETIME + TX_EXPIRATION_TOLERANCE;\n\n/// A function that manages offchain-delivered messages for processing during sync.\n///\n/// Offchain messages are messages that are not broadcasted via onchain logs. They are instead delivered to the\n/// recipient by calling the `offchain_receive` utility function (injected by the `#[aztec]` macro). Message transport\n/// is the app's responsibility. Typical examples of transport methods are: messaging apps, email, QR codes, etc.\n///\n/// Once offchain messages are delivered to the recipient's private environment via `offchain_receive`, messages are\n/// locally stored in a persistent inbox.\n///\n/// This function determines when each message in said inbox is ready for processing, when it can be safely disposed\n/// of, etc.\n///\n/// The only current implementation of an `OffchainInboxSync` is [`sync_inbox`], which manages an inbox with expiration\n/// based eviction and automatic transaction context resolution.\npub(crate) type OffchainInboxSync<Env> = unconstrained fn[Env](\n/* contract_address */AztecAddress, /* scope */ AztecAddress) -> EphemeralArray<OffchainMessageWithContext>;\n\n/// A message delivered via the `offchain_receive` utility function.\npub struct OffchainMessage {\n /// The encrypted message payload.\n pub ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n /// The intended recipient of the message.\n pub recipient: AztecAddress,\n /// The hash of the transaction that produced this message. `Option::none` indicates a tx-less message.\n pub tx_hash: Option<Field>,\n /// Anchor block timestamp at message emission.\n pub anchor_block_timestamp: u64,\n}\n\n/// An offchain message awaiting processing (or re-processing) in the inbox.\n///\n/// Messages remain in the inbox until they expire, even if they have already been processed. This is necessary to\n/// handle reorgs: a processed message may need to be re-processed if the transaction that provided its context is\n/// reverted. On each sync, resolved messages are promoted to [`OffchainMessageWithContext`] for processing.\n#[derive(Serialize, Deserialize)]\nstruct PendingOffchainMsg {\n /// The encrypted message payload.\n ciphertext: BoundedVec<Field, MESSAGE_CIPHERTEXT_LEN>,\n /// The intended recipient of the message.\n recipient: AztecAddress,\n /// The hash of the transaction that produced this message. A value of 0 indicates a tx-less message.\n tx_hash: Field,\n /// Anchor block timestamp at message emission. Used to compute the effective expiration: messages are evicted\n /// after `anchor_block_timestamp + MAX_MSG_TTL`.\n anchor_block_timestamp: u64,\n}\n\n/// Delivers offchain messages to the given contract's offchain inbox for subsequent processing.\n///\n/// Offchain messages are transaction effects that are not broadcasted via onchain logs. Instead, the sender shares the\n/// message to the recipient through an external channel (e.g. a URL accessible by the recipient). The recipient then\n/// calls this function to hand the messages to the contract so they can be processed through the same mechanisms as\n/// onchain messages.\n///\n/// Each message is routed to the inbox scoped to its `recipient` field, so messages for different accounts are\n/// automatically isolated.\n///\n/// Messages are processed when their originating transaction is found onchain (providing the context needed to\n/// validate resulting notes and events).\n///\n/// Messages are kept in the inbox until they expire. The effective expiration is\n/// `anchor_block_timestamp + MAX_MSG_TTL`.\n///\n/// Processing order is not guaranteed.\npub unconstrained fn receive(\n contract_address: AztecAddress,\n messages: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL>,\n) {\n // May contain duplicates if multiple messages target the same recipient. This is harmless since\n // cache invalidation on the TS side is idempotent (deleting an already-deleted key is a no-op).\n let mut scopes: BoundedVec<AztecAddress, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n let mut i = 0;\n let messages_len = messages.len();\n while i < messages_len {\n let msg = messages.get(i);\n let tx_hash = if msg.tx_hash.is_some() {\n msg.tx_hash.unwrap()\n } else {\n 0\n };\n let inbox: CapsuleArray<PendingOffchainMsg> =\n CapsuleArray::at(contract_address, OFFCHAIN_INBOX_SLOT, msg.recipient);\n inbox.push(\n PendingOffchainMsg {\n ciphertext: msg.ciphertext,\n recipient: msg.recipient,\n tx_hash,\n anchor_block_timestamp: msg.anchor_block_timestamp,\n },\n );\n scopes.push(msg.recipient);\n i += 1;\n }\n\n set_contract_sync_cache_invalid(contract_address, scopes);\n}\n\n/// Returns offchain-delivered messages to process during sync.\n///\n/// Messages remain in the inbox and are reprocessed on each sync until their originating transaction is no longer at\n/// risk of being dropped by a reorg.\npub unconstrained fn sync_inbox(\n contract_address: AztecAddress,\n scope: AztecAddress,\n) -> EphemeralArray<OffchainMessageWithContext> {\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(contract_address, OFFCHAIN_INBOX_SLOT, scope);\n let context_resolution_requests: EphemeralArray<Field> = EphemeralArray::at(OFFCHAIN_CONTEXT_REQUESTS_SLOT).clear();\n let ready_to_process: EphemeralArray<OffchainMessageWithContext> =\n EphemeralArray::at(OFFCHAIN_READY_MESSAGES_SLOT).clear();\n\n // Build a request list aligned with the inbox indices.\n let mut i = 0;\n let inbox_len = inbox.len();\n while i < inbox_len {\n let msg = inbox.get(i);\n context_resolution_requests.push(msg.tx_hash);\n i += 1;\n }\n\n // Ask PXE to resolve contexts for all requested tx hashes. The oracle returns responses in a new\n // ephemeral array.\n let resolved_contexts =\n crate::oracle::message_processing::get_message_contexts_by_tx_hash(context_resolution_requests);\n\n assert_eq(resolved_contexts.len(), inbox_len);\n\n let now = UtilityContext::new().timestamp();\n\n let mut j = inbox_len;\n while j > 0 {\n // This loop decides what to do with each message in the offchain message inbox. We need to handle 3\n // different scenarios for each message.\n //\n // 1. The TX that emitted this message is still not known to PXE: in this case we can't yet process this\n // message, as any notes or events discovered will fail to be validated. So we leave the message in the inbox,\n // awaiting for future syncs to detect that the TX became available.\n //\n // 2. The message is not associated to a TX to begin with. The current version of offchain message processing\n // does not support this case, but in the future it will. Right now, a message without an associated TX will\n // sit in the inbox until it expires.\n //\n // 3. The TX that emitted this message has been found by PXE. That gives us all the information needed to\n // process the message. We add the message to the `ready_to_process` EphemeralArray so that the `sync_state`\n // loop\n // processes it.\n //\n // In all cases, if the message has expired (i.e. `now > anchor_block_timestamp + MAX_MSG_TTL`), we remove it\n // from the inbox.\n //\n // Note: the loop runs backwards because it might call `inbox.remove(j)` to purge expired messages and we also\n // need to align it with `resolved_contexts.get(j)`. Going from last to first simplifies the algorithm as\n // not yet visited element indexes remain stable.\n j -= 1;\n let maybe_ctx = resolved_contexts.get(j);\n let msg = inbox.get(j);\n\n // Compute the message's effective expiration timestamp to determine if we can purge it from the inbox.\n let effective_expiration = msg.anchor_block_timestamp + MAX_MSG_TTL;\n\n // Message expired. We remove it from the inbox.\n if now > effective_expiration {\n inbox.remove(j);\n }\n\n // Scenario 1: associated TX not yet available. We keep the message in the inbox, as it might become\n // processable as new blocks get mined.\n // Scenario 2: no TX associated to message. The message will sit in the inbox until it expires.\n if maybe_ctx.is_none() {\n continue;\n }\n\n // Scenario 3: Message is ready to process, add to result array. Note we still keep it in the inbox unless we\n // consider it has expired: this is because we need to account for reorgs. If reorg occurs after we processed\n // a message, the effects of processing the message get rewind. However, the associated TX can be included in\n // a subsequent block. Should that happen, the message must be re-processed to ensure consistency.\n let message_context = maybe_ctx.unwrap();\n ready_to_process.push(OffchainMessageWithContext { message_ciphertext: msg.ciphertext, message_context });\n }\n\n ready_to_process\n}\n\nmod test {\n use crate::{\n capsules::CapsuleArray, oracle::random::random, protocol::address::AztecAddress,\n test::helpers::test_environment::TestEnvironment,\n };\n use super::{\n MAX_MSG_TTL, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL, OFFCHAIN_INBOX_SLOT, OffchainMessage, PendingOffchainMsg,\n receive, sync_inbox,\n };\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n /// Creates an `OffchainMessage` with dummy ciphertext and the given scope as recipient.\n fn make_msg(recipient: AztecAddress, tx_hash: Option<Field>, anchor_block_timestamp: u64) -> OffchainMessage {\n OffchainMessage { ciphertext: BoundedVec::new(), recipient, tx_hash, anchor_block_timestamp }\n }\n\n /// Advances the TXE block timestamp by `offset` seconds and returns the resulting timestamp.\n unconstrained fn advance_by(env: TestEnvironment, offset: u64) -> u64 {\n env.advance_next_block_timestamp_by(offset);\n env.mine_block();\n env.last_block_timestamp()\n }\n\n #[test]\n unconstrained fn empty_inbox_returns_empty_result() {\n let (env, scope) = setup();\n env.utility_context(|context| {\n let result = sync_inbox(context.this_address(), scope);\n let inbox: CapsuleArray<PendingOffchainMsg> =\n CapsuleArray::at(context.this_address(), OFFCHAIN_INBOX_SLOT, scope);\n\n assert_eq(result.len(), 0);\n assert_eq(inbox.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn tx_bound_msg_expires_after_max_msg_ttl() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(scope, Option::some(random()), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n // Advance past anchor_ts + MAX_MSG_TTL.\n let _now = advance_by(env, MAX_MSG_TTL + 1);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, scope);\n\n assert_eq(result.len(), 0); // context is None, not ready\n assert_eq(inbox.len(), 0); // expired, removed\n });\n }\n\n #[test]\n unconstrained fn tx_bound_msg_not_expired_before_max_msg_ttl() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(scope, Option::some(random()), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n // Advance, but not past anchor_ts + MAX_MSG_TTL.\n let _now = advance_by(env, 100);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, scope);\n\n assert_eq(result.len(), 0); // context is None, not ready\n assert_eq(inbox.len(), 1); // not expired, stays\n });\n }\n\n #[test]\n unconstrained fn tx_less_msg_expires_after_max_msg_ttl() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(scope, Option::none(), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n // Advance past anchor_ts + MAX_MSG_TTL.\n let _now = advance_by(env, MAX_MSG_TTL + 1);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, scope);\n\n assert_eq(result.len(), 0); // context is None, not ready\n assert_eq(inbox.len(), 0); // expired, removed\n });\n }\n\n #[test]\n unconstrained fn unresolved_tx_stays_in_inbox() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(scope, Option::some(random()), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n let _now = advance_by(env, 100);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, scope);\n\n assert_eq(result.len(), 0); // not resolved, not ready\n assert_eq(inbox.len(), 1); // not expired, stays\n });\n }\n\n #[test]\n unconstrained fn multiple_messages_mixed_expiration() {\n let (env, scope) = setup();\n let anchor_ts = advance_by(env, 10);\n\n let survivor_tx_hash = random();\n\n env.utility_context(|context| {\n let address = context.this_address();\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n // Message 0: tx-bound, anchor_ts in the past so it expires at\n // anchor_ts + MAX_MSG_TTL. We set anchor to 0 so it expires quickly.\n msgs.push(make_msg(scope, Option::some(random()), 0));\n // Message 1: tx-bound, anchor_ts is recent so it survives.\n msgs.push(make_msg(scope, Option::some(survivor_tx_hash), anchor_ts));\n // Message 2: tx-less, anchor_ts=0 so it also expires.\n msgs.push(make_msg(scope, Option::none(), 0));\n receive(address, msgs);\n });\n\n // Advance past MAX_MSG_TTL for anchor_ts=0, but not for anchor_ts=anchor_ts.\n let _now = advance_by(env, MAX_MSG_TTL);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, scope);\n\n assert_eq(result.len(), 0); // all contexts are None\n // Message 0 expired (anchor=0), message 1 survived (anchor=anchor_ts),\n // Message 2 expired (anchor=0).\n assert_eq(inbox.len(), 1);\n assert_eq(inbox.get(0).tx_hash, survivor_tx_hash);\n });\n }\n\n // -- Resolved context (ready to process) ------------------------------\n\n #[test]\n unconstrained fn resolved_msg_is_ready_to_process() {\n let (env, scope) = setup();\n // TestEnvironment::new() deploys protocol contracts, creating blocks with tx effects.\n // In TXE, tx hashes equal Fr(blockNumber), so Fr(1) is the tx effect from block 1.\n // We use this as a \"known resolvable\" tx hash.\n let known_tx_hash: Field = 1;\n let anchor_ts = advance_by(env, 10);\n\n env.utility_context(|context| {\n let mut msgs: BoundedVec<OffchainMessage, MAX_OFFCHAIN_MESSAGES_PER_RECEIVE_CALL> = BoundedVec::new();\n msgs.push(make_msg(scope, Option::some(known_tx_hash), anchor_ts));\n receive(context.this_address(), msgs);\n });\n\n let _now = advance_by(env, 100);\n\n env.utility_context(|context| {\n let address = context.this_address();\n let result = sync_inbox(address, scope);\n let inbox: CapsuleArray<PendingOffchainMsg> = CapsuleArray::at(address, OFFCHAIN_INBOX_SLOT, scope);\n\n // The message should be ready to process since its tx context was resolved.\n assert_eq(result.len(), 1);\n\n let ctx = result.get(0).message_context;\n assert_eq(ctx.tx_hash, known_tx_hash);\n assert(ctx.first_nullifier_in_tx != 0, \"resolved context must have a first nullifier\");\n\n // Message stays in inbox (not expired) for potential reorg reprocessing.\n assert_eq(inbox.len(), 1);\n });\n }\n}\n"
|
|
1246
1172
|
},
|
|
1247
1173
|
"16": {
|
|
1248
1174
|
"function_locations": [
|
|
@@ -1532,7 +1458,7 @@
|
|
|
1532
1458
|
"path": "std/field/mod.nr",
|
|
1533
1459
|
"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 __assert_max_bit_size(self, BIT_SIZE);\n }\n\n /// Decomposes `self` into its little 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 array 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 = __to_le_bits(self);\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 array 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 = __to_be_bits(self);\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 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 __to_le_radix(self, radix)\n }\n\n 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 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 __to_be_radix(self, radix)\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(apply_range_constraint)]\nfn __assert_max_bit_size(value: Field, bit_size: u32) {}\n\n// `_radix` must be less than 256\n#[builtin(to_le_radix)]\nfn __to_le_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n// `_radix` must be less than 256\n#[builtin(to_be_radix)]\nfn __to_be_radix<let N: u32>(value: Field, radix: u32) -> [u8; N] {}\n\n/// Decomposes `self` into its little 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 array 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)]\nfn __to_le_bits<let N: u32>(value: Field) -> [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 array 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)]\nfn __to_be_bits<let N: u32>(value: Field) -> [u1; 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, static_assert};\n use super::{\n field_less_than, modulus_be_bits, modulus_be_bytes, modulus_le_bits, modulus_le_bytes,\n };\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(\"radix must be greater than 1\");\n }\n }\n\n // Updated test to account for Brillig restriction that radix must be greater than 2\n #[test(should_fail_with = \"radix must be greater than 1\")]\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 _: [u8; 8] = field.to_le_radix(1);\n } else {\n panic(\"radix must be greater than 1\");\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(\"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(\"radix must be less than or equal to 256\")\n }\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n unconstrained fn not_enough_limbs_brillig() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 16 limbs\")]\n fn not_enough_limbs() {\n let _: [u8; 16] = 0x100000000000000000000000000000000.to_le_bytes();\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 #[test]\n unconstrained fn test_large_field_values_unconstrained() {\n let large_field = 0xffffffffffffffff;\n\n let bits: [u1; 64] = large_field.to_le_bits();\n assert_eq(bits[0], 1);\n\n let bytes: [u8; 8] = large_field.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_field);\n\n let radix_bytes: [u8; 8] = large_field.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_field);\n }\n\n #[test]\n fn test_large_field_values() {\n let large_val = 0xffffffffffffffff;\n\n let bits: [u1; 64] = large_val.to_le_bits();\n assert_eq(bits[0], 1);\n\n let bytes: [u8; 8] = large_val.to_le_bytes();\n assert_eq(Field::from_le_bytes::<8>(bytes), large_val);\n\n let radix_bytes: [u8; 8] = large_val.to_le_radix(256);\n assert_eq(Field::from_le_bytes::<8>(radix_bytes), large_val);\n }\n\n #[test]\n fn test_decomposition_edge_cases() {\n let zero_bits: [u1; 8] = 0.to_le_bits();\n assert_eq(zero_bits, [0; 8]);\n\n let zero_bytes: [u8; 8] = 0.to_le_bytes();\n assert_eq(zero_bytes, [0; 8]);\n\n let one_bits: [u1; 8] = 1.to_le_bits();\n let expected: [u1; 8] = [1, 0, 0, 0, 0, 0, 0, 0];\n assert_eq(one_bits, expected);\n\n let pow2_bits: [u1; 8] = 4.to_le_bits();\n let expected: [u1; 8] = [0, 0, 1, 0, 0, 0, 0, 0];\n assert_eq(pow2_bits, expected);\n }\n\n #[test]\n fn test_pow_32() {\n assert_eq(2.pow_32(3), 8);\n assert_eq(3.pow_32(2), 9);\n assert_eq(5.pow_32(0), 1);\n assert_eq(7.pow_32(1), 7);\n\n assert_eq(2.pow_32(10), 1024);\n\n assert_eq(0.pow_32(5), 0);\n assert_eq(0.pow_32(0), 1);\n\n assert_eq(1.pow_32(100), 1);\n }\n\n #[test]\n fn test_sgn0() {\n assert_eq(0.sgn0(), 0);\n assert_eq(2.sgn0(), 0);\n assert_eq(4.sgn0(), 0);\n assert_eq(100.sgn0(), 0);\n\n assert_eq(1.sgn0(), 1);\n assert_eq(3.sgn0(), 1);\n assert_eq(5.sgn0(), 1);\n assert_eq(101.sgn0(), 1);\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 8 limbs\")]\n fn test_bit_decomposition_overflow() {\n // 8 bits can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [u1; 8] = large_val.to_le_bits();\n }\n\n #[test(should_fail_with = \"Field failed to decompose into specified 4 limbs\")]\n fn test_byte_decomposition_overflow() {\n // 4 bytes can't represent large field values\n let large_val = 0x1000000000000000;\n let _: [u8; 4] = large_val.to_le_bytes();\n }\n\n #[test]\n fn test_to_from_be_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 BE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_minus_1_bytes[32 - 1] > 0);\n p_minus_1_bytes[32 - 1] -= 1;\n\n let p_minus_1 = Field::from_be_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_be_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 BE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_be_bytes().as_array();\n assert(p_plus_1_bytes[32 - 1] < 255);\n p_plus_1_bytes[32 - 1] += 1;\n\n let p_plus_1 = Field::from_be_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 BE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_be_bytes();\n assert_eq(p_plus_1_converted_bytes[32 - 1], 1);\n p_plus_1_converted_bytes[32 - 1] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_be_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_be_bytes().len(), 32);\n let p = Field::from_be_bytes::<32>(modulus_be_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 BE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_be_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n #[test]\n fn test_to_from_le_bytes_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this byte produces the expected 32 LE bytes for (modulus - 1)\n let mut p_minus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_minus_1_bytes[0] > 0);\n p_minus_1_bytes[0] -= 1;\n\n let p_minus_1 = Field::from_le_bytes::<32>(p_minus_1_bytes);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 32 BE bytes produces the same bytes\n let p_minus_1_converted_bytes: [u8; 32] = p_minus_1.to_le_bytes();\n assert_eq(p_minus_1_converted_bytes, p_minus_1_bytes);\n\n // checking that incrementing this byte produces 32 LE bytes for (modulus + 1)\n let mut p_plus_1_bytes: [u8; 32] = modulus_le_bytes().as_array();\n assert(p_plus_1_bytes[0] < 255);\n p_plus_1_bytes[0] += 1;\n\n let p_plus_1 = Field::from_le_bytes::<32>(p_plus_1_bytes);\n assert_eq(p_plus_1, 1);\n\n // checking that converting p_plus_1 to 32 LE bytes produces the same\n // byte set to 1 as p_plus_1_bytes and otherwise zeroes\n let mut p_plus_1_converted_bytes: [u8; 32] = p_plus_1.to_le_bytes();\n assert_eq(p_plus_1_converted_bytes[0], 1);\n p_plus_1_converted_bytes[0] = 0;\n assert_eq(p_plus_1_converted_bytes, [0; 32]);\n\n // checking that Field::from_le_bytes::<32> on the Field modulus produces 0\n assert_eq(modulus_le_bytes().len(), 32);\n let p = Field::from_le_bytes::<32>(modulus_le_bytes().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 32 LE bytes produces 32 zeroes\n let p_bytes: [u8; 32] = 0.to_le_bytes();\n assert_eq(p_bytes, [0; 32]);\n }\n }\n\n /// Convert a little endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_le_bits<let N: u32>(bits: [u1; N]) -> Field {\n static_assert(\n N <= modulus_le_bits().len(),\n \"N must be less than or equal to modulus_le_bits().len()\",\n );\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n /// Convert a big endian bit array to a field element.\n /// If the provided bit array overflows the field modulus then the Field will silently wrap around.\n fn from_be_bits<let N: u32>(bits: [u1; N]) -> Field {\n let mut v = 1;\n let mut result = 0;\n\n for i in 0..N {\n result += (bits[N - 1 - i] as Field) * v;\n v = v * 2;\n }\n result\n }\n\n #[test]\n fn test_to_from_be_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 BE bits for (modulus - 1)\n let mut p_minus_1_bits: [u1; 254] = modulus_be_bits().as_array();\n assert(p_minus_1_bits[254 - 1] > 0);\n p_minus_1_bits[254 - 1] -= 1;\n\n let p_minus_1 = from_be_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [u1; 254] = p_minus_1.to_be_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 BE bits for (modulus + 4)\n let mut p_plus_4_bits: [u1; 254] = modulus_be_bits().as_array();\n assert(p_plus_4_bits[254 - 3] < 1);\n p_plus_4_bits[254 - 3] += 1;\n\n let p_plus_4 = from_be_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 BE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [u1; 254] = p_plus_4.to_be_bits();\n assert_eq(p_plus_4_converted_bits[254 - 3], 1);\n p_plus_4_converted_bits[254 - 3] = 0;\n assert_eq(p_plus_4_converted_bits, [0; 254]);\n\n // checking that Field::from_be_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_be_bits().len(), 254);\n let p = from_be_bits::<254>(modulus_be_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 BE bytes produces 254 zeroes\n let p_bits: [u1; 254] = 0.to_be_bits();\n assert_eq(p_bits, [0; 254]);\n }\n }\n\n #[test]\n fn test_to_from_le_bits_bn254_edge_cases() {\n if crate::compat::is_bn254() {\n // checking that decrementing this bit produces the expected 254 LE bits for (modulus - 1)\n let mut p_minus_1_bits: [u1; 254] = modulus_le_bits().as_array();\n assert(p_minus_1_bits[0] > 0);\n p_minus_1_bits[0] -= 1;\n\n let p_minus_1 = from_le_bits::<254>(p_minus_1_bits);\n assert_eq(p_minus_1 + 1, 0);\n\n // checking that converting (modulus - 1) from and then to 254 BE bits produces the same bits\n let p_minus_1_converted_bits: [u1; 254] = p_minus_1.to_le_bits();\n assert_eq(p_minus_1_converted_bits, p_minus_1_bits);\n\n // checking that incrementing this bit produces 254 LE bits for (modulus + 4)\n let mut p_plus_4_bits: [u1; 254] = modulus_le_bits().as_array();\n assert(p_plus_4_bits[2] < 1);\n p_plus_4_bits[2] += 1;\n\n let p_plus_4 = from_le_bits::<254>(p_plus_4_bits);\n assert_eq(p_plus_4, 4);\n\n // checking that converting p_plus_4 to 254 LE bits produces the same\n // bit set to 1 as p_plus_4_bits and otherwise zeroes\n let mut p_plus_4_converted_bits: [u1; 254] = p_plus_4.to_le_bits();\n assert_eq(p_plus_4_converted_bits[2], 1);\n p_plus_4_converted_bits[2] = 0;\n assert_eq(p_plus_4_converted_bits, [0; 254]);\n\n // checking that Field::from_le_bits::<254> on the Field modulus produces 0\n assert_eq(modulus_le_bits().len(), 254);\n let p = from_le_bits::<254>(modulus_le_bits().as_array());\n assert_eq(p, 0);\n\n // checking that converting 0 to 254 LE bytes produces 254 zeroes\n let p_bits: [u1; 254] = 0.to_le_bits();\n assert_eq(p_bits, [0; 254]);\n }\n }\n}\n"
|
|
1534
1460
|
},
|
|
1535
|
-
"
|
|
1461
|
+
"173": {
|
|
1536
1462
|
"function_locations": [
|
|
1537
1463
|
{
|
|
1538
1464
|
"name": "aes128_decrypt_oracle",
|
|
@@ -1540,21 +1466,21 @@
|
|
|
1540
1466
|
},
|
|
1541
1467
|
{
|
|
1542
1468
|
"name": "try_aes128_decrypt",
|
|
1543
|
-
"start":
|
|
1469
|
+
"start": 1046
|
|
1544
1470
|
},
|
|
1545
1471
|
{
|
|
1546
1472
|
"name": "test::aes_encrypt_then_decrypt",
|
|
1547
|
-
"start":
|
|
1473
|
+
"start": 1860
|
|
1548
1474
|
},
|
|
1549
1475
|
{
|
|
1550
1476
|
"name": "test::aes_encrypt_then_decrypt_with_bad_sym_key_is_caught",
|
|
1551
|
-
"start":
|
|
1477
|
+
"start": 3150
|
|
1552
1478
|
}
|
|
1553
1479
|
],
|
|
1554
1480
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/aes128_decrypt.nr",
|
|
1555
|
-
"source": "#[oracle(aztec_utl_decryptAes128)]\nunconstrained fn aes128_decrypt_oracle<let N: u32>(\n ciphertext: BoundedVec<u8, N>,\n iv: [u8; 16],\n sym_key: [u8; 16],\n) -> Option<BoundedVec<u8, N>> {}\n\n/// Attempts to decrypt a ciphertext using AES128.\n///\n/// Returns `Option::some(plaintext)` on success, or `Option::none()` if decryption fails (e.g. due to malformed\n/// ciphertext). Note that decryption with the wrong key will
|
|
1481
|
+
"source": "#[oracle(aztec_utl_decryptAes128)]\nunconstrained fn aes128_decrypt_oracle<let N: u32>(\n ciphertext: BoundedVec<u8, N>,\n iv: [u8; 16],\n sym_key: [u8; 16],\n) -> Option<BoundedVec<u8, N>> {}\n\n/// Attempts to decrypt a ciphertext using AES128.\n///\n/// Returns `Option::some(plaintext)` on success, or `Option::none()` if decryption fails (e.g. due to malformed\n/// ciphertext or invalid PKCS#7 padding). Note that decryption with the wrong key will almost always return `None`\n/// because the decrypted garbage data will have invalid PKCS#7 padding.\n///\n/// Note that we accept ciphertext as a BoundedVec, not as an array. This is because this function is typically used\n/// when processing logs and at that point we don't have comptime information about the length of the ciphertext as\n/// the log is not specific to any individual note.\n// TODO(F-498): review naming consistency\npub unconstrained fn try_aes128_decrypt<let N: u32>(\n ciphertext: BoundedVec<u8, N>,\n iv: [u8; 16],\n sym_key: [u8; 16],\n) -> Option<BoundedVec<u8, N>> {\n aes128_decrypt_oracle(ciphertext, iv, sym_key)\n}\n\nmod test {\n use crate::{\n keys::ecdh_shared_secret::compute_app_siloed_shared_secret,\n messages::encryption::aes128::derive_aes_symmetric_key_and_iv_from_shared_secret,\n utils::{array::subarray::subarray, point::point_from_x_coord},\n };\n use crate::protocol::address::AztecAddress;\n use crate::test::helpers::test_environment::TestEnvironment;\n use super::try_aes128_decrypt;\n use std::aes128::aes128_encrypt;\n\n global CONTRACT_ADDRESS: AztecAddress = AztecAddress { inner: 42 };\n global TEST_PLAINTEXT_LENGTH: u32 = 10;\n global TEST_CIPHERTEXT_LENGTH: u32 = 16;\n global TEST_PADDING_LENGTH: u32 = TEST_CIPHERTEXT_LENGTH - TEST_PLAINTEXT_LENGTH;\n\n #[test]\n unconstrained fn aes_encrypt_then_decrypt() {\n let env = TestEnvironment::new();\n\n env.utility_context(|_| {\n let shared_secret_point = point_from_x_coord(1).unwrap();\n let s_app = compute_app_siloed_shared_secret(shared_secret_point, CONTRACT_ADDRESS);\n\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_shared_secret::<1>(s_app)[0];\n\n let plaintext: [u8; TEST_PLAINTEXT_LENGTH] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n\n let ciphertext: [u8; TEST_CIPHERTEXT_LENGTH] = aes128_encrypt(plaintext, iv, sym_key);\n\n let ciphertext_bvec = BoundedVec::<u8, TEST_CIPHERTEXT_LENGTH>::from_array(ciphertext);\n\n let received_plaintext = try_aes128_decrypt(ciphertext_bvec, iv, sym_key).unwrap();\n assert_eq(received_plaintext.len(), TEST_PLAINTEXT_LENGTH);\n assert_eq(received_plaintext.max_len(), TEST_CIPHERTEXT_LENGTH);\n assert_eq(subarray::<_, _, TEST_PLAINTEXT_LENGTH>(received_plaintext.storage(), 0), plaintext);\n assert_eq(\n subarray::<_, _, TEST_PADDING_LENGTH>(received_plaintext.storage(), TEST_PLAINTEXT_LENGTH),\n [0 as u8; TEST_PADDING_LENGTH],\n );\n })\n }\n\n #[test]\n unconstrained fn aes_encrypt_then_decrypt_with_bad_sym_key_is_caught() {\n let env = TestEnvironment::new();\n\n env.utility_context(|_| {\n // Decrypting with the wrong key results in garbage data with invalid PKCS#7 padding,\n // so the oracle returns None.\n let shared_secret_point = point_from_x_coord(1).unwrap();\n let s_app = compute_app_siloed_shared_secret(shared_secret_point, CONTRACT_ADDRESS);\n\n let (sym_key, iv) = derive_aes_symmetric_key_and_iv_from_shared_secret::<1>(s_app)[0];\n\n let plaintext: [u8; TEST_PLAINTEXT_LENGTH] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];\n let ciphertext: [u8; TEST_CIPHERTEXT_LENGTH] = aes128_encrypt(plaintext, iv, sym_key);\n\n let mut bad_sym_key = sym_key;\n bad_sym_key[0] = 0;\n\n let ciphertext_bvec = BoundedVec::<u8, TEST_CIPHERTEXT_LENGTH>::from_array(ciphertext);\n // Decryption with wrong key returns None because the garbage output has invalid PKCS#7 padding.\n let result = try_aes128_decrypt(ciphertext_bvec, iv, bad_sym_key);\n assert(result.is_none(), \"decryption with bad key should return None\");\n });\n }\n}\n"
|
|
1556
1482
|
},
|
|
1557
|
-
"
|
|
1483
|
+
"175": {
|
|
1558
1484
|
"function_locations": [
|
|
1559
1485
|
{
|
|
1560
1486
|
"name": "address",
|
|
@@ -1792,7 +1718,7 @@
|
|
|
1792
1718
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/avm.nr",
|
|
1793
1719
|
"source": "//! AVM oracles.\n//!\n//! There are only available during public execution. Calling any of them from a private or utility function will\n//! result in runtime errors.\n\nuse crate::protocol::address::{AztecAddress, EthAddress};\n\npub unconstrained fn address() -> AztecAddress {\n address_opcode()\n}\npub unconstrained fn sender() -> AztecAddress {\n sender_opcode()\n}\npub unconstrained fn transaction_fee() -> Field {\n transaction_fee_opcode()\n}\npub unconstrained fn chain_id() -> Field {\n chain_id_opcode()\n}\npub unconstrained fn version() -> Field {\n version_opcode()\n}\npub unconstrained fn block_number() -> u32 {\n block_number_opcode()\n}\npub unconstrained fn timestamp() -> u64 {\n timestamp_opcode()\n}\npub unconstrained fn min_fee_per_l2_gas() -> u128 {\n min_fee_per_l2_gas_opcode()\n}\npub unconstrained fn min_fee_per_da_gas() -> u128 {\n min_fee_per_da_gas_opcode()\n}\npub unconstrained fn l2_gas_left() -> u32 {\n l2_gas_left_opcode()\n}\npub unconstrained fn da_gas_left() -> u32 {\n da_gas_left_opcode()\n}\npub unconstrained fn is_static_call() -> u1 {\n is_static_call_opcode()\n}\npub unconstrained fn note_hash_exists(note_hash: Field, leaf_index: u64) -> u1 {\n note_hash_exists_opcode(note_hash, leaf_index)\n}\npub unconstrained fn emit_note_hash(note_hash: Field) {\n emit_note_hash_opcode(note_hash)\n}\npub unconstrained fn nullifier_exists(siloed_nullifier: Field) -> u1 {\n nullifier_exists_opcode(siloed_nullifier)\n}\npub unconstrained fn emit_nullifier(nullifier: Field) {\n emit_nullifier_opcode(nullifier)\n}\npub unconstrained fn emit_public_log(message: [Field]) {\n emit_public_log_opcode(message)\n}\npub unconstrained fn l1_to_l2_msg_exists(msg_hash: Field, msg_leaf_index: u64) -> u1 {\n l1_to_l2_msg_exists_opcode(msg_hash, msg_leaf_index)\n}\npub unconstrained fn send_l2_to_l1_msg(recipient: EthAddress, content: Field) {\n send_l2_to_l1_msg_opcode(recipient, content)\n}\n\npub unconstrained fn call<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n args: [Field; N],\n) {\n call_opcode(l2_gas_allocation, da_gas_allocation, address, N, args)\n}\n\npub unconstrained fn call_static<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n args: [Field; N],\n) {\n call_static_opcode(l2_gas_allocation, da_gas_allocation, address, N, args)\n}\n\npub unconstrained fn calldata_copy<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {\n calldata_copy_opcode(cdoffset, copy_size)\n}\n\n/// `success_copy` is placed immediately after the CALL opcode to get the success value\npub unconstrained fn success_copy() -> bool {\n success_copy_opcode()\n}\n\npub unconstrained fn returndata_size() -> u32 {\n returndata_size_opcode()\n}\n\npub unconstrained fn returndata_copy(rdoffset: u32, copy_size: u32) -> [Field] {\n returndata_copy_opcode(rdoffset, copy_size)\n}\n\n/// The additional prefix is to avoid clashing with the `return` Noir keyword.\npub unconstrained fn avm_return(returndata: [Field]) {\n return_opcode(returndata)\n}\n\n/// This opcode reverts using the exact data given. In general it should only be used to do rethrows, where the revert\n/// data is the same as the original revert data. For normal reverts, use Noir's `assert` which, on top of reverting,\n/// will also add an error selector to the revert data.\npub unconstrained fn revert(revertdata: [Field]) {\n revert_opcode(revertdata)\n}\n\npub unconstrained fn storage_read(storage_slot: Field, contract_address: Field) -> Field {\n storage_read_opcode(storage_slot, contract_address)\n}\n\npub unconstrained fn storage_write(storage_slot: Field, value: Field) {\n storage_write_opcode(storage_slot, value);\n}\n\n#[oracle(aztec_avm_address)]\nunconstrained fn address_opcode() -> AztecAddress {}\n\n#[oracle(aztec_avm_sender)]\nunconstrained fn sender_opcode() -> AztecAddress {}\n\n#[oracle(aztec_avm_transactionFee)]\nunconstrained fn transaction_fee_opcode() -> Field {}\n\n#[oracle(aztec_avm_chainId)]\nunconstrained fn chain_id_opcode() -> Field {}\n\n#[oracle(aztec_avm_version)]\nunconstrained fn version_opcode() -> Field {}\n\n#[oracle(aztec_avm_blockNumber)]\nunconstrained fn block_number_opcode() -> u32 {}\n\n#[oracle(aztec_avm_timestamp)]\nunconstrained fn timestamp_opcode() -> u64 {}\n\n#[oracle(aztec_avm_minFeePerL2Gas)]\nunconstrained fn min_fee_per_l2_gas_opcode() -> u128 {}\n\n#[oracle(aztec_avm_minFeePerDaGas)]\nunconstrained fn min_fee_per_da_gas_opcode() -> u128 {}\n\n#[oracle(aztec_avm_l2GasLeft)]\nunconstrained fn l2_gas_left_opcode() -> u32 {}\n\n#[oracle(aztec_avm_daGasLeft)]\nunconstrained fn da_gas_left_opcode() -> u32 {}\n\n#[oracle(aztec_avm_isStaticCall)]\nunconstrained fn is_static_call_opcode() -> u1 {}\n\n#[oracle(aztec_avm_noteHashExists)]\nunconstrained fn note_hash_exists_opcode(note_hash: Field, leaf_index: u64) -> u1 {}\n\n#[oracle(aztec_avm_emitNoteHash)]\nunconstrained fn emit_note_hash_opcode(note_hash: Field) {}\n\n#[oracle(aztec_avm_nullifierExists)]\nunconstrained fn nullifier_exists_opcode(siloed_nullifier: Field) -> u1 {}\n\n#[oracle(aztec_avm_emitNullifier)]\nunconstrained fn emit_nullifier_opcode(nullifier: Field) {}\n\n#[oracle(aztec_avm_emitPublicLog)]\nunconstrained fn emit_public_log_opcode(message: [Field]) {}\n\n#[oracle(aztec_avm_l1ToL2MsgExists)]\nunconstrained fn l1_to_l2_msg_exists_opcode(msg_hash: Field, msg_leaf_index: u64) -> u1 {}\n\n#[oracle(aztec_avm_sendL2ToL1Msg)]\nunconstrained fn send_l2_to_l1_msg_opcode(recipient: EthAddress, content: Field) {}\n\n#[oracle(aztec_avm_calldataCopy)]\nunconstrained fn calldata_copy_opcode<let N: u32>(cdoffset: u32, copy_size: u32) -> [Field; N] {}\n\n#[oracle(aztec_avm_returndataSize)]\nunconstrained fn returndata_size_opcode() -> u32 {}\n\n#[oracle(aztec_avm_returndataCopy)]\nunconstrained fn returndata_copy_opcode(rdoffset: u32, copy_size: u32) -> [Field] {}\n\n#[oracle(aztec_avm_return)]\nunconstrained fn return_opcode(returndata: [Field]) {}\n\n#[oracle(aztec_avm_revert)]\nunconstrained fn revert_opcode(revertdata: [Field]) {}\n\n// While the length parameter might seem unnecessary given that we have N we keep it around because at the AVM bytecode\n// level, we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally take\n// that route.\n#[oracle(aztec_avm_call)]\nunconstrained fn call_opcode<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n length: u32,\n args: [Field; N],\n) {}\n\n// While the length parameter might seem unnecessary given that we have N we keep it around because at the AVM bytecode\n// level, we want to support non-comptime-known lengths for such opcodes, even if Noir code will not generally take\n// that route.\n#[oracle(aztec_avm_staticCall)]\nunconstrained fn call_static_opcode<let N: u32>(\n l2_gas_allocation: u32,\n da_gas_allocation: u32,\n address: AztecAddress,\n length: u32,\n args: [Field; N],\n) {}\n\n#[oracle(aztec_avm_successCopy)]\nunconstrained fn success_copy_opcode() -> bool {}\n\n#[oracle(aztec_avm_storageRead)]\nunconstrained fn storage_read_opcode(storage_slot: Field, contract_address: Field) -> Field {}\n\n#[oracle(aztec_avm_storageWrite)]\nunconstrained fn storage_write_opcode(storage_slot: Field, value: Field) {}\n"
|
|
1794
1720
|
},
|
|
1795
|
-
"
|
|
1721
|
+
"178": {
|
|
1796
1722
|
"function_locations": [
|
|
1797
1723
|
{
|
|
1798
1724
|
"name": "store",
|
|
@@ -1826,61 +1752,79 @@
|
|
|
1826
1752
|
"name": "copy_oracle",
|
|
1827
1753
|
"start": 3261
|
|
1828
1754
|
},
|
|
1755
|
+
{
|
|
1756
|
+
"name": "test::setup",
|
|
1757
|
+
"start": 3884
|
|
1758
|
+
},
|
|
1829
1759
|
{
|
|
1830
1760
|
"name": "test::stores_and_loads",
|
|
1831
|
-
"start":
|
|
1761
|
+
"start": 4060
|
|
1832
1762
|
},
|
|
1833
1763
|
{
|
|
1834
1764
|
"name": "test::store_overwrites",
|
|
1835
|
-
"start":
|
|
1765
|
+
"start": 4450
|
|
1836
1766
|
},
|
|
1837
1767
|
{
|
|
1838
1768
|
"name": "test::loads_empty_slot",
|
|
1839
|
-
"start":
|
|
1769
|
+
"start": 4957
|
|
1840
1770
|
},
|
|
1841
1771
|
{
|
|
1842
1772
|
"name": "test::deletes_stored_value",
|
|
1843
|
-
"start":
|
|
1773
|
+
"start": 5311
|
|
1844
1774
|
},
|
|
1845
1775
|
{
|
|
1846
1776
|
"name": "test::deletes_empty_slot",
|
|
1847
|
-
"start":
|
|
1777
|
+
"start": 5819
|
|
1848
1778
|
},
|
|
1849
1779
|
{
|
|
1850
1780
|
"name": "test::copies_non_overlapping_values",
|
|
1851
|
-
"start":
|
|
1781
|
+
"start": 6233
|
|
1852
1782
|
},
|
|
1853
1783
|
{
|
|
1854
1784
|
"name": "test::copies_overlapping_values_with_src_ahead",
|
|
1855
|
-
"start":
|
|
1785
|
+
"start": 7106
|
|
1856
1786
|
},
|
|
1857
1787
|
{
|
|
1858
1788
|
"name": "test::copies_overlapping_values_with_dst_ahead",
|
|
1859
|
-
"start":
|
|
1789
|
+
"start": 8366
|
|
1860
1790
|
},
|
|
1861
1791
|
{
|
|
1862
1792
|
"name": "test::cannot_copy_empty_values",
|
|
1863
|
-
"start":
|
|
1793
|
+
"start": 9648
|
|
1864
1794
|
},
|
|
1865
1795
|
{
|
|
1866
1796
|
"name": "test::cannot_store_other_contract",
|
|
1867
|
-
"start":
|
|
1797
|
+
"start": 9970
|
|
1868
1798
|
},
|
|
1869
1799
|
{
|
|
1870
1800
|
"name": "test::cannot_load_other_contract",
|
|
1871
|
-
"start":
|
|
1801
|
+
"start": 10443
|
|
1872
1802
|
},
|
|
1873
1803
|
{
|
|
1874
1804
|
"name": "test::cannot_delete_other_contract",
|
|
1875
|
-
"start":
|
|
1805
|
+
"start": 10891
|
|
1876
1806
|
},
|
|
1877
1807
|
{
|
|
1878
1808
|
"name": "test::cannot_copy_other_contract",
|
|
1879
|
-
"start":
|
|
1809
|
+
"start": 11311
|
|
1880
1810
|
}
|
|
1881
1811
|
],
|
|
1882
1812
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/capsules.nr",
|
|
1883
|
-
"source": "use crate::protocol::{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.\n// TODO(F-498): review naming consistency\npub unconstrained fn store<T>(contract_address: AztecAddress, slot: Field, value: T, scope: AztecAddress)\nwhere\n T: Serialize,\n{\n let serialized = value.serialize();\n set_capsule_oracle(contract_address, slot, serialized, scope);\n}\n\n/// Returns data previously stored via `storeCapsule` in the per-contract non-volatile database. Returns\n/// Option::none() if nothing was stored at the given slot.\n// TODO(F-498): review naming consistency\npub unconstrained fn load<T>(contract_address: AztecAddress, slot: Field, scope: AztecAddress) -> Option<T>\nwhere\n T: Deserialize,\n{\n let serialized_option = get_capsule_oracle(contract_address, slot, <T as Deserialize>::N, scope);\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, scope: AztecAddress) {\n delete_oracle(contract_address, slot, scope);\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`. Supports overlapping source and\n/// destination regions (which will result in the overlapped source values being overwritten). All copied slots must\n/// 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 scope: AztecAddress,\n) {\n copy_oracle(contract_address, src_slot, dst_slot, num_entries, scope);\n}\n\n#[oracle(aztec_utl_setCapsule)]\nunconstrained fn set_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n values: [Field; N],\n scope: AztecAddress,\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\n/// expected shape would be single, array, single.). Instead, we return the serialization and deserialize in Noir.\n#[oracle(aztec_utl_getCapsule)]\nunconstrained fn get_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n array_len: u32,\n scope: AztecAddress,\n) -> Option<[Field; N]> {}\n\n#[oracle(aztec_utl_deleteCapsule)]\nunconstrained fn delete_oracle(contract_address: AztecAddress, slot: Field, scope: AztecAddress) {}\n\n#[oracle(aztec_utl_copyCapsule)]\nunconstrained fn copy_oracle(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n scope: AztecAddress,\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::MockStruct},\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, ToField}};\n\n global SLOT: Field = 1;\n global SCOPE: AztecAddress = AztecAddress { inner: 0xcafe };\n\n #[test]\n unconstrained fn stores_and_loads() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, SCOPE);\n\n assert_eq(load(contract_address, SLOT, SCOPE).unwrap(), value);\n });\n }\n\n #[test]\n unconstrained fn store_overwrites() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, SCOPE);\n\n let new_value = MockStruct::new(7, 8);\n store(contract_address, SLOT, new_value, SCOPE);\n\n assert_eq(load(contract_address, SLOT, SCOPE).unwrap(), new_value);\n });\n }\n\n #[test]\n unconstrained fn loads_empty_slot() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, SCOPE);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_stored_value() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, SCOPE);\n delete(contract_address, SLOT, SCOPE);\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, SCOPE);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_empty_slot() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n delete(contract_address, SLOT, SCOPE);\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, SCOPE);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn copies_non_overlapping_values() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\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], SCOPE);\n store(contract_address, src + 1, values[1], SCOPE);\n store(contract_address, src + 2, values[2], SCOPE);\n\n let dst = 10;\n copy(contract_address, src, dst, 3, SCOPE);\n\n assert_eq(load(contract_address, dst, SCOPE).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, SCOPE).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, SCOPE).unwrap(), values[2]);\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_src_ahead() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\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], SCOPE);\n store(contract_address, src + 1, values[1], SCOPE);\n store(contract_address, src + 2, values[2], SCOPE);\n\n let dst = 2;\n copy(contract_address, src, dst, 3, SCOPE);\n\n assert_eq(load(contract_address, dst, SCOPE).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, SCOPE).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, SCOPE).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, SCOPE).unwrap(), values[0]); // src[0] (unchanged)\n assert_eq(load(contract_address, src + 1, SCOPE).unwrap(), values[0]); // dst[0]\n assert_eq(load(contract_address, src + 2, SCOPE).unwrap(), values[1]); // dst[1]\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_dst_ahead() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\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], SCOPE);\n store(contract_address, src + 1, values[1], SCOPE);\n store(contract_address, src + 2, values[2], SCOPE);\n\n let dst = 1;\n copy(contract_address, src, dst, 3, SCOPE);\n\n assert_eq(load(contract_address, dst, SCOPE).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, SCOPE).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, SCOPE).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, SCOPE).unwrap(), values[1]); // dst[1]\n assert_eq(load(contract_address, src + 1, SCOPE).unwrap(), values[2]); // dst[2]\n assert_eq(load(contract_address, src + 2, SCOPE).unwrap(), values[2]); // src[2] (unchanged)\n });\n }\n\n #[test(should_fail_with = \"copy empty slot\")]\n unconstrained fn cannot_copy_empty_values() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n copy(contract_address, SLOT, SLOT, 1, SCOPE);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_store_other_contract() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\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, SCOPE);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_load_other_contract() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let _: Option<MockStruct> = load(other_contract_address, SLOT, SCOPE);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_delete_other_contract() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n delete(other_contract_address, SLOT, SCOPE);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_copy_other_contract() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n copy(other_contract_address, SLOT, SLOT, 0, SCOPE);\n });\n }\n}\n"
|
|
1813
|
+
"source": "use crate::protocol::{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.\n// TODO(F-498): review naming consistency\npub unconstrained fn store<T>(contract_address: AztecAddress, slot: Field, value: T, scope: AztecAddress)\nwhere\n T: Serialize,\n{\n let serialized = value.serialize();\n set_capsule_oracle(contract_address, slot, serialized, scope);\n}\n\n/// Returns data previously stored via `storeCapsule` in the per-contract non-volatile database. Returns\n/// Option::none() if nothing was stored at the given slot.\n// TODO(F-498): review naming consistency\npub unconstrained fn load<T>(contract_address: AztecAddress, slot: Field, scope: AztecAddress) -> Option<T>\nwhere\n T: Deserialize,\n{\n let serialized_option = get_capsule_oracle(contract_address, slot, <T as Deserialize>::N, scope);\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, scope: AztecAddress) {\n delete_oracle(contract_address, slot, scope);\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`. Supports overlapping source and\n/// destination regions (which will result in the overlapped source values being overwritten). All copied slots must\n/// 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 scope: AztecAddress,\n) {\n copy_oracle(contract_address, src_slot, dst_slot, num_entries, scope);\n}\n\n#[oracle(aztec_utl_setCapsule)]\nunconstrained fn set_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n values: [Field; N],\n scope: AztecAddress,\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\n/// expected shape would be single, array, single.). Instead, we return the serialization and deserialize in Noir.\n#[oracle(aztec_utl_getCapsule)]\nunconstrained fn get_capsule_oracle<let N: u32>(\n contract_address: AztecAddress,\n slot: Field,\n array_len: u32,\n scope: AztecAddress,\n) -> Option<[Field; N]> {}\n\n#[oracle(aztec_utl_deleteCapsule)]\nunconstrained fn delete_oracle(contract_address: AztecAddress, slot: Field, scope: AztecAddress) {}\n\n#[oracle(aztec_utl_copyCapsule)]\nunconstrained fn copy_oracle(\n contract_address: AztecAddress,\n src_slot: Field,\n dst_slot: Field,\n num_entries: u32,\n scope: AztecAddress,\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::MockStruct},\n };\n use crate::protocol::{address::AztecAddress, traits::{FromField, ToField}};\n\n global SLOT: Field = 1;\n\n unconstrained fn setup() -> (TestEnvironment, AztecAddress) {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n (env, scope)\n }\n\n #[test]\n unconstrained fn stores_and_loads() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n\n assert_eq(load(contract_address, SLOT, scope).unwrap(), value);\n });\n }\n\n #[test]\n unconstrained fn store_overwrites() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n\n let new_value = MockStruct::new(7, 8);\n store(contract_address, SLOT, new_value, scope);\n\n assert_eq(load(contract_address, SLOT, scope).unwrap(), new_value);\n });\n }\n\n #[test]\n unconstrained fn loads_empty_slot() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_stored_value() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let value = MockStruct::new(5, 6);\n store(contract_address, SLOT, value, scope);\n delete(contract_address, SLOT, scope);\n\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn deletes_empty_slot() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n delete(contract_address, SLOT, scope);\n let loaded_value: Option<MockStruct> = load(contract_address, SLOT, scope);\n assert_eq(loaded_value, Option::none());\n });\n }\n\n #[test]\n unconstrained fn copies_non_overlapping_values() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\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], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 10;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).unwrap(), values[2]);\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_src_ahead() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\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], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 2;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).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, scope).unwrap(), values[0]); // src[0] (unchanged)\n assert_eq(load(contract_address, src + 1, scope).unwrap(), values[0]); // dst[0]\n assert_eq(load(contract_address, src + 2, scope).unwrap(), values[1]); // dst[1]\n });\n }\n\n #[test]\n unconstrained fn copies_overlapping_values_with_dst_ahead() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\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], scope);\n store(contract_address, src + 1, values[1], scope);\n store(contract_address, src + 2, values[2], scope);\n\n let dst = 1;\n copy(contract_address, src, dst, 3, scope);\n\n assert_eq(load(contract_address, dst, scope).unwrap(), values[0]);\n assert_eq(load(contract_address, dst + 1, scope).unwrap(), values[1]);\n assert_eq(load(contract_address, dst + 2, scope).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, scope).unwrap(), values[1]); // dst[1]\n assert_eq(load(contract_address, src + 1, scope).unwrap(), values[2]); // dst[2]\n assert_eq(load(contract_address, src + 2, scope).unwrap(), values[2]); // src[2] (unchanged)\n });\n }\n\n #[test(should_fail_with = \"copy empty slot\")]\n unconstrained fn cannot_copy_empty_values() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n copy(contract_address, SLOT, SLOT, 1, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_store_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\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, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_load_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n let _: Option<MockStruct> = load(other_contract_address, SLOT, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_delete_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n delete(other_contract_address, SLOT, scope);\n });\n }\n\n #[test(should_fail_with = \"not allowed to access\")]\n unconstrained fn cannot_copy_other_contract() {\n let (env, scope) = setup();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let other_contract_address = AztecAddress::from_field(contract_address.to_field() + 1);\n\n copy(other_contract_address, SLOT, SLOT, 0, scope);\n });\n }\n}\n"
|
|
1814
|
+
},
|
|
1815
|
+
"179": {
|
|
1816
|
+
"function_locations": [
|
|
1817
|
+
{
|
|
1818
|
+
"name": "set_contract_sync_cache_invalid_oracle",
|
|
1819
|
+
"start": 242
|
|
1820
|
+
},
|
|
1821
|
+
{
|
|
1822
|
+
"name": "set_contract_sync_cache_invalid",
|
|
1823
|
+
"start": 700
|
|
1824
|
+
}
|
|
1825
|
+
],
|
|
1826
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/contract_sync.nr",
|
|
1827
|
+
"source": "use crate::protocol::address::AztecAddress;\n\n#[oracle(aztec_utl_setContractSyncCacheInvalid)]\nunconstrained fn set_contract_sync_cache_invalid_oracle<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {}\n\n/// Forces the PXE to re-sync the given contract for a set of scopes on the next query.\n///\n/// Call this after writing data (e.g. offchain messages) that the contract's `sync_state` function needs to discover.\n/// Without invalidation, the sync cache would skip re-running `sync_state` until the next block.\npub unconstrained fn set_contract_sync_cache_invalid<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {\n set_contract_sync_cache_invalid_oracle(contract_address, scopes);\n}\n"
|
|
1884
1828
|
},
|
|
1885
1829
|
"18": {
|
|
1886
1830
|
"function_locations": [
|
|
@@ -1954,109 +1898,95 @@
|
|
|
1954
1898
|
},
|
|
1955
1899
|
{
|
|
1956
1900
|
"name": "<impl BuildHasher for BuildHasherDefault<H>>::build_hasher",
|
|
1957
|
-
"start":
|
|
1901
|
+
"start": 6947
|
|
1958
1902
|
},
|
|
1959
1903
|
{
|
|
1960
1904
|
"name": "<impl Default for BuildHasherDefault<H>>::default",
|
|
1961
|
-
"start":
|
|
1905
|
+
"start": 7079
|
|
1962
1906
|
},
|
|
1963
1907
|
{
|
|
1964
1908
|
"name": "<impl Hash for Field>::hash",
|
|
1965
|
-
"start":
|
|
1909
|
+
"start": 7211
|
|
1966
1910
|
},
|
|
1967
1911
|
{
|
|
1968
1912
|
"name": "<impl Hash for u1>::hash",
|
|
1969
|
-
"start":
|
|
1913
|
+
"start": 7341
|
|
1970
1914
|
},
|
|
1971
1915
|
{
|
|
1972
1916
|
"name": "<impl Hash for u8>::hash",
|
|
1973
|
-
"start":
|
|
1917
|
+
"start": 7480
|
|
1974
1918
|
},
|
|
1975
1919
|
{
|
|
1976
1920
|
"name": "<impl Hash for u16>::hash",
|
|
1977
|
-
"start":
|
|
1921
|
+
"start": 7620
|
|
1978
1922
|
},
|
|
1979
1923
|
{
|
|
1980
1924
|
"name": "<impl Hash for u32>::hash",
|
|
1981
|
-
"start":
|
|
1925
|
+
"start": 7760
|
|
1982
1926
|
},
|
|
1983
1927
|
{
|
|
1984
1928
|
"name": "<impl Hash for u64>::hash",
|
|
1985
|
-
"start":
|
|
1929
|
+
"start": 7900
|
|
1986
1930
|
},
|
|
1987
1931
|
{
|
|
1988
1932
|
"name": "<impl Hash for u128>::hash",
|
|
1989
|
-
"start":
|
|
1933
|
+
"start": 8041
|
|
1990
1934
|
},
|
|
1991
1935
|
{
|
|
1992
1936
|
"name": "<impl Hash for i8>::hash",
|
|
1993
|
-
"start":
|
|
1937
|
+
"start": 8180
|
|
1994
1938
|
},
|
|
1995
1939
|
{
|
|
1996
1940
|
"name": "<impl Hash for i16>::hash",
|
|
1997
|
-
"start":
|
|
1941
|
+
"start": 8326
|
|
1998
1942
|
},
|
|
1999
1943
|
{
|
|
2000
1944
|
"name": "<impl Hash for i32>::hash",
|
|
2001
|
-
"start":
|
|
1945
|
+
"start": 8473
|
|
2002
1946
|
},
|
|
2003
1947
|
{
|
|
2004
1948
|
"name": "<impl Hash for i64>::hash",
|
|
2005
|
-
"start":
|
|
1949
|
+
"start": 8620
|
|
2006
1950
|
},
|
|
2007
1951
|
{
|
|
2008
1952
|
"name": "<impl Hash for bool>::hash",
|
|
2009
|
-
"start":
|
|
1953
|
+
"start": 8768
|
|
2010
1954
|
},
|
|
2011
1955
|
{
|
|
2012
1956
|
"name": "<impl Hash for ()>::hash",
|
|
2013
|
-
"start":
|
|
1957
|
+
"start": 8915
|
|
2014
1958
|
},
|
|
2015
1959
|
{
|
|
2016
1960
|
"name": "<impl Hash for [T; N]>::hash",
|
|
2017
|
-
"start":
|
|
1961
|
+
"start": 9047
|
|
2018
1962
|
},
|
|
2019
1963
|
{
|
|
2020
1964
|
"name": "<impl Hash for [T]>::hash",
|
|
2021
|
-
"start":
|
|
1965
|
+
"start": 9236
|
|
2022
1966
|
},
|
|
2023
1967
|
{
|
|
2024
1968
|
"name": "<impl Hash for (A, B)>::hash",
|
|
2025
|
-
"start":
|
|
1969
|
+
"start": 9476
|
|
2026
1970
|
},
|
|
2027
1971
|
{
|
|
2028
1972
|
"name": "<impl Hash for (A, B, C)>::hash",
|
|
2029
|
-
"start":
|
|
1973
|
+
"start": 9692
|
|
2030
1974
|
},
|
|
2031
1975
|
{
|
|
2032
1976
|
"name": "<impl Hash for (A, B, C, D)>::hash",
|
|
2033
|
-
"start":
|
|
1977
|
+
"start": 9955
|
|
2034
1978
|
},
|
|
2035
1979
|
{
|
|
2036
1980
|
"name": "<impl Hash for (A, B, C, D, E)>::hash",
|
|
2037
|
-
"start":
|
|
1981
|
+
"start": 10265
|
|
2038
1982
|
},
|
|
2039
1983
|
{
|
|
2040
1984
|
"name": "assert_pedersen",
|
|
2041
|
-
"start":
|
|
1985
|
+
"start": 10661
|
|
2042
1986
|
}
|
|
2043
1987
|
],
|
|
2044
1988
|
"path": "std/hash/mod.nr",
|
|
2045
|
-
"source": "// Exposed only for usage in `std::meta`\npub(crate) mod poseidon2;\n\nuse crate::default::Default;\nuse crate::embedded_curve_ops::{\n EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul, multi_scalar_mul_array_return,\n};\nuse crate::meta::derive_via;\nuse crate::static_assert;\n\n/// The size of the state accepted by the backend in `poseidon2_permutation`.\nglobal POSEIDON2_CONFIG_STATE_SIZE: u32 = poseidon2_config_state_size();\n\n#[foreign(sha256_compression)]\n// docs:start:sha256_compression\npub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8] {}\n// docs:end:sha256_compression\n\n#[foreign(keccakf1600)]\n// docs:start:keccakf1600\npub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {}\n// docs:end:keccakf1600\n\npub mod keccak {\n #[deprecated(\"This function has been moved to std::hash::keccakf1600\")]\n pub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {\n super::keccakf1600(input)\n }\n}\n\n#[foreign(blake2s)]\n// docs:start:blake2s\npub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake2s\n{}\n\n// docs:start:blake3\npub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake3\n{\n if crate::runtime::is_unconstrained() {\n // Temporary measure while Barretenberg is main proving system.\n // Please open an issue if you're working on another proving system and running into problems due to this.\n crate::static_assert(\n N <= 1024,\n \"Barretenberg cannot prove blake3 hashes with inputs larger than 1024 bytes\",\n );\n }\n __blake3(input)\n}\n\n#[foreign(blake3)]\nfn __blake3<let N: u32>(input: [u8; N]) -> [u8; 32] {}\n\n// docs:start:pedersen_commitment\npub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint {\n // docs:end:pedersen_commitment\n pedersen_commitment_with_separator(input, 0)\n}\n\n#[inline_always]\npub fn pedersen_commitment_with_separator<let N: u32>(\n input: [Field; N],\n separator: u32,\n) -> EmbeddedCurvePoint {\n let mut points = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N];\n for i in 0..N {\n // we use the unsafe version because the multi_scalar_mul will constrain the scalars.\n points[i] = from_field_unsafe(input[i]);\n }\n let generators = derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n multi_scalar_mul(generators, points)\n}\n\n// docs:start:pedersen_hash\npub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field\n// docs:end:pedersen_hash\n{\n pedersen_hash_with_separator(input, 0)\n}\n\n#[no_predicates]\npub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {\n let mut scalars: [EmbeddedCurveScalar; N + 1] = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N + 1];\n let mut generators: [EmbeddedCurvePoint; N + 1] =\n [EmbeddedCurvePoint::point_at_infinity(); N + 1];\n crate::assert_constant(separator);\n let domain_generators: [EmbeddedCurvePoint; N] =\n derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n\n for i in 0..N {\n scalars[i] = from_field_unsafe(input[i]);\n generators[i] = domain_generators[i];\n }\n scalars[N] = EmbeddedCurveScalar { lo: N as Field, hi: 0 as Field };\n\n let length_generator: [EmbeddedCurvePoint; 1] =\n derive_generators(\"pedersen_hash_length\".as_bytes(), 0);\n generators[N] = length_generator[0];\n multi_scalar_mul_array_return(generators, scalars)[0].x\n}\n\n#[field(bn254)]\n#[inline_always]\npub fn derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {\n crate::assert_constant(domain_separator_bytes);\n crate::assert_constant(starting_index);\n __derive_generators(domain_separator_bytes, starting_index)\n}\n\n#[builtin(derive_pedersen_generators)]\n#[field(bn254)]\nfn __derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {}\n\n#[field(bn254)]\n// Decompose the input 'bn254 scalar' into two 128 bits limbs.\n// It is called 'unsafe' because it does not assert the limbs are 128 bits\n// Assuming the limbs are 128 bits:\n// Assert the decomposition does not overflow the field size.\nfn from_field_unsafe(scalar: Field) -> EmbeddedCurveScalar {\n // Safety: xlo and xhi decomposition is checked below\n let (xlo, xhi) = unsafe { crate::field::bn254::decompose_hint(scalar) };\n // Check that the decomposition is correct\n assert_eq(scalar, xlo + crate::field::bn254::TWO_POW_128 * xhi);\n // Check that the decomposition does not overflow the field size\n let (a, b) = if xhi == crate::field::bn254::PHI {\n (xlo, crate::field::bn254::PLO)\n } else {\n (xhi, crate::field::bn254::PHI)\n };\n crate::field::bn254::assert_lt(a, b);\n\n EmbeddedCurveScalar { lo: xlo, hi: xhi }\n}\n\npub fn poseidon2_permutation<let N: u32>(input: [Field; N], state_len: u32) -> [Field; N] {\n assert_eq(input.len(), state_len);\n\n static_assert(\n N == POSEIDON2_CONFIG_STATE_SIZE,\n f\"the input length must equal the state size in the Poseidon2 config; expected {POSEIDON2_CONFIG_STATE_SIZE}, got {N}\",\n );\n poseidon2_permutation_internal(input)\n}\n\n#[foreign(poseidon2_permutation)]\nfn poseidon2_permutation_internal<let N: u32>(input: [Field; N]) -> [Field; N] {}\n\n#[foreign(poseidon2_config_state_size)]\ncomptime fn poseidon2_config_state_size() -> u32 {}\n\n// Generic hashing support.\n// Partially ported and impacted by rust.\n\n// Hash trait shall be implemented per type.\n#[derive_via(derive_hash)]\npub trait Hash {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher;\n}\n\n// docs:start:derive_hash\ncomptime fn derive_hash(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::hash::Hash };\n let signature = quote { fn hash<H>(_self: Self, _state: &mut H) where H: $crate::hash::Hasher };\n let for_each_field = |name| quote { _self.$name.hash(_state); };\n crate::meta::make_trait_impl(\n s,\n name,\n signature,\n for_each_field,\n quote {},\n |fields| fields,\n )\n}\n// docs:end:derive_hash\n\n// Hasher trait shall be implemented by algorithms to provide hash-agnostic means.\n// TODO: consider making the types generic here ([u8], [Field], etc.)\npub trait Hasher {\n fn finish(self) -> Field;\n\n fn write(&mut self, input: Field);\n}\n\n// BuildHasher is a factory trait, responsible for production of specific Hasher.\npub trait BuildHasher {\n type H: Hasher;\n\n fn build_hasher(self) -> H;\n}\n\npub struct BuildHasherDefault<H>;\n\nimpl<H> BuildHasher for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n type H = H;\n\n fn build_hasher(_self: Self) -> H {\n H::default()\n }\n}\n\nimpl<H> Default for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n fn default() -> Self {\n BuildHasherDefault {}\n }\n}\n\nimpl Hash for Field {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self);\n }\n}\n\nimpl Hash for u1 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u128 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for i8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u8 as Field);\n }\n}\n\nimpl Hash for i16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u16 as Field);\n }\n}\n\nimpl Hash for i32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u32 as Field);\n }\n}\n\nimpl Hash for i64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u64 as Field);\n }\n}\n\nimpl Hash for bool {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for () {\n fn hash<H>(_self: Self, _state: &mut H)\n where\n H: Hasher,\n {}\n}\n\nimpl<T, let N: u32> Hash for [T; N]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<T> Hash for [T]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.len().hash(state);\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<A, B> Hash for (A, B)\nwhere\n A: Hash,\n B: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n }\n}\n\nimpl<A, B, C> Hash for (A, B, C)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n }\n}\n\nimpl<A, B, C, D> Hash for (A, B, C, D)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n }\n}\n\nimpl<A, B, C, D, E> Hash for (A, B, C, D, E)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n }\n}\n\n// Some test vectors for Pedersen hash and Pedersen Commitment.\n// They have been generated using the same functions so the tests are for now useless\n// but they will be useful when we switch to Noir implementation.\n#[test]\nfn assert_pedersen() {\n assert_eq(\n pedersen_hash_with_separator([1], 1),\n 0x1b3f4b1a83092a13d8d1a59f7acb62aba15e7002f4440f2275edb99ebbc2305f,\n );\n assert_eq(\n pedersen_commitment_with_separator([1], 1),\n EmbeddedCurvePoint {\n x: 0x054aa86a73cb8a34525e5bbed6e43ba1198e860f5f3950268f71df4591bde402,\n y: 0x209dcfbf2cfb57f9f6046f44d71ac6faf87254afc7407c04eb621a6287cac126,\n is_infinite: false,\n },\n );\n\n assert_eq(\n pedersen_hash_with_separator([1, 2], 2),\n 0x26691c129448e9ace0c66d11f0a16d9014a9e8498ee78f4d69f0083168188255,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2], 2),\n EmbeddedCurvePoint {\n x: 0x2e2b3b191e49541fe468ec6877721d445dcaffe41728df0a0eafeb15e87b0753,\n y: 0x2ff4482400ad3a6228be17a2af33e2bcdf41be04795f9782bd96efe7e24f8778,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3], 3),\n 0x0bc694b7a1f8d10d2d8987d07433f26bd616a2d351bc79a3c540d85b6206dbe4,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3], 3),\n EmbeddedCurvePoint {\n x: 0x1fee4e8cf8d2f527caa2684236b07c4b1bad7342c01b0f75e9a877a71827dc85,\n y: 0x2f9fedb9a090697ab69bf04c8bc15f7385b3e4b68c849c1536e5ae15ff138fd1,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4], 4),\n 0xdae10fb32a8408521803905981a2b300d6a35e40e798743e9322b223a5eddc,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4], 4),\n EmbeddedCurvePoint {\n x: 0x07ae3e202811e1fca39c2d81eabe6f79183978e6f12be0d3b8eda095b79bdbc9,\n y: 0x0afc6f892593db6fbba60f2da558517e279e0ae04f95758587760ba193145014,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5], 5),\n 0xfc375b062c4f4f0150f7100dfb8d9b72a6d28582dd9512390b0497cdad9c22,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5], 5),\n EmbeddedCurvePoint {\n x: 0x1754b12bd475a6984a1094b5109eeca9838f4f81ac89c5f0a41dbce53189bb29,\n y: 0x2da030e3cfcdc7ddad80eaf2599df6692cae0717d4e9f7bfbee8d073d5d278f7,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6], 6),\n 0x1696ed13dc2730062a98ac9d8f9de0661bb98829c7582f699d0273b18c86a572,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6], 6),\n EmbeddedCurvePoint {\n x: 0x190f6c0e97ad83e1e28da22a98aae156da083c5a4100e929b77e750d3106a697,\n y: 0x1f4b60f34ef91221a0b49756fa0705da93311a61af73d37a0c458877706616fb,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n 0x128c0ff144fc66b6cb60eeac8a38e23da52992fc427b92397a7dffd71c45ede3,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n EmbeddedCurvePoint {\n x: 0x015441e9d29491b06563fac16fc76abf7a9534c715421d0de85d20dbe2965939,\n y: 0x1d2575b0276f4e9087e6e07c2cb75aa1baafad127af4be5918ef8a2ef2fea8fc,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n 0x2f960e117482044dfc99d12fece2ef6862fba9242be4846c7c9a3e854325a55c,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n EmbeddedCurvePoint {\n x: 0x1657737676968887fceb6dd516382ea13b3a2c557f509811cd86d5d1199bc443,\n y: 0x1f39f0cb569040105fa1e2f156521e8b8e08261e635a2b210bdc94e8d6d65f77,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n 0x0c96db0790602dcb166cc4699e2d306c479a76926b81c2cb2aaa92d249ec7be7,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n EmbeddedCurvePoint {\n x: 0x0a3ceae42d14914a432aa60ec7fded4af7dad7dd4acdbf2908452675ec67e06d,\n y: 0xfc19761eaaf621ad4aec9a8b2e84a4eceffdba78f60f8b9391b0bd9345a2f2,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n 0x2cd37505871bc460a62ea1e63c7fe51149df5d0801302cf1cbc48beb8dff7e94,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n EmbeddedCurvePoint {\n x: 0x2fb3f8b3d41ddde007c8c3c62550f9a9380ee546fcc639ffbb3fd30c8d8de30c,\n y: 0x300783be23c446b11a4c0fabf6c91af148937cea15fcf5fb054abf7f752ee245,\n is_infinite: false,\n },\n );\n}\n"
|
|
2046
|
-
},
|
|
2047
|
-
"180": {
|
|
2048
|
-
"function_locations": [
|
|
2049
|
-
{
|
|
2050
|
-
"name": "set_contract_sync_cache_invalid_oracle",
|
|
2051
|
-
"start": 242
|
|
2052
|
-
},
|
|
2053
|
-
{
|
|
2054
|
-
"name": "set_contract_sync_cache_invalid",
|
|
2055
|
-
"start": 700
|
|
2056
|
-
}
|
|
2057
|
-
],
|
|
2058
|
-
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/contract_sync.nr",
|
|
2059
|
-
"source": "use crate::protocol::address::AztecAddress;\n\n#[oracle(aztec_utl_setContractSyncCacheInvalid)]\nunconstrained fn set_contract_sync_cache_invalid_oracle<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {}\n\n/// Forces the PXE to re-sync the given contract for a set of scopes on the next query.\n///\n/// Call this after writing data (e.g. offchain messages) that the contract's `sync_state` function needs to discover.\n/// Without invalidation, the sync cache would skip re-running `sync_state` until the next block.\npub unconstrained fn set_contract_sync_cache_invalid<let N: u32>(\n contract_address: AztecAddress,\n scopes: BoundedVec<AztecAddress, N>,\n) {\n set_contract_sync_cache_invalid_oracle(contract_address, scopes);\n}\n"
|
|
1989
|
+
"source": "// Exposed only for usage in `std::meta`\npub(crate) mod poseidon2;\n\nuse crate::default::Default;\nuse crate::embedded_curve_ops::{\n EmbeddedCurvePoint, EmbeddedCurveScalar, multi_scalar_mul, multi_scalar_mul_array_return,\n};\nuse crate::meta::derive_via;\nuse crate::static_assert;\n\n/// The size of the state accepted by the backend in `poseidon2_permutation`.\nglobal POSEIDON2_CONFIG_STATE_SIZE: u32 = poseidon2_config_state_size();\n\n#[foreign(sha256_compression)]\n// docs:start:sha256_compression\npub fn sha256_compression(input: [u32; 16], state: [u32; 8]) -> [u32; 8] {}\n// docs:end:sha256_compression\n\n#[foreign(keccakf1600)]\n// docs:start:keccakf1600\npub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {}\n// docs:end:keccakf1600\n\npub mod keccak {\n #[deprecated(\"This function has been moved to std::hash::keccakf1600\")]\n pub fn keccakf1600(input: [u64; 25]) -> [u64; 25] {\n super::keccakf1600(input)\n }\n}\n\n#[foreign(blake2s)]\n// docs:start:blake2s\npub fn blake2s<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake2s\n{}\n\n// docs:start:blake3\npub fn blake3<let N: u32>(input: [u8; N]) -> [u8; 32]\n// docs:end:blake3\n{\n if crate::runtime::is_unconstrained() {\n // Temporary measure while Barretenberg is main proving system.\n // Please open an issue if you're working on another proving system and running into problems due to this.\n crate::static_assert(\n N <= 1024,\n \"Barretenberg cannot prove blake3 hashes with inputs larger than 1024 bytes\",\n );\n }\n __blake3(input)\n}\n\n#[foreign(blake3)]\nfn __blake3<let N: u32>(input: [u8; N]) -> [u8; 32] {}\n\n// docs:start:pedersen_commitment\npub fn pedersen_commitment<let N: u32>(input: [Field; N]) -> EmbeddedCurvePoint {\n // docs:end:pedersen_commitment\n pedersen_commitment_with_separator(input, 0)\n}\n\n#[inline_always]\npub fn pedersen_commitment_with_separator<let N: u32>(\n input: [Field; N],\n separator: u32,\n) -> EmbeddedCurvePoint {\n let mut points = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N];\n for i in 0..N {\n // we use the unsafe version because the multi_scalar_mul will constrain the scalars.\n points[i] = from_field_unsafe(input[i]);\n }\n let generators = derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n multi_scalar_mul(generators, points)\n}\n\n// docs:start:pedersen_hash\npub fn pedersen_hash<let N: u32>(input: [Field; N]) -> Field\n// docs:end:pedersen_hash\n{\n pedersen_hash_with_separator(input, 0)\n}\n\n#[no_predicates]\npub fn pedersen_hash_with_separator<let N: u32>(input: [Field; N], separator: u32) -> Field {\n let mut scalars: [EmbeddedCurveScalar; N + 1] = [EmbeddedCurveScalar { lo: 0, hi: 0 }; N + 1];\n let mut generators: [EmbeddedCurvePoint; N + 1] =\n [EmbeddedCurvePoint::point_at_infinity(); N + 1];\n crate::assert_constant(separator);\n let domain_generators: [EmbeddedCurvePoint; N] =\n derive_generators(\"DEFAULT_DOMAIN_SEPARATOR\".as_bytes(), separator);\n\n for i in 0..N {\n scalars[i] = from_field_unsafe(input[i]);\n generators[i] = domain_generators[i];\n }\n scalars[N] = EmbeddedCurveScalar { lo: N as Field, hi: 0 as Field };\n\n let length_generator: [EmbeddedCurvePoint; 1] =\n derive_generators(\"pedersen_hash_length\".as_bytes(), 0);\n generators[N] = length_generator[0];\n multi_scalar_mul_array_return(generators, scalars)[0].x\n}\n\n#[field(bn254)]\n#[inline_always]\npub fn derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {\n crate::assert_constant(domain_separator_bytes);\n crate::assert_constant(starting_index);\n __derive_generators(domain_separator_bytes, starting_index)\n}\n\n#[builtin(derive_pedersen_generators)]\n#[field(bn254)]\nfn __derive_generators<let N: u32, let M: u32>(\n domain_separator_bytes: [u8; M],\n starting_index: u32,\n) -> [EmbeddedCurvePoint; N] {}\n\n#[field(bn254)]\n// Decompose the input 'bn254 scalar' into two 128 bits limbs.\n// It is called 'unsafe' because it does not assert the limbs are 128 bits\n// Assuming the limbs are 128 bits:\n// Assert the decomposition does not overflow the field size.\nfn from_field_unsafe(scalar: Field) -> EmbeddedCurveScalar {\n // Safety: xlo and xhi decomposition is checked below\n let (xlo, xhi) = unsafe { crate::field::bn254::decompose_hint(scalar) };\n // Check that the decomposition is correct\n assert_eq(scalar, xlo + crate::field::bn254::TWO_POW_128 * xhi);\n // Check that the decomposition does not overflow the field size\n let (a, b) = if xhi == crate::field::bn254::PHI {\n (xlo, crate::field::bn254::PLO)\n } else {\n (xhi, crate::field::bn254::PHI)\n };\n crate::field::bn254::assert_lt(a, b);\n\n EmbeddedCurveScalar { lo: xlo, hi: xhi }\n}\n\npub fn poseidon2_permutation<let N: u32>(input: [Field; N], state_len: u32) -> [Field; N] {\n assert_eq(input.len(), state_len);\n\n static_assert(\n N == POSEIDON2_CONFIG_STATE_SIZE,\n f\"the input length must equal the state size in the Poseidon2 config; expected {POSEIDON2_CONFIG_STATE_SIZE}, got {N}\",\n );\n poseidon2_permutation_internal(input)\n}\n\n#[foreign(poseidon2_permutation)]\nfn poseidon2_permutation_internal<let N: u32>(input: [Field; N]) -> [Field; N] {}\n\n#[foreign(poseidon2_config_state_size)]\ncomptime fn poseidon2_config_state_size() -> u32 {}\n\n// Generic hashing support.\n// Partially ported and impacted by rust.\n\n// Hash trait shall be implemented per type.\n#[derive_via(derive_hash)]\npub trait Hash {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher;\n}\n\n// docs:start:derive_hash\ncomptime fn derive_hash(s: TypeDefinition) -> Quoted {\n let name = quote { $crate::hash::Hash };\n let signature = quote { fn hash<H>(_self: Self, _state: &mut H) where H: $crate::hash::Hasher };\n let for_each_field = |name| quote { _self.$name.hash(_state); };\n crate::meta::make_trait_impl(\n s,\n name,\n signature,\n for_each_field,\n quote {},\n |fields| fields,\n )\n}\n// docs:end:derive_hash\n\n// Hasher trait shall be implemented by algorithms to provide hash-agnostic means.\n// TODO: consider making the types generic here ([u8], [Field], etc.)\npub trait Hasher {\n fn finish(self) -> Field;\n\n /// Returns the hash value without consuming the hasher.\n /// Override this for more efficient implementations that avoid copying.\n /// TODO: deprecate finish() and replace it\n fn finish_ref(&self) -> Field {\n (*self).finish()\n }\n\n fn write(&mut self, input: Field);\n}\n\n// BuildHasher is a factory trait, responsible for production of specific Hasher.\npub trait BuildHasher {\n type H: Hasher;\n\n fn build_hasher(self) -> H;\n}\n\npub struct BuildHasherDefault<H>;\n\nimpl<H> BuildHasher for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n type H = H;\n\n fn build_hasher(_self: Self) -> H {\n H::default()\n }\n}\n\nimpl<H> Default for BuildHasherDefault<H>\nwhere\n H: Hasher + Default,\n{\n fn default() -> Self {\n BuildHasherDefault {}\n }\n}\n\nimpl Hash for Field {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self);\n }\n}\n\nimpl Hash for u1 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for u128 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for i8 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u8 as Field);\n }\n}\n\nimpl Hash for i16 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u16 as Field);\n }\n}\n\nimpl Hash for i32 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u32 as Field);\n }\n}\n\nimpl Hash for i64 {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as u64 as Field);\n }\n}\n\nimpl Hash for bool {\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n H::write(state, self as Field);\n }\n}\n\nimpl Hash for () {\n fn hash<H>(_self: Self, _state: &mut H)\n where\n H: Hasher,\n {}\n}\n\nimpl<T, let N: u32> Hash for [T; N]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<T> Hash for [T]\nwhere\n T: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.len().hash(state);\n for elem in self {\n elem.hash(state);\n }\n }\n}\n\nimpl<A, B> Hash for (A, B)\nwhere\n A: Hash,\n B: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n }\n}\n\nimpl<A, B, C> Hash for (A, B, C)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n }\n}\n\nimpl<A, B, C, D> Hash for (A, B, C, D)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n }\n}\n\nimpl<A, B, C, D, E> Hash for (A, B, C, D, E)\nwhere\n A: Hash,\n B: Hash,\n C: Hash,\n D: Hash,\n E: Hash,\n{\n fn hash<H>(self, state: &mut H)\n where\n H: Hasher,\n {\n self.0.hash(state);\n self.1.hash(state);\n self.2.hash(state);\n self.3.hash(state);\n self.4.hash(state);\n }\n}\n\n// Some test vectors for Pedersen hash and Pedersen Commitment.\n// They have been generated using the same functions so the tests are for now useless\n// but they will be useful when we switch to Noir implementation.\n#[test]\nfn assert_pedersen() {\n assert_eq(\n pedersen_hash_with_separator([1], 1),\n 0x1b3f4b1a83092a13d8d1a59f7acb62aba15e7002f4440f2275edb99ebbc2305f,\n );\n assert_eq(\n pedersen_commitment_with_separator([1], 1),\n EmbeddedCurvePoint {\n x: 0x054aa86a73cb8a34525e5bbed6e43ba1198e860f5f3950268f71df4591bde402,\n y: 0x209dcfbf2cfb57f9f6046f44d71ac6faf87254afc7407c04eb621a6287cac126,\n is_infinite: false,\n },\n );\n\n assert_eq(\n pedersen_hash_with_separator([1, 2], 2),\n 0x26691c129448e9ace0c66d11f0a16d9014a9e8498ee78f4d69f0083168188255,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2], 2),\n EmbeddedCurvePoint {\n x: 0x2e2b3b191e49541fe468ec6877721d445dcaffe41728df0a0eafeb15e87b0753,\n y: 0x2ff4482400ad3a6228be17a2af33e2bcdf41be04795f9782bd96efe7e24f8778,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3], 3),\n 0x0bc694b7a1f8d10d2d8987d07433f26bd616a2d351bc79a3c540d85b6206dbe4,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3], 3),\n EmbeddedCurvePoint {\n x: 0x1fee4e8cf8d2f527caa2684236b07c4b1bad7342c01b0f75e9a877a71827dc85,\n y: 0x2f9fedb9a090697ab69bf04c8bc15f7385b3e4b68c849c1536e5ae15ff138fd1,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4], 4),\n 0xdae10fb32a8408521803905981a2b300d6a35e40e798743e9322b223a5eddc,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4], 4),\n EmbeddedCurvePoint {\n x: 0x07ae3e202811e1fca39c2d81eabe6f79183978e6f12be0d3b8eda095b79bdbc9,\n y: 0x0afc6f892593db6fbba60f2da558517e279e0ae04f95758587760ba193145014,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5], 5),\n 0xfc375b062c4f4f0150f7100dfb8d9b72a6d28582dd9512390b0497cdad9c22,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5], 5),\n EmbeddedCurvePoint {\n x: 0x1754b12bd475a6984a1094b5109eeca9838f4f81ac89c5f0a41dbce53189bb29,\n y: 0x2da030e3cfcdc7ddad80eaf2599df6692cae0717d4e9f7bfbee8d073d5d278f7,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6], 6),\n 0x1696ed13dc2730062a98ac9d8f9de0661bb98829c7582f699d0273b18c86a572,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6], 6),\n EmbeddedCurvePoint {\n x: 0x190f6c0e97ad83e1e28da22a98aae156da083c5a4100e929b77e750d3106a697,\n y: 0x1f4b60f34ef91221a0b49756fa0705da93311a61af73d37a0c458877706616fb,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n 0x128c0ff144fc66b6cb60eeac8a38e23da52992fc427b92397a7dffd71c45ede3,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7], 7),\n EmbeddedCurvePoint {\n x: 0x015441e9d29491b06563fac16fc76abf7a9534c715421d0de85d20dbe2965939,\n y: 0x1d2575b0276f4e9087e6e07c2cb75aa1baafad127af4be5918ef8a2ef2fea8fc,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n 0x2f960e117482044dfc99d12fece2ef6862fba9242be4846c7c9a3e854325a55c,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8], 8),\n EmbeddedCurvePoint {\n x: 0x1657737676968887fceb6dd516382ea13b3a2c557f509811cd86d5d1199bc443,\n y: 0x1f39f0cb569040105fa1e2f156521e8b8e08261e635a2b210bdc94e8d6d65f77,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n 0x0c96db0790602dcb166cc4699e2d306c479a76926b81c2cb2aaa92d249ec7be7,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9], 9),\n EmbeddedCurvePoint {\n x: 0x0a3ceae42d14914a432aa60ec7fded4af7dad7dd4acdbf2908452675ec67e06d,\n y: 0xfc19761eaaf621ad4aec9a8b2e84a4eceffdba78f60f8b9391b0bd9345a2f2,\n is_infinite: false,\n },\n );\n assert_eq(\n pedersen_hash_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n 0x2cd37505871bc460a62ea1e63c7fe51149df5d0801302cf1cbc48beb8dff7e94,\n );\n assert_eq(\n pedersen_commitment_with_separator([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 10),\n EmbeddedCurvePoint {\n x: 0x2fb3f8b3d41ddde007c8c3c62550f9a9380ee546fcc639ffbb3fd30c8d8de30c,\n y: 0x300783be23c446b11a4c0fabf6c91af148937cea15fcf5fb054abf7f752ee245,\n is_infinite: false,\n },\n );\n}\n"
|
|
2060
1990
|
},
|
|
2061
1991
|
"181": {
|
|
2062
1992
|
"function_locations": [
|
|
@@ -2075,40 +2005,40 @@
|
|
|
2075
2005
|
"191": {
|
|
2076
2006
|
"function_locations": [
|
|
2077
2007
|
{
|
|
2078
|
-
"name": "
|
|
2079
|
-
"start":
|
|
2008
|
+
"name": "get_pending_tagged_logs",
|
|
2009
|
+
"start": 570
|
|
2080
2010
|
},
|
|
2081
2011
|
{
|
|
2082
2012
|
"name": "get_pending_tagged_logs_oracle",
|
|
2083
|
-
"start":
|
|
2013
|
+
"start": 795
|
|
2084
2014
|
},
|
|
2085
2015
|
{
|
|
2086
2016
|
"name": "validate_and_store_enqueued_notes_and_events",
|
|
2087
|
-
"start":
|
|
2017
|
+
"start": 1128
|
|
2088
2018
|
},
|
|
2089
2019
|
{
|
|
2090
2020
|
"name": "validate_and_store_enqueued_notes_and_events_oracle",
|
|
2091
|
-
"start":
|
|
2021
|
+
"start": 1692
|
|
2092
2022
|
},
|
|
2093
2023
|
{
|
|
2094
2024
|
"name": "get_logs_by_tag",
|
|
2095
|
-
"start":
|
|
2025
|
+
"start": 1938
|
|
2096
2026
|
},
|
|
2097
2027
|
{
|
|
2098
|
-
"name": "
|
|
2099
|
-
"start":
|
|
2028
|
+
"name": "get_logs_by_tag_v2_oracle",
|
|
2029
|
+
"start": 2163
|
|
2100
2030
|
},
|
|
2101
2031
|
{
|
|
2102
2032
|
"name": "get_message_contexts_by_tx_hash",
|
|
2103
|
-
"start":
|
|
2033
|
+
"start": 2423
|
|
2104
2034
|
},
|
|
2105
2035
|
{
|
|
2106
|
-
"name": "
|
|
2107
|
-
"start":
|
|
2036
|
+
"name": "get_message_contexts_by_tx_hash_v2_oracle",
|
|
2037
|
+
"start": 2694
|
|
2108
2038
|
}
|
|
2109
2039
|
],
|
|
2110
2040
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/oracle/message_processing.nr",
|
|
2111
|
-
"source": "use crate::protocol::address::AztecAddress;\n\n/// Finds new private logs that may have been sent to all registered accounts in PXE in the current contract and
|
|
2041
|
+
"source": "use crate::ephemeral::EphemeralArray;\nuse crate::messages::processing::{\n log_retrieval_request::LogRetrievalRequest, log_retrieval_response::LogRetrievalResponse, MessageContext,\n pending_tagged_log::PendingTaggedLog,\n};\nuse crate::protocol::address::AztecAddress;\n\n/// Finds new private logs that may have been sent to all registered accounts in PXE in the current contract and\n/// returns them in an ephemeral array with an oracle-allocated base slot.\npub(crate) unconstrained fn get_pending_tagged_logs(scope: AztecAddress) -> EphemeralArray<PendingTaggedLog> {\n let result_slot = get_pending_tagged_logs_oracle(scope);\n EphemeralArray::at(result_slot)\n}\n\n#[oracle(aztec_utl_getPendingTaggedLogs_v2)]\nunconstrained fn get_pending_tagged_logs_oracle(scope: AztecAddress) -> Field {}\n\n/// Validates note/event requests stored in ephemeral arrays.\npub(crate) unconstrained fn validate_and_store_enqueued_notes_and_events(\n note_validation_requests_array_slot: Field,\n event_validation_requests_array_slot: Field,\n max_note_packed_len: Field,\n max_event_serialized_len: Field,\n scope: AztecAddress,\n) {\n validate_and_store_enqueued_notes_and_events_oracle(\n note_validation_requests_array_slot,\n event_validation_requests_array_slot,\n max_note_packed_len,\n max_event_serialized_len,\n scope,\n );\n}\n\n#[oracle(aztec_utl_validateAndStoreEnqueuedNotesAndEvents_v2)]\nunconstrained fn validate_and_store_enqueued_notes_and_events_oracle(\n note_validation_requests_array_slot: Field,\n event_validation_requests_array_slot: Field,\n max_note_packed_len: Field,\n max_event_serialized_len: Field,\n scope: AztecAddress,\n) {}\n\n/// Fetches logs by tag from an ephemeral request array and returns a response ephemeral array.\npub(crate) unconstrained fn get_logs_by_tag(\n requests: EphemeralArray<LogRetrievalRequest>,\n) -> EphemeralArray<Option<LogRetrievalResponse>> {\n let response_slot = get_logs_by_tag_v2_oracle(requests.slot);\n EphemeralArray::at(response_slot)\n}\n\n#[oracle(aztec_utl_getLogsByTag_v2)]\nunconstrained fn get_logs_by_tag_v2_oracle(request_array_slot: Field) -> Field {}\n\n/// Resolves message contexts for tx hashes in an ephemeral request array and returns a response ephemeral array.\npub(crate) unconstrained fn get_message_contexts_by_tx_hash(\n requests: EphemeralArray<Field>,\n) -> EphemeralArray<Option<MessageContext>> {\n let response_slot = get_message_contexts_by_tx_hash_v2_oracle(requests.slot);\n EphemeralArray::at(response_slot)\n}\n\n#[oracle(aztec_utl_getMessageContextsByTxHash_v2)]\nunconstrained fn get_message_contexts_by_tx_hash_v2_oracle(request_array_slot: Field) -> Field {}\n"
|
|
2112
2042
|
},
|
|
2113
2043
|
"198": {
|
|
2114
2044
|
"function_locations": [
|
|
@@ -2674,121 +2604,109 @@
|
|
|
2674
2604
|
"name": "field_from_bytes_32_trunc",
|
|
2675
2605
|
"start": 553
|
|
2676
2606
|
},
|
|
2677
|
-
{
|
|
2678
|
-
"name": "full_field_less_than",
|
|
2679
|
-
"start": 1218
|
|
2680
|
-
},
|
|
2681
|
-
{
|
|
2682
|
-
"name": "full_field_greater_than",
|
|
2683
|
-
"start": 1302
|
|
2684
|
-
},
|
|
2685
2607
|
{
|
|
2686
2608
|
"name": "min",
|
|
2687
|
-
"start":
|
|
2609
|
+
"start": 1054
|
|
2688
2610
|
},
|
|
2689
2611
|
{
|
|
2690
2612
|
"name": "pow",
|
|
2691
|
-
"start":
|
|
2613
|
+
"start": 1899
|
|
2692
2614
|
},
|
|
2693
2615
|
{
|
|
2694
2616
|
"name": "sqrt",
|
|
2695
|
-
"start":
|
|
2617
|
+
"start": 2231
|
|
2696
2618
|
},
|
|
2697
2619
|
{
|
|
2698
2620
|
"name": "is_square",
|
|
2699
|
-
"start":
|
|
2621
|
+
"start": 2913
|
|
2700
2622
|
},
|
|
2701
2623
|
{
|
|
2702
2624
|
"name": "tonelli_shanks_sqrt",
|
|
2703
|
-
"start":
|
|
2625
|
+
"start": 3341
|
|
2704
2626
|
},
|
|
2705
2627
|
{
|
|
2706
2628
|
"name": "__sqrt",
|
|
2707
|
-
"start":
|
|
2629
|
+
"start": 3949
|
|
2708
2630
|
},
|
|
2709
2631
|
{
|
|
2710
2632
|
"name": "validate_sqrt_hint",
|
|
2711
|
-
"start":
|
|
2633
|
+
"start": 4793
|
|
2712
2634
|
},
|
|
2713
2635
|
{
|
|
2714
2636
|
"name": "validate_not_sqrt_hint",
|
|
2715
|
-
"start":
|
|
2637
|
+
"start": 4930
|
|
2716
2638
|
},
|
|
2717
2639
|
{
|
|
2718
2640
|
"name": "bytes_field_test",
|
|
2719
|
-
"start":
|
|
2641
|
+
"start": 6568
|
|
2720
2642
|
},
|
|
2721
2643
|
{
|
|
2722
2644
|
"name": "max_field_test",
|
|
2723
|
-
"start":
|
|
2645
|
+
"start": 7551
|
|
2724
2646
|
},
|
|
2725
2647
|
{
|
|
2726
2648
|
"name": "sqrt_valid_test",
|
|
2727
|
-
"start":
|
|
2649
|
+
"start": 8175
|
|
2728
2650
|
},
|
|
2729
2651
|
{
|
|
2730
2652
|
"name": "sqrt_invalid_test",
|
|
2731
|
-
"start":
|
|
2653
|
+
"start": 8377
|
|
2732
2654
|
},
|
|
2733
2655
|
{
|
|
2734
2656
|
"name": "sqrt_zero_test",
|
|
2735
|
-
"start":
|
|
2657
|
+
"start": 8546
|
|
2736
2658
|
},
|
|
2737
2659
|
{
|
|
2738
2660
|
"name": "sqrt_one_test",
|
|
2739
|
-
"start":
|
|
2661
|
+
"start": 8683
|
|
2740
2662
|
},
|
|
2741
2663
|
{
|
|
2742
2664
|
"name": "field_from_bytes_empty_test",
|
|
2743
|
-
"start":
|
|
2665
|
+
"start": 8852
|
|
2744
2666
|
},
|
|
2745
2667
|
{
|
|
2746
2668
|
"name": "field_from_bytes_little_endian_test",
|
|
2747
|
-
"start":
|
|
2669
|
+
"start": 9105
|
|
2748
2670
|
},
|
|
2749
2671
|
{
|
|
2750
2672
|
"name": "pow_test",
|
|
2751
|
-
"start":
|
|
2673
|
+
"start": 9490
|
|
2752
2674
|
},
|
|
2753
2675
|
{
|
|
2754
2676
|
"name": "min_test",
|
|
2755
|
-
"start":
|
|
2756
|
-
},
|
|
2757
|
-
{
|
|
2758
|
-
"name": "full_field_comparison_test",
|
|
2759
|
-
"start": 10201
|
|
2677
|
+
"start": 9713
|
|
2760
2678
|
},
|
|
2761
2679
|
{
|
|
2762
2680
|
"name": "sqrt_has_two_roots_test",
|
|
2763
|
-
"start":
|
|
2681
|
+
"start": 9887
|
|
2764
2682
|
},
|
|
2765
2683
|
{
|
|
2766
2684
|
"name": "sqrt_negative_one_test",
|
|
2767
|
-
"start":
|
|
2685
|
+
"start": 10560
|
|
2768
2686
|
},
|
|
2769
2687
|
{
|
|
2770
2688
|
"name": "validate_sqrt_hint_valid_test",
|
|
2771
|
-
"start":
|
|
2689
|
+
"start": 10766
|
|
2772
2690
|
},
|
|
2773
2691
|
{
|
|
2774
2692
|
"name": "validate_sqrt_hint_invalid_test",
|
|
2775
|
-
"start":
|
|
2693
|
+
"start": 11197
|
|
2776
2694
|
},
|
|
2777
2695
|
{
|
|
2778
2696
|
"name": "validate_not_sqrt_hint_valid_test",
|
|
2779
|
-
"start":
|
|
2697
|
+
"start": 11329
|
|
2780
2698
|
},
|
|
2781
2699
|
{
|
|
2782
2700
|
"name": "validate_not_sqrt_hint_zero_test",
|
|
2783
|
-
"start":
|
|
2701
|
+
"start": 11609
|
|
2784
2702
|
},
|
|
2785
2703
|
{
|
|
2786
2704
|
"name": "validate_not_sqrt_hint_wrong_hint_test",
|
|
2787
|
-
"start":
|
|
2705
|
+
"start": 11826
|
|
2788
2706
|
}
|
|
2789
2707
|
],
|
|
2790
2708
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/noir-protocol-circuits/crates/types/src/utils/field.nr",
|
|
2791
|
-
"source": "pub fn field_from_bytes<let N: u32>(bytes: [u8; N], big_endian: bool) -> Field {\n assert(bytes.len() < 32, \"field_from_bytes: N must be less than 32\");\n let mut as_field = 0;\n let mut offset = 1;\n for i in 0..N {\n let mut index = i;\n if big_endian {\n index = N - i - 1;\n }\n as_field += (bytes[index] as Field) * offset;\n offset *= 256;\n }\n\n as_field\n}\n\n// Convert a 32 byte array to a field element by truncating the final byte\npub fn field_from_bytes_32_trunc(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..15 {\n // covers bytes 16..30 (31 is truncated and ignored)\n low = low + (bytes32[15 + 15 - i] as Field) * v;\n v = v * 256;\n // covers bytes 0..14\n high = high + (bytes32[14 - i] as Field) * v;\n }\n // covers byte 15\n low = low + (bytes32[15] as Field) * v;\n\n low + high * v\n}\n\n// TODO to radix returns u8, so we cannot use bigger radixes. It'd be ideal to use a radix of the maximum range-constrained integer noir supports\npub fn full_field_less_than(lhs: Field, rhs: Field) -> bool {\n lhs.lt(rhs)\n}\n\npub fn full_field_greater_than(lhs: Field, rhs: Field) -> bool {\n rhs.lt(lhs)\n}\n\npub fn min(f1: Field, f2: Field) -> Field {\n if f1.lt(f2) {\n f1\n } else {\n f2\n }\n}\n\n// TODO: write doc-comments and tests for these magic constants.\n\nglobal KNOWN_NON_RESIDUE: Field = 5; // This is a non-residue in Noir's native Field.\nglobal C1: u32 = 28;\nglobal C3: Field = 40770029410420498293352137776570907027550720424234931066070132305055;\nglobal C5: Field = 19103219067921713944291392827692070036145651957329286315305642004821462161904;\n\n// @dev: only use this for _huge_ exponents y, when writing a constrained function.\n// If you're only exponentiating by a small value, first consider writing-out the multiplications by hand.\n// Only after you've measured the gates of that approach, consider using the native Field::pow_32 function.\n// Only if your exponent is larger than 32 bits, resort to using this function.\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/// Returns Option::some(sqrt) if there is a square root, and Option::none() if there isn't.\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\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.\nunconstrained 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\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]\nunconstrained fn bytes_field_test() {\n // Tests correctness of field_from_bytes_32_trunc against existing methods\n // Bytes representing 0x543e0a6642ffeb8039296861765a53407bba62bd1c97ca43374de950bbe0a7\n let inputs = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167,\n ];\n let field = field_from_bytes(inputs, true);\n let return_bytes: [u8; 31] = field.to_be_bytes();\n assert_eq(inputs, return_bytes);\n // 32 bytes - we remove the final byte, and check it matches the field\n let inputs2 = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167, 158,\n ];\n let field2 = field_from_bytes_32_trunc(inputs2);\n let return_bytes2: [u8; 31] = field2.to_be_bytes();\n\n assert_eq(return_bytes2, return_bytes);\n assert_eq(field2, field);\n}\n\n#[test]\nunconstrained fn max_field_test() {\n // Tests the hardcoded value in constants.nr vs underlying modulus\n // NB: We can't use 0-1 in constants.nr as it will be transpiled incorrectly to ts and sol constants files\n let max_value = crate::constants::MAX_FIELD_VALUE;\n assert_eq(max_value, 0 - 1);\n // modulus == 0 is tested elsewhere, so below is more of a sanity check\n let max_bytes: [u8; 32] = max_value.to_be_bytes();\n let mod_bytes = std::field::modulus_be_bytes();\n for i in 0..31 {\n assert_eq(max_bytes[i], mod_bytes[i]);\n }\n assert_eq(max_bytes[31], mod_bytes[31] - 1);\n}\n\n#[test]\nunconstrained fn sqrt_valid_test() {\n let x = 16; // examples: 16, 9, 25, 81\n let result = sqrt(x);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), x);\n}\n\n#[test]\nunconstrained fn sqrt_invalid_test() {\n let x = KNOWN_NON_RESIDUE; // has no square root in the field\n let result = sqrt(x);\n assert(result.is_none());\n}\n\n#[test]\nunconstrained fn sqrt_zero_test() {\n let result = sqrt(0);\n assert(result.is_some());\n assert_eq(result.unwrap(), 0);\n}\n\n#[test]\nunconstrained fn sqrt_one_test() {\n let result = sqrt(1);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), 1);\n}\n\n#[test]\nunconstrained fn field_from_bytes_empty_test() {\n let empty: [u8; 0] = [];\n let result = field_from_bytes(empty, true);\n assert_eq(result, 0);\n\n let result_le = field_from_bytes(empty, false);\n assert_eq(result_le, 0);\n}\n\n#[test]\nunconstrained fn field_from_bytes_little_endian_test() {\n // Test little-endian conversion: [0x01, 0x02] should be 0x0201 = 513\n let bytes = [0x01, 0x02];\n let result_le = field_from_bytes(bytes, false);\n assert_eq(result_le, 0x0201);\n\n // Compare with big-endian: [0x01, 0x02] should be 0x0102 = 258\n let result_be = field_from_bytes(bytes, true);\n assert_eq(result_be, 0x0102);\n}\n\n#[test]\nunconstrained fn pow_test() {\n assert_eq(pow(2, 0), 1);\n assert_eq(pow(2, 1), 2);\n assert_eq(pow(2, 10), 1024);\n assert_eq(pow(3, 5), 243);\n assert_eq(pow(0, 5), 0);\n assert_eq(pow(1, 100), 1);\n}\n\n#[test]\nunconstrained fn min_test() {\n assert_eq(min(5, 10), 5);\n assert_eq(min(10, 5), 5);\n assert_eq(min(7, 7), 7);\n assert_eq(min(0, 1), 0);\n}\n\n#[test]\nunconstrained fn full_field_comparison_test() {\n assert(full_field_less_than(5, 10));\n assert(!full_field_less_than(10, 5));\n assert(!full_field_less_than(5, 5));\n\n assert(full_field_greater_than(10, 5));\n assert(!full_field_greater_than(5, 10));\n assert(!full_field_greater_than(5, 5));\n}\n\n#[test]\nunconstrained fn sqrt_has_two_roots_test() {\n // Every square has two roots: r and -r (i.e., p - r)\n // sqrt(16) can return 4 or -4\n let x = 16;\n let result = sqrt(x).unwrap();\n assert(result * result == x);\n // The other root is -result\n let other_root = 0 - result;\n assert(other_root * other_root == x);\n // Verify they are different (unless x = 0)\n assert(result != other_root);\n\n // Same for 9: roots are 3 and -3\n let y = 9;\n let result_y = sqrt(y).unwrap();\n assert(result_y * result_y == y);\n let other_root_y = 0 - result_y;\n assert(other_root_y * other_root_y == y);\n assert(result_y != other_root_y);\n}\n\n#[test]\nunconstrained fn sqrt_negative_one_test() {\n let x = 0 - 1;\n let result = sqrt(x);\n assert(result.unwrap() == 0x30644e72e131a029048b6e193fd841045cea24f6fd736bec231204708f703636);\n}\n\n#[test]\nunconstrained fn validate_sqrt_hint_valid_test() {\n // 4 is a valid sqrt of 16\n validate_sqrt_hint(16, 4);\n // -4 is also a valid sqrt of 16\n validate_sqrt_hint(16, 0 - 4);\n // 0 is a valid sqrt of 0\n validate_sqrt_hint(0, 0);\n // 1 is a valid sqrt of 1\n validate_sqrt_hint(1, 1);\n // -1 is also a valid sqrt of 1\n validate_sqrt_hint(1, 0 - 1);\n}\n\n#[test(should_fail_with = \"is not the sqrt of x\")]\nunconstrained fn validate_sqrt_hint_invalid_test() {\n // 5 is not a valid sqrt of 16\n validate_sqrt_hint(16, 5);\n}\n\n#[test]\nunconstrained fn validate_not_sqrt_hint_valid_test() {\n // 5 (KNOWN_NON_RESIDUE) is not a square.\n let x = KNOWN_NON_RESIDUE;\n let hint = tonelli_shanks_sqrt(x * KNOWN_NON_RESIDUE);\n validate_not_sqrt_hint(x, hint);\n}\n\n#[test(should_fail_with = \"0 has a square root\")]\nunconstrained fn validate_not_sqrt_hint_zero_test() {\n // 0 has a square root, so we cannot claim it is not square\n validate_not_sqrt_hint(0, 0);\n}\n\n#[test(should_fail_with = \"does not demonstrate that\")]\nunconstrained fn validate_not_sqrt_hint_wrong_hint_test() {\n // Provide a wrong hint for a non-square\n let x = KNOWN_NON_RESIDUE;\n validate_not_sqrt_hint(x, 123);\n}\n"
|
|
2709
|
+
"source": "pub fn field_from_bytes<let N: u32>(bytes: [u8; N], big_endian: bool) -> Field {\n assert(bytes.len() < 32, \"field_from_bytes: N must be less than 32\");\n let mut as_field = 0;\n let mut offset = 1;\n for i in 0..N {\n let mut index = i;\n if big_endian {\n index = N - i - 1;\n }\n as_field += (bytes[index] as Field) * offset;\n offset *= 256;\n }\n\n as_field\n}\n\n// Convert a 32 byte array to a field element by truncating the final byte\npub fn field_from_bytes_32_trunc(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..15 {\n // covers bytes 16..30 (31 is truncated and ignored)\n low = low + (bytes32[15 + 15 - i] as Field) * v;\n v = v * 256;\n // covers bytes 0..14\n high = high + (bytes32[14 - i] as Field) * v;\n }\n // covers byte 15\n low = low + (bytes32[15] as Field) * v;\n\n low + high * v\n}\n\npub fn min(f1: Field, f2: Field) -> Field {\n if f1.lt(f2) {\n f1\n } else {\n f2\n }\n}\n\n// TODO: write doc-comments and tests for these magic constants.\n\nglobal KNOWN_NON_RESIDUE: Field = 5; // This is a non-residue in Noir's native Field.\nglobal C1: u32 = 28;\nglobal C3: Field = 40770029410420498293352137776570907027550720424234931066070132305055;\nglobal C5: Field = 19103219067921713944291392827692070036145651957329286315305642004821462161904;\n\n// @dev: only use this for _huge_ exponents y, when writing a constrained function.\n// If you're only exponentiating by a small value, first consider writing-out the multiplications by hand.\n// Only after you've measured the gates of that approach, consider using the native Field::pow_32 function.\n// Only if your exponent is larger than 32 bits, resort to using this function.\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/// Returns Option::some(sqrt) if there is a square root, and Option::none() if there isn't.\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\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.\nunconstrained 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\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]\nunconstrained fn bytes_field_test() {\n // Tests correctness of field_from_bytes_32_trunc against existing methods\n // Bytes representing 0x543e0a6642ffeb8039296861765a53407bba62bd1c97ca43374de950bbe0a7\n let inputs = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167,\n ];\n let field = field_from_bytes(inputs, true);\n let return_bytes: [u8; 31] = field.to_be_bytes();\n assert_eq(inputs, return_bytes);\n // 32 bytes - we remove the final byte, and check it matches the field\n let inputs2 = [\n 84, 62, 10, 102, 66, 255, 235, 128, 57, 41, 104, 97, 118, 90, 83, 64, 123, 186, 98, 189, 28,\n 151, 202, 67, 55, 77, 233, 80, 187, 224, 167, 158,\n ];\n let field2 = field_from_bytes_32_trunc(inputs2);\n let return_bytes2: [u8; 31] = field2.to_be_bytes();\n\n assert_eq(return_bytes2, return_bytes);\n assert_eq(field2, field);\n}\n\n#[test]\nunconstrained fn max_field_test() {\n // Tests the hardcoded value in constants.nr vs underlying modulus\n // NB: We can't use 0-1 in constants.nr as it will be transpiled incorrectly to ts and sol constants files\n let max_value = crate::constants::MAX_FIELD_VALUE;\n assert_eq(max_value, 0 - 1);\n // modulus == 0 is tested elsewhere, so below is more of a sanity check\n let max_bytes: [u8; 32] = max_value.to_be_bytes();\n let mod_bytes = std::field::modulus_be_bytes();\n for i in 0..31 {\n assert_eq(max_bytes[i], mod_bytes[i]);\n }\n assert_eq(max_bytes[31], mod_bytes[31] - 1);\n}\n\n#[test]\nunconstrained fn sqrt_valid_test() {\n let x = 16; // examples: 16, 9, 25, 81\n let result = sqrt(x);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), x);\n}\n\n#[test]\nunconstrained fn sqrt_invalid_test() {\n let x = KNOWN_NON_RESIDUE; // has no square root in the field\n let result = sqrt(x);\n assert(result.is_none());\n}\n\n#[test]\nunconstrained fn sqrt_zero_test() {\n let result = sqrt(0);\n assert(result.is_some());\n assert_eq(result.unwrap(), 0);\n}\n\n#[test]\nunconstrained fn sqrt_one_test() {\n let result = sqrt(1);\n assert(result.is_some());\n assert_eq(result.unwrap() * result.unwrap(), 1);\n}\n\n#[test]\nunconstrained fn field_from_bytes_empty_test() {\n let empty: [u8; 0] = [];\n let result = field_from_bytes(empty, true);\n assert_eq(result, 0);\n\n let result_le = field_from_bytes(empty, false);\n assert_eq(result_le, 0);\n}\n\n#[test]\nunconstrained fn field_from_bytes_little_endian_test() {\n // Test little-endian conversion: [0x01, 0x02] should be 0x0201 = 513\n let bytes = [0x01, 0x02];\n let result_le = field_from_bytes(bytes, false);\n assert_eq(result_le, 0x0201);\n\n // Compare with big-endian: [0x01, 0x02] should be 0x0102 = 258\n let result_be = field_from_bytes(bytes, true);\n assert_eq(result_be, 0x0102);\n}\n\n#[test]\nunconstrained fn pow_test() {\n assert_eq(pow(2, 0), 1);\n assert_eq(pow(2, 1), 2);\n assert_eq(pow(2, 10), 1024);\n assert_eq(pow(3, 5), 243);\n assert_eq(pow(0, 5), 0);\n assert_eq(pow(1, 100), 1);\n}\n\n#[test]\nunconstrained fn min_test() {\n assert_eq(min(5, 10), 5);\n assert_eq(min(10, 5), 5);\n assert_eq(min(7, 7), 7);\n assert_eq(min(0, 1), 0);\n}\n\n#[test]\nunconstrained fn sqrt_has_two_roots_test() {\n // Every square has two roots: r and -r (i.e., p - r)\n // sqrt(16) can return 4 or -4\n let x = 16;\n let result = sqrt(x).unwrap();\n assert(result * result == x);\n // The other root is -result\n let other_root = 0 - result;\n assert(other_root * other_root == x);\n // Verify they are different (unless x = 0)\n assert(result != other_root);\n\n // Same for 9: roots are 3 and -3\n let y = 9;\n let result_y = sqrt(y).unwrap();\n assert(result_y * result_y == y);\n let other_root_y = 0 - result_y;\n assert(other_root_y * other_root_y == y);\n assert(result_y != other_root_y);\n}\n\n#[test]\nunconstrained fn sqrt_negative_one_test() {\n let x = 0 - 1;\n let result = sqrt(x);\n assert(result.unwrap() == 0x30644e72e131a029048b6e193fd841045cea24f6fd736bec231204708f703636);\n}\n\n#[test]\nunconstrained fn validate_sqrt_hint_valid_test() {\n // 4 is a valid sqrt of 16\n validate_sqrt_hint(16, 4);\n // -4 is also a valid sqrt of 16\n validate_sqrt_hint(16, 0 - 4);\n // 0 is a valid sqrt of 0\n validate_sqrt_hint(0, 0);\n // 1 is a valid sqrt of 1\n validate_sqrt_hint(1, 1);\n // -1 is also a valid sqrt of 1\n validate_sqrt_hint(1, 0 - 1);\n}\n\n#[test(should_fail_with = \"is not the sqrt of x\")]\nunconstrained fn validate_sqrt_hint_invalid_test() {\n // 5 is not a valid sqrt of 16\n validate_sqrt_hint(16, 5);\n}\n\n#[test]\nunconstrained fn validate_not_sqrt_hint_valid_test() {\n // 5 (KNOWN_NON_RESIDUE) is not a square.\n let x = KNOWN_NON_RESIDUE;\n let hint = tonelli_shanks_sqrt(x * KNOWN_NON_RESIDUE);\n validate_not_sqrt_hint(x, hint);\n}\n\n#[test(should_fail_with = \"0 has a square root\")]\nunconstrained fn validate_not_sqrt_hint_zero_test() {\n // 0 has a square root, so we cannot claim it is not square\n validate_not_sqrt_hint(0, 0);\n}\n\n#[test(should_fail_with = \"does not demonstrate that\")]\nunconstrained fn validate_not_sqrt_hint_wrong_hint_test() {\n // Provide a wrong hint for a non-square\n let x = KNOWN_NON_RESIDUE;\n validate_not_sqrt_hint(x, 123);\n}\n"
|
|
2792
2710
|
},
|
|
2793
2711
|
"41": {
|
|
2794
2712
|
"function_locations": [
|
|
@@ -2802,91 +2720,91 @@
|
|
|
2802
2720
|
},
|
|
2803
2721
|
{
|
|
2804
2722
|
"name": "Option<T>::is_none",
|
|
2805
|
-
"start":
|
|
2723
|
+
"start": 672
|
|
2806
2724
|
},
|
|
2807
2725
|
{
|
|
2808
2726
|
"name": "Option<T>::is_some",
|
|
2809
|
-
"start":
|
|
2727
|
+
"start": 774
|
|
2810
2728
|
},
|
|
2811
2729
|
{
|
|
2812
2730
|
"name": "Option<T>::unwrap",
|
|
2813
|
-
"start":
|
|
2731
|
+
"start": 898
|
|
2814
2732
|
},
|
|
2815
2733
|
{
|
|
2816
2734
|
"name": "Option<T>::unwrap_unchecked",
|
|
2817
|
-
"start":
|
|
2735
|
+
"start": 1196
|
|
2818
2736
|
},
|
|
2819
2737
|
{
|
|
2820
2738
|
"name": "Option<T>::unwrap_or",
|
|
2821
|
-
"start":
|
|
2739
|
+
"start": 1368
|
|
2822
2740
|
},
|
|
2823
2741
|
{
|
|
2824
2742
|
"name": "Option<T>::unwrap_or_else",
|
|
2825
|
-
"start":
|
|
2743
|
+
"start": 1668
|
|
2826
2744
|
},
|
|
2827
2745
|
{
|
|
2828
2746
|
"name": "Option<T>::expect",
|
|
2829
|
-
"start":
|
|
2747
|
+
"start": 1969
|
|
2830
2748
|
},
|
|
2831
2749
|
{
|
|
2832
2750
|
"name": "Option<T>::map",
|
|
2833
|
-
"start":
|
|
2751
|
+
"start": 2190
|
|
2834
2752
|
},
|
|
2835
2753
|
{
|
|
2836
2754
|
"name": "Option<T>::map_or",
|
|
2837
|
-
"start":
|
|
2755
|
+
"start": 2490
|
|
2838
2756
|
},
|
|
2839
2757
|
{
|
|
2840
2758
|
"name": "Option<T>::map_or_else",
|
|
2841
|
-
"start":
|
|
2759
|
+
"start": 2784
|
|
2842
2760
|
},
|
|
2843
2761
|
{
|
|
2844
2762
|
"name": "Option<T>::and",
|
|
2845
|
-
"start":
|
|
2763
|
+
"start": 3009
|
|
2846
2764
|
},
|
|
2847
2765
|
{
|
|
2848
2766
|
"name": "Option<T>::and_then",
|
|
2849
|
-
"start":
|
|
2767
|
+
"start": 3446
|
|
2850
2768
|
},
|
|
2851
2769
|
{
|
|
2852
2770
|
"name": "Option<T>::or",
|
|
2853
|
-
"start":
|
|
2771
|
+
"start": 3669
|
|
2854
2772
|
},
|
|
2855
2773
|
{
|
|
2856
2774
|
"name": "Option<T>::or_else",
|
|
2857
|
-
"start":
|
|
2775
|
+
"start": 3902
|
|
2858
2776
|
},
|
|
2859
2777
|
{
|
|
2860
2778
|
"name": "Option<T>::xor",
|
|
2861
|
-
"start":
|
|
2779
|
+
"start": 4192
|
|
2862
2780
|
},
|
|
2863
2781
|
{
|
|
2864
2782
|
"name": "Option<T>::filter",
|
|
2865
|
-
"start":
|
|
2783
|
+
"start": 4636
|
|
2866
2784
|
},
|
|
2867
2785
|
{
|
|
2868
2786
|
"name": "Option<T>::flatten",
|
|
2869
|
-
"start":
|
|
2787
|
+
"start": 5065
|
|
2870
2788
|
},
|
|
2871
2789
|
{
|
|
2872
2790
|
"name": "<impl Default for Option<T>>::default",
|
|
2873
|
-
"start":
|
|
2791
|
+
"start": 5242
|
|
2874
2792
|
},
|
|
2875
2793
|
{
|
|
2876
2794
|
"name": "<impl Eq for Option<T>>::eq",
|
|
2877
|
-
"start":
|
|
2795
|
+
"start": 5357
|
|
2878
2796
|
},
|
|
2879
2797
|
{
|
|
2880
2798
|
"name": "<impl Hash for Option<T>>::hash",
|
|
2881
|
-
"start":
|
|
2799
|
+
"start": 5706
|
|
2882
2800
|
},
|
|
2883
2801
|
{
|
|
2884
2802
|
"name": "<impl Ord for Option<T>>::cmp",
|
|
2885
|
-
"start":
|
|
2803
|
+
"start": 5975
|
|
2886
2804
|
}
|
|
2887
2805
|
],
|
|
2888
2806
|
"path": "std/option.nr",
|
|
2889
|
-
"source": "use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\n/// Represents a value of type T or its absence.\n/// Use `Option::some(value)` to construct a value or `Option::none()` to record the absence of one.\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"
|
|
2807
|
+
"source": "use crate::cmp::{Eq, Ord, Ordering};\nuse crate::default::Default;\nuse crate::hash::{Hash, Hasher};\n\n/// Represents a value of type T or its absence.\n/// Use `Option::some(value)` to construct a value or `Option::none()` to record the absence of one.\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"
|
|
2890
2808
|
},
|
|
2891
2809
|
"411": {
|
|
2892
2810
|
"function_locations": [
|
|
@@ -3372,355 +3290,379 @@
|
|
|
3372
3290
|
},
|
|
3373
3291
|
{
|
|
3374
3292
|
"name": "BoundedVec<T, MaxLen>::get",
|
|
3375
|
-
"start":
|
|
3293
|
+
"start": 3202
|
|
3376
3294
|
},
|
|
3377
3295
|
{
|
|
3378
3296
|
"name": "BoundedVec<T, MaxLen>::get_unchecked",
|
|
3379
|
-
"start":
|
|
3297
|
+
"start": 4110
|
|
3380
3298
|
},
|
|
3381
3299
|
{
|
|
3382
3300
|
"name": "BoundedVec<T, MaxLen>::set",
|
|
3383
|
-
"start":
|
|
3301
|
+
"start": 4693
|
|
3384
3302
|
},
|
|
3385
3303
|
{
|
|
3386
3304
|
"name": "BoundedVec<T, MaxLen>::set_unchecked",
|
|
3387
|
-
"start":
|
|
3305
|
+
"start": 6221
|
|
3388
3306
|
},
|
|
3389
3307
|
{
|
|
3390
3308
|
"name": "BoundedVec<T, MaxLen>::push",
|
|
3391
|
-
"start":
|
|
3309
|
+
"start": 6759
|
|
3392
3310
|
},
|
|
3393
3311
|
{
|
|
3394
3312
|
"name": "BoundedVec<T, MaxLen>::len",
|
|
3395
|
-
"start":
|
|
3313
|
+
"start": 7367
|
|
3396
3314
|
},
|
|
3397
3315
|
{
|
|
3398
3316
|
"name": "BoundedVec<T, MaxLen>::max_len",
|
|
3399
|
-
"start":
|
|
3317
|
+
"start": 7808
|
|
3400
3318
|
},
|
|
3401
3319
|
{
|
|
3402
3320
|
"name": "BoundedVec<T, MaxLen>::storage",
|
|
3403
|
-
"start":
|
|
3321
|
+
"start": 8407
|
|
3404
3322
|
},
|
|
3405
3323
|
{
|
|
3406
3324
|
"name": "BoundedVec<T, MaxLen>::extend_from_array",
|
|
3407
|
-
"start":
|
|
3325
|
+
"start": 8963
|
|
3408
3326
|
},
|
|
3409
3327
|
{
|
|
3410
3328
|
"name": "BoundedVec<T, MaxLen>::extend_from_vector",
|
|
3411
|
-
"start":
|
|
3329
|
+
"start": 9734
|
|
3412
3330
|
},
|
|
3413
3331
|
{
|
|
3414
3332
|
"name": "BoundedVec<T, MaxLen>::extend_from_bounded_vec",
|
|
3415
|
-
"start":
|
|
3333
|
+
"start": 10679
|
|
3416
3334
|
},
|
|
3417
3335
|
{
|
|
3418
3336
|
"name": "BoundedVec<T, MaxLen>::from_array",
|
|
3419
|
-
"start":
|
|
3337
|
+
"start": 13074
|
|
3420
3338
|
},
|
|
3421
3339
|
{
|
|
3422
3340
|
"name": "BoundedVec<T, MaxLen>::pop",
|
|
3423
|
-
"start":
|
|
3341
|
+
"start": 13817
|
|
3424
3342
|
},
|
|
3425
3343
|
{
|
|
3426
3344
|
"name": "BoundedVec<T, MaxLen>::any",
|
|
3427
|
-
"start":
|
|
3345
|
+
"start": 14440
|
|
3428
3346
|
},
|
|
3429
3347
|
{
|
|
3430
3348
|
"name": "BoundedVec<T, MaxLen>::map",
|
|
3431
|
-
"start":
|
|
3349
|
+
"start": 15356
|
|
3432
3350
|
},
|
|
3433
3351
|
{
|
|
3434
3352
|
"name": "BoundedVec<T, MaxLen>::mapi",
|
|
3435
|
-
"start":
|
|
3353
|
+
"start": 16356
|
|
3436
3354
|
},
|
|
3437
3355
|
{
|
|
3438
3356
|
"name": "BoundedVec<T, MaxLen>::for_each",
|
|
3439
|
-
"start":
|
|
3357
|
+
"start": 17314
|
|
3440
3358
|
},
|
|
3441
3359
|
{
|
|
3442
3360
|
"name": "BoundedVec<T, MaxLen>::for_eachi",
|
|
3443
|
-
"start":
|
|
3361
|
+
"start": 18119
|
|
3444
3362
|
},
|
|
3445
3363
|
{
|
|
3446
3364
|
"name": "BoundedVec<T, MaxLen>::from_parts",
|
|
3447
|
-
"start":
|
|
3365
|
+
"start": 19118
|
|
3448
3366
|
},
|
|
3449
3367
|
{
|
|
3450
3368
|
"name": "BoundedVec<T, MaxLen>::from_parts_unchecked",
|
|
3451
|
-
"start":
|
|
3369
|
+
"start": 20767
|
|
3452
3370
|
},
|
|
3453
3371
|
{
|
|
3454
3372
|
"name": "<impl Eq for BoundedVec<T, MaxLen>>::eq",
|
|
3455
|
-
"start":
|
|
3373
|
+
"start": 20979
|
|
3456
3374
|
},
|
|
3457
3375
|
{
|
|
3458
3376
|
"name": "<impl From<[T; Len]> for BoundedVec<T, MaxLen>>::from",
|
|
3459
|
-
"start":
|
|
3377
|
+
"start": 21550
|
|
3460
3378
|
},
|
|
3461
3379
|
{
|
|
3462
3380
|
"name": "bounded_vec_tests::get::panics_when_reading_elements_past_end_of_vec",
|
|
3463
|
-
"start":
|
|
3381
|
+
"start": 21833
|
|
3464
3382
|
},
|
|
3465
3383
|
{
|
|
3466
3384
|
"name": "bounded_vec_tests::get::panics_when_reading_beyond_length",
|
|
3467
|
-
"start":
|
|
3385
|
+
"start": 22068
|
|
3468
3386
|
},
|
|
3469
3387
|
{
|
|
3470
3388
|
"name": "bounded_vec_tests::get::get_works_within_bounds",
|
|
3471
|
-
"start":
|
|
3389
|
+
"start": 22243
|
|
3472
3390
|
},
|
|
3473
3391
|
{
|
|
3474
3392
|
"name": "bounded_vec_tests::get::get_unchecked_works",
|
|
3475
|
-
"start":
|
|
3393
|
+
"start": 22502
|
|
3476
3394
|
},
|
|
3477
3395
|
{
|
|
3478
3396
|
"name": "bounded_vec_tests::get::get_unchecked_works_past_len",
|
|
3479
|
-
"start":
|
|
3397
|
+
"start": 22746
|
|
3480
3398
|
},
|
|
3481
3399
|
{
|
|
3482
3400
|
"name": "bounded_vec_tests::set::set_updates_values_properly",
|
|
3483
|
-
"start":
|
|
3401
|
+
"start": 23019
|
|
3484
3402
|
},
|
|
3485
3403
|
{
|
|
3486
3404
|
"name": "bounded_vec_tests::set::panics_when_writing_elements_past_end_of_vec",
|
|
3487
|
-
"start":
|
|
3405
|
+
"start": 23657
|
|
3488
3406
|
},
|
|
3489
3407
|
{
|
|
3490
3408
|
"name": "bounded_vec_tests::set::panics_when_setting_beyond_length",
|
|
3491
|
-
"start":
|
|
3409
|
+
"start": 23892
|
|
3492
3410
|
},
|
|
3493
3411
|
{
|
|
3494
3412
|
"name": "bounded_vec_tests::set::set_unchecked_operations",
|
|
3495
|
-
"start":
|
|
3413
|
+
"start": 24067
|
|
3496
3414
|
},
|
|
3497
3415
|
{
|
|
3498
3416
|
"name": "bounded_vec_tests::set::set_unchecked_operations_past_len",
|
|
3499
|
-
"start":
|
|
3417
|
+
"start": 24399
|
|
3500
3418
|
},
|
|
3501
3419
|
{
|
|
3502
3420
|
"name": "bounded_vec_tests::set::set_preserves_other_elements",
|
|
3503
|
-
"start":
|
|
3421
|
+
"start": 24663
|
|
3504
3422
|
},
|
|
3505
3423
|
{
|
|
3506
3424
|
"name": "bounded_vec_tests::any::returns_false_if_predicate_not_satisfied",
|
|
3507
|
-
"start":
|
|
3425
|
+
"start": 25131
|
|
3508
3426
|
},
|
|
3509
3427
|
{
|
|
3510
3428
|
"name": "bounded_vec_tests::any::returns_true_if_predicate_satisfied",
|
|
3511
|
-
"start":
|
|
3429
|
+
"start": 25385
|
|
3512
3430
|
},
|
|
3513
3431
|
{
|
|
3514
3432
|
"name": "bounded_vec_tests::any::returns_false_on_empty_boundedvec",
|
|
3515
|
-
"start":
|
|
3433
|
+
"start": 25634
|
|
3516
3434
|
},
|
|
3517
3435
|
{
|
|
3518
3436
|
"name": "bounded_vec_tests::any::any_with_complex_predicates",
|
|
3519
|
-
"start":
|
|
3437
|
+
"start": 25845
|
|
3520
3438
|
},
|
|
3521
3439
|
{
|
|
3522
3440
|
"name": "bounded_vec_tests::any::any_with_partial_vector",
|
|
3523
|
-
"start":
|
|
3441
|
+
"start": 26208
|
|
3524
3442
|
},
|
|
3525
3443
|
{
|
|
3526
3444
|
"name": "bounded_vec_tests::map::applies_function_correctly",
|
|
3527
|
-
"start":
|
|
3445
|
+
"start": 26595
|
|
3528
3446
|
},
|
|
3529
3447
|
{
|
|
3530
3448
|
"name": "bounded_vec_tests::map::applies_function_that_changes_return_type",
|
|
3531
|
-
"start":
|
|
3449
|
+
"start": 27017
|
|
3532
3450
|
},
|
|
3533
3451
|
{
|
|
3534
3452
|
"name": "bounded_vec_tests::map::does_not_apply_function_past_len",
|
|
3535
|
-
"start":
|
|
3453
|
+
"start": 27365
|
|
3536
3454
|
},
|
|
3537
3455
|
{
|
|
3538
3456
|
"name": "bounded_vec_tests::map::map_with_conditional_logic",
|
|
3539
|
-
"start":
|
|
3457
|
+
"start": 27738
|
|
3540
3458
|
},
|
|
3541
3459
|
{
|
|
3542
3460
|
"name": "bounded_vec_tests::map::map_preserves_length",
|
|
3543
|
-
"start":
|
|
3461
|
+
"start": 28062
|
|
3544
3462
|
},
|
|
3545
3463
|
{
|
|
3546
3464
|
"name": "bounded_vec_tests::map::map_on_empty_vector",
|
|
3547
|
-
"start":
|
|
3465
|
+
"start": 28354
|
|
3548
3466
|
},
|
|
3549
3467
|
{
|
|
3550
3468
|
"name": "bounded_vec_tests::mapi::applies_function_correctly",
|
|
3551
|
-
"start":
|
|
3469
|
+
"start": 28728
|
|
3552
3470
|
},
|
|
3553
3471
|
{
|
|
3554
3472
|
"name": "bounded_vec_tests::mapi::applies_function_that_changes_return_type",
|
|
3555
|
-
"start":
|
|
3473
|
+
"start": 29161
|
|
3556
3474
|
},
|
|
3557
3475
|
{
|
|
3558
3476
|
"name": "bounded_vec_tests::mapi::does_not_apply_function_past_len",
|
|
3559
|
-
"start":
|
|
3477
|
+
"start": 29518
|
|
3560
3478
|
},
|
|
3561
3479
|
{
|
|
3562
3480
|
"name": "bounded_vec_tests::mapi::mapi_with_index_branching_logic",
|
|
3563
|
-
"start":
|
|
3481
|
+
"start": 29900
|
|
3564
3482
|
},
|
|
3565
3483
|
{
|
|
3566
3484
|
"name": "bounded_vec_tests::for_each::for_each_map",
|
|
3567
|
-
"start":
|
|
3485
|
+
"start": 30459
|
|
3568
3486
|
},
|
|
3569
3487
|
{
|
|
3570
3488
|
"name": "bounded_vec_tests::for_each::smoke_test",
|
|
3571
|
-
"start":
|
|
3489
|
+
"start": 30689
|
|
3572
3490
|
},
|
|
3573
3491
|
{
|
|
3574
3492
|
"name": "bounded_vec_tests::for_each::applies_function_correctly",
|
|
3575
|
-
"start":
|
|
3493
|
+
"start": 31097
|
|
3576
3494
|
},
|
|
3577
3495
|
{
|
|
3578
3496
|
"name": "bounded_vec_tests::for_each::applies_function_that_changes_return_type",
|
|
3579
|
-
"start":
|
|
3497
|
+
"start": 31431
|
|
3580
3498
|
},
|
|
3581
3499
|
{
|
|
3582
3500
|
"name": "bounded_vec_tests::for_each::does_not_apply_function_past_len",
|
|
3583
|
-
"start":
|
|
3501
|
+
"start": 31789
|
|
3584
3502
|
},
|
|
3585
3503
|
{
|
|
3586
3504
|
"name": "bounded_vec_tests::for_each::for_each_on_empty_vector",
|
|
3587
|
-
"start":
|
|
3505
|
+
"start": 32170
|
|
3588
3506
|
},
|
|
3589
3507
|
{
|
|
3590
3508
|
"name": "bounded_vec_tests::for_each::for_each_with_side_effects",
|
|
3591
|
-
"start":
|
|
3509
|
+
"start": 32456
|
|
3592
3510
|
},
|
|
3593
3511
|
{
|
|
3594
3512
|
"name": "bounded_vec_tests::for_eachi::for_eachi_mapi",
|
|
3595
|
-
"start":
|
|
3513
|
+
"start": 33013
|
|
3596
3514
|
},
|
|
3597
3515
|
{
|
|
3598
3516
|
"name": "bounded_vec_tests::for_eachi::smoke_test",
|
|
3599
|
-
"start":
|
|
3517
|
+
"start": 33250
|
|
3600
3518
|
},
|
|
3601
3519
|
{
|
|
3602
3520
|
"name": "bounded_vec_tests::for_eachi::applies_function_correctly",
|
|
3603
|
-
"start":
|
|
3521
|
+
"start": 33706
|
|
3604
3522
|
},
|
|
3605
3523
|
{
|
|
3606
3524
|
"name": "bounded_vec_tests::for_eachi::applies_function_that_changes_return_type",
|
|
3607
|
-
"start":
|
|
3525
|
+
"start": 34050
|
|
3608
3526
|
},
|
|
3609
3527
|
{
|
|
3610
3528
|
"name": "bounded_vec_tests::for_eachi::does_not_apply_function_past_len",
|
|
3611
|
-
"start":
|
|
3529
|
+
"start": 34418
|
|
3612
3530
|
},
|
|
3613
3531
|
{
|
|
3614
3532
|
"name": "bounded_vec_tests::for_eachi::for_eachi_on_empty_vector",
|
|
3615
|
-
"start":
|
|
3533
|
+
"start": 34805
|
|
3616
3534
|
},
|
|
3617
3535
|
{
|
|
3618
3536
|
"name": "bounded_vec_tests::for_eachi::for_eachi_with_index_tracking",
|
|
3619
|
-
"start":
|
|
3537
|
+
"start": 35098
|
|
3620
3538
|
},
|
|
3621
3539
|
{
|
|
3622
3540
|
"name": "bounded_vec_tests::from_array::empty",
|
|
3623
|
-
"start":
|
|
3541
|
+
"start": 35575
|
|
3624
3542
|
},
|
|
3625
3543
|
{
|
|
3626
3544
|
"name": "bounded_vec_tests::from_array::equal_len",
|
|
3627
|
-
"start":
|
|
3545
|
+
"start": 35885
|
|
3628
3546
|
},
|
|
3629
3547
|
{
|
|
3630
3548
|
"name": "bounded_vec_tests::from_array::max_len_greater_then_array_len",
|
|
3631
|
-
"start":
|
|
3549
|
+
"start": 36202
|
|
3632
3550
|
},
|
|
3633
3551
|
{
|
|
3634
3552
|
"name": "bounded_vec_tests::from_array::max_len_lower_then_array_len",
|
|
3635
|
-
"start":
|
|
3553
|
+
"start": 36673
|
|
3636
3554
|
},
|
|
3637
3555
|
{
|
|
3638
3556
|
"name": "bounded_vec_tests::from_array::from_array_preserves_order",
|
|
3639
|
-
"start":
|
|
3557
|
+
"start": 36816
|
|
3640
3558
|
},
|
|
3641
3559
|
{
|
|
3642
3560
|
"name": "bounded_vec_tests::from_array::from_array_with_different_types",
|
|
3643
|
-
"start":
|
|
3561
|
+
"start": 37105
|
|
3644
3562
|
},
|
|
3645
3563
|
{
|
|
3646
3564
|
"name": "bounded_vec_tests::trait_from::simple",
|
|
3647
|
-
"start":
|
|
3565
|
+
"start": 37542
|
|
3648
3566
|
},
|
|
3649
3567
|
{
|
|
3650
3568
|
"name": "bounded_vec_tests::trait_eq::empty_equality",
|
|
3651
|
-
"start":
|
|
3569
|
+
"start": 37980
|
|
3652
3570
|
},
|
|
3653
3571
|
{
|
|
3654
3572
|
"name": "bounded_vec_tests::trait_eq::inequality",
|
|
3655
|
-
"start":
|
|
3573
|
+
"start": 38229
|
|
3656
3574
|
},
|
|
3657
3575
|
{
|
|
3658
3576
|
"name": "bounded_vec_tests::from_parts::from_parts",
|
|
3659
|
-
"start":
|
|
3577
|
+
"start": 38638
|
|
3660
3578
|
},
|
|
3661
3579
|
{
|
|
3662
3580
|
"name": "bounded_vec_tests::from_parts::from_parts_unchecked",
|
|
3663
|
-
"start":
|
|
3581
|
+
"start": 39228
|
|
3664
3582
|
},
|
|
3665
3583
|
{
|
|
3666
3584
|
"name": "bounded_vec_tests::push_pop::push_and_pop_operations",
|
|
3667
|
-
"start":
|
|
3585
|
+
"start": 40010
|
|
3668
3586
|
},
|
|
3669
3587
|
{
|
|
3670
3588
|
"name": "bounded_vec_tests::push_pop::push_to_full_vector",
|
|
3671
|
-
"start":
|
|
3589
|
+
"start": 40636
|
|
3672
3590
|
},
|
|
3673
3591
|
{
|
|
3674
3592
|
"name": "bounded_vec_tests::push_pop::pop_from_empty_vector",
|
|
3675
|
-
"start":
|
|
3593
|
+
"start": 40910
|
|
3676
3594
|
},
|
|
3677
3595
|
{
|
|
3678
3596
|
"name": "bounded_vec_tests::push_pop::push_pop_cycle",
|
|
3679
|
-
"start":
|
|
3597
|
+
"start": 41079
|
|
3680
3598
|
},
|
|
3681
3599
|
{
|
|
3682
3600
|
"name": "bounded_vec_tests::extend::extend_from_array",
|
|
3683
|
-
"start":
|
|
3601
|
+
"start": 41725
|
|
3684
3602
|
},
|
|
3685
3603
|
{
|
|
3686
3604
|
"name": "bounded_vec_tests::extend::extend_from_vector",
|
|
3687
|
-
"start":
|
|
3605
|
+
"start": 42071
|
|
3688
3606
|
},
|
|
3689
3607
|
{
|
|
3690
3608
|
"name": "bounded_vec_tests::extend::extend_from_bounded_vec",
|
|
3691
|
-
"start":
|
|
3609
|
+
"start": 42435
|
|
3610
|
+
},
|
|
3611
|
+
{
|
|
3612
|
+
"name": "bounded_vec_tests::extend::extend_from_bounded_vec_limit",
|
|
3613
|
+
"start": 43056
|
|
3614
|
+
},
|
|
3615
|
+
{
|
|
3616
|
+
"name": "bounded_vec_tests::extend::extend_from_bounded_vec_full_and_empty",
|
|
3617
|
+
"start": 43570
|
|
3618
|
+
},
|
|
3619
|
+
{
|
|
3620
|
+
"name": "bounded_vec_tests::extend::extend_from_bounded_vec_zero_len",
|
|
3621
|
+
"start": 44074
|
|
3622
|
+
},
|
|
3623
|
+
{
|
|
3624
|
+
"name": "bounded_vec_tests::extend::extend_from_bounded_vec_last_zeroed",
|
|
3625
|
+
"start": 44368
|
|
3626
|
+
},
|
|
3627
|
+
{
|
|
3628
|
+
"name": "bounded_vec_tests::extend::extend_from_bounded_vec_empty_self",
|
|
3629
|
+
"start": 44793
|
|
3630
|
+
},
|
|
3631
|
+
{
|
|
3632
|
+
"name": "bounded_vec_tests::extend::extend_from_bounded_vec_equal_capacity",
|
|
3633
|
+
"start": 45360
|
|
3692
3634
|
},
|
|
3693
3635
|
{
|
|
3694
3636
|
"name": "bounded_vec_tests::extend::extend_array_beyond_max_len",
|
|
3695
|
-
"start":
|
|
3637
|
+
"start": 45947
|
|
3696
3638
|
},
|
|
3697
3639
|
{
|
|
3698
3640
|
"name": "bounded_vec_tests::extend::extend_vector_beyond_max_len",
|
|
3699
|
-
"start":
|
|
3641
|
+
"start": 46225
|
|
3700
3642
|
},
|
|
3701
3643
|
{
|
|
3702
3644
|
"name": "bounded_vec_tests::extend::extend_bounded_vec_beyond_max_len",
|
|
3703
|
-
"start":
|
|
3645
|
+
"start": 46528
|
|
3704
3646
|
},
|
|
3705
3647
|
{
|
|
3706
3648
|
"name": "bounded_vec_tests::extend::extend_with_empty_collections",
|
|
3707
|
-
"start":
|
|
3649
|
+
"start": 46814
|
|
3708
3650
|
},
|
|
3709
3651
|
{
|
|
3710
3652
|
"name": "bounded_vec_tests::storage::storage_consistency",
|
|
3711
|
-
"start":
|
|
3653
|
+
"start": 47414
|
|
3712
3654
|
},
|
|
3713
3655
|
{
|
|
3714
3656
|
"name": "bounded_vec_tests::storage::storage_after_pop",
|
|
3715
|
-
"start":
|
|
3657
|
+
"start": 47916
|
|
3716
3658
|
},
|
|
3717
3659
|
{
|
|
3718
3660
|
"name": "bounded_vec_tests::storage::vector_immutable",
|
|
3719
|
-
"start":
|
|
3661
|
+
"start": 48234
|
|
3720
3662
|
}
|
|
3721
3663
|
],
|
|
3722
3664
|
"path": "std/collections/bounded_vec.nr",
|
|
3723
|
-
"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 built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors 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 vectors 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 vector 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_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[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 for i in 0..Len {\n if i < append_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, \"cannot pop from an empty vector\");\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 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`][Self::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 let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 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\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\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 #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\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 #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\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 #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\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 #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\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 #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\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 bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let 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 mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec() {\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 3> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be zeroed\n assert_eq(vec.storage(), [1, 2, 0]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n"
|
|
3665
|
+
"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 built-in vector except that it\n/// is bounded with a maximum possible length. `BoundedVec` is also not\n/// subject to the same restrictions vectors are (notably, nested vectors 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 vectors 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 vector 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_vector([2, 4].as_vector());\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_vector(&mut self, vector: [T]) {\n let new_len = self.len + vector.len();\n assert(new_len <= MaxLen, \"extend_from_vector out of bounds\");\n for i in 0..vector.len() {\n self.storage[self.len + i] = vector[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 // The source vector can be longer than the destination, or vice versa;\n // regardless we will only ever be able to read or write whichever is\n // the shorter max length of the two. We asserted that the actual content fits,\n // but the capacity of the source vector could be higher.\n let max = crate::cmp::min(Len, MaxLen);\n\n // Save the last item in case we have to do a fixup on an already full array.\n let last = if MaxLen > 0 {\n self.storage[MaxLen - 1]\n } else {\n crate::mem::zeroed()\n };\n\n for src in 0..max {\n // Since we are iterating to the static capacity of the arrays,\n // the destination could be out of bounds. If that's the case,\n // overwrite the last item, which we'll fixup in the end.\n // NB using cmp::min resulted in more opcodes here.\n let mut dst = self.len + src;\n if dst >= MaxLen { dst = MaxLen - 1; };\n // Assigning the source or zeroed to avoid having to merge arrays in SSA.\n self.storage[dst] = if src < append_len {\n vec.get_unchecked(src)\n } else {\n last\n }\n }\n\n // Fixup the last item if we have to.\n if MaxLen > 0 {\n self.storage[MaxLen - 1] = if (self.len + append_len == MaxLen) & (append_len > 0) {\n vec.get_unchecked(append_len - 1)\n } else {\n last\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, \"cannot pop from an empty vector\");\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 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 ret.storage[i] = if i < self.len() {\n f(self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\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 ret.storage[i] = if i < self.len() {\n f(i, self.get_unchecked(i))\n } else {\n crate::mem::zeroed()\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`][Self::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 let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 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\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\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 #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\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 #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\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 #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\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 #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\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 #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\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 bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let 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 mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3].as_vector());\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec() {\n // The source deliberately has a higher capacity,\n // to make sure we are not trying to assign out-of-bounds.\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 9> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_limit() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_full_and_empty() {\n // Capacity and contents chosen so the last item must be assigned to.\n let mut vec1: BoundedVec<u32, 2> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 2);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n }\n\n #[test]\n fn extend_from_bounded_vec_zero_len() {\n let mut vec1: BoundedVec<u32, 0> = BoundedVec::new();\n let vec2: BoundedVec<u32, 0> = BoundedVec::new();\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_last_zeroed() {\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 4> = BoundedVec::new();\n\n vec1.push(1);\n vec1.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get_unchecked(3), 0);\n }\n\n #[test]\n fn extend_from_bounded_vec_empty_self() {\n // self.len == 0 with Len > MaxLen: the loop doesn't reach\n // the last storage slot, so the fixup must write it.\n let mut vec1: BoundedVec<u32, 3> = BoundedVec::new();\n let vec2: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec_equal_capacity() {\n // Len == MaxLen, fills to capacity.\n let mut vec1: BoundedVec<u32, 4> = BoundedVec::new();\n vec1.push(1);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_array([2, 3, 4]);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 4);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n assert_eq(vec1.get(3), 4);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_vector out of bounds\")]\n fn extend_vector_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_vector([2, 3, 4].as_vector()); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_vector([].as_vector());\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be zeroed\n assert_eq(vec.storage(), [1, 2, 0]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n"
|
|
3724
3666
|
},
|
|
3725
3667
|
"61": {
|
|
3726
3668
|
"function_locations": [
|
|
@@ -3754,57 +3696,57 @@
|
|
|
3754
3696
|
},
|
|
3755
3697
|
{
|
|
3756
3698
|
"name": "test::empty_array",
|
|
3757
|
-
"start":
|
|
3699
|
+
"start": 6789
|
|
3758
3700
|
},
|
|
3759
3701
|
{
|
|
3760
3702
|
"name": "test::empty_array_read",
|
|
3761
|
-
"start":
|
|
3703
|
+
"start": 7263
|
|
3762
3704
|
},
|
|
3763
3705
|
{
|
|
3764
3706
|
"name": "test::array_push",
|
|
3765
|
-
"start":
|
|
3707
|
+
"start": 7638
|
|
3766
3708
|
},
|
|
3767
3709
|
{
|
|
3768
3710
|
"name": "test::read_past_len",
|
|
3769
|
-
"start":
|
|
3711
|
+
"start": 8156
|
|
3770
3712
|
},
|
|
3771
3713
|
{
|
|
3772
3714
|
"name": "test::array_remove_last",
|
|
3773
|
-
"start":
|
|
3715
|
+
"start": 8559
|
|
3774
3716
|
},
|
|
3775
3717
|
{
|
|
3776
3718
|
"name": "test::array_remove_some",
|
|
3777
|
-
"start":
|
|
3719
|
+
"start": 8997
|
|
3778
3720
|
},
|
|
3779
3721
|
{
|
|
3780
3722
|
"name": "test::array_remove_all",
|
|
3781
|
-
"start":
|
|
3723
|
+
"start": 9729
|
|
3782
3724
|
},
|
|
3783
3725
|
{
|
|
3784
3726
|
"name": "test::for_each_called_with_all_elements",
|
|
3785
|
-
"start":
|
|
3727
|
+
"start": 10296
|
|
3786
3728
|
},
|
|
3787
3729
|
{
|
|
3788
3730
|
"name": "test::for_each_remove_some",
|
|
3789
|
-
"start":
|
|
3731
|
+
"start": 11389
|
|
3790
3732
|
},
|
|
3791
3733
|
{
|
|
3792
3734
|
"name": "test::for_each_remove_all",
|
|
3793
|
-
"start":
|
|
3735
|
+
"start": 12081
|
|
3794
3736
|
},
|
|
3795
3737
|
{
|
|
3796
3738
|
"name": "test::for_each_remove_all_no_copy",
|
|
3797
|
-
"start":
|
|
3739
|
+
"start": 12619
|
|
3798
3740
|
},
|
|
3799
3741
|
{
|
|
3800
3742
|
"name": "test::different_scopes_are_isolated",
|
|
3801
|
-
"start":
|
|
3743
|
+
"start": 13383
|
|
3802
3744
|
}
|
|
3803
3745
|
],
|
|
3804
3746
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/capsules/mod.nr",
|
|
3805
|
-
"source": "use crate::oracle::capsules;\nuse crate::protocol::{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 /// Scope for capsule isolation. Capsule operations are scoped to the given address, allowing multiple independent\n /// namespaces within the same contract.\n scope: AztecAddress,\n}\n\nimpl<T> CapsuleArray<T> {\n /// Returns a CapsuleArray scoped to a specific address.\n ///\n /// Array elements are stored in contiguous slots\n /// following the base slot, so there should be sufficient space between array base slots to accommodate elements.\n /// 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, scope: AztecAddress) -> Self {\n Self { contract_address, base_slot, scope }\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, self.scope).unwrap_or(0) as u32\n }\n\n /// Stores a value at the end of the array.\n pub unconstrained fn push(self, value: T)\n where\n T: Serialize,\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(\n self.contract_address,\n self.slot_at(current_length),\n value,\n self.scope,\n );\n\n // Then we simply update the length.\n let new_length = current_length + 1;\n capsules::store(\n self.contract_address,\n self.base_slot,\n new_length,\n self.scope,\n );\n }\n\n /// Retrieves the value stored in the array at `index`. Throws if the index is out of bounds.\n pub unconstrained fn get(self, index: u32) -> T\n where\n T: Deserialize,\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), self.scope).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 self.scope,\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(\n self.contract_address,\n self.slot_at(current_length - 1),\n self.scope,\n );\n capsules::store(\n self.contract_address,\n self.base_slot,\n current_length - 1,\n self.scope,\n );\n }\n\n /// Calls a function on each element of the array.\n ///\n /// The function `f` is called once with each array value and its corresponding index. The order in which values\n /// are processed is arbitrary.\n ///\n /// ## Array Mutation\n ///\n /// It is safe to delete the current element (and only the current element) from inside the callback via `remove`:\n /// ```noir\n /// array.for_each(|index, value| {\n /// if some_condition(value) {\n /// array.remove(index); // safe only for this index\n /// }\n /// }\n /// ```\n ///\n /// If all elements in the array need to iterated over and then removed, then using `for_each` results in optimal\n /// efficiency.\n ///\n /// It is **not** safe to push new elements into the array from inside the callback.\n pub unconstrained fn for_each<Env>(self, f: unconstrained fn[Env](u32, T) -> ())\n where\n T: Deserialize,\n {\n // Iterating over all elements is simple, but we want to do it in such a way that a) deleting the current\n // element is safe to do, and b) deleting *all* elements is optimally efficient. This is because CapsuleArrays\n // are typically used to hold pending tasks, so iterating them while clearing completed tasks (sometimes\n // unconditionally, resulting in a full clear) is a very common access pattern.\n //\n // The way we achieve this is by iterating backwards: each element can always be deleted since it won't change\n // any preceding (lower) indices, and if every element is deleted then every element will (in turn) be the last\n // element. This results in an optimal full clear since `remove` will be able to skip the `capsules::copy` call\n // to shift any elements past the deleted one (because there will be none).\n let mut i = self.len();\n while i > 0 {\n i -= 1;\n f(i, self.get(i));\n }\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::protocol::address::AztecAddress;\n use crate::test::helpers::test_environment::TestEnvironment;\n use super::CapsuleArray;\n\n global SLOT: Field = 1230;\n global SCOPE: AztecAddress = AztecAddress { inner: 0xface };\n\n #[test]\n unconstrained fn empty_array() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array: CapsuleArray<Field> = CapsuleArray::at(contract_address, SLOT, SCOPE);\n assert_eq(array.len(), 0);\n });\n }\n\n #[test(should_fail_with = \"Attempted to read past the length of a CapsuleArray\")]\n unconstrained fn empty_array_read() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n let _: Field = array.get(0);\n });\n }\n\n #[test]\n unconstrained fn array_push() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n array.push(5);\n\n assert_eq(array.len(), 1);\n assert_eq(array.get(0), 5);\n });\n }\n\n #[test(should_fail_with = \"Attempted to read past the length of a CapsuleArray\")]\n unconstrained fn read_past_len() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n array.push(5);\n\n let _ = array.get(1);\n });\n }\n\n #[test]\n unconstrained fn array_remove_last() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n\n array.push(5);\n array.remove(0);\n\n assert_eq(array.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn array_remove_some() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\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\n #[test]\n unconstrained fn array_remove_all() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\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\n #[test]\n unconstrained fn for_each_called_with_all_elements() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n // We store all values that we were called with and check that all (value, index) tuples are present. Note\n // that we do not care about the order in which each tuple was passed to the closure.\n let called_with = &mut BoundedVec::<(u32, Field), 3>::new();\n array.for_each(|index, value| { called_with.push((index, value)); });\n\n assert_eq(called_with.len(), 3);\n assert(called_with.any(|(index, value)| (index == 0) & (value == 4)));\n assert(called_with.any(|(index, value)| (index == 1) & (value == 5)));\n assert(called_with.any(|(index, value)| (index == 2) & (value == 6)));\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_some() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n array.for_each(|index, _| {\n if index == 1 {\n array.remove(index);\n }\n });\n\n assert_eq(array.len(), 2);\n assert_eq(array.get(0), 4);\n assert_eq(array.get(1), 6);\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_all() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n array.for_each(|index, _| { array.remove(index); });\n\n assert_eq(array.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_all_no_copy() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, SCOPE);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n // We test that the aztec_utl_copyCapsule was never called, which is the expensive operation we want to\n // avoid.\n let mock = std::test::OracleMock::mock(\"aztec_utl_copyCapsule\");\n\n array.for_each(|index, _| { array.remove(index); });\n\n assert_eq(mock.times_called(), 0);\n });\n }\n\n #[test]\n unconstrained fn different_scopes_are_isolated() {\n let env = TestEnvironment::new();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let scope_a = AztecAddress { inner: 0xaaa };\n let scope_b = AztecAddress { inner: 0xbbb };\n\n let array_a = CapsuleArray::at(contract_address, SLOT, scope_a);\n let array_b = CapsuleArray::at(contract_address, SLOT, scope_b);\n\n array_a.push(10);\n array_a.push(20);\n array_b.push(99);\n\n assert_eq(array_a.len(), 2);\n assert_eq(array_a.get(0), 10);\n assert_eq(array_a.get(1), 20);\n\n assert_eq(array_b.len(), 1);\n assert_eq(array_b.get(0), 99);\n });\n }\n}\n"
|
|
3747
|
+
"source": "use crate::oracle::capsules;\nuse crate::protocol::{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 /// Scope for capsule isolation. Capsule operations are scoped to the given address, allowing multiple independent\n /// namespaces within the same contract.\n scope: AztecAddress,\n}\n\nimpl<T> CapsuleArray<T> {\n /// Returns a CapsuleArray scoped to a specific address.\n ///\n /// Array elements are stored in contiguous slots\n /// following the base slot, so there should be sufficient space between array base slots to accommodate elements.\n /// 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, scope: AztecAddress) -> Self {\n Self { contract_address, base_slot, scope }\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, self.scope).unwrap_or(0) as u32\n }\n\n /// Stores a value at the end of the array.\n pub unconstrained fn push(self, value: T)\n where\n T: Serialize,\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(\n self.contract_address,\n self.slot_at(current_length),\n value,\n self.scope,\n );\n\n // Then we simply update the length.\n let new_length = current_length + 1;\n capsules::store(\n self.contract_address,\n self.base_slot,\n new_length,\n self.scope,\n );\n }\n\n /// Retrieves the value stored in the array at `index`. Throws if the index is out of bounds.\n pub unconstrained fn get(self, index: u32) -> T\n where\n T: Deserialize,\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), self.scope).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 self.scope,\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(\n self.contract_address,\n self.slot_at(current_length - 1),\n self.scope,\n );\n capsules::store(\n self.contract_address,\n self.base_slot,\n current_length - 1,\n self.scope,\n );\n }\n\n /// Calls a function on each element of the array.\n ///\n /// The function `f` is called once with each array value and its corresponding index. The order in which values\n /// are processed is arbitrary.\n ///\n /// ## Array Mutation\n ///\n /// It is safe to delete the current element (and only the current element) from inside the callback via `remove`:\n /// ```noir\n /// array.for_each(|index, value| {\n /// if some_condition(value) {\n /// array.remove(index); // safe only for this index\n /// }\n /// }\n /// ```\n ///\n /// If all elements in the array need to iterated over and then removed, then using `for_each` results in optimal\n /// efficiency.\n ///\n /// It is **not** safe to push new elements into the array from inside the callback.\n pub unconstrained fn for_each<Env>(self, f: unconstrained fn[Env](u32, T) -> ())\n where\n T: Deserialize,\n {\n // Iterating over all elements is simple, but we want to do it in such a way that a) deleting the current\n // element is safe to do, and b) deleting *all* elements is optimally efficient. This is because CapsuleArrays\n // are typically used to hold pending tasks, so iterating them while clearing completed tasks (sometimes\n // unconditionally, resulting in a full clear) is a very common access pattern.\n //\n // The way we achieve this is by iterating backwards: each element can always be deleted since it won't change\n // any preceding (lower) indices, and if every element is deleted then every element will (in turn) be the last\n // element. This results in an optimal full clear since `remove` will be able to skip the `capsules::copy` call\n // to shift any elements past the deleted one (because there will be none).\n let mut i = self.len();\n while i > 0 {\n i -= 1;\n f(i, self.get(i));\n }\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\n global SLOT: Field = 1230;\n\n #[test]\n unconstrained fn empty_array() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array: CapsuleArray<Field> = CapsuleArray::at(contract_address, SLOT, scope);\n assert_eq(array.len(), 0);\n });\n }\n\n #[test(should_fail_with = \"Attempted to read past the length of a CapsuleArray\")]\n unconstrained fn empty_array_read() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n let _: Field = array.get(0);\n });\n }\n\n #[test]\n unconstrained fn array_push() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n array.push(5);\n\n assert_eq(array.len(), 1);\n assert_eq(array.get(0), 5);\n });\n }\n\n #[test(should_fail_with = \"Attempted to read past the length of a CapsuleArray\")]\n unconstrained fn read_past_len() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n array.push(5);\n\n let _ = array.get(1);\n });\n }\n\n #[test]\n unconstrained fn array_remove_last() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n\n array.push(5);\n array.remove(0);\n\n assert_eq(array.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn array_remove_some() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, scope);\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\n #[test]\n unconstrained fn array_remove_all() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array = CapsuleArray::at(contract_address, SLOT, scope);\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\n #[test]\n unconstrained fn for_each_called_with_all_elements() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n // We store all values that we were called with and check that all (value, index) tuples are present. Note\n // that we do not care about the order in which each tuple was passed to the closure.\n let called_with = &mut BoundedVec::<(u32, Field), 3>::new();\n array.for_each(|index, value| { called_with.push((index, value)); });\n\n assert_eq(called_with.len(), 3);\n assert(called_with.any(|(index, value)| (index == 0) & (value == 4)));\n assert(called_with.any(|(index, value)| (index == 1) & (value == 5)));\n assert(called_with.any(|(index, value)| (index == 2) & (value == 6)));\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_some() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n array.for_each(|index, _| {\n if index == 1 {\n array.remove(index);\n }\n });\n\n assert_eq(array.len(), 2);\n assert_eq(array.get(0), 4);\n assert_eq(array.get(1), 6);\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_all() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n array.for_each(|index, _| { array.remove(index); });\n\n assert_eq(array.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_all_no_copy() {\n let mut env = TestEnvironment::new();\n let scope = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n let array = CapsuleArray::at(contract_address, SLOT, scope);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n // We test that the aztec_utl_copyCapsule was never called, which is the expensive operation we want to\n // avoid.\n let mock = std::test::OracleMock::mock(\"aztec_utl_copyCapsule\");\n\n array.for_each(|index, _| { array.remove(index); });\n\n assert_eq(mock.times_called(), 0);\n });\n }\n\n #[test]\n unconstrained fn different_scopes_are_isolated() {\n let mut env = TestEnvironment::new();\n let scope_a = env.create_light_account();\n let scope_b = env.create_light_account();\n env.private_context(|context| {\n let contract_address = context.this_address();\n\n let array_a = CapsuleArray::at(contract_address, SLOT, scope_a);\n let array_b = CapsuleArray::at(contract_address, SLOT, scope_b);\n\n array_a.push(10);\n array_a.push(20);\n array_b.push(99);\n\n assert_eq(array_a.len(), 2);\n assert_eq(array_a.get(0), 10);\n assert_eq(array_a.get(1), 20);\n\n assert_eq(array_b.len(), 1);\n assert_eq(array_b.get(0), 99);\n });\n }\n}\n"
|
|
3806
3748
|
},
|
|
3807
|
-
"
|
|
3749
|
+
"70": {
|
|
3808
3750
|
"function_locations": [
|
|
3809
3751
|
{
|
|
3810
3752
|
"name": "<impl Eq for PublicContext>::eq",
|
|
@@ -3934,7 +3876,7 @@
|
|
|
3934
3876
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/public_context.nr",
|
|
3935
3877
|
"source": "use crate::{\n context::gas::GasOpts,\n hash::{\n compute_l1_to_l2_message_hash, compute_l1_to_l2_message_nullifier, compute_secret_hash,\n compute_siloed_nullifier,\n },\n oracle::avm,\n};\nuse crate::protocol::{\n abis::function_selector::FunctionSelector,\n address::{AztecAddress, EthAddress},\n constants::{MAX_U32_VALUE, NULL_MSG_SENDER_CONTRACT_ADDRESS},\n traits::{Empty, FromField, Packable, Serialize, ToField},\n utils::writer::Writer,\n};\n\n/// # PublicContext\n///\n/// The **main interface** between an #[external(\"public\")] function and the Aztec blockchain.\n///\n/// An instance of the PublicContext is initialized automatically at the outset of every public function, within the\n/// #[external(\"public\")] macro, so you'll never need to consciously instantiate this yourself.\n///\n/// The instance is always named `context`, and it will always be available within the body of every\n/// #[external(\"public\")] function in your smart contract.\n///\n/// Typical usage for a smart contract developer will be to call getter methods of the PublicContext.\n///\n/// _Pushing_ data and requests to the context is mostly handled within aztec-nr's own functions, so typically a smart\n/// contract developer won't need to call any setter methods directly.\n///\n/// ## Responsibilities\n/// - Exposes contextual data to a public function:\n/// - Data relating to how this public function was called:\n/// - msg_sender, this_address\n/// - Data relating to the current blockchain state:\n/// - timestamp, block_number, chain_id, version\n/// - Gas and fee information\n/// - Provides state access:\n/// - Read/write public storage (key-value mapping)\n/// - Check existence of notes and nullifiers (Some patterns use notes & nullifiers to store public (not private)\n/// information)\n/// - Enables consumption of L1->L2 messages.\n/// - Enables calls to other public smart contract functions:\n/// - Writes data to the blockchain:\n/// - Updates to public state variables\n/// - New public logs (for events)\n/// - New L2->L1 messages\n/// - New notes & nullifiers (E.g. pushing public info to notes/nullifiers, or for completing \"partial notes\")\n///\n/// ## Key Differences from Private Execution\n///\n/// Unlike private functions -- which are executed on the user's device and which can only reference historic state --\n/// public functions are executed by a block proposer and are executed \"live\" on the _current_ tip of the chain. This\n/// means public functions can:\n/// - Read and write _current_ public state\n/// - Immediately see the effects of earlier transactions in the same block\n///\n/// Also, public functions are executed within a zkVM (the \"AVM\"), so that they can _revert_ whilst still ensuring\n/// payment to the proposer and prover. (Private functions cannot revert: they either succeed, or they cannot be\n/// included).\n///\n/// ## Optimising Public Functions\n///\n/// Using the AVM to execute public functions means they compile down to \"AVM bytecode\" instead of the ACIR that\n/// private functions (standalone circuits) compile to. Therefore the approach to optimising a public function is\n/// fundamentally different from optimising a public function.\n///\npub struct PublicContext {\n pub args_hash: Option<Field>,\n pub compute_args_hash: fn() -> Field,\n}\n\nimpl Eq for PublicContext {\n fn eq(self, other: Self) -> bool {\n (self.args_hash == other.args_hash)\n // Can't compare the function compute_args_hash\n }\n}\n\nimpl PublicContext {\n /// Creates a new PublicContext instance.\n ///\n /// Low-level function: This is called automatically by the #[external(\"public\")] macro, so you shouldn't need to\n /// be called directly by smart contract developers.\n ///\n /// # Arguments\n /// * `compute_args_hash` - Function to compute the args_hash\n ///\n /// # Returns\n /// * A new PublicContext instance\n ///\n pub fn new(compute_args_hash: fn() -> Field) -> Self {\n PublicContext { args_hash: Option::none(), compute_args_hash }\n }\n\n /// Emits a _public_ log that will be visible onchain to everyone.\n ///\n /// # Arguments\n /// * `tag` - A tag placed at `fields[0]` of the emitted log. Nodes index logs by this value, allowing\n /// clients to efficiently query for matching logs without scanning all of them.\n /// * `log` - The data to log, must implement Serialize trait.\n ///\n /// ## Safety\n ///\n /// The `tag` should be domain-separated (e.g. via [`crate::protocol::hash::compute_log_tag`]) to prevent\n /// collisions between logs from different sources. Without domain separation, two unrelated log types that\n /// happen to share a raw tag value become indistinguishable. Prefer `self.emit(event)` for events, which\n /// handles tagging automatically.\n pub fn emit_public_log_unsafe<T>(_self: Self, tag: Field, log: T)\n where\n T: Serialize,\n {\n // We use a Writer to serialize the log directly after the tag, avoiding an extra O(n) copy that would\n // result from serializing first and then prepending the tag.\n let mut writer: Writer<1 + <T as Serialize>::N> = Writer::new();\n writer.write(tag);\n Serialize::stream_serialize(log, &mut writer);\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_public_log(writer.finish().as_vector()) };\n }\n\n /// Checks if a given note hash exists in the note hash tree at a particular leaf_index.\n ///\n /// # Arguments\n /// * `note_hash` - The note hash to check for existence\n /// * `leaf_index` - The index where the note hash should be located\n ///\n /// # Returns\n /// * `bool` - True if the note hash exists at the specified index\n ///\n pub fn note_hash_exists(_self: Self, note_hash: Field, leaf_index: u64) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::note_hash_exists(note_hash, leaf_index) } == 1\n }\n\n /// Checks if a specific L1-to-L2 message exists in the L1-to-L2 message tree at a particular leaf index.\n ///\n /// Common use cases include token bridging, cross-chain governance, and triggering L2 actions based on L1 events.\n ///\n /// This function should be called before attempting to consume an L1-to-L2 message.\n ///\n /// # Arguments\n /// * `msg_hash` - Hash of the L1-to-L2 message to check\n /// * `msg_leaf_index` - The index where the message should be located\n ///\n /// # Returns\n /// * `bool` - True if the message exists at the specified index\n ///\n /// # Advanced\n /// * Uses the AVM l1_to_l2_msg_exists opcode for tree lookup\n /// * Messages are copied from L1 Inbox to L2 by block proposers\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 TODO(alvaro): Make l1l2msg leaf index a u64 upstream\n unsafe { avm::l1_to_l2_msg_exists(msg_hash, msg_leaf_index as u64) } == 1\n }\n\n /// Returns `true` if an `unsiloed_nullifier` has been emitted by `contract_address`.\n ///\n /// Note that unsiloed nullifiers are not the actual values stored in the nullifier tree: they are first siloed via\n /// [`crate::hash::compute_siloed_nullifier`] with the emitting contract's address.\n ///\n /// ## Use Cases\n ///\n /// Nullifiers are typically used as a _privacy-preserving_ record of a one-time action, but they can also be used\n /// to efficiently record _public_ one-time actions as well. This is cheaper than using public storage, and has the\n /// added benefit of the nullifier being emittable from a private function.\n ///\n /// An example is to check whether a contract has been published: we emit a nullifier that is deterministic and\n /// which has a _public_ preimage.\n ///\n /// ## Public vs Private\n ///\n /// In general, one should not attempt to prove nullifier non-existence in private, as that will not consider the\n /// possibility of the nullifier having been emitted in any transaction between the anchor block and the inclusion\n /// block. Private functions instead prove existence via\n /// [`crate::context::PrivateContext::assert_nullifier_exists`]\n /// and 'prove' non-existence by _emitting_ the nullifer, which would cause the transaction to fail if the\n /// nullifier existed.\n ///\n /// This is not the case in public functions, which **do** have access to the tip of the blockchain and so can\n /// reliably prove whether a nullifier exists or not.\n ///\n /// ## Safety\n ///\n /// While it is safe to rely on this function's return value to determine if a nullifier exists or not, it is often\n /// **not** safe to infer additional information from that. In particular, it is **unsafe** to infer that the\n /// existence of a nullifier emitted from a private function implies that all other side-effects of said private\n /// execution have been completed, more concretely that any enqueued public calls have been executed.\n ///\n /// For example, if a function in contract `A` privately emits nullifier `X` and then enqueues public function `Y`,\n /// then it is **unsafe** for a contract `B` to infer that `Y` has alredy executed simply because `X` exists.\n ///\n /// This is because **all** private transaction effects are committed _before_ enqueued public functions are run\n /// (in\n /// order to not reveal detailed timing information about the transaction), so it is possible to observe a\n /// nullifier that was emitted alongside the enqueuing of a public call **before** said call has been completed.\n ///\n /// ## Cost\n ///\n /// This emits the `CHECKNULLIFIEREXISTS` opcode, which conceptually performs a merkle inclusion proof on the\n /// nullifier tree (both when the nullifier exists and when it doesn't).\n pub fn nullifier_exists_unsafe(_self: Self, unsiloed_nullifier: Field, contract_address: AztecAddress) -> bool {\n let siloed_nullifier = compute_siloed_nullifier(contract_address, unsiloed_nullifier);\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::nullifier_exists(siloed_nullifier) } == 1\n }\n\n /// Consumes a message sent from Ethereum (L1) to Aztec (L2) -- effectively marking it as \"read\".\n ///\n /// Use this function if you only want the message to ever be \"referred to\" once. Once consumed using this method,\n /// the message cannot be consumed again, because a nullifier is emitted. If your use case wants for the message to\n /// be read unlimited times, then you can always read any historic message from the L1-to-L2 messages tree, using\n /// the `l1_to_l2_msg_exists` method. Messages never technically get deleted from that tree.\n ///\n /// The message will first be inserted into an Aztec \"Inbox\" smart contract on L1. It will not be available for\n /// consumption immediately. Messages get copied-over from the L1 Inbox to L2 by the next Proposer in batches. So\n /// you will need to wait until the messages are copied before you can consume them.\n ///\n /// # Arguments\n /// * `content` - The message content that was sent from L1\n /// * `secret` - Secret value used for message privacy (if needed)\n /// * `sender` - Ethereum address that sent the message\n /// * `leaf_index` - Index of the message in the L1-to-L2 message tree\n ///\n /// # Advanced\n /// * Validates message existence in the L1-to-L2 message tree\n /// * Prevents double-consumption by emitting a nullifier\n /// * Message hash is computed from all parameters + chain context\n /// * Will revert if message doesn't exist or was already consumed\n ///\n pub fn consume_l1_to_l2_message(self: Self, content: Field, secret: Field, sender: EthAddress, leaf_index: Field) {\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(!self.nullifier_exists_unsafe(nullifier, self.this_address()), \"L1-to-L2 message is already nullified\");\n assert(self.l1_to_l2_msg_exists(message_hash, leaf_index), \"Tried to consume nonexistent L1-to-L2 message\");\n\n self.push_nullifier(nullifier);\n }\n\n /// Sends an \"L2 -> L1 message\" from this function (Aztec, L2) to a smart contract on Ethereum (L1). L1 contracts\n /// which are designed to send/receive messages to/from Aztec are called \"Portal Contracts\".\n ///\n /// Common use cases include withdrawals, cross-chain asset transfers, and triggering L1 actions based on L2 state\n /// changes.\n ///\n /// The message will be inserted into an Aztec \"Outbox\" contract on L1, when this transaction's block is proposed\n /// to L1. Sending the message will not result in any immediate state changes in the target portal contract. The\n /// message will need to be manually consumed from the Outbox through a separate Ethereum transaction: a user will\n /// need to call a function of the portal contract -- a function specifically designed to make a call to the Outbox\n /// to consume the message. The message will only be available for consumption once the _epoch_ proof has been\n /// submitted. Given that there are multiple Aztec blocks within an epoch, it might take some time for this epoch\n /// proof to be submitted -- especially if the block was near the start of an epoch.\n ///\n /// # Arguments\n /// * `recipient` - Ethereum address that will receive the message\n /// * `content` - Message content (32 bytes as a Field element)\n ///\n pub fn message_portal(_self: Self, recipient: EthAddress, content: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::send_l2_to_l1_msg(recipient, content) };\n }\n\n /// Calls a public function on another contract.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - Function to call on the target contract\n /// * `args` - Arguments to pass to the function\n /// * `gas_opts` - An optional allocation of gas to the called function.\n ///\n /// # Returns\n /// * `[Field]` - Return data from the called function\n ///\n pub unconstrained fn call_public_function<let N: u32>(\n _self: Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; N],\n gas_opts: GasOpts,\n ) -> [Field] {\n let calldata = [function_selector.to_field()].concat(args);\n\n avm::call(\n gas_opts.l2_gas.unwrap_or(MAX_U32_VALUE),\n gas_opts.da_gas.unwrap_or(MAX_U32_VALUE),\n contract_address,\n calldata,\n );\n // Use success_copy to determine whether the call succeeded\n let success = avm::success_copy();\n\n let result_data = avm::returndata_copy(0, avm::returndata_size());\n if !success {\n // Rethrow the revert data.\n avm::revert(result_data);\n }\n result_data\n }\n\n /// Makes a read-only call to a public function on another contract.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be staticcalls.\n ///\n /// Useful for querying data from other contracts safely.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `contract_address` - Address of the contract to call\n /// * `function_selector` - Function to call on the target contract\n /// * `args` - Array of arguments to pass to the called function\n /// * `gas_opts` - An optional allocation of gas to the called function.\n ///\n /// # Returns\n /// * `[Field]` - Return data from the called function\n ///\n pub unconstrained fn static_call_public_function<let N: u32>(\n _self: Self,\n contract_address: AztecAddress,\n function_selector: FunctionSelector,\n args: [Field; N],\n gas_opts: GasOpts,\n ) -> [Field] {\n let calldata = [function_selector.to_field()].concat(args);\n\n avm::call_static(\n gas_opts.l2_gas.unwrap_or(MAX_U32_VALUE),\n gas_opts.da_gas.unwrap_or(MAX_U32_VALUE),\n contract_address,\n calldata,\n );\n // Use success_copy to determine whether the call succeeded\n let success = avm::success_copy();\n\n let result_data = avm::returndata_copy(0, avm::returndata_size());\n if !success {\n // Rethrow the revert data.\n avm::revert(result_data);\n }\n result_data\n }\n\n /// Adds a new note hash to the Aztec blockchain's global Note Hash Tree.\n ///\n /// Notes are ordinarily constructed and emitted by _private_ functions, to ensure that both the content of the\n /// note, and the contract that emitted the note, stay private.\n ///\n /// There are however some useful patterns whereby a note needs to contain _public_ data. The ability to push a new\n /// note_hash from a _public_ function means that notes can be injected with public data immediately -- as soon as\n /// the public value is known. The slower alternative would be to submit a follow-up transaction so that a private\n /// function can inject the data. Both are possible on Aztec.\n ///\n /// Search \"Partial Note\" for a very common pattern which enables a note to be \"partially\" populated with some data\n /// in a _private_ function, and then later \"completed\" with some data in a public function.\n ///\n /// # Arguments\n /// * `note_hash` - The hash of the note to add to the tree\n ///\n /// # Advanced\n /// * The note hash will be siloed with the contract address by the protocol\n ///\n pub fn push_note_hash(_self: Self, note_hash: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_note_hash(note_hash) };\n }\n\n /// Creates a new [nullifier](crate::nullifier).\n ///\n /// While nullifiers are primarily intended as a _privacy-preserving_ record of a one-time action, they can also\n /// be used to efficiently record _public_ one-time actions. This function allows creating nullifiers from public\n /// contract functions, which behave just like those created from private functions.\n ///\n /// ## Safety\n ///\n /// This is a low-level function that must be used with great care to avoid subtle corruption of contract state.\n ///\n /// In particular, callers must ensure all nullifiers created by a contract are properly domain-separated, so that\n /// unrelated components don't interfere with one another (e.g. a transaction nullifier accidentally marking a\n /// variable as initialized). Note nullifiers should only be created via\n /// [`crate::context::PrivateContext::push_nullifier_for_note_hash`].\n ///\n /// ## Advanced\n ///\n /// The raw `nullifier` is not what is inserted into the Aztec state tree: it will be first siloed by contract\n /// address via [`crate::protocol::hash::compute_siloed_nullifier`] in order to prevent accidental or malicious\n /// interference of nullifiers from different contracts.\n pub fn push_nullifier(_self: Self, nullifier: Field) {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::emit_nullifier(nullifier) };\n }\n\n /// Returns the address of the current contract being executed.\n ///\n /// This is equivalent to `address(this)` in Solidity (hence the name). Use this to identify the current contract's\n /// address, commonly needed for access control or when interacting with other contracts.\n ///\n /// # Returns\n /// * `AztecAddress` - The contract address of the current function being executed.\n ///\n pub fn this_address(_self: Self) -> AztecAddress {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::address()\n }\n }\n\n /// Returns the contract address that initiated this function call.\n ///\n /// This is similar to `msg.sender` in Solidity (hence the name).\n ///\n /// Important Note: If the calling function is a _private_ function, then it had the option of hiding its address\n /// when enqueuing this public function call. In such cases, this method will return `Option<AztecAddress>::none`.\n /// If the calling function is a _public_ function, it will always return an `Option<AztecAddress>::some` (i.e. a\n /// non-null value).\n ///\n /// # Returns\n /// * `Option<AztecAddress>` - The address of the smart contract that called this function (be it an app contract\n /// or a user's account contract).\n ///\n /// # Advanced\n /// * Value is provided by the AVM sender opcode\n /// * In nested calls, this is the immediate caller, not the original transaction sender\n ///\n pub fn maybe_msg_sender(_self: Self) -> Option<AztecAddress> {\n // Safety: AVM opcodes are constrained by the AVM itself\n let maybe_msg_sender = unsafe { avm::sender() };\n if maybe_msg_sender == NULL_MSG_SENDER_CONTRACT_ADDRESS {\n Option::none()\n } else {\n Option::some(maybe_msg_sender)\n }\n }\n\n /// Returns the function selector of the currently-executing function.\n ///\n /// This is similar to `msg.sig` in Solidity, returning the first 4 bytes of the function signature.\n ///\n /// # Returns\n /// * `FunctionSelector` - The 4-byte function identifier\n ///\n /// # Advanced\n /// * Extracted from the first element of calldata\n /// * Used internally for function dispatch in the AVM\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 { avm::calldata_copy(0, 1) };\n FunctionSelector::from_field(raw_selector[0])\n }\n\n /// Returns the hash of the arguments passed to the current function.\n ///\n /// Very low-level function: The #[external(\"public\")] macro uses this internally. Smart contract developers\n /// typically won't need to access this directly as arguments are automatically made available.\n ///\n /// # Returns\n /// * `Field` - Hash of the function arguments\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\n /// Returns the \"transaction fee\" for the current transaction. This is the final tx fee that will be deducted from\n /// the fee_payer's \"fee-juice\" balance (in the protocol's Base Rollup circuit).\n ///\n /// # Returns\n /// * `Field` - The actual, final cost of the transaction, taking into account: the actual gas used during the\n /// setup and app-logic phases, and the fixed amount of gas that's been allocated by the user for the teardown\n /// phase. I.e. effectiveL2FeePerGas * l2GasUsed + effectiveDAFeePerGas * daGasUsed\n ///\n /// This will return `0` during the \"setup\" and \"app-logic\" phases of tx execution (because the final tx fee is not\n /// known at that time). This will only return a nonzero value during the \"teardown\" phase of execution, where the\n /// final tx fee can actually be computed.\n ///\n /// Regardless of _when_ this function is called during the teardown phase, it will always return the same final tx\n /// fee value. The teardown phase does not consume a variable amount of gas: it always consumes a pre-allocated\n /// amount of gas, as specified by the user when they generate their tx.\n ///\n pub fn transaction_fee(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::transaction_fee()\n }\n }\n\n /// Returns the chain ID of the current network.\n ///\n /// This is similar to `block.chainid` in Solidity. Returns the unique identifier for the blockchain network this\n /// transaction is executing on.\n ///\n /// Helps prevent cross-chain replay attacks. Useful if implementing multi-chain contract logic.\n ///\n /// # Returns\n /// * `Field` - The chain ID as a field element\n ///\n pub fn chain_id(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::chain_id()\n }\n }\n\n /// Returns the Aztec protocol version that this transaction is executing under. Different versions may have\n /// different rules, opcodes, or cryptographic primitives.\n ///\n /// This is similar to how Ethereum has different EVM versions.\n ///\n /// Useful for forward/backward compatibility checks\n ///\n /// Not to be confused with contract versions; this is the protocol version.\n ///\n /// # Returns\n /// * `Field` - The protocol version as a field element\n ///\n pub fn version(_self: Self) -> Field {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::version()\n }\n }\n /// Returns the current block number.\n ///\n /// This is similar to `block.number` in Solidity.\n ///\n /// Note: the current block number is only available within a public function (as opposed to a private function).\n ///\n /// Note: the time intervals between blocks should not be relied upon as being consistent:\n /// - Timestamps of blocks fall within a range, rather than at exact regular intervals.\n /// - Slots can be missed.\n /// - Protocol upgrades can completely change the intervals between blocks (and indeed the current roadmap plans to\n /// reduce the time between blocks, eventually). Use `context.timestamp()` for more-reliable time-based logic.\n ///\n /// # Returns\n /// * `u32` - The current block number\n ///\n pub fn block_number(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::block_number()\n }\n }\n\n /// Returns the timestamp of the current block.\n ///\n /// This is similar to `block.timestamp` in Solidity.\n ///\n /// All functions of all transactions in a block share the exact same timestamp (even though technically each\n /// transaction is executed one-after-the-other).\n ///\n /// Important note: Timestamps of Aztec blocks are not at reliably-fixed intervals. The proposer of the block has\n /// some flexibility to choose a timestamp which is in a valid _range_: Obviously the timestamp of this block must\n /// be strictly greater than that of the previous block, and must must be less than the timestamp of whichever\n /// ethereum block the aztec block is proposed to. Furthermore, if the timestamp is not deemed close enough to the\n /// actual current time, the committee of validators will not attest to the block.\n ///\n /// # Returns\n /// * `u64` - Unix timestamp in seconds\n ///\n pub fn timestamp(_self: Self) -> u64 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::timestamp()\n }\n }\n\n /// Returns the fee per unit of L2 gas for this transaction (aka the \"L2 gas price\"), as chosen by the user.\n ///\n /// L2 gas covers the cost of executing public functions and handling side-effects within the AVM.\n ///\n /// # Returns\n /// * `u128` - Fee per unit of L2 gas\n ///\n /// Wallet developers should be mindful that the choice of gas price (which is publicly visible) can leak\n /// information about the user, e.g.:\n /// - which wallet software the user is using;\n /// - the amount of time which has elapsed from the time the user's wallet chose a gas price (at the going rate),\n /// to the time of tx submission. This can give clues about the proving time, and hence the nature of the tx.\n /// - the urgency of the transaction (which is kind of unavoidable, if the tx is indeed urgent).\n /// - the wealth of the user.\n /// - the exact user (if the gas price is explicitly chosen by the user to be some unique number like 0.123456789,\n /// or their favorite number). Wallet devs might wish to consider fuzzing the choice of gas price.\n ///\n pub fn min_fee_per_l2_gas(_self: Self) -> u128 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::min_fee_per_l2_gas()\n }\n }\n\n /// Returns the fee per unit of DA (Data Availability) gas (aka the \"DA gas price\").\n ///\n /// DA gas covers the cost of making transaction data available on L1.\n ///\n /// See the warning in `min_fee_per_l2_gas` for how gas prices can be leaky.\n ///\n /// # Returns\n /// * `u128` - Fee per unit of DA gas\n ///\n pub fn min_fee_per_da_gas(_self: Self) -> u128 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::min_fee_per_da_gas()\n }\n }\n\n /// Returns the remaining L2 gas available for this transaction.\n ///\n /// Different AVM opcodes consume different amounts of gas.\n ///\n /// # Returns\n /// * `u32` - Remaining L2 gas units\n ///\n pub fn l2_gas_left(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::l2_gas_left()\n }\n }\n\n /// Returns the remaining DA (Data Availability) gas available for this transaction.\n ///\n /// DA gas is consumed when emitting data that needs to be made available on L1, such as public logs or state\n /// updates. All of the side-effects from the private part of the tx also consume DA gas before execution of any\n /// public functions even begins.\n ///\n /// # Returns\n /// * `u32` - Remaining DA gas units\n ///\n pub fn da_gas_left(_self: Self) -> u32 {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe {\n avm::da_gas_left()\n }\n }\n\n /// Checks if the current execution is within a staticcall context, where no state changes or logs are allowed to\n /// be emitted (by this function or any nested function calls).\n ///\n /// # Returns\n /// * `bool` - True if in staticcall context, false otherwise\n ///\n pub fn is_static_call(_self: Self) -> bool {\n // Safety: AVM opcodes are constrained by the AVM itself\n unsafe { avm::is_static_call() } == 1\n }\n\n /// Reads raw field values from public storage. Reads N consecutive storage slots starting from the given slot.\n ///\n /// Very low-level function. Users should typically use the public state variable abstractions to perform reads:\n /// PublicMutable & PublicImmutable.\n ///\n /// # Arguments\n /// * `storage_slot` - The starting storage slot to read from\n ///\n /// # Returns\n /// * `[Field; N]` - Array of N field values from consecutive storage slots\n ///\n /// # Generic Parameters\n /// * `N` - the number of consecutive slots to return, starting from the `storage_slot`.\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 { avm::storage_read(storage_slot + i as Field, self.this_address().to_field()) };\n }\n out\n }\n\n /// Reads a typed value from public storage.\n ///\n /// Low-level function. Users should typically use the public state variable abstractions to perform reads:\n /// PublicMutable & PublicImmutable.\n ///\n /// # Arguments\n /// * `storage_slot` - The storage slot to read from\n ///\n /// # Returns\n /// * `T` - The deserialized value from storage\n ///\n /// # Generic Parameters\n /// * `T` - The type that the caller expects to read from the `storage_slot`.\n ///\n pub fn storage_read<T>(self, storage_slot: Field) -> T\n where\n T: Packable,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n\n /// Writes raw field values to public storage. Writes to N consecutive storage slots starting from the given slot.\n ///\n /// Very low-level function. Users should typically use the public state variable abstractions to perform writes:\n /// PublicMutable & PublicImmutable.\n ///\n /// Public storage writes take effect immediately.\n ///\n /// # Arguments\n /// * `storage_slot` - The starting storage slot to write to\n /// * `values` - Array of N Fields to write to storage\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 { avm::storage_write(storage_slot + i as Field, values[i]) };\n }\n }\n\n /// Writes a typed value to public storage.\n ///\n /// Low-level function. Users should typically use the public state variable abstractions to perform writes:\n /// PublicMutable & PublicImmutable.\n ///\n /// # Arguments\n /// * `storage_slot` - The storage slot to write to\n /// * `value` - The typed value to write to storage\n ///\n /// # Generic Parameters\n /// * `T` - The type to write to storage.\n ///\n pub fn storage_write<T>(self, storage_slot: Field, value: T)\n where\n T: Packable,\n {\n self.raw_storage_write(storage_slot, value.pack());\n }\n}\n\nimpl Empty for PublicContext {\n fn empty() -> Self {\n PublicContext::new(|| 0)\n }\n}\n"
|
|
3936
3878
|
},
|
|
3937
|
-
"
|
|
3879
|
+
"72": {
|
|
3938
3880
|
"function_locations": [
|
|
3939
3881
|
{
|
|
3940
3882
|
"name": "UtilityContext::new",
|
|
@@ -3980,7 +3922,7 @@
|
|
|
3980
3922
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/context/utility_context.nr",
|
|
3981
3923
|
"source": "use crate::oracle::{execution::get_utility_context, storage::storage_read};\nuse crate::protocol::{abis::block_header::BlockHeader, address::AztecAddress, traits::Packable};\n\n// If you'll modify this struct don't forget to update utility_context.ts as well.\npub struct UtilityContext {\n block_header: BlockHeader,\n contract_address: AztecAddress,\n}\n\nimpl UtilityContext {\n pub unconstrained fn new() -> Self {\n get_utility_context()\n }\n\n pub unconstrained fn at(contract_address: AztecAddress) -> Self {\n // We get a context with default contract address, and then we construct the final context with the provided\n // contract address.\n let default_context = get_utility_context();\n\n Self { block_header: default_context.block_header, contract_address }\n }\n\n pub fn block_header(self) -> BlockHeader {\n self.block_header\n }\n\n pub fn block_number(self) -> u32 {\n self.block_header.block_number()\n }\n\n pub fn timestamp(self) -> u64 {\n self.block_header.timestamp()\n }\n\n pub fn this_address(self) -> AztecAddress {\n self.contract_address\n }\n\n pub fn version(self) -> Field {\n self.block_header.version()\n }\n\n pub fn chain_id(self) -> Field {\n self.block_header.chain_id()\n }\n\n pub unconstrained fn raw_storage_read<let N: u32>(self: Self, storage_slot: Field) -> [Field; N] {\n storage_read(self.block_header, self.this_address(), storage_slot)\n }\n\n pub unconstrained fn storage_read<T>(self, storage_slot: Field) -> T\n where\n T: Packable,\n {\n T::unpack(self.raw_storage_read(storage_slot))\n }\n}\n"
|
|
3982
3924
|
},
|
|
3983
|
-
"
|
|
3925
|
+
"74": {
|
|
3984
3926
|
"function_locations": [
|
|
3985
3927
|
{
|
|
3986
3928
|
"name": "ContractSelfPublic<Storage, CallSelf, CallSelfStatic, CallInternal>::new",
|
|
@@ -4006,7 +3948,117 @@
|
|
|
4006
3948
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/contract_self/contract_self_public.nr",
|
|
4007
3949
|
"source": "//! The `self` contract value for public execution contexts.\n\nuse crate::{\n context::{calls::{PublicCall, PublicStaticCall}, PublicContext},\n event::{event_emission::emit_event_in_public, event_interface::EventInterface},\n};\nuse crate::protocol::{address::AztecAddress, traits::{Deserialize, Serialize}};\n\n/// Core interface for interacting with aztec-nr contract features in public execution contexts.\n///\n/// This struct is automatically injected into every [`external`](crate::macros::functions::external) and\n/// [`internal`](crate::macros::functions::internal) contract function marked with `\"public\"` by the Aztec macro\n/// system and is accessible through the `self` variable.\n///\n/// ## Type Parameters\n///\n/// - `Storage`: The contract's storage struct (defined with [`storage`](crate::macros::storage::storage), or `()` if\n/// the contract has no storage\n/// - `CallSelf`: Macro-generated type for calling contract's own non-view functions\n/// - `CallSelfStatic`: Macro-generated type for calling contract's own view functions\n/// - `CallInternal`: Macro-generated type for calling internal functions\npub struct ContractSelfPublic<Storage, CallSelf, CallSelfStatic, CallInternal> {\n /// The address of this contract\n pub address: AztecAddress,\n\n /// The contract's storage instance, representing the struct to which the\n /// [`storage`](crate::macros::storage::storage) macro was applied in your contract. If the contract has no\n /// storage, the type of this will be `()`.\n ///\n /// This storage instance is specialized for the current execution context (public) and\n /// provides access to the contract's state variables.\n ///\n /// ## Developer Note\n ///\n /// If you've arrived here while trying to access your contract's storage while the `Storage` generic type is set\n /// to unit type `()`, it means you haven't yet defined a Storage struct using the\n /// [`storage`](crate::macros::storage::storage) macro in your contract. For guidance on setting this up, please\n /// refer to our docs: https://docs.aztec.network/developers/docs/guides/smart_contracts/storage\n pub storage: Storage,\n\n /// The public execution context.\n pub context: PublicContext,\n\n /// Provides type-safe methods for calling this contract's own non-view functions.\n ///\n /// Example API:\n /// ```noir\n /// self.call_self.some_public_function(args)\n /// ```\n pub call_self: CallSelf,\n\n /// Provides type-safe methods for calling this contract's own view functions.\n ///\n /// Example API:\n /// ```noir\n /// self.call_self_static.some_view_function(args)\n /// ```\n pub call_self_static: CallSelfStatic,\n\n /// Provides type-safe methods for calling internal functions.\n ///\n /// Example API:\n /// ```noir\n /// self.internal.some_internal_function(args)\n /// ```\n pub internal: CallInternal,\n}\n\nimpl<Storage, CallSelf, CallSelfStatic, CallInternal> ContractSelfPublic<Storage, CallSelf, CallSelfStatic, CallInternal> {\n /// Creates a new `ContractSelfPublic` instance for a public function.\n ///\n /// This constructor is called automatically by the macro system and should not be called directly.\n pub fn new(\n context: PublicContext,\n storage: Storage,\n call_self: CallSelf,\n call_self_static: CallSelfStatic,\n internal: CallInternal,\n ) -> Self {\n Self { context, storage, address: context.this_address(), call_self, call_self_static, internal }\n }\n\n /// The address of the contract address that made this function call.\n ///\n /// This is similar to Solidity's `msg.sender` value.\n ///\n /// ## Incognito Calls\n ///\n /// Contracts can call public functions from private ones hiding their identity (see\n ///\n /// [`ContractSelfPrivate::enqueue_incognito`](crate::contract_self::ContractSelfPrivate::enqueue_incognito)).\n /// This function reverts when executed in such a context.\n ///\n /// If you need to handle these cases, use [`PublicContext::maybe_msg_sender`].\n pub fn msg_sender(self: Self) -> AztecAddress {\n self.context.maybe_msg_sender().unwrap()\n }\n\n /// Emits an event publicly.\n ///\n /// Public events are emitted as plaintext and are therefore visible to everyone. This is is the same as Solidity\n /// events on EVM chains.\n ///\n /// Unlike private events, they don't require delivery of an event message.\n ///\n /// # Example\n /// ```noir\n /// #[event]\n /// struct Update { value: Field }\n ///\n /// #[external(\"public\")]\n /// fn publish_update(value: Field) {\n /// self.emit(Update { value });\n /// }\n /// ```\n ///\n /// # Cost\n ///\n /// Public event emission is achieved by emitting public transaction logs. A total of `N+1` fields are emitted,\n /// where `N` is the serialization length of the event.\n pub fn emit<Event>(&mut self, event: Event)\n where\n Event: EventInterface + Serialize,\n {\n emit_event_in_public(self.context, event);\n }\n\n /// Makes a public contract call.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `call` - The object representing the public function to invoke.\n ///\n /// # Returns\n /// * `T` - Whatever data the called function has returned.\n ///\n /// # Example\n /// ```noir\n /// self.call(Token::at(address).transfer_in_public(recipient, amount));\n /// ```\n ///\n pub unconstrained fn call<let M: u32, let N: u32, T>(self, call: PublicCall<M, N, T>) -> T\n where\n T: Deserialize,\n {\n call.call(self.context)\n }\n\n /// Makes a public read-only contract call.\n ///\n /// This is similar to Solidity's `staticcall`. The called function cannot modify state or emit events. Any nested\n /// calls are constrained to also be static calls.\n ///\n /// Will revert if the called function reverts or runs out of gas.\n ///\n /// # Arguments\n /// * `call` - The object representing the read-only public function to invoke.\n ///\n /// # Returns\n /// * `T` - Whatever data the called function has returned.\n ///\n /// # Example\n /// ```noir\n /// self.view(Token::at(address).balance_of_public(recipient));\n /// ```\n ///\n pub unconstrained fn view<let M: u32, let N: u32, T>(self, call: PublicStaticCall<M, N, T>) -> T\n where\n T: Deserialize,\n {\n call.view(self.context)\n }\n}\n"
|
|
4008
3950
|
},
|
|
4009
|
-
"
|
|
3951
|
+
"77": {
|
|
3952
|
+
"function_locations": [
|
|
3953
|
+
{
|
|
3954
|
+
"name": "EphemeralArray<T>::at",
|
|
3955
|
+
"start": 1305
|
|
3956
|
+
},
|
|
3957
|
+
{
|
|
3958
|
+
"name": "EphemeralArray<T>::len",
|
|
3959
|
+
"start": 1438
|
|
3960
|
+
},
|
|
3961
|
+
{
|
|
3962
|
+
"name": "EphemeralArray<T>::push",
|
|
3963
|
+
"start": 1618
|
|
3964
|
+
},
|
|
3965
|
+
{
|
|
3966
|
+
"name": "EphemeralArray<T>::pop",
|
|
3967
|
+
"start": 1888
|
|
3968
|
+
},
|
|
3969
|
+
{
|
|
3970
|
+
"name": "EphemeralArray<T>::get",
|
|
3971
|
+
"start": 2176
|
|
3972
|
+
},
|
|
3973
|
+
{
|
|
3974
|
+
"name": "EphemeralArray<T>::set",
|
|
3975
|
+
"start": 2475
|
|
3976
|
+
},
|
|
3977
|
+
{
|
|
3978
|
+
"name": "EphemeralArray<T>::remove",
|
|
3979
|
+
"start": 2743
|
|
3980
|
+
},
|
|
3981
|
+
{
|
|
3982
|
+
"name": "EphemeralArray<T>::clear",
|
|
3983
|
+
"start": 3022
|
|
3984
|
+
},
|
|
3985
|
+
{
|
|
3986
|
+
"name": "EphemeralArray<T>::for_each",
|
|
3987
|
+
"start": 3593
|
|
3988
|
+
},
|
|
3989
|
+
{
|
|
3990
|
+
"name": "test::empty_array",
|
|
3991
|
+
"start": 3983
|
|
3992
|
+
},
|
|
3993
|
+
{
|
|
3994
|
+
"name": "test::empty_array_read",
|
|
3995
|
+
"start": 4280
|
|
3996
|
+
},
|
|
3997
|
+
{
|
|
3998
|
+
"name": "test::empty_array_pop",
|
|
3999
|
+
"start": 4550
|
|
4000
|
+
},
|
|
4001
|
+
{
|
|
4002
|
+
"name": "test::array_push",
|
|
4003
|
+
"start": 4783
|
|
4004
|
+
},
|
|
4005
|
+
{
|
|
4006
|
+
"name": "test::read_past_len",
|
|
4007
|
+
"start": 5122
|
|
4008
|
+
},
|
|
4009
|
+
{
|
|
4010
|
+
"name": "test::array_pop",
|
|
4011
|
+
"start": 5376
|
|
4012
|
+
},
|
|
4013
|
+
{
|
|
4014
|
+
"name": "test::array_set",
|
|
4015
|
+
"start": 5783
|
|
4016
|
+
},
|
|
4017
|
+
{
|
|
4018
|
+
"name": "test::array_remove_last",
|
|
4019
|
+
"start": 6081
|
|
4020
|
+
},
|
|
4021
|
+
{
|
|
4022
|
+
"name": "test::array_remove_some",
|
|
4023
|
+
"start": 6376
|
|
4024
|
+
},
|
|
4025
|
+
{
|
|
4026
|
+
"name": "test::array_remove_all",
|
|
4027
|
+
"start": 6847
|
|
4028
|
+
},
|
|
4029
|
+
{
|
|
4030
|
+
"name": "test::for_each_called_with_all_elements",
|
|
4031
|
+
"start": 7273
|
|
4032
|
+
},
|
|
4033
|
+
{
|
|
4034
|
+
"name": "test::for_each_remove_some",
|
|
4035
|
+
"start": 8009
|
|
4036
|
+
},
|
|
4037
|
+
{
|
|
4038
|
+
"name": "test::for_each_remove_all",
|
|
4039
|
+
"start": 8561
|
|
4040
|
+
},
|
|
4041
|
+
{
|
|
4042
|
+
"name": "test::different_slots_are_isolated",
|
|
4043
|
+
"start": 8960
|
|
4044
|
+
},
|
|
4045
|
+
{
|
|
4046
|
+
"name": "test::works_with_multi_field_type",
|
|
4047
|
+
"start": 9534
|
|
4048
|
+
},
|
|
4049
|
+
{
|
|
4050
|
+
"name": "test::clear_returns_self",
|
|
4051
|
+
"start": 10148
|
|
4052
|
+
},
|
|
4053
|
+
{
|
|
4054
|
+
"name": "test::clear_wipes_previous_data",
|
|
4055
|
+
"start": 10535
|
|
4056
|
+
}
|
|
4057
|
+
],
|
|
4058
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/ephemeral/mod.nr",
|
|
4059
|
+
"source": "use crate::oracle::ephemeral;\nuse crate::protocol::traits::{Deserialize, Serialize};\n\n/// A dynamically sized array that exists only during a single contract call frame.\n///\n/// Ephemeral arrays are backed by in-memory storage on the PXE side rather than a persistent database. Each contract\n/// call frame gets its own isolated slot space of ephemeral arrays. Child simulations cannot see the parent's\n/// ephemeral arrays, and vice versa.\n///\n/// Each logical array operation (push, pop, get, etc.) is a single oracle call, making ephemeral arrays significantly\n/// cheaper than capsule arrays.\n///\n/// ## Use Cases\n///\n/// Ephemeral arrays are designed for passing data between PXE (TypeScript) and contracts (Noir) during simulation,\n/// for example, note validation requests or event validation responses. This data type is appropriate for data that\n/// is not supposed to be persisted.\n///\n/// For data that needs to persist across simulations, contract calls, etc, use\n/// [`CapsuleArray`](crate::capsules::CapsuleArray) instead.\npub struct EphemeralArray<T> {\n pub slot: Field,\n}\n\nimpl<T> EphemeralArray<T> {\n /// Returns a handle to an ephemeral array at the given slot, which may already contain data (e.g. populated\n /// by an oracle).\n pub unconstrained fn at(slot: Field) -> Self {\n Self { slot }\n }\n\n /// Returns the number of elements stored in the array.\n pub unconstrained fn len(self) -> u32 {\n ephemeral::len_oracle(self.slot)\n }\n\n /// Stores a value at the end of the array.\n pub unconstrained fn push(self, value: T)\n where\n T: Serialize,\n {\n let serialized = value.serialize();\n let _ = ephemeral::push_oracle(self.slot, serialized);\n }\n\n /// Removes and returns the last element. Panics if the array is empty.\n pub unconstrained fn pop(self) -> T\n where\n T: Deserialize,\n {\n let serialized = ephemeral::pop_oracle(self.slot);\n Deserialize::deserialize(serialized)\n }\n\n /// Retrieves the value stored at `index`. Panics if the index is out of bounds.\n pub unconstrained fn get(self, index: u32) -> T\n where\n T: Deserialize,\n {\n let serialized = ephemeral::get_oracle(self.slot, index);\n Deserialize::deserialize(serialized)\n }\n\n /// Overwrites the value stored at `index`. Panics if the index is out of bounds.\n pub unconstrained fn set(self, index: u32, value: T)\n where\n T: Serialize,\n {\n let serialized = value.serialize();\n ephemeral::set_oracle(self.slot, index, serialized);\n }\n\n /// Removes the element at `index`, shifting subsequent elements backward. Panics if out of bounds.\n pub unconstrained fn remove(self, index: u32) {\n ephemeral::remove_oracle(self.slot, index);\n }\n\n /// Removes all elements from the array and returns self for chaining (e.g. `EphemeralArray::at(slot).clear()`\n /// to get a guaranteed-empty array at a given slot).\n pub unconstrained fn clear(self) -> Self {\n ephemeral::clear_oracle(self.slot);\n self\n }\n\n /// Calls a function on each element of the array.\n ///\n /// The function `f` is called once with each array value and its corresponding index. Iteration proceeds\n /// backwards so that it is safe to remove the current element (and only the current element) inside the\n /// callback.\n ///\n /// It is **not** safe to push new elements from inside the callback.\n pub unconstrained fn for_each<Env>(self, f: unconstrained fn[Env](u32, T) -> ())\n where\n T: Deserialize,\n {\n let mut i = self.len();\n while i > 0 {\n i -= 1;\n f(i, self.get(i));\n }\n }\n}\n\nmod test {\n use crate::test::helpers::test_environment::TestEnvironment;\n use crate::test::mocks::MockStruct;\n use super::EphemeralArray;\n\n global SLOT: Field = 1230;\n global OTHER_SLOT: Field = 5670;\n\n #[test]\n unconstrained fn empty_array() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array: EphemeralArray<Field> = EphemeralArray::at(SLOT);\n assert_eq(array.len(), 0);\n });\n }\n\n #[test(should_fail_with = \"out of bounds\")]\n unconstrained fn empty_array_read() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n let _: Field = array.get(0);\n });\n }\n\n #[test(should_fail_with = \"is empty\")]\n unconstrained fn empty_array_pop() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n let _: Field = array.pop();\n });\n }\n\n #[test]\n unconstrained fn array_push() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n array.push(5);\n\n assert_eq(array.len(), 1);\n assert_eq(array.get(0), 5);\n });\n }\n\n #[test(should_fail_with = \"out of bounds\")]\n unconstrained fn read_past_len() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n array.push(5);\n\n let _ = array.get(1);\n });\n }\n\n #[test]\n unconstrained fn array_pop() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n array.push(5);\n array.push(10);\n\n let popped: Field = array.pop();\n assert_eq(popped, 10);\n assert_eq(array.len(), 1);\n assert_eq(array.get(0), 5);\n });\n }\n\n #[test]\n unconstrained fn array_set() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n array.push(5);\n array.set(0, 99);\n assert_eq(array.get(0), 99);\n });\n }\n\n #[test]\n unconstrained fn array_remove_last() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n array.push(5);\n array.remove(0);\n assert_eq(array.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn array_remove_some() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n\n array.push(7);\n array.push(8);\n array.push(9);\n\n assert_eq(array.len(), 3);\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\n #[test]\n unconstrained fn array_remove_all() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(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\n #[test]\n unconstrained fn for_each_called_with_all_elements() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n let called_with = &mut BoundedVec::<(u32, Field), 3>::new();\n array.for_each(|index, value| { called_with.push((index, value)); });\n\n assert_eq(called_with.len(), 3);\n assert(called_with.any(|(index, value)| (index == 0) & (value == 4)));\n assert(called_with.any(|(index, value)| (index == 1) & (value == 5)));\n assert(called_with.any(|(index, value)| (index == 2) & (value == 6)));\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_some() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n array.for_each(|index, _| {\n if index == 1 {\n array.remove(index);\n }\n });\n\n assert_eq(array.len(), 2);\n assert_eq(array.get(0), 4);\n assert_eq(array.get(1), 6);\n });\n }\n\n #[test]\n unconstrained fn for_each_remove_all() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array = EphemeralArray::at(SLOT);\n\n array.push(4);\n array.push(5);\n array.push(6);\n\n array.for_each(|index, _| { array.remove(index); });\n\n assert_eq(array.len(), 0);\n });\n }\n\n #[test]\n unconstrained fn different_slots_are_isolated() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array_a = EphemeralArray::at(SLOT);\n let array_b = EphemeralArray::at(OTHER_SLOT);\n\n array_a.push(10);\n array_a.push(20);\n array_b.push(99);\n\n assert_eq(array_a.len(), 2);\n assert_eq(array_a.get(0), 10);\n assert_eq(array_a.get(1), 20);\n\n assert_eq(array_b.len(), 1);\n assert_eq(array_b.get(0), 99);\n });\n }\n\n #[test]\n unconstrained fn works_with_multi_field_type() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array: EphemeralArray<MockStruct> = EphemeralArray::at(SLOT);\n\n let a = MockStruct::new(5, 6);\n let b = MockStruct::new(7, 8);\n array.push(a);\n array.push(b);\n\n assert_eq(array.len(), 2);\n assert_eq(array.get(0), a);\n assert_eq(array.get(1), b);\n\n let popped: MockStruct = array.pop();\n assert_eq(popped, b);\n assert_eq(array.len(), 1);\n });\n }\n\n #[test]\n unconstrained fn clear_returns_self() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array: EphemeralArray<Field> = EphemeralArray::at(SLOT).clear();\n assert_eq(array.len(), 0);\n\n array.push(42);\n assert_eq(array.len(), 1);\n assert_eq(array.get(0), 42);\n });\n }\n\n #[test]\n unconstrained fn clear_wipes_previous_data() {\n let env = TestEnvironment::new();\n env.utility_context(|_| {\n let array: EphemeralArray<Field> = EphemeralArray::at(SLOT);\n array.push(1);\n array.push(2);\n array.push(3);\n assert_eq(array.len(), 3);\n\n // Clear the same slot, previous data should be gone.\n let fresh: EphemeralArray<Field> = EphemeralArray::at(SLOT).clear();\n assert_eq(fresh.len(), 0);\n fresh.push(4);\n assert_eq(fresh.get(0), 4);\n });\n }\n}\n"
|
|
4060
|
+
},
|
|
4061
|
+
"79": {
|
|
4010
4062
|
"function_locations": [
|
|
4011
4063
|
{
|
|
4012
4064
|
"name": "compute_private_event_commitment",
|
|
@@ -4028,37 +4080,37 @@
|
|
|
4028
4080
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/event/event_interface.nr",
|
|
4029
4081
|
"source": "use crate::{event::EventSelector, messages::logs::event::MAX_EVENT_SERIALIZED_LEN};\nuse crate::protocol::{\n constants::DOM_SEP__EVENT_COMMITMENT,\n hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_bounded_vec},\n traits::{Serialize, ToField},\n};\n\npub trait EventInterface {\n fn get_event_type_id() -> EventSelector;\n}\n\n/// A private event's commitment is a value stored on-chain which is used to verify that the event was indeed emitted.\n///\n/// It requires a `randomness` value that must be produced alongside the event in order to perform said validation.\n/// This random value prevents attacks in which someone guesses plausible events (e.g. 'Alice transfers to Bob an\n/// amount of 10'), since they will not be able to test for existence of their guessed events without brute-forcing the\n/// entire `Field` space by guessing `randomness` values.\npub fn compute_private_event_commitment<Event>(event: Event, randomness: Field) -> Field\nwhere\n Event: EventInterface + Serialize,\n{\n poseidon2_hash_with_separator(\n [randomness, Event::get_event_type_id().to_field()].concat(event.serialize()),\n DOM_SEP__EVENT_COMMITMENT,\n )\n}\n\n/// Unconstrained variant of [`compute_private_event_commitment`] which takes the event in serialized form.\n///\n/// This function is unconstrained as the mechanism it uses to compute the commitment would be very inefficient in a\n/// constrained environment (due to the hashing of a dynamically sized array). This is not an issue as it is typically\n/// invoked when processing event messages, which is an unconstrained operation.\npub unconstrained fn compute_private_serialized_event_commitment(\n serialized_event: BoundedVec<Field, MAX_EVENT_SERIALIZED_LEN>,\n randomness: Field,\n event_type_id: Field,\n) -> Field {\n let mut commitment_preimage =\n BoundedVec::<_, 2 + MAX_EVENT_SERIALIZED_LEN>::from_array([randomness, event_type_id]);\n commitment_preimage.extend_from_bounded_vec(serialized_event);\n\n poseidon2_hash_with_separator_bounded_vec(commitment_preimage, DOM_SEP__EVENT_COMMITMENT)\n}\n\nmod test {\n use crate::event::event_interface::{\n compute_private_event_commitment, compute_private_serialized_event_commitment, EventInterface,\n };\n use crate::messages::logs::event::MAX_EVENT_SERIALIZED_LEN;\n use crate::protocol::traits::{Serialize, ToField};\n use crate::test::mocks::mock_event::MockEvent;\n\n global VALUE: Field = 7;\n global RANDOMNESS: Field = 10;\n\n #[test]\n unconstrained fn max_size_serialized_event_commitment() {\n let serialized_event = BoundedVec::from_array([0; MAX_EVENT_SERIALIZED_LEN]);\n let _ = compute_private_serialized_event_commitment(serialized_event, 0, 0);\n }\n\n #[test]\n unconstrained fn event_commitment_equivalence() {\n let event = MockEvent::new(VALUE).build_event();\n\n assert_eq(\n compute_private_event_commitment(event, RANDOMNESS),\n compute_private_serialized_event_commitment(\n BoundedVec::from_array(event.serialize()),\n RANDOMNESS,\n MockEvent::get_event_type_id().to_field(),\n ),\n );\n }\n}\n"
|
|
4030
4082
|
},
|
|
4031
|
-
"
|
|
4083
|
+
"81": {
|
|
4032
4084
|
"function_locations": [
|
|
4033
4085
|
{
|
|
4034
4086
|
"name": "<impl FromField for EventSelector>::from_field",
|
|
4035
|
-
"start":
|
|
4087
|
+
"start": 337
|
|
4036
4088
|
},
|
|
4037
4089
|
{
|
|
4038
4090
|
"name": "<impl ToField for EventSelector>::to_field",
|
|
4039
|
-
"start":
|
|
4091
|
+
"start": 449
|
|
4040
4092
|
},
|
|
4041
4093
|
{
|
|
4042
4094
|
"name": "<impl Empty for EventSelector>::empty",
|
|
4043
|
-
"start":
|
|
4095
|
+
"start": 542
|
|
4044
4096
|
},
|
|
4045
4097
|
{
|
|
4046
4098
|
"name": "EventSelector::from_u32",
|
|
4047
|
-
"start":
|
|
4099
|
+
"start": 647
|
|
4048
4100
|
},
|
|
4049
4101
|
{
|
|
4050
4102
|
"name": "EventSelector::from_signature",
|
|
4051
|
-
"start":
|
|
4103
|
+
"start": 751
|
|
4052
4104
|
},
|
|
4053
4105
|
{
|
|
4054
4106
|
"name": "EventSelector::zero",
|
|
4055
|
-
"start":
|
|
4107
|
+
"start": 985
|
|
4056
4108
|
}
|
|
4057
4109
|
],
|
|
4058
4110
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/event/event_selector.nr",
|
|
4059
|
-
"source": "use crate::protocol::{hash::poseidon2_hash_bytes, traits::{Deserialize, Empty, FromField, Serialize, ToField}};\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct EventSelector {\n //
|
|
4111
|
+
"source": "use crate::protocol::{hash::poseidon2_hash_bytes, traits::{Deserialize, Empty, FromField, Serialize, ToField}};\n\n#[derive(Deserialize, Eq, Serialize)]\npub struct EventSelector {\n // Low 32 bits of the poseidon2 hash of the event signature.\n inner: u32,\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 = 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"
|
|
4060
4112
|
},
|
|
4061
|
-
"
|
|
4113
|
+
"94": {
|
|
4062
4114
|
"function_locations": [
|
|
4063
4115
|
{
|
|
4064
4116
|
"name": "derive_ecdh_shared_secret",
|
|
@@ -4095,6 +4147,76 @@
|
|
|
4095
4147
|
],
|
|
4096
4148
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/keys/ecdh_shared_secret.nr",
|
|
4097
4149
|
"source": "use crate::protocol::{\n address::aztec_address::AztecAddress,\n constants::{DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET, DOM_SEP__ECDH_FIELD_MASK, DOM_SEP__ECDH_SUBKEY},\n hash::poseidon2_hash_with_separator,\n point::Point,\n scalar::Scalar,\n traits::{FromField, ToField},\n};\nuse std::{embedded_curve_ops::multi_scalar_mul, ops::Neg};\n\n/// Computes a standard ECDH shared secret: secret * public_key = shared_secret.\n///\n/// The input secret is known only to one party. The output shared secret can be derived given knowledge of\n/// `public_key`'s key-pair and the public ephemeral secret, using this same function (with reversed inputs).\n///\n/// E.g.: Epk = esk * G // ephemeral key-pair\n/// Pk = sk * G // recipient key-pair\n/// Shared secret S = esk * Pk = sk * Epk\n///\n/// See also: https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman\npub fn derive_ecdh_shared_secret(secret: Scalar, public_key: Point) -> Point {\n multi_scalar_mul([public_key], [secret])\n}\n\n/// Computes an app-siloed shared secret from a raw ECDH shared secret point and a contract address.\n///\n/// `s_app = h(DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET, S.x, S.y, contract_address)`\npub(crate) fn compute_app_siloed_shared_secret(shared_secret: Point, contract_address: AztecAddress) -> Field {\n poseidon2_hash_with_separator(\n [shared_secret.x, shared_secret.y, contract_address.to_field()],\n DOM_SEP__APP_SILOED_ECDH_SHARED_SECRET,\n )\n}\n\n/// Derives an indexed subkey from an app-siloed shared secret, used for AES key/IV derivation.\n///\n/// `s_i = h(DOM_SEP__ECDH_SUBKEY + i, s_app)`\npub(crate) fn derive_shared_secret_subkey(s_app: Field, index: u32) -> Field {\n poseidon2_hash_with_separator([s_app], DOM_SEP__ECDH_SUBKEY + index)\n}\n\n/// Derives an indexed field mask from an app-siloed shared secret, used for masking ciphertext fields.\n///\n/// `m_i = h(DOM_SEP__ECDH_FIELD_MASK + i, s_app)`\npub(crate) fn derive_shared_secret_field_mask(s_app: Field, index: u32) -> Field {\n poseidon2_hash_with_separator([s_app], DOM_SEP__ECDH_FIELD_MASK + index)\n}\n\n#[test]\nunconstrained fn test_consistency_with_typescript() {\n let secret = Scalar {\n lo: 0x00000000000000000000000000000000649e7ca01d9de27b21624098b897babd,\n hi: 0x0000000000000000000000000000000023b3127c127b1f29a7adff5cccf8fb06,\n };\n let point = Point {\n x: 0x2688431c705a5ff3e6c6f2573c9e3ba1c1026d2251d0dbbf2d810aa53fd1d186,\n y: 0x1e96887b117afca01c00468264f4f80b5bb16d94c1808a448595f115556e5c8e,\n is_infinite: false,\n };\n\n let shared_secret = derive_ecdh_shared_secret(secret, point);\n\n // This is just pasted from a test run. The original typescript code from which this could be generated seems to\n // have been deleted by someone, and soon the typescript code for encryption and decryption won't be needed, so\n // this will have to do.\n let hard_coded_shared_secret = Point {\n x: 0x15d55a5b3b2caa6a6207f313f05c5113deba5da9927d6421bcaa164822b911bc,\n y: 0x0974c3d0825031ae933243d653ebb1a0b08b90ee7f228f94c5c74739ea3c871e,\n is_infinite: false,\n };\n assert_eq(shared_secret, hard_coded_shared_secret);\n}\n\n#[test]\nunconstrained fn test_shared_secret_computation_in_both_directions() {\n let secret_a = Scalar { lo: 0x1234, hi: 0x2345 };\n let secret_b = Scalar { lo: 0x3456, hi: 0x4567 };\n\n let pk_a = std::embedded_curve_ops::fixed_base_scalar_mul(secret_a);\n let pk_b = std::embedded_curve_ops::fixed_base_scalar_mul(secret_b);\n\n let shared_secret = derive_ecdh_shared_secret(secret_a, pk_b);\n let shared_secret_alt = derive_ecdh_shared_secret(secret_b, pk_a);\n\n assert_eq(shared_secret, shared_secret_alt);\n}\n\n#[test]\nunconstrained fn test_shared_secret_computation_from_address_in_both_directions() {\n let secret_a = Scalar { lo: 0x1234, hi: 0x2345 };\n let secret_b = Scalar { lo: 0x3456, hi: 0x4567 };\n\n let mut pk_a = std::embedded_curve_ops::fixed_base_scalar_mul(secret_a);\n let mut pk_b = std::embedded_curve_ops::fixed_base_scalar_mul(secret_b);\n\n let address_b = AztecAddress::from_field(pk_b.x);\n\n // We were lazy in deriving the secret keys, and didn't check the resulting y-coordinates of the pk_a or pk_b to be\n // less than half the field modulus. If needed, we negate the pk's so that they yield valid address points. (We\n // could also have negated the secrets, but there's no negate method for EmbeddedCurvesScalar).\n pk_a = if (AztecAddress::from_field(pk_a.x).to_address_point().unwrap().inner == pk_a) {\n pk_a\n } else {\n pk_a.neg()\n };\n pk_b = if (address_b.to_address_point().unwrap().inner == pk_b) {\n pk_b\n } else {\n pk_b.neg()\n };\n\n let shared_secret = derive_ecdh_shared_secret(secret_a, address_b.to_address_point().unwrap().inner);\n let shared_secret_alt = derive_ecdh_shared_secret(secret_b, pk_a);\n\n assert_eq(shared_secret, shared_secret_alt);\n}\n\n#[test]\nunconstrained fn test_app_siloed_shared_secret_differs_per_contract() {\n let secret_a = Scalar { lo: 0x1234, hi: 0x2345 };\n let pk_b = std::embedded_curve_ops::fixed_base_scalar_mul(Scalar { lo: 0x3456, hi: 0x4567 });\n\n let shared_secret = derive_ecdh_shared_secret(secret_a, pk_b);\n\n let contract_a = AztecAddress::from_field(0xAAAA);\n let contract_b = AztecAddress::from_field(0xBBBB);\n\n let s_app_a = compute_app_siloed_shared_secret(shared_secret, contract_a);\n let s_app_b = compute_app_siloed_shared_secret(shared_secret, contract_b);\n\n assert(s_app_a != s_app_b, \"app-siloed secrets must differ for different contracts\");\n}\n"
|
|
4150
|
+
},
|
|
4151
|
+
"99": {
|
|
4152
|
+
"function_locations": [
|
|
4153
|
+
{
|
|
4154
|
+
"name": "log_prefix",
|
|
4155
|
+
"start": 525
|
|
4156
|
+
},
|
|
4157
|
+
{
|
|
4158
|
+
"name": "aztecnr_fatal_log",
|
|
4159
|
+
"start": 717
|
|
4160
|
+
},
|
|
4161
|
+
{
|
|
4162
|
+
"name": "aztecnr_error_log",
|
|
4163
|
+
"start": 943
|
|
4164
|
+
},
|
|
4165
|
+
{
|
|
4166
|
+
"name": "aztecnr_warn_log",
|
|
4167
|
+
"start": 1168
|
|
4168
|
+
},
|
|
4169
|
+
{
|
|
4170
|
+
"name": "aztecnr_info_log",
|
|
4171
|
+
"start": 1392
|
|
4172
|
+
},
|
|
4173
|
+
{
|
|
4174
|
+
"name": "aztecnr_verbose_log",
|
|
4175
|
+
"start": 1619
|
|
4176
|
+
},
|
|
4177
|
+
{
|
|
4178
|
+
"name": "aztecnr_debug_log",
|
|
4179
|
+
"start": 1847
|
|
4180
|
+
},
|
|
4181
|
+
{
|
|
4182
|
+
"name": "aztecnr_trace_log",
|
|
4183
|
+
"start": 2073
|
|
4184
|
+
},
|
|
4185
|
+
{
|
|
4186
|
+
"name": "aztecnr_fatal_log_format",
|
|
4187
|
+
"start": 2367
|
|
4188
|
+
},
|
|
4189
|
+
{
|
|
4190
|
+
"name": "aztecnr_error_log_format",
|
|
4191
|
+
"start": 2622
|
|
4192
|
+
},
|
|
4193
|
+
{
|
|
4194
|
+
"name": "aztecnr_warn_log_format",
|
|
4195
|
+
"start": 2876
|
|
4196
|
+
},
|
|
4197
|
+
{
|
|
4198
|
+
"name": "aztecnr_info_log_format",
|
|
4199
|
+
"start": 3129
|
|
4200
|
+
},
|
|
4201
|
+
{
|
|
4202
|
+
"name": "aztecnr_verbose_log_format",
|
|
4203
|
+
"start": 3385
|
|
4204
|
+
},
|
|
4205
|
+
{
|
|
4206
|
+
"name": "aztecnr_debug_log_format",
|
|
4207
|
+
"start": 3642
|
|
4208
|
+
},
|
|
4209
|
+
{
|
|
4210
|
+
"name": "aztecnr_trace_log_format",
|
|
4211
|
+
"start": 3897
|
|
4212
|
+
},
|
|
4213
|
+
{
|
|
4214
|
+
"name": "resolve_fn",
|
|
4215
|
+
"start": 4151
|
|
4216
|
+
}
|
|
4217
|
+
],
|
|
4218
|
+
"path": "/home/aztec-dev/aztec-packages/noir-projects/aztec-nr/aztec/src/logging.nr",
|
|
4219
|
+
"source": "// Not all log levels are currently used, but we provide the full set so that new call sites can use any level. Because\n// of that we tag all with `#[allow(dead_code)]` to prevent warnings.\n//\n// All wrappers resolve function paths at comptime via `resolve_fn` so that the emitted `Quoted` code works both inside\n// aztec-nr (where `crate::` = aztec) and inside macro-generated contract code (where `crate::` = the contract).\n\nuse std::meta::ctstring::AsCtString;\n\ncomptime fn log_prefix<let N: u32>(msg: str<N>) -> CtString {\n \"[aztec-nr] \".as_ctstring().append_str(msg)\n}\n\n// --- No-args variants (direct call) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log });\n quote { $f($msg) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log });\n quote { $f($msg) }\n}\n\n// --- Format variants (return lambda for runtime args) ---\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_fatal_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::fatal_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_error_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::error_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_warn_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::warn_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_info_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::info_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_verbose_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::verbose_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_debug_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::debug_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n#[allow(dead_code)]\npub(crate) comptime fn aztecnr_trace_log_format<let N: u32>(msg: str<N>) -> Quoted {\n let msg = log_prefix(msg);\n let f = resolve_fn(quote { crate::protocol::logging::trace_log_format });\n quote { (|args| $f($msg, args)) }\n}\n\n// See module-level comment for why this is needed.\ncomptime fn resolve_fn(path: Quoted) -> TypedExpr {\n path.as_expr().unwrap().resolve(Option::none())\n}\n"
|
|
4098
4220
|
}
|
|
4099
4221
|
}
|
|
4100
4222
|
}
|