-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Relay chain client pallet for AH Staking #6259
base: master
Are you sure you want to change the base?
Conversation
|
||
assert_eq!(Outbound::get(), vec![MockMessages::SetSessionKeys((1, keys, vec![0, 0, 0]))]); | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks overall good, but it is hard to measure how correct this is, before seeing an e2e usage. I think this pallet should have very few unit tests, and many RC + Para tests based on XCM emulator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's a good point. That's why I ended up adding the integration-tests
crate before completing these pallet unit tests, as the integration tests will be more useful.
//! termination, performs pre-checks and propagates that information to another pallet or consensus | ||
//! system through the [`crate::Config::SessionKeysHandler`]. | ||
//! | ||
//! Callers can request to 1) set validator keys and 2) purge validator keys. These actions *may |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this any different from calling pallet_xcm::send_xcm(transact { relay_chain_call })
? I suggest consulting with @franciscoaguirre in the high level of design of RC <> AH interaction.
This PR introduces a new pallet (
pallet-staking-rc-client
) which abstracts the interfaces that staking needs to interact with but, in the context of AHM, will be in a different consensus system (i.e. in the relay chain). This new pallet acts as a session and on-offence handler broker and sits in "between" the staking pallet in AH and the relay chain, while being part of the AH runtime.The main design goal of this pallet is twofold:
trait SessionManager
and other interfaces in Asset Hub in a way that is transparent to the pallet staking. The current staking logic should have no changes (minimal at most) and it doesn't really care whether the session manager implementors and others are part of the AH runtime or in an external consensus system.staking > relay chain
and abstract it as much as possible, implementing caching and other strategies to mimmic as much as possible a sync flow between staking and the relay chain.This PR also adds an integration test module where the behaviour between staking and the relay-chain pallets, brokered by
pallet-staking-rc-client
, can be tested as close as possible to the real case scenario of multi-chain communication.Closes #6166