Commit 6a29c37
AztecBot
feat(avm): add AvmContextInputs (AztecProtocol/aztec-packages#5396)
NOTE: I don't know why this triggered a change in the snapshot.
---
This structure lets us easily pass things from the (TS) context to the constructor of the `AvmContext` in Noir, using `calldata` as a vehicle (effectively adding them as public inputs).
The choice to add the structure to the function arguments as LAST and not first is because adding them first would break any non-noir-generated bytecode (since they would have to shift their expected calldata by a magic number `N = sizeof(AvmContextInputs)`). Putting it last, makes it transparent for them. A calldatacopy would still work.
However, having this makes any external call always have `AvmContextInputs` in the calldata, bloating it (on chain) for non-noir-generated bytecode. This is not an issue now.
For the moment, this is temporary, but might be useful long term. (Sean mentioned passing maybe env getters like this).
---
Implemented `AvmContext.selector()` and `AvmContext.get_args_hash()` using the above.2 files changed
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
356 | 363 | | |
357 | 364 | | |
358 | 365 | | |
359 | 366 | | |
360 | | - | |
| 367 | + | |
361 | 368 | | |
362 | 369 | | |
363 | 370 | | |
| |||
0 commit comments