-
Notifications
You must be signed in to change notification settings - Fork 115
Description
Right now, a note may have up to 1024 input elements (8KB), and we'll probably need to impose script size limit on a note, and we'll also soon have "note attachments", which we'll also probably limit to 8KB or 16KB.
Overall, maybe we impose a general limit on the size of a note to be something like 32KB. At this limit, we could allow up to 100 notes. So, let's reduce the limit on this endpoint to 100.
Originally posted by @bobbinth in 0xMiden/node#1443 (comment)
I think this could be done similarly to enforcing AccountUpdateDetails size:
For this issue, I think we need to:
- Add a note size constant in
crates/miden-objects/src/constants.rs. - Implement
get_size_hintstarting fromOutputNoterecursively for all contained types, e.g. forNote,PartialNote, etc. We should also add tests for at leastOutputNote::get_size_hint, making sure the size hint and the actual number of serialized bytes match. - Enforce size limit in
OutputNotes::new.
Ultimately, I think we need to implement both account and note size restrictions in the tx kernel as well, though this can be done separately, together with the work on storage fees, since both will require computing the size of account deltas or notes in the kernl.