-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Tuple based session key module. #2713
Conversation
|
I'm fine with the "just have your e.g. we have two keys trait MyConsensusTrait: session::Trait {
type OurKey;
type ConvertSessionKey: Convert<<Self as session::Trait>::SessionKey, Self::OurKey>;
} |
|
So this glue has to go into the aura::Trait, grandpa::Trait and babe::Trait? |
a008a63 to
580ac33
Compare
580ac33 to
7b26636
Compare
94bfcc6 to
57e747d
Compare
Yup |
|
Just some considerations about BLS keys: It's fine if GRANDPA reads them in using some trait like Any type that satisfies the The session keys database should ideally be pulled out from the chain's data into some in-memory database like once per validator set election. It'll get run very slow if you end up checking the proofs-of-possession with every block or something. I've no idea how this interacts with forks around the validator set election or whatever. |
57e747d to
d4caad6
Compare
|
@dvc94ch The original design for this probably won't work; session module will need to keep an eye on the individual keys to ensure that validators do not use any key that some other validator has registered. Something like #2628 is therefore needed, though it should be made to work with all elements of the tuple. So: session module itself will need to know how to deconstruct session key "tuples" into individual keys, and it should maintain a per-key ordered list of active session keys in order to have efficient means of prevent a duplicate being registered. |
|
I'll write a bit of pseudocode to illustrate... |
|
Some considerations about the structure listed in paritytech/polkadot#47 (comment) |
The session module already supports tuple based session keys. You can add a custom session key type and provide
Into<sr25519::Public>andInto<ed25519::Public>orInto<ble::Public>implementations. I updated the test to include such an example. Please let me know if I've missed the point :) @gavofyork @kianenigma