Design and implement pallet-staking-rc-client
#6166
Labels
T2-pallets
This PR/Issue is related to a particular pallet.
pallet-staking-rc-client
#6166
Design and implement the relay-chain client pallet (i.e. deployed in the staking parachain) that handles i/o from the relay chain, most notably:
New pallet being worked at https://github.com/paritytech/polkadot-sdk/compare/gpestana/staking-rc-client. Opening a PR asap.
Counter-part pallet of
pallet-staking-client
(#6167).Tasks
The relay chain and AH staking need to interact with each other over an era in different phases of an election. The communication must be done through XCM and each of functions have different requirements and time/space constraints.
Era rotation and new validator set
The relay-chain does not have the concept of "era". Staking and EPM-MB will run the elections in AH and once a new set of validators is ready, it notifies the relay-chain to change the validator set through XCM. This means that if no election happens within the expected time, the current validator set will remain active in the relay-chain.
new_validator_set
XCM message passing (pallet-staking-rc-client
-> relay-chain) with message batchingRegister/unregister validator keys
Currently, the session pallet in the relay-chain exposes
Call::set_keys
andCall::purge_keys
for wannabe validators to set/unset their session keys. With AH staking, these extrinsics should be exposed in thepallet-staking-rc-client
(or in thepallet-staking
). This information should be propagated through XCM to thepallet-staking-client
in the relay chain with a similar behaviour as currently (i.e.set_keys
will be placed in theNextKeys
storage, etc).set_keys
/purge_keys
extrinsic ad XCM message passing (pallet-staking-rc-client
-> relay-chain)NextKeys
in relay-chain is in sync with the new session/era expected by AH?Block producing era points
Currently, the staking pallet implements the
pallet_authorship::EventHandler
to receive the era points of a block author for the current session. As similar interface must be implemented with XCM as i/o instead.Given the potential delays in calling and propagating
EventHandler::reward_by_ids
between rc and AH, the reward payout may be done only after era+1 ("era" being the active era of the validator).(session, validator)
tuple?Offences
There are 2 types of offence reports currently, implicit and explicit. The implicit offences are generated in the relay chain and should be propagated to AH staking for slashing. The explicit (i.e. signed offences) are reported by signed origins through an extrinsic. This extrinsic should be implemented in the
pallet-staking-rc-client
(i.e. in AH) and relayed to the relay chain with XCM.The relay chain should implement a thin disablement layer to ensure that the implicit offences result in a timely validator disablement in the relay-chain without having to wait for the RC -> AH -> RC XCM message passing.
report_offence
) extrinsic and XCM message passing (pallet-staking-rc-client
-> relay-chain)pallet-staking-client
(in relay-chain). Related to Design and implementpallet-staking-client
#6167The text was updated successfully, but these errors were encountered: