Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

More comprehensive identity system #4326

Merged
merged 17 commits into from
Dec 9, 2019
Merged

More comprehensive identity system #4326

merged 17 commits into from
Dec 9, 2019

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Dec 8, 2019

Closes #4311

A federated naming system, allowing for multiple registrars to be added from a specified origin. Registrars can set a fee to provide identity-verification service. Anyone can put forth a proposed identity for a fixed deposit and ask for review by any number of registrars (paying each of their fees). Registrar judgements are multi-tier allowing for more sophisticated opinions than a boolean true or false.

A super-user can remove accounts and slash the deposit.

The number of registrars should be limited, and the deposit made sufficiently large, to ensure no state-bloat attack is viable.

@jacogr incoming! :)

TODO:

  • Tests
  • Docs

@gavofyork gavofyork added A0-please_review Pull request needs code review. A3-in_progress Pull request is in progress. No review needed at this stage. labels Dec 8, 2019
@gavofyork gavofyork removed the A3-in_progress Pull request is in progress. No review needed at this stage. label Dec 9, 2019
Copy link
Contributor

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

Looks good at first glance, I didn't analyse in details though.

frame/identity/src/lib.rs Show resolved Hide resolved
frame/identity/src/lib.rs Outdated Show resolved Hide resolved
frame/identity/src/lib.rs Show resolved Hide resolved
frame/identity/src/lib.rs Show resolved Hide resolved
frame/identity/src/lib.rs Show resolved Hide resolved
Copy link
Contributor

@pepyakin pepyakin left a comment

Choose a reason for hiding this comment

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

Looks good.

A small concern that it seems that there is a chance to get a judgment without paying a fee, by racing cancelling the request before a judgment is processed.

frame/identity/src/lib.rs Show resolved Hide resolved
frame/identity/src/lib.rs Outdated Show resolved Hide resolved
frame/identity/src/lib.rs Outdated Show resolved Hide resolved
frame/identity/src/lib.rs Outdated Show resolved Hide resolved
frame/identity/src/lib.rs Outdated Show resolved Hide resolved
pub IdentityOf get(fn identity): map T::AccountId => Option<Registration<BalanceOf<T>>>;

/// Alternative "sub" identities of this account.
pub SubsOf get(fn subs): map T::AccountId => (BalanceOf<T>, Vec<(T::AccountId, Data)>);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be useful to say that the first tuple item is the deposit. I am also a bit unclear on how the second item would work, it has Data but it doesn't describe what this data points to. To IdentityInfo stored somewhere?

frame/identity/src/lib.rs Show resolved Hide resolved
frame/identity/src/lib.rs Outdated Show resolved Hide resolved
@gavofyork
Copy link
Member Author

Looks good.

A small concern that it seems that there is a chance to get a judgment without paying a fee, by racing cancelling the request before a judgment is processed.

Well done! I was wondering if anyone would notice that. Yeah, if it turns out to be an issue (which I don't think it will since you'd pretty much need to be a validator to successfully beat the other tx in a race), then we can introduce an extra function provide_paid_judgement which only works if the fee is there.

@gavofyork gavofyork merged commit 9bc29f8 into master Dec 9, 2019
@gavofyork gavofyork added this to Done in Runtime via automation Dec 9, 2019
@xlc
Copy link
Contributor

xlc commented Dec 10, 2019

Looks good.
A small concern that it seems that there is a chance to get a judgment without paying a fee, by racing cancelling the request before a judgment is processed.

Well done! I was wondering if anyone would notice that. Yeah, if it turns out to be an issue (which I don't think it will since you'd pretty much need to be a validator to successfully beat the other tx in a race), then we can introduce an extra function provide_paid_judgement which only works if the fee is there.

Can't you add some tips to increase the priority of a transaction and therefore make it very likely the cancel tx get executed before the judgment tx? With a long-ish block time and short tx propagation time, the chance of success front-running can be pretty high.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend naming system
6 participants