-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support for unique linking #782
Conversation
// Flag specifying whether there should only ever be a single account <-> DID | ||
// link, or multiple. | ||
#[pallet::constant] | ||
type UniqueLinkingEnabled: Get<bool>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this a Get<bool>
instead of a const to both allow clients to query whether this pallet enforces unique links or not, and to also make testing easier since this value can be dynamically mocked, as opposed to a const.
a872cc4
to
abf6587
Compare
9d31e0e
to
61ec5a2
Compare
abf6587
to
0514617
Compare
61ec5a2
to
d5e79c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some questions.
0514617
to
84d3faf
Compare
d5e79c7
to
21e97e7
Compare
Part of KILTprotocol/ticket#3650, built on top of #782. I left a few comments on the review to help the reviewer understanding the context of this changeset. ## Checklist - [x] Add dotnames pallet to both runtimes - [x] Add second linking deployment with unique linking to both runtimes - [ ] ~Add new runtime API for batch resolution to both runtimes~ -> will do in a separate PR along with a new runtime API for unique linking resolution
Part of https://github.com/KILTprotocol/ticket/issues/3650. Built on top of #781.
Trade-off
I chose to go this way instead of providing an optional counter, because providing a counter would require one of the following two approaches:
Hence, the solution was to provide a somehow more limited feature of simply specifying whether the links are expected to be unique per DID or not. This, as long as we set
false
for our deployed pallets would not require any storage migration, and does not require any changes in the benchmarks, so I found it a good compromise.