-
Notifications
You must be signed in to change notification settings - Fork 689
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
pallet-identity
: Make identity
generic
#179
Comments
I'd like to do this. |
Yes its a good issue, thanks @hirschenberger. cc @chevdor see what we are doing here? Networks can have more variety on what Registrars can judge on, and the format will change. |
Thanks for the heads up @ggwpez, that will likely break a lot on my end but that is not a concern :) This It is good if a chain can define what an Identity is so they also can decide to have a It would be also great to consider that a chain may want to have multiple type of Identities. A chain may want a simple base Identity for all but a version with more information for some populations. That can be handled with more Optional fields and enforced by registrars but leaving this decision to the chain authors make it more elegant. |
This shouldn't be really involved? You only need to move the identity to the config trait. You also don't need any migration if you just continue to use the current identity struct. |
We should probably make it possible for registrars to specify for which fields they can attest. Then the registrar is always attesting for the same fields of all the identities they approve. |
@bkchr that would totally make sense and would be a helpful addition if the info is available on chain. |
Fixes #179 # Description This PR makes the structure containing identity information used in `pallet-identity` generic through the pallet `Config`. Additionally, the old structure is now available in a separate module called `simple` (pending rename) and is compatible with the new interface. Another change in this PR is that while the `additional` field in `IdentityInfo` stays for backwards compatibility reasons, the associated costs are stil present in the pallet through the `additional` function in the `IdentityInformationProvider` interface. This function is marked as deprecated as it is only a temporary solution to the backwards compatibility problem we had. In short, we could have removed the additional fields in the struct and done a migration, but we chose to wait and do it off-chain through the genesis of the system parachain. After we move the identity pallet to the parachain, additional fields will be migrated into the existing fields and the `additional` key-value store will be removed. Until that happens, this interface will provide the necessary information to properly account for the associated costs. Additionally, this PR fixes an unrelated issue; the `IdentityField` enum used to represent the fields as bitflags couldn't store more than 8 fields, even though it was marked as `#[repr(u64)]`. This was because of the `derive` implementation of `TypeInfo`, which assumed `u8` semantics. The custom implementation of this trait in 0105cc0 fixes the issue. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Sam Johnson <sam@durosoft.com> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Fixes #179 # Description This PR makes the structure containing identity information used in `pallet-identity` generic through the pallet `Config`. Additionally, the old structure is now available in a separate module called `simple` (pending rename) and is compatible with the new interface. Another change in this PR is that while the `additional` field in `IdentityInfo` stays for backwards compatibility reasons, the associated costs are stil present in the pallet through the `additional` function in the `IdentityInformationProvider` interface. This function is marked as deprecated as it is only a temporary solution to the backwards compatibility problem we had. In short, we could have removed the additional fields in the struct and done a migration, but we chose to wait and do it off-chain through the genesis of the system parachain. After we move the identity pallet to the parachain, additional fields will be migrated into the existing fields and the `additional` key-value store will be removed. Until that happens, this interface will provide the necessary information to properly account for the associated costs. Additionally, this PR fixes an unrelated issue; the `IdentityField` enum used to represent the fields as bitflags couldn't store more than 8 fields, even though it was marked as `#[repr(u64)]`. This was because of the `derive` implementation of `TypeInfo`, which assumed `u8` semantics. The custom implementation of this trait in 0105cc0 fixes the issue. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Sam Johnson <sam@durosoft.com> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Fixes paritytech#179 # Description This PR makes the structure containing identity information used in `pallet-identity` generic through the pallet `Config`. Additionally, the old structure is now available in a separate module called `simple` (pending rename) and is compatible with the new interface. Another change in this PR is that while the `additional` field in `IdentityInfo` stays for backwards compatibility reasons, the associated costs are stil present in the pallet through the `additional` function in the `IdentityInformationProvider` interface. This function is marked as deprecated as it is only a temporary solution to the backwards compatibility problem we had. In short, we could have removed the additional fields in the struct and done a migration, but we chose to wait and do it off-chain through the genesis of the system parachain. After we move the identity pallet to the parachain, additional fields will be migrated into the existing fields and the `additional` key-value store will be removed. Until that happens, this interface will provide the necessary information to properly account for the associated costs. Additionally, this PR fixes an unrelated issue; the `IdentityField` enum used to represent the fields as bitflags couldn't store more than 8 fields, even though it was marked as `#[repr(u64)]`. This was because of the `derive` implementation of `TypeInfo`, which assumed `u8` semantics. The custom implementation of this trait in paritytech@0105cc0 fixes the issue. --------- Signed-off-by: georgepisaltu <george.pisaltu@parity.io> Co-authored-by: Sam Johnson <sam@durosoft.com> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
* Fix clippy errors. * Cargo fmt. * Enable clippy checks. * Create if does not exist. * Fix warnings and enable sccache for clippy. * chmod +x * Revert and ignore errors. * Update cancel-workflow-action. * Fixes. * Clippy fixes. * Fix compilation. * Fix new clippy warnings. * fmt --all * Fix the rest. * fmt --all * Conditional. * Bump smallvec. * Use separate cache dir for clippy to prevent races. * Remove unused imports in tests * Remove "useless conversion" * Move clippy to main worfklow to avoid clashes. * Fix clippy error. * Fix remaning clippy errors. * cargo fmt --all Co-authored-by: Hernando Castano <castano.ha@gmail.com>
IdentityInfo
is currently declared inpallet-identity
:https://github.com/paritytech/substrate/blob/f6928f87138c25e0f16821a19fb1feb0edf8e214/frame/identity/src/types.rs#L290-L334
It already supports
additional
identities that are free for the user to choose. However, people are still opening issues about wanting special fields for discord, github or whatever to be added. It would be much better to make the wholeIdentityInfo
generic via theConfig
trait.So, a
IdentityInfo
associated type should be added to theConfig
trait and everywhere where currentlyIdentityInfo
is being used, should be replaced byT::IdentityInfo
. To stay backwards compatible, we should keep the oldIdentityInfo
struct and then all downstream users can just point theConfig::IdentityInfo
topallet_identity::IdentityInfo
.The text was updated successfully, but these errors were encountered: