Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information