Skip to content

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

Merged
nchamo merged 3 commits into
merge-train/fairiesfrom
nchamo/ephemeral-arrays-serialization
May 21, 2026
Merged

feat(aztec-nr): add Serialize/Deserialize for EphemeralArray#23417
nchamo merged 3 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!

@nchamo nchamo added the claudebox Owned by claudebox. it can push to this PR. label May 21, 2026
@nchamo
Copy link
Copy Markdown
Contributor Author

nchamo commented May 21, 2026

@AztecBot , please fix conflict

…zation

Resolves conflict in oracle/message_processing.nr: combine the base
branch's oracle rename (dropping the _v2 suffix now that the old
handlers are gone) with this PR's EphemeralArray<T> oracle signatures.
@nchamo nchamo enabled auto-merge (squash) May 21, 2026 10:52
@nchamo nchamo merged commit 0b78738 into merge-train/fairies May 21, 2026
14 checks passed
@nchamo nchamo deleted the nchamo/ephemeral-arrays-serialization branch May 21, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants