From 25c02c13112b326ece8e9008a641034ffe6ae734 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Sat, 18 Nov 2023 21:27:06 -0500 Subject: [PATCH] Ban Serai from setting keys They were already banned form publishing `Batch`s, yet the ability to set keys enabled changing how certain functionality in the coordinator operated. Removing this malleability ensures operation as expected. --- substrate/validator-sets/pallet/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/substrate/validator-sets/pallet/src/lib.rs b/substrate/validator-sets/pallet/src/lib.rs index 83947d32..28ec02b8 100644 --- a/substrate/validator-sets/pallet/src/lib.rs +++ b/substrate/validator-sets/pallet/src/lib.rs @@ -741,6 +741,11 @@ pub mod pallet { Call::__Ignore(_, _) => unreachable!(), }; + // Don't allow the Serai set to set_keys, as they have no reason to do so + if network == &NetworkId::Serai { + Err(InvalidTransaction::Custom(0))?; + } + let session = Session(pallet_session::Pallet::::current_index()); let set = ValidatorSet { session, network: *network };