Skip to content

Commit e9b7795

Browse files
authored
docs: add note on why events are serialized (#19150)
Closes #11571 (as won't do)
2 parents f6d0643 + 4e27fe7 commit e9b7795

File tree

1 file changed

+4
-0
lines changed
  • noir-projects/aztec-nr/aztec/src/messages/logs

1 file changed

+4
-0
lines changed

noir-projects/aztec-nr/aztec/src/messages/logs/event.nr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ pub fn private_event_to_message_plaintext<Event>(
1818
where
1919
Event: EventInterface + Serialize,
2020
{
21+
// We use `Serialize` because we want for events to be processable by off-chain actors, e.g. block explorers,
22+
// wallets and apps, without having to rely on contract invocation. If we used `Packable` we'd need to call utility
23+
// functions in order to unpack events, which would introduce a level of complexity we don't currently think is
24+
// worth the savings in DA (for public events) and proving time (when encrypting private event messages).
2125
let serialized_event = event.serialize();
2226

2327
let mut msg_content = [0; PRIVATE_EVENT_RESERVED_FIELDS + <Event as Serialize>::N];

0 commit comments

Comments
 (0)