Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Prepare SessionInfo module to be used in practice #2093

Closed
rphmeier opened this issue Dec 9, 2020 · 2 comments · Fixed by #2102
Closed

Prepare SessionInfo module to be used in practice #2093

rphmeier opened this issue Dec 9, 2020 · 2 comments · Fixed by #2102
Assignees
Labels
I4-annoyance Code behaves within expectations, however this “expected behaviour” itself is at issue.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Dec 9, 2020

After #2092 all runtimes will be aware of Assignment keys.

We have two issues right now:

  1. No way exists currently for the AssignmentIds to make their way into the SessionChangeNotifications issued by the Initializer. We'll need to find a way to wire both keys into the initializer, which Substrate's APIs haven't quite been designed for. Then it should be trivial to pull the AssignmentIds out of the SessionChangeNotification in SessionInfo.
  2. The SessionInfo module will initially have EarliestSession be 0, but when introduced on a live chain that's been around for several thousand sessions (Kusama, Polkadot), it'll end up in a potentially heavy loop trying to prune all session info from 0..some_high_session_number. We should work around this so enabling the SessionInfo module on existing chains is light.
@rphmeier rphmeier added the I4-annoyance Code behaves within expectations, however this “expected behaviour” itself is at issue. label Dec 9, 2020
@rphmeier rphmeier added this to the Medical Center milestone Dec 9, 2020
@ordian ordian self-assigned this Dec 9, 2020
@ordian
Copy link
Member

ordian commented Dec 9, 2020

For 1, an alternative would be to have a runtime module storing those keys for the current session and session info module fetching those keys as we do with the authority discovery keys. This works because of 1 block delay in the session change notification.

@rphmeier
Copy link
Contributor Author

rphmeier commented Dec 9, 2020

We could even have the Initializer be that module. We'd just have to implement the OneSessionHandler for some wrapper around Initializer like AssignmentKeyHandler<Initializer>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I4-annoyance Code behaves within expectations, however this “expected behaviour” itself is at issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants