Skip to content

feat(aztec-nr): add Serialize/Deserialize for EphemeralArray#23417

Open
nchamo wants to merge 2 commits into
merge-train/fairiesfrom
nchamo/ephemeral-arrays-serialization
Open

feat(aztec-nr): add Serialize/Deserialize for EphemeralArray#23417
nchamo wants to merge 2 commits into
merge-train/fairiesfrom
nchamo/ephemeral-arrays-serialization

Conversation

@nchamo
Copy link
Copy Markdown
Contributor

@nchamo nchamo commented May 19, 2026

Summary

  • Adds Serialize and Deserialize trait implementations to EphemeralArray<T>, serializing as a single Field (the slot identifier).
  • Updates oracle function signatures in message_processing.nr and shared_secret.nr to accept and return EphemeralArray<T> directly instead of opaque raw Field slots, eliminating manual EphemeralArray::at(slot) wrapping at every call site.

@nchamo nchamo requested a review from nventuro as a code owner May 19, 2026 22:58
@nchamo nchamo self-assigned this May 19, 2026
@nchamo nchamo requested a review from mverzilli May 19, 2026 23:23
impl<T> Serialize for EphemeralArray<T> {
let N: u32 = 1;

fn serialize(self) -> [Field; 1] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This signature should be [Field; N], correct?

(or, if the N assignment in line 108 can be deleted, that would be equally good I guess)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Did it in 9968a92

pub(crate) unconstrained fn get_pending_tagged_logs(scope: AztecAddress) -> EphemeralArray<PendingTaggedLog> {
let result_slot = get_pending_tagged_logs_oracle(scope);
EphemeralArray::at(result_slot)
get_pending_tagged_logs_oracle(scope)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lovely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants