feat: add miden::standards::note_tag module#2366
Conversation
| push.{id_prefix} | ||
| push.{tag_len} | ||
|
|
||
| exec.note_tag::create_custom_account_target |
There was a problem hiding this comment.
In what scenario would it be required to create a NoteTag with a tag length greater than 1? Does this mean that the note can have multiple tags?
There was a problem hiding this comment.
I'm not quite sure I understand the question. A note tag with len 0 or 1 would contain 0 or 1 bit from the account ID prefix, so it'd be almost useless. So for useful note tags we almost always want a tag with len greater than 1. (Default is 14).
I think the reason to support 0 is mainly for API uniformity, so you can pass any value in 0..=32, but also so you can easily "nullify" a note tag by passing len = 0, if you don't want a tag.
Not sure if this answers the question.
partylikeits1983
left a comment
There was a problem hiding this comment.
Looks good! Thanks for updating the bridge out masm code :)
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you! I left one comment inline - but it is not directly related to this PR.
| exec.note_tag::create_account_target | ||
| # => [network_faucet_tag, ASSET] |
There was a problem hiding this comment.
Not directly related to this PR, but why do we need to set a tag for a BURN note? These are network notes and instead of a tag we should be setting an attachment for them, no?
There was a problem hiding this comment.
I'll merge this PR as is - but cc @partylikeits1983 and @mmagician in case this is something we'd want to update in a different PR.
Follow-up to #2329 that removes
miden::protocol::note::build_note_tag_for_network_accountand addsmiden::standards::note_tag.It contains two procedures:
create_account_target- equivalent toNoteTag::with_account_targetcreate_custom_account_target- equivalent toNoteTag::with_custom_account_targetSetting note tags for notes targeted at network accounts may no longer be useful, as mentioned here. So, the current use of this procedure in
create_burn_notemay not be necessary. The logic still seems useful to have when creating notes targeted at local accounts at runtime.Includes various small doc fixes and replaces magic numbers with constants.
Replaces
ExecutionErrorwithExecErrorinCodeExecutorfor better out-of-the-box error messages in failing tests.