[AHM] refactor: Move disable logic from pallet-staking
to pallet-session
#6508
Labels
I4-refactor
Code needs refactoring.
pallet-staking
to pallet-session
#6508
Context
The initial discussion on this took place here.
Currently the validator disable logic is mostly contained in
pallet-staking
, which passes the information topallet-session
, that then calls the pallets registered as SessionHandler.But staking does not have a concept of disabling in itself, and everything needed to apply disable logic can also be done in
pallet-staking
. The larger issue with current code is that, it becomes incompatible (or at least very inefficient) when staking moves to AH and communication between staking <> session becomes async.Proposed disable flow post AH migration
OffenceSeverity
(same asSlashPerbill
) in itsDisabledValidators
storage.SlashPerbill
) is sent to AH for slashing.In practice, pallet_staking will be replaced by
pallet_staking_client
(or a more suitable name) that will fill in the gaps. That is, it will act asOnOffenceHandler
andSessionManager
on RC, and async communicate with Staking/AH.Refactor tasks
pallet-session
.pallet-staking
should not know anything about disabling.DisabledValidators
list is maintained in two places: pallet-session and pallet-staking. Thepallet-staking
storage should be removed and the offense severity should be migrated topallet-session
.The text was updated successfully, but these errors were encountered: