From c2d3b0556a9e1023e115c030f62584f2b18ea538 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Mon, 23 Dec 2024 12:56:43 +0000 Subject: [PATCH 1/6] disallow tweaking sub-ids from any proxy --- system-parachains/people/people-kusama/src/lib.rs | 6 +++++- system-parachains/people/people-polkadot/src/lib.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 3390839256..9c6b549e4a 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -492,7 +492,11 @@ impl InstanceFilter for ProxyType { c, RuntimeCall::Balances { .. } | // `request_judgement` puts up a deposit to transfer to a registrar - RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) + RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) | + // `set_subs`, `add_sub`, `quite_sub` will take and repatriate deposits from the proxied account, should not be allowed. + RuntimeCall::Identity(pallet_identity::Call::add_sub { .. }) | + RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) | + RuntimeCall::Identity(pallet_identity::Call::quit_sub { .. }) ), ProxyType::CancelProxy => matches!( c, diff --git a/system-parachains/people/people-polkadot/src/lib.rs b/system-parachains/people/people-polkadot/src/lib.rs index a439971e5f..68a5e0d289 100644 --- a/system-parachains/people/people-polkadot/src/lib.rs +++ b/system-parachains/people/people-polkadot/src/lib.rs @@ -456,7 +456,11 @@ impl InstanceFilter for ProxyType { c, RuntimeCall::Balances { .. } | // `request_judgement` puts up a deposit to transfer to a registrar - RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) + RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) | + // `set_subs`, `add_sub`, `quite_sub` will take and repatriate deposits from the proxied account, should not be allowed. + RuntimeCall::Identity(pallet_identity::Call::add_sub { .. }) | + RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) | + RuntimeCall::Identity(pallet_identity::Call::quit_sub { .. }) ), ProxyType::CancelProxy => matches!( c, From 6243b2256ea8a9ab4309477a629125d5a3cf565c Mon Sep 17 00:00:00 2001 From: kianenigma Date: Mon, 23 Dec 2024 12:58:53 +0000 Subject: [PATCH 2/6] not needed for quit_sub --- system-parachains/people/people-kusama/src/lib.rs | 3 ++- system-parachains/people/people-polkadot/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 9c6b549e4a..31867a1967 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -493,7 +493,8 @@ impl InstanceFilter for ProxyType { RuntimeCall::Balances { .. } | // `request_judgement` puts up a deposit to transfer to a registrar RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) | - // `set_subs`, `add_sub`, `quite_sub` will take and repatriate deposits from the proxied account, should not be allowed. + // `set_subs` and `add_sub` will take and repatriate deposits from the proxied + // account, should not be allowed. RuntimeCall::Identity(pallet_identity::Call::add_sub { .. }) | RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) | RuntimeCall::Identity(pallet_identity::Call::quit_sub { .. }) diff --git a/system-parachains/people/people-polkadot/src/lib.rs b/system-parachains/people/people-polkadot/src/lib.rs index 68a5e0d289..f7286ded13 100644 --- a/system-parachains/people/people-polkadot/src/lib.rs +++ b/system-parachains/people/people-polkadot/src/lib.rs @@ -457,10 +457,10 @@ impl InstanceFilter for ProxyType { RuntimeCall::Balances { .. } | // `request_judgement` puts up a deposit to transfer to a registrar RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. }) | - // `set_subs`, `add_sub`, `quite_sub` will take and repatriate deposits from the proxied account, should not be allowed. + // `set_subs` and `add_sub` will take and repatriate deposits from the proxied + // account, should not be allowed. RuntimeCall::Identity(pallet_identity::Call::add_sub { .. }) | RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) | - RuntimeCall::Identity(pallet_identity::Call::quit_sub { .. }) ), ProxyType::CancelProxy => matches!( c, From 78ac6f3d4f43bdf338905456e1e1adfd2ee4c33b Mon Sep 17 00:00:00 2001 From: kianenigma Date: Mon, 23 Dec 2024 12:59:30 +0000 Subject: [PATCH 3/6] fix --- system-parachains/people/people-kusama/src/lib.rs | 3 +-- system-parachains/people/people-polkadot/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/system-parachains/people/people-kusama/src/lib.rs b/system-parachains/people/people-kusama/src/lib.rs index 31867a1967..c3c4b23a2b 100644 --- a/system-parachains/people/people-kusama/src/lib.rs +++ b/system-parachains/people/people-kusama/src/lib.rs @@ -496,8 +496,7 @@ impl InstanceFilter for ProxyType { // `set_subs` and `add_sub` will take and repatriate deposits from the proxied // account, should not be allowed. RuntimeCall::Identity(pallet_identity::Call::add_sub { .. }) | - RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) | - RuntimeCall::Identity(pallet_identity::Call::quit_sub { .. }) + RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) ), ProxyType::CancelProxy => matches!( c, diff --git a/system-parachains/people/people-polkadot/src/lib.rs b/system-parachains/people/people-polkadot/src/lib.rs index f7286ded13..5a0c678c7c 100644 --- a/system-parachains/people/people-polkadot/src/lib.rs +++ b/system-parachains/people/people-polkadot/src/lib.rs @@ -460,7 +460,7 @@ impl InstanceFilter for ProxyType { // `set_subs` and `add_sub` will take and repatriate deposits from the proxied // account, should not be allowed. RuntimeCall::Identity(pallet_identity::Call::add_sub { .. }) | - RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) | + RuntimeCall::Identity(pallet_identity::Call::set_subs { .. }) ), ProxyType::CancelProxy => matches!( c, From ca483a3e913f907a32b4b1874205ef8c90dc841d Mon Sep 17 00:00:00 2001 From: kianenigma Date: Mon, 23 Dec 2024 13:02:27 +0000 Subject: [PATCH 4/6] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fe06d9544..841d454688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix missing Encointer democracy pallet hook needed for enactment ([polkadot-fellows/runtimes/pull/508](https://github.com/polkadot-fellows/runtimes/pull/508)) +### Fixed +- [Disallow `add_sub` and `set_subs` from `NonTransfer` proxy type in people chain runtimes](https://github.com/polkadot-fellows/runtimes/pull/518) + ### Added - Location conversion tests for relays and parachains ([polkadot-fellows/runtimes#487](https://github.com/polkadot-fellows/runtimes/pull/487)) From 0ea21b68e5bab91f13302012515454c109f40469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 23 Dec 2024 14:27:47 +0100 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 841d454688..aa77c06587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix missing Encointer democracy pallet hook needed for enactment ([polkadot-fellows/runtimes/pull/508](https://github.com/polkadot-fellows/runtimes/pull/508)) ### Fixed + - [Disallow `add_sub` and `set_subs` from `NonTransfer` proxy type in people chain runtimes](https://github.com/polkadot-fellows/runtimes/pull/518) ### Added From 6ea8c2d3ea1916abb8fc18e6213f5b0568804104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 23 Dec 2024 14:28:18 +0100 Subject: [PATCH 6/6] Update CHANGELOG.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dónal Murray --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa77c06587..a377bbd57e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed -- [Disallow `add_sub` and `set_subs` from `NonTransfer` proxy type in people chain runtimes](https://github.com/polkadot-fellows/runtimes/pull/518) +- Disallow `add_sub` and `set_subs` from `NonTransfer` proxy type in people chain runtimes ([polkadot-fellows/runtimes#518](https://github.com/polkadot-fellows/runtimes/pull/518)) ### Added