diff --git a/docs/docs-developers/docs/resources/migration_notes.md b/docs/docs-developers/docs/resources/migration_notes.md index e5b668106696..de8844723961 100644 --- a/docs/docs-developers/docs/resources/migration_notes.md +++ b/docs/docs-developers/docs/resources/migration_notes.md @@ -90,6 +90,44 @@ The zero address (`AztecAddress::zero()`) is always allowed regardless of the sc **Impact**: Contracts that access capsules scoped to addresses not included in the transaction's authorized scopes will now fail at runtime. Ensure the correct scopes are passed when executing transactions. +### [Aztec.nr] Ephemeral arrays replace capsule arrays in PXE oracle interfaces + +Oracle interfaces between Aztec.nr and PXE now use a new `EphemeralArray` type (`aztec::ephemeral::EphemeralArray`) instead of `CapsuleArray`. Ephemeral arrays live in memory and are scoped by contract call frame, so they no longer need to be addressed by `(contract_address, scope)`. Several public message-discovery and validation functions lost their `recipient`, `scope`, and `contract_address` parameters as a result. + +Most contracts are not affected, as the macro-generated `sync_state` and `process_message` functions handle these APIs automatically. Only contracts that call these functions directly need to update. + +**Migration:** + +```diff + attempt_note_discovery( + contract_address, + tx_hash, + unique_note_hashes_in_tx, + first_nullifier_in_tx, +- recipient, + compute_note_hash, + compute_note_nullifier, + owner, + storage_slot, + randomness, + note_type_id, + packed_note, + ); + +- enqueue_note_for_validation(contract_address, owner, storage_slot, randomness, note_nonce, packed_note, note_hash, nullifier, tx_hash, scope); ++ enqueue_note_for_validation(contract_address, owner, storage_slot, randomness, note_nonce, packed_note, note_hash, nullifier, tx_hash); + +- enqueue_event_for_validation(contract_address, event_type_id, randomness, serialized_event, event_commitment, tx_hash, scope); ++ enqueue_event_for_validation(contract_address, event_type_id, randomness, serialized_event, event_commitment, tx_hash); + +- validate_and_store_enqueued_notes_and_events(contract_address, scope); ++ validate_and_store_enqueued_notes_and_events(scope); +``` + +The `sync_inbox` function and the `OffchainInboxSync` type now return `EphemeralArray` instead of `CapsuleArray`. Custom message handlers that bind the returned array to an explicit type must update the type annotation. + +**Impact**: Contracts that call the above functions directly (rather than relying on macro-generated code) will fail to compile until the trailing `recipient`, `scope`, and `contract_address` parameters are removed. + ### `aztec new` and `aztec init` now create a 2-crate workspace `aztec new` and `aztec init` now create a workspace with two crates instead of a single contract crate: