Skip to content
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

chore: instantiatable linking pallet #781

Merged
merged 5 commits into from
Nov 6, 2024

Conversation

ntn-x2
Copy link
Member

@ntn-x2 ntn-x2 commented Nov 4, 2024

@ntn-x2 ntn-x2 requested a review from Ad96el November 4, 2024 13:17
@ntn-x2 ntn-x2 force-pushed the aa/instantiatable-linking-pallet branch 2 times, most recently from abf6587 to 0514617 Compare November 5, 2024 11:01
Ad96el
Ad96el previously approved these changes Nov 5, 2024
Copy link
Member

@Ad96el Ad96el left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

where
T::AccountId: Into<LinkableAccountId> + From<sp_runtime::AccountId32> + Into<sp_runtime::AccountId32>,
<T as frame_system::Config>::AccountId:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it slipped in. Not a big deal tho.

Base automatically changed from aa/instantiatable-names-pallet to develop November 6, 2024 07:19
@ntn-x2 ntn-x2 dismissed Ad96el’s stale review November 6, 2024 07:19

The base branch was changed.

@ntn-x2 ntn-x2 force-pushed the aa/instantiatable-linking-pallet branch from 0514617 to 84d3faf Compare November 6, 2024 07:21
@ntn-x2 ntn-x2 merged commit 6f7f587 into develop Nov 6, 2024
6 of 7 checks passed
@ntn-x2 ntn-x2 deleted the aa/instantiatable-linking-pallet branch November 6, 2024 07:22
ntn-x2 added a commit that referenced this pull request Nov 6, 2024
Part of KILTprotocol/ticket#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:

1. Transform the storage double map into a counted one, requiring a
migration also for our currently-deployed pallet, which I wanted to
avoid
2. Not use a counter, but iterate every time to make sure there are
still "spots" left for the current DID. This would require changing the
benchmarking logic as now we have a potentially unbounded iteration
happening. I also wanted to avoid that.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants