-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
The full client now tracks finality by querying the engine on each block import, and it also persists the finalization state to the DB. For the light client current it doesn't persist finality information and only keeps track of finality for epoch signals, by calling `is_epoch_end_light`. This method implements the previously existing logic of building finality for all the blocks in the current epoch and then checking the finalized blocks against the transition store.
- missing docs for is_epoch_end_light - unused method unfinalized_hashes in RollingFinality
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.
In general LGTM. Is it possible to add a couple of tests here?
}; | ||
|
||
let ancestry_iter = ancestry.map(|header| { | ||
let mut signers = vec![header.author().clone()]; |
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.
let mut signers = vec![header.author().clone()]; | |
let mut signers = vec![*header.author()]; |
} | ||
} | ||
|
||
let finalized = epoch_manager.finality_checker.push_hash(chain_head.hash(), vec![chain_head.author().clone()]); |
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.
let finalized = epoch_manager.finality_checker.push_hash(chain_head.hash(), vec![chain_head.author().clone()]); | |
let finalized = epoch_manager.finality_checker.push_hash(chain_head.hash(), vec![*chain_head.author()]); |
if !epoch_manager.zoom_to(&*client, &self.machine, &*self.validators, chain_head) { | ||
return None; | ||
} | ||
let mut hash = chain_head.parent_hash().clone(); |
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.
let mut hash = chain_head.parent_hash().clone(); | |
let mut hash = *chain_head.parent_hash(); |
let mut ancestry = itertools::repeat_call(move || { | ||
chain(hash).and_then(|header| { | ||
if header.number() == 0 { return None } | ||
hash = header.parent_hash().clone(); |
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.
hash = header.parent_hash().clone(); | |
hash = *header.parent_hash(); |
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 good to me, nitpick clone
on copy-type but I'm not that familiar with this part of codebase so probably good with another review!
Reopen stale #9113. I couldn't reopen #9113 since I rebased the branch and force-pushed.
ExtendedHeader
is_epoch_end
was updated to take a vec of recently finalized headersis_epoch_end_light
was added which maintains the previous interface and is used by the light client since the client itself doesn't track finality