Skip to content

Commit f943cad

Browse files
vezenovmAztecBot
andauthored
refactor(aztec-nr)!: move messages::message_delivery to messages::delivery (#23875)
Pure module move to make reviewing #23865 easier. In #23865 we update the MessageDeliver builder API. Once this merges, #23865 gets rebased on top so its diff shows only the API delta. - Renames `aztec/src/messages/message_delivery.nr` to `aztec/src/messages/delivery/mod.nr` - Updates every import and doc-link site - No behavior change and no API change; - New `## TBD` migration note for the module move, and the existing TBD `set_sender_for_tags` entry updated to the new path. - Regenerated the two contract snapshots affected by the move (`invalid_event` stderr, `token_contract` expanded). Top of stack. Next is #23865 --------- Co-authored-by: AztecBot <tech@aztec-labs.com>
1 parent ad12d0f commit f943cad

64 files changed

Lines changed: 274 additions & 788 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

boxes/boxes/react/src/contracts/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use aztec::macros::aztec;
44
contract BoxReact {
55
use aztec::{
66
macros::{functions::{external, initializer}, storage::storage},
7-
messages::message_delivery::MessageDelivery,
7+
messages::delivery::MessageDelivery,
88
protocol::address::AztecAddress,
99
state_vars::{Owned, PrivateMutable},
1010
};

boxes/boxes/vite/src/contracts/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use aztec::macros::aztec;
44
contract BoxReact {
55
use aztec::{
66
macros::{functions::{external, initializer}, storage::storage},
7-
messages::message_delivery::MessageDelivery,
7+
messages::delivery::MessageDelivery,
88
protocol::address::AztecAddress,
99
state_vars::{Owned, PrivateMutable},
1010
};

docs/docs-developers/docs/aztec-nr/framework-description/events_and_logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct Transfer {
3030
In private functions, emit events using `self.emit()` and deliver them to recipients:
3131

3232
```rust
33-
use aztec::messages::message_delivery::MessageDelivery;
33+
use aztec::messages::delivery::MessageDelivery;
3434

3535
#[external("private")]
3636
fn transfer(to: AztecAddress, amount: u128) {

docs/docs-developers/docs/aztec-nr/framework-description/note_delivery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ When you create a note using state variables like `PrivateMutable`, `PrivateSet`
2222
```rust
2323
#[aztec]
2424
pub contract PrivateToken {
25-
use aztec::messages::message_delivery::MessageDelivery;
25+
use aztec::messages::delivery::MessageDelivery;
2626

2727
#[external("private")]
2828
fn mint(amount: u128, recipient: AztecAddress) {

docs/docs-developers/docs/aztec-nr/framework-description/state_variables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ When working with private state variables, many operations return a `NoteMessage
273273
#### Delivery Methods
274274

275275
Private notes need to be communicated to their recipients so they know the note exists and can use it. The [`NoteMessage`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/note/struct.NoteMessage) wrapper forces you to make an explicit choice about how this happens:
276-
- [`MessageDelivery::onchain_constrained()`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/messages/message_delivery/global.MessageDelivery): Verified in the circuit (most secure, but highest cost) - Use when the sender cannot be trusted to deliver correctly (e.g., protocol fees, multisig config updates). **Warning:** Currently [not fully constrained](https://github.com/AztecProtocol/aztec-packages/issues/14565) - the log's tag is unconstrained.
277-
- [`MessageDelivery::onchain_unconstrained()`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/messages/message_delivery/global.MessageDelivery): Message stored onchain but no guarantees on content - Use when the sender is incentivized to deliver correctly but may not have an offchain channel to the recipient.
278-
- [`MessageDelivery::offchain()`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/messages/message_delivery/global.MessageDelivery): Lowest cost, no onchain data - Use when the sender and recipient can communicate and the sender is incentivized to deliver correctly.
276+
- [`MessageDelivery::onchain_constrained()`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/messages/delivery/global.MessageDelivery): Verified in the circuit (most secure, but highest cost) - Use when the sender cannot be trusted to deliver correctly (e.g., protocol fees, multisig config updates). **Warning:** Currently [not fully constrained](https://github.com/AztecProtocol/aztec-packages/issues/14565) - the log's tag is unconstrained.
277+
- [`MessageDelivery::onchain_unconstrained()`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/messages/delivery/global.MessageDelivery): Message stored onchain but no guarantees on content - Use when the sender is incentivized to deliver correctly but may not have an offchain channel to the recipient.
278+
- [`MessageDelivery::offchain()`](pathname:///aztec-nr-api/#api_ref_version/noir_aztec/messages/delivery/global.MessageDelivery): Lowest cost, no onchain data - Use when the sender and recipient can communicate and the sender is incentivized to deliver correctly.
279279

280280
#include_code note_delivery /noir-projects/noir-contracts/contracts/app/private_token_contract/src/main.nr rust
281281

docs/docs-developers/docs/resources/migration_notes.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ Aztec is in active development. Each version may introduce breaking changes that
99

1010
## TBD
1111

12+
### [Aztec.nr] `messages::message_delivery` module moved to `messages::delivery`
13+
14+
The `message_delivery` module has been renamed to `delivery`. Update imports accordingly:
15+
16+
```diff
17+
- use aztec::messages::message_delivery::MessageDelivery;
18+
+ use aztec::messages::delivery::MessageDelivery;
19+
```
20+
1221
### [Aztec.nr] `get_pending_tagged_logs` oracle interface updated (oracle version 28)
1322

1423
The `aztec_utl_getPendingTaggedLogs` oracle now takes an additional `provided_secrets` parameter of type `EphemeralArray<ProvidedSecret>`. This lets apps pass tagging secrets that PXE cannot derive on its own (e.g. handshake-derived secrets) alongside the secrets PXE manages internally.
@@ -19,7 +28,7 @@ The `set_sender_for_tags` oracle has been removed. Contracts that used it to ove
1928

2029
```diff
2130
- use aztec::oracle::notes::set_sender_for_tags;
22-
+ use aztec::messages::message_delivery::MessageDelivery;
31+
+ use aztec::messages::delivery::MessageDelivery;
2332

2433
- unsafe { set_sender_for_tags(some_address) };
2534
- note.deliver(MessageDelivery::onchain_constrained());

docs/docs-developers/docs/tutorials/contract_tutorials/counter_contract.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub contract Counter {
7979
- `macros::{functions::{external, initializer}, storage::storage}`
8080
Imports the macros needed to define function types (`external`, `initializer`) and the `storage` macro for declaring contract storage structures.
8181

82-
- `messages::message_delivery::MessageDelivery`
82+
- `messages::delivery::MessageDelivery`
8383
Imports `MessageDelivery` for specifying how note delivery should be handled (e.g., constrained onchain delivery).
8484

8585
- `oracle::logging::debug_log_format`

docs/examples/contracts/bob_token_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub contract BobToken {
77
// docs:end:start
88
use aztec::{
99
macros::{functions::{external, initializer, only_self}, storage::storage},
10-
messages::message_delivery::MessageDelivery,
10+
messages::delivery::MessageDelivery,
1111
protocol::address::AztecAddress,
1212
state_vars::{Map, Owned, PublicMutable},
1313
};

docs/examples/contracts/counter_contract/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub contract Counter {
77
// docs:start:imports
88
use aztec::{
99
macros::{functions::{external, initializer}, storage::storage},
10-
messages::message_delivery::MessageDelivery,
10+
messages::delivery::MessageDelivery,
1111
oracle::logging::debug_log_format,
1212
protocol::{address::AztecAddress, traits::ToField},
1313
state_vars::Owned,

docs/examples/contracts/nft/src/main.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub contract NFTPunk {
1010
protocol::address::AztecAddress,
1111
state_vars::{DelayedPublicMutable, Map, Owned, PrivateSet, PublicImmutable},
1212
};
13-
use aztec::messages::message_delivery::MessageDelivery;
13+
use aztec::messages::delivery::MessageDelivery;
1414
use aztec::note::{
1515
note_getter_options::NoteGetterOptions, note_interface::NoteProperties,
1616
note_viewer_options::NoteViewerOptions,

0 commit comments

Comments
 (0)