Skip to content

Commit 779327a

Browse files
authored
chore(docs): update migration notes relevant to v2.0.2 (#17147)
updates the migration notes in the docs. also fixes the background highlight color for dark mode search
2 parents aa31516 + 0d921ab commit 779327a

File tree

3 files changed

+59
-48
lines changed

3 files changed

+59
-48
lines changed

docs/docs/migration_notes.md

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,6 @@ Aztec is in full-speed development. Literally every version breaks compatibility
99

1010
## TBD
1111

12-
## [Public functions]
13-
14-
The L2 gas cost of the different AVM opcodes have been updated to reflect more realistic proving costs. Developers should review the L2 gas costs of executing public functions and reevaluate any hardcoded L2 gas limits.
15-
16-
## [Aztec Tools]
17-
18-
### Contract compilation now requires two steps
19-
20-
The `aztec-nargo` command is now a direct pass-through to vanilla nargo, without any special compilation flags or postprocessing. Contract compilation for Aztec now requires two explicit steps:
21-
22-
1. Compile your contracts with `aztec-nargo compile`
23-
2. Run postprocessing with the new `aztec-postprocess-contract` command
24-
25-
The postprocessing step includes:
26-
27-
- Transpiling functions for the Aztec VM
28-
- Generating verification keys for private functions
29-
- Caching verification keys for faster subsequent compilations
30-
31-
Update your build scripts accordingly:
32-
33-
```diff
34-
- aztec-nargo compile
35-
+ aztec-nargo compile
36-
+ aztec-postprocess-contract
37-
```
38-
39-
If you're using the `aztec-up` installer, the `aztec-postprocess-contract` command will be automatically installed alongside `aztec-nargo`.
40-
41-
## [Aztec.js] Mandatory `from`
42-
43-
As we prepare for a bigger `Wallet` interface refactor and the upcoming `WalletSDK`, a new parameter has been added to contract interactions, which now should indicate _explicitly_ the address of the entrypoint (usually the account contract) that will be used to authenticate the request. This will be checked in runtime against the current `this.wallet.getAddress()` value, to ensure consistent behavior while the rest of the API is reworked.
44-
45-
```diff
46-
- await contract.methods.my_func(arg).send().wait();
47-
+ await contract.methods.my_func(arg).send({ from: account1Address }).wait();
48-
```
49-
5012
## [Aztec.nr]
5113

5214
### Historical block renamed as anchor block
@@ -58,7 +20,7 @@ This naming change resulted in quite a few changes and if you've access private
5820
```diff
5921
- let header = context.get_block_header();
6022
+ let header = context.get_anchor_block_header();
61-
```diff
23+
```
6224

6325
### PrivateMutable: replace / initialize_or_replace behaviour change
6426

@@ -92,7 +54,6 @@ This makes it easy and efficient to handle both initialization and current value
9254
+ storage.my_var.initialize_or_replace(|opt_current: Option<Note>| opt_current.unwrap_or(0 /* initial value */) + 1);
9355
```
9456

95-
9657
- The callback can be a closure (inline) or a named function.
9758
- Any previous assumptions that replace simply inserts a new_note directly must be updated.
9859

@@ -162,6 +123,48 @@ Then update the emissions:
162123
+ storage.balances.at(owner).insert(note).emit(&mut context, context.msg_sender(), MessageDelivery.UNCONSTRAINED_OFFCHAIN);
163124
```
164125

126+
## 2.0.2
127+
128+
## [Public functions]
129+
130+
The L2 gas cost of the different AVM opcodes have been updated to reflect more realistic proving costs. Developers should review the L2 gas costs of executing public functions and reevaluate any hardcoded L2 gas limits.
131+
132+
## [Aztec Tools]
133+
134+
### Contract compilation now requires two steps
135+
136+
The `aztec-nargo` command is now a direct pass-through to vanilla nargo, without any special compilation flags or postprocessing. Contract compilation for Aztec now requires two explicit steps:
137+
138+
1. Compile your contracts with `aztec-nargo compile`
139+
2. Run postprocessing with the new `aztec-postprocess-contract` command
140+
141+
The postprocessing step includes:
142+
143+
- Transpiling functions for the Aztec VM
144+
- Generating verification keys for private functions
145+
- Caching verification keys for faster subsequent compilations
146+
147+
Update your build scripts accordingly:
148+
149+
```diff
150+
- aztec-nargo compile
151+
+ aztec-nargo compile
152+
+ aztec-postprocess-contract
153+
```
154+
155+
If you're using the `aztec-up` installer, the `aztec-postprocess-contract` command will be automatically installed alongside `aztec-nargo`.
156+
157+
## [Aztec.js] Mandatory `from`
158+
159+
As we prepare for a bigger `Wallet` interface refactor and the upcoming `WalletSDK`, a new parameter has been added to contract interactions, which now should indicate _explicitly_ the address of the entrypoint (usually the account contract) that will be used to authenticate the request. This will be checked in runtime against the current `this.wallet.getAddress()` value, to ensure consistent behavior while the rest of the API is reworked.
160+
161+
```diff
162+
- await contract.methods.my_func(arg).send().wait();
163+
+ await contract.methods.my_func(arg).send({ from: account1Address }).wait();
164+
```
165+
166+
## [Aztec.nr]
167+
165168
### `emit_event_in_public_log` function renamed as `emit_event_in_public`
166169

167170
This change was done to make the naming consistent with the private counterpart (`emit_event_in_private`).
@@ -316,7 +319,7 @@ The `private` and `public` methods are gone. Private, public and utility context
316319

317320
The following are two tests using the older version of `TestEnvironment`:
318321

319-
```noir
322+
```rust
320323
#[test]
321324
unconstrained fn initial_empty_value() {
322325
let mut env = TestEnvironment::new();
@@ -356,7 +359,7 @@ unconstrained fn non_admin_cannot_set_authorized() {
356359

357360
These now look like this:
358361

359-
```noir
362+
```rust
360363
#[test]
361364
unconstrained fn authorized_initially_unset() {
362365
let mut env = TestEnvironment::new();
@@ -1152,7 +1155,7 @@ This is a breaking change because we now require `Packable` trait implementation
11521155

11531156
Example implementation of Packable trait for `U128` type from `noir::std`:
11541157

1155-
```
1158+
```rust
11561159
use crate::traits::{Packable, ToField};
11571160

11581161
let U128_PACKED_LEN: u32 = 1;

docs/src/css/custom.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@
118118
--brand-background: #1a1400;
119119
--ifm-font-color-base: #f2eee1;
120120
background: #1a1400;
121+
122+
/* Dark theme Typesense/DocSearch contrast improvements */
123+
--docsearch-modal-background: #1a1400;
124+
--docsearch-hit-background: #a9cc1f;
125+
--docsearch-highlight-color: #a9cc1f;
126+
--docsearch-text-color: #f2eee1;
127+
--docsearch-muted-color: #999;
128+
--docsearch-searchbox-focus-background: #2a2000;
121129
}
122130

123131
[data-theme="dark"] .footer {
@@ -405,4 +413,4 @@ html[data-theme="dark"] .sidebar-divider {
405413

406414
.badge {
407415
border-radius: unset;
408-
}
416+
}

docs/versioned_docs/version-v2.0.2/migration_notes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags: [migration, updating, sandbox]
77

88
Aztec is in full-speed development. Literally every version breaks compatibility with the previous ones. This page attempts to target errors and difficulties you might encounter when upgrading, and how to resolve them.
99

10-
## TBD
10+
## 2.0.2
1111

1212
## [Aztec Tools]
1313

@@ -56,9 +56,9 @@ The private event emission API has been significantly reworked to provide cleare
5656
1. `emit_event_in_private_log` has been renamed to `emit_event_in_private` and now takes a `delivery_mode` parameter instead of `constraints`
5757
2. `emit_event_as_offchain_message` has been removed in favor of using `emit_event_in_private` with `MessageDelivery.UNCONSTRAINED_OFFCHAIN`
5858
3. `PrivateLogContent` enum has been replaced with `MessageDelivery` enum with the following values:
59-
- `CONSTRAINED_ONCHAIN`: For onchain delivery with cryptographic guarantees (replaces `CONSTRAINED_ENCRYPTION`)
60-
- `UNCONSTRAINED_OFFCHAIN`: For offchain delivery without constraints
61-
- `UNCONSTRAINED_ONCHAIN`: For onchain delivery without constraints (replaces `NO_CONSTRAINTS`)
59+
- `CONSTRAINED_ONCHAIN`: For onchain delivery with cryptographic guarantees that recipients can discover and decrypt messages. Uses constrained encryption but is slower to prove. Best for critical messages that contracts need to verify.
60+
- `UNCONSTRAINED_ONCHAIN`: For onchain delivery without encryption constraints. Faster proving but trusts the sender. Good when the sender is incentivized to perform encryption correctly (e.g. they are buying something and will only get it if the recipient sees the note). No guarantees that recipients will be able to find or decrypt messages.
61+
- `UNCONSTRAINED_OFFCHAIN`: For offchain delivery (e.g. cloud storage) without constraints. Lowest cost since no onchain storage needed. Requires custom infrastructure for delivery. No guarantees that messages will be delivered or that recipients will ever find them.
6262

6363
### Contract functions can no longer be `pub` or `pub(crate)`
6464

0 commit comments

Comments
 (0)