From 04c69bf317537744525304893fe31b4d0f568b55 Mon Sep 17 00:00:00 2001 From: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Date: Fri, 31 May 2024 16:59:21 +0200 Subject: [PATCH] Block Request Judgement Calls on Polkadot (#338) This change blocks `request_judgement` calls on the Relay Chain. This is because requesting judgement reserves some funds to be sent to the registrar. This complicates migration to the People Chain and requires either breaking changes to the Identity pallet or phantom reserved funds. Blocking new requests (but allowing judgements and cancellations) prior to the migration will be simpler and lower risk. --- CHANGELOG.md | 1 + relay/polkadot/src/lib.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f34f76d1bd..81cb3dbd9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Transaction payments work via new `fungible` trait implementation ([polkadot-fellows/runtimes#332](https://github.com/polkadot-fellows/runtimes/pull/332)) +- Block `request_judgement` calls on the Relay Chain ([polkadot-fellows/runtimes#338](https://github.com/polkadot-fellows/runtimes/pull/338)) ### Fixed diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 38e53dc9e8..0c38abd3dd 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -61,8 +61,8 @@ use frame_support::{ genesis_builder_helper::{build_config, create_default_config}, parameter_types, traits::{ - fungible::HoldConsideration, ConstU32, EitherOf, EitherOfDiverse, Everything, Get, - InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage, + fungible::HoldConsideration, ConstU32, Contains, EitherOf, EitherOfDiverse, EverythingBut, + Get, InstanceFilter, KeyOwnerProofSystem, LinearStoragePrice, PrivilegeCmp, ProcessMessage, ProcessMessageError, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, @@ -175,8 +175,16 @@ parameter_types! { pub const SS58Prefix: u8 = 0; } +/// A type to identify `identity::request_judgement` calls. +pub struct IsIdentityJudgementRequestCall; +impl Contains for IsIdentityJudgementRequestCall { + fn contains(c: &RuntimeCall) -> bool { + matches!(c, RuntimeCall::Identity(pallet_identity::Call::request_judgement { .. })) + } +} + impl frame_system::Config for Runtime { - type BaseCallFilter = Everything; + type BaseCallFilter = EverythingBut; type BlockWeights = BlockWeights; type BlockLength = BlockLength; type RuntimeOrigin = RuntimeOrigin;