-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
pub struct ImportRoute { | ||
/// Blocks that were invalidated by new block. | ||
pub invalidated_blocks: Vec<H256>, | ||
/// Blocks that were validted by new 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.
typo
In What about something like enum InsertResult/InsertLocation {
CanonChain(route),
Branch(route),
BranchBecameCanonChain(retracted_route/invalidated_route, route)
} |
But regarding this enum: enum InsertResult/InsertLocation {
CanonChain(route),
Branch(route),
BranchBecameCanonChain(retracted_route/invalidated_route, route)
} there is no reason to have route for branch / canonchain. Branch does not have a route at all, and for canon chain, route == inserted block hash. I would prefer to keep |
Agreed. What about |
I'm open for other ideas. Current name comes from cpp implementation. |
I vote for keeping it consistent with cpp or calling it |
@@ -42,6 +44,8 @@ pub enum BlockLocation { | |||
/// Hash of the newest common ancestor with old canon chain. | |||
ancestor: H256, | |||
/// Hashes of the blocks between ancestor and this block. | |||
route: Vec<H256> | |||
route: Vec<H256>, |
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.
enacted
prefer snappier naming than the asymmetric |
cc @tomusdrw . You probably need it :)