Commit 22ad5a5
feat: View functions with static context enforcing (AztecProtocol#6338)
Closes AztecProtocol#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 <[email protected]>1 parent e5cc9dc commit 22ad5a5
89 files changed
Lines changed: 1391 additions & 493 deletions
File tree
- barretenberg/cpp/src/barretenberg/vm/avm_trace
- docs
- docs
- static/img
- l1-contracts/src/core/libraries
- noir-projects
- aztec-nr
- authwit/src/entrypoint
- aztec/src
- context
- inputs
- noir-contracts
- contracts
- app_subscription_contract/src
- avm_nested_calls_test_contract/src
- avm_test_contract/src
- crowdfunding_contract/src
- docs_example_contract/src
- lending_contract/src
- price_feed_contract/src
- static_child_contract
- src
- static_parent_contract
- src
- uniswap_contract/src
- noir-protocol-circuits/crates/types/src
- abis
- tests/fixtures
- transaction
- noir/noir-repo/aztec_macros/src
- transforms
- utils
- yarn-project
- aztec.js/src
- contract
- entrypoint
- fee
- wallet
- circuit-types/src
- interfaces
- tx
- circuits.js/src
- contract
- structs
- __snapshots__
- tests
- end-to-end/src
- e2e_fees
- fixtures
- entrypoints/src
- foundation/src/abi
- noir-protocol-circuits-types/src
- pxe/src/pxe_service
- test
- simulator/src
- avm
- client
- common
- mocks
- public
- types/src
- abi
- noir
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
9 | 45 | | |
10 | 46 | | |
11 | 47 | | |
12 | 48 | | |
13 | 49 | | |
14 | 50 | | |
15 | | - | |
| 51 | + | |
| 52 | + | |
16 | 53 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 54 | + | |
| 55 | + | |
21 | 56 | | |
22 | | - | |
| 57 | + | |
| 58 | + | |
23 | 59 | | |
24 | 60 | | |
25 | 61 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
9 | | - | |
| 8 | + | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
0 commit comments