-
Notifications
You must be signed in to change notification settings - Fork 2.7k
extract some grandpa types to Primitives crate #12208
extract some grandpa types to Primitives crate #12208
Conversation
bkchr
left a comment
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.
Two nitpicks, otherwise it looks good.
| /// This is meant to be stored in the db and passed around the network to other | ||
| /// nodes, and are used by syncing nodes to prove authority set handoffs. | ||
| #[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)] | ||
| pub struct GrandpaJustification<Block: BlockT> { |
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.
| pub struct GrandpaJustification<Block: BlockT> { | |
| pub struct GrandpaJustification<Header: HeaderT> { |
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.
I also want to use it in this way. But its impls must use Block type.
| pub justification: sp_finality_grandpa::GrandpaJustification<Block::Header>, | ||
| _block: PhantomData<Block>, |
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.
| pub justification: sp_finality_grandpa::GrandpaJustification<Block::Header>, | |
| _block: PhantomData<Block>, | |
| pub justification: sp_finality_grandpa::GrandpaJustification<Header>, |
|
LGTM. If we want to go even deeper I think that almost everything concerning communication For example starting from the The various messages All the way up to the So in short I think that Grandpa mostly requires to be generic over the Should also be said that in practice it also doesn't make much difference. |
Yeah, I know. When grandpa types and logic are used for a specific instance chain, Block trait constraint is enough. But current I need to verifiy grandpa in multi-chains(though all Block types maybe are same). So Header trait is better. |
Indeed I was silently pushing for bouding everything to |
|
bot merge |
|
Waiting for commit status. |
* extract some grandpa types to primitives * fmt * fmt
Headerrather than theBlocktype.pub.