-
Notifications
You must be signed in to change notification settings - Fork 124
Open
Labels
blockedSomething prevents working on thisSomething prevents working on thisgood first issueGood for newcomersGood for newcomersrustIssues that affect or pull requests that update Rust codeIssues that affect or pull requests that update Rust code
Milestone
Description
After #2285 is done, AccountStorageMode::Network should have been removed, and once that happens, we can simplify the NoteTag::with_account_target API further and use the full 32 bits of a note tag instead of at most 30 bits.
One difficulty is that RoutingParameters relies on NoteTag::MAX_ACCOUNT_TARGET_TAG_LENGTH to be 30 since its 5-bit format can only encode 2^5 = 32 values, and 31 is reserved to signal the absence of a note tag.
The potential solutions are:
- Allow up to 32 bits in
RoutingParameters::note_tag_lenand:- Reduce address interface from 11 to 10 bits and increase note tag from 5 to 6 bits.
- This would waste quite a bit of available space for the note tag.
- Move note tag length encoding to a separate byte, making more room. This means two bytes in total for address interface and note tag, instead of one as now.
- This wastes even more space.
- Reduce address interface from 11 to 10 bits and increase note tag from 5 to 6 bits.
- Continue enforcing that at most 30 bits can be encoded in
RoutingParameters::note_tag_leneven though theNoteTagitself can support up to 32.
My preference is the latter option:
- 30 bits in a note tag already sufficiently reduce the set of potential target accounts.
- Network notes targeted at accounts are no longer identified by the note tag, so the requirement for having it be as precise as possible is no longer relevant.
- Leaves the address as small as it is.
So the tasks would be:
- Refactor
NoteTagaccount targets to allow for up to 32 bits. - Introduce a
RoutingParameters::MAX_NOTE_TAG_LENGTH = 30and use it to enforce max note tag len, instead of relying onNoteTag::MAX_ACCOUNT_TARGET_TAG_LENGTHwhich would be 32 at that point.
Context: #2219 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
blockedSomething prevents working on thisSomething prevents working on thisgood first issueGood for newcomersGood for newcomersrustIssues that affect or pull requests that update Rust codeIssues that affect or pull requests that update Rust code