feat: move event size check from declaration to private emission#22168
Merged
Conversation
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 in `encode_private_event_message` instead. Adds a test contract and e2e test proving large events work when emitted publicly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
the failure looks like some CI nonsense so merging in base branch to hopefully get this to merge |
Collaborator
|
❌ Failed to cherry-pick to |
AztecBot
pushed a commit
that referenced
this pull request
Mar 31, 2026
Thunkar
added a commit
that referenced
this pull request
Apr 1, 2026
) [v4-next backport] (#22182) ## 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 in `encode_private_event_message` instead. Adds a test contract and e2e test proving large events work when emitted publicly. ## Conflict Resolution The `invalid_event` comp-failure contract had a conflict because on v4-next the `InvalidEvent` struct is defined inline (with a custom `Serialize` impl) rather than in a separate module. Resolution kept the inline definition while updating the function body to use the new `self.emit().deliver_to()` pattern instead of `get_event_type_id()`. ## Changes - Removed event size static assertion from `#[event]` macro's `get_event_type_id()` - Added size check to `encode_private_event_message` (only enforced for private emission) - Updated `invalid_event` comp-failure contract to emit privately instead of calling `get_event_type_id()` - Added `large_public_event_contract` test contract - Added e2e test for large public events ClaudeBox log: https://claudebox.work/s/e313e5935f72366d?run=1
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 1, 2026
BEGIN_COMMIT_OVERRIDE feat!: remove ALL_SCOPES (#22136) chore: syncing oracle versions (#22131) fix(aztec-nr): use registered accounts as capsule test scopes (#22171) chore: reverting accidentally merged AI slop (#22175) feat: move event size check from declaration to private emission (#22168) fix: prevent oracle failure on tag computation for invalid recipient (#22163) feat: disable noir test cache on merge-train/fairies (#22206) END_COMMIT_OVERRIDE
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.
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.