From 6dfa11042b57c92be6a9c8b0d35fe71a05f05039 Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 22 Jan 2025 14:50:20 +0000 Subject: [PATCH] migration notes fix --- docs/docs/migration_notes.md | 48 +++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index 85097e5c78b..c532c5f5dca 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -6,6 +6,31 @@ keywords: [sandbox, aztec, notes, migration, updating, upgrading] 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. +## TBD + +### [Aztec.nr] Introduction of `Packable` trait +We have introduced a `Packable` trait that allows types to be serialized and deserialized with a focus on minimizing the size of the resulting Field array. +This is in contrast to the `Serialize` and `Deserialize` traits, which follows Noir's intrinsic serialization format. +This is a breaking change because we now require `Packable` trait implementation for any type that is to be stored in contract storage. + +Example implementation of Packable trait for `U128` type from `noir::std`: + +``` +use crate::traits::{Packable, ToField}; + +let U128_PACKED_LEN: u32 = 1; + +impl Packable for U128 { + fn pack(self) -> [Field; U128_PACKED_LEN] { + [self.to_field()] + } + + fn unpack(fields: [Field; U128_PACKED_LEN]) -> Self { + U128::from_integer(fields[0]) + } +} +``` + ## 0.72.0 ### Public logs replace unencrypted logs Any log emitted from public is now known as a public log, rather than an unencrypted log. This means methods relating to these logs have been renamed e.g. in the pxe, archiver, txe: @@ -41,29 +66,6 @@ This PR also renamed encrypted events to private events: ### [Aztec.nr] Removal of `getSiblingPath` oracle Use `getMembershipWitness` oracle instead that returns both the sibling path and index. -### [Aztec.nr] Introduction of `Packable` trait -We have introduced a `Packable` trait that allows types to be serialized and deserialized with a focus on minimizing the size of the resulting Field array. -This is in contrast to the `Serialize` and `Deserialize` traits, which follows Noir's intrinsic serialization format. -This is a breaking change because we now require `Packable` trait implementation for any type that is to be stored in contract storage. - -Example implementation of Packable trait for `U128` type from `noir::std`: - -``` -use crate::traits::{Packable, ToField}; - -let U128_PACKED_LEN: u32 = 1; - -impl Packable for U128 { - fn pack(self) -> [Field; U128_PACKED_LEN] { - [self.to_field()] - } - - fn unpack(fields: [Field; U128_PACKED_LEN]) -> Self { - U128::from_integer(fields[0]) - } -} -``` - ## 0.68.0 ### [archiver, node, pxe] Remove contract artifacts in node and archiver and store function names instead Contract artifacts were only in the archiver for debugging purposes. Instead function names are now (optionally) emitted