Skip to content

feat: add compile-time size check for events and error code links#21024

Merged
nventuro merged 6 commits intomerge-train/fairiesfrom
nv/add-event-len-test
Mar 3, 2026
Merged

feat: add compile-time size check for events and error code links#21024
nventuro merged 6 commits intomerge-train/fairiesfrom
nv/add-event-len-test

Conversation

@nventuro
Copy link
Copy Markdown
Contributor

@nventuro nventuro commented Mar 3, 2026

This adds the static assert for packing length that we had in #[note] to #[event] as well, and also adds links to the docsite, where in the future we may have information as to how to proceed (e.g. what to do with too-long events etc).

Add a static_assert to the #[event] macro that validates event serialized
length does not exceed MAX_EVENT_SERIALIZED_LEN, mirroring the existing
check in the #[note] macro. Add error code URLs to both the note and
event static_assert messages linking to docs.aztec.network/errors/{4,5},
with corresponding netlify redirects. Add an invalid_event compile
failure test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nventuro nventuro requested a review from benesjan March 3, 2026 02:16
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@benesjan benesjan marked this pull request as draft March 3, 2026 06:13
Copy link
Copy Markdown
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

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

LGTM

@benesjan benesjan marked this pull request as ready for review March 3, 2026 06:37
@benesjan benesjan marked this pull request as draft March 3, 2026 12:55
@benesjan benesjan marked this pull request as ready for review March 3, 2026 13:18
@benesjan
Copy link
Copy Markdown
Contributor

benesjan commented Mar 3, 2026

@nventuro The code in this PR was broken so I fixed it. The fixes I needed to do are in the last 3 commits.

@nventuro nventuro merged commit fb0e406 into merge-train/fairies Mar 3, 2026
15 checks passed
@nventuro nventuro deleted the nv/add-event-len-test branch March 3, 2026 14:31
@AztecBot
Copy link
Copy Markdown
Collaborator

AztecBot commented Mar 3, 2026

❌ Failed to cherry-pick to v4 due to conflicts. Dispatching ClaudeBox to resolve. View backport run.

AztecBot pushed a commit that referenced this pull request Mar 3, 2026
…1024)

This adds the static assert for packing length that we had in #[note] to
future we may have information as to how to proceed (e.g. what to do
with too-long events etc).

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: benesjan <janbenes1234@gmail.com>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 3, 2026
BEGIN_COMMIT_OVERRIDE
feat: allow custom addresses to be prefunded with fee juice in local
network (#21000)
docs(claude): add Noir early return idiom to CLAUDE.md (#21021)
feat: add compile-time size check for events and error code links
(#21024)
feat: use warn_log_format for discarded messages (#21053)
END_COMMIT_OVERRIDE
johnathan79717 pushed a commit that referenced this pull request Mar 4, 2026
…1024)

This adds the static assert for packing length that we had in #[note] to
#[event] as well, and also adds links to the docsite, where in the
future we may have information as to how to proceed (e.g. what to do
with too-long events etc).

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: benesjan <janbenes1234@gmail.com>
AztecBot added a commit that referenced this pull request Mar 18, 2026
nventuro added a commit that referenced this pull request Mar 19, 2026
…1134, #21072, #21186, #21189, #21229, #21228, #21234, #21639) (#21745)

## Summary

Combined backport of 12 PRs to v4-next, cherry-picked in chronological
merge order:

1. #20512 — docs: add delayedpublicmutable apiref, fix misc docs
2. #20379 — feat: custom message handlers in Aztec.nr
3. #20831 — feat!: make unused msg disco fns private
4. #21024 — feat: add compile-time size check for events and error code
links
5. #21134 — chore: add warning on invalid recipients
6. #21072 — feat: add aztecaddress::is_valid
7. #21186 — chore: use returns `true` for boolean fns
8. #21189 — feat: add note hash and nullifier helper functions with
domain separation
9. #21229 — docs: small delayedpubmut update
10. #21228 — test: restore pubmut tests
11. #21234 — fix: claim contract & improve nullif docs
12. #21639 — feat!: split compute note hash and nullifier to reduce
hashing

Each PR is a separate commit (raw cherry-pick with conflicts left in),
followed by a single final commit that resolves all conflicts — making
it easy to review the conflict resolution independently.

## Conflict resolution (last commit)

- `delayed_public_mutable.nr` / `public_immutable.nr` — merged doc
comments from both sides
- `aztec.nr` macros — integrated custom message handler + split compute
functions
- `discovery/mod.nr` / `process_message.nr` — merged offchain inbox sync
+ custom handler dispatch + split compute
- `constants.nr` / `constants_tests.nr` — added new domain separators
- `Nargo.toml` — added custom_message_contract
- `netlify.toml` — merged error code redirects
- `auth_contract` — kept v4-next delay value
- `note_metadata.nr` — doc comment reformat
- `migration_notes.md` — merged migration notes from both sides
- Deleted `traits.nr` (v4-next uses `traits/` directory)


ClaudeBox log: https://claudebox.work/s/3145d1bd30977c20?run=1

---------

Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
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.

3 participants