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

Add registrar proxy #1296

Merged
merged 4 commits into from
Jul 1, 2020
Merged

Conversation

chevdor
Copy link
Contributor

@chevdor chevdor commented Jun 20, 2020

This PR adds a new ProxyType: IdentityJudgement, allowing only Identity.provideJudgement either as single call or batched call.

The main usage is for identity registrars who want to automate their process without exposing the registrar's main account.

Proxy setup:

image

Usage:

image

Fix #1290

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

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

LGTM

@gavofyork gavofyork added A0-please_review Pull request needs code review. B2-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. labels Jun 22, 2020
@@ -814,6 +815,9 @@ impl InstanceFilter<Call> for ProxyType {
Call::Staking(..) | Call::Utility(utility::Call::batch(..))
| Call::Utility(utility::Call::as_limited_sub(..))
),
ProxyType::RegistrarJudgement => matches!(c,
Copy link
Member

Choose a reason for hiding this comment

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

probably worth including utility.batch also.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that's exactly what I want to add :) I was looking for how to add batch but only a given method.

I have also (not pushed yet) the change for westend and polkadot.

Copy link
Member

Choose a reason for hiding this comment

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

@chevdor if you directly add Call::Utility(utility::Call::batch(..)) as is done above, the other filters will continue to apply through to the batch call.

Copy link
Member

Choose a reason for hiding this comment

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

i.e. you will only be able to batch to make the specific calls you have whitelisted. You of course can verify this with a dev node or something.

@chevdor
Copy link
Contributor Author

chevdor commented Jun 26, 2020

This feature can be tested in the UI under settings/dev by adding the following type:

{ "ProxyType": { "_enum": ["Any",
	"NonTransfer",
	"Governance",
	"Staking",
	"IdentityJudgement"
] } }

@chevdor
Copy link
Contributor Author

chevdor commented Jun 26, 2020

No issue here but I am leaving it as draft until I can take a bit more time to test for myself.

@chevdor
Copy link
Contributor Author

chevdor commented Jun 27, 2020

I tested the following on kusama-dev manually:

  • Provide judgement as single call thru the proxy - PASS
  • Provide judgement as batch call thru the proxy - PASS
  • Test proxied transfer from an account with only IdentityJudgement - PASS (All green in the UI but the transfer did not occur)

@chevdor
Copy link
Contributor Author

chevdor commented Jun 27, 2020

Rebased master

@chevdor chevdor marked this pull request as ready for review June 27, 2020 11:31
@gavofyork gavofyork merged commit c6b29c7 into paritytech:master Jul 1, 2020
@chevdor chevdor deleted the wk-proxytype-registrar branch August 28, 2021 20:15
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. C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add proxyType for identity.setJudgement
4 participants