feat: move event size check from declaration to private emission (#22168) [v4-next backport]#22182
Merged
Thunkar merged 4 commits intobackport-to-v4-next-stagingfrom Apr 1, 2026
Conversation
benesjan
approved these changes
Mar 31, 2026
v4-next's Noir compiler requires #[abi(tag)] attributes to be on structs inside contract bodies. Moving InvalidEvent to a separate file triggers '#[abi(tag)] attributes can only be used in contracts'.
Collaborator
Author
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
AztecBot
added a commit
that referenced
this pull request
Apr 1, 2026
BEGIN_COMMIT_OVERRIDE cherry-pick: feat: move event size check from declaration to private emission (#22168) fix: prevent oracle failure on tag computation for invalid recipient (#22163) feat: move event size check from declaration to private emission (#22168) [v4-next backport] (#22182) fix(cli-wallet): peek claim stack instead of popping for estimate-gas-only (#22196) fix: use Fr.fromString for CLI wallet claim params to handle decimal values (#22197) fix: indefinite retry for prover node and agent broker communication (#22202) END_COMMIT_OVERRIDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backport of #22168 to v4-next.
The
#[event]macro previously enforced MAX_EVENT_SERIALIZED_LEN at declaration time, blocking valid use cases like large public-only events. The size constraint only applies to private emission (due to encryption overhead), so the check now lives inencode_private_event_messageinstead. Adds a test contract and e2e test proving large events work when emitted publicly.Conflict Resolution
The
invalid_eventcomp-failure contract had a conflict because on v4-next theInvalidEventstruct is defined inline (with a customSerializeimpl) rather than in a separate module. Resolution kept the inline definition while updating the function body to use the newself.emit().deliver_to()pattern instead ofget_event_type_id().Changes
#[event]macro'sget_event_type_id()encode_private_event_message(only enforced for private emission)invalid_eventcomp-failure contract to emit privately instead of callingget_event_type_id()large_public_event_contracttest contractClaudeBox log: https://claudebox.work/s/e313e5935f72366d?run=1