-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: View functions with static context enforcing (#6338)
Closes #6078 Introduces the `#[aztec(view)]` (open to different naming, @spalladino @rahul-kothari ) modifier to functions, that forces them to be executed in an static context. It also forces generation of a "static only" `CallInterface` for them, trying to spare users from making regular calls to them. ~~Need input from the AVM team (@dbanks12 @fcarreiro) on how to implement the concept in the AVMContext.~~ In order to support direct simulated calls to view functions, the simulate method has been modified to go through the account entrypoint, which has led to implementing retrieval of return values through the whole callstack instead of just taking the latest one. Also adds the ability to navigate from contract interfaces to their implementations via LSP! --------- Co-authored-by: dbanks12 <david@aztecprotocol.com>
- Loading branch information
1 parent
5261908
commit e83aaea
Showing
4 changed files
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x000a14ed4120f2ca2accd5c2df2725a5df0f0b47284b4637ce1ab130993b4275>`; | ||
exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x29d77b0175116357d39252de002a2944652f87ccb4404f9346bff6d44f020f7f>`; | ||
|
||
exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x068d19438d3d8c62c31d9a2698171613193b61111cc572c812c312a2d2e93cea>`; | ||
exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x00c30fa28e1ab0d35bd0eaa591f469b7f9b92bc37aa5696eaf447b88ad331339>`; |
8 changes: 4 additions & 4 deletions
8
yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x2dcb7f5edd8b3268a64870512e0df631ddbd7cfcf1f836d46c3d1694220f5a42"`; | ||
exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x1bda75e8d4cf46fd126d14d6e28d1dc8ff3860b49ff59edd7da8bfeee909aef3"`; | ||
|
||
exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x22f08643eefc9bf59f16b025bb942a8635d2d7df183514bd2fd12dc79745beb5"`; | ||
exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x0230a99218df238d4a28664ee700e10a4fdfe98e4a2f5c678bce8c95d5fa04b1"`; | ||
|
||
exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x143088c82c9c2ee67c8a608a3692c6aa65f3825db9305e7af13277ddcb78ee41>`; | ||
exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x2328377f64bffa61d6a773e688b4b217b1dca488b8f905d94effe3fbc968111c>`; | ||
|
||
exports[`PublicCallStackItem computes hash 1`] = `Fr<0x035771f894adb10988cd2ee8754f7d06825b530e488fc4354420c9c6ea5cba77>`; | ||
exports[`PublicCallStackItem computes hash 1`] = `Fr<0x20506d5ffb519b1e5763fdfe3c3f84cd6292585bacd024eccca04e31b17b4cfc>`; |