Skip to content

Commit

Permalink
Block Request Judgement Calls on Polkadot (#338)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joepetrowski authored May 31, 2024
1 parent d8365e3 commit 04c69bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 11 additions & 3 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -175,8 +175,16 @@ parameter_types! {
pub const SS58Prefix: u8 = 0;
}

/// A type to identify `identity::request_judgement` calls.
pub struct IsIdentityJudgementRequestCall;
impl Contains<RuntimeCall> 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<IsIdentityJudgementRequestCall>;
type BlockWeights = BlockWeights;
type BlockLength = BlockLength;
type RuntimeOrigin = RuntimeOrigin;
Expand Down

0 comments on commit 04c69bf

Please sign in to comment.