This repository was archived by the owner on Nov 6, 2020. It is now read-only.
aura: finalize blocks#9692
Merged
Merged
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
ascjones
reviewed
Oct 18, 2018
Contributor
ascjones
left a comment
There was a problem hiding this comment.
In general LGTM. Is it possible to add a couple of tests here?
ascjones
approved these changes
Oct 23, 2018
niklasad1
reviewed
Oct 23, 2018
| }; | ||
|
|
||
| let ancestry_iter = ancestry.map(|header| { | ||
| let mut signers = vec![header.author().clone()]; |
Collaborator
There was a problem hiding this comment.
Suggested change
| let mut signers = vec![header.author().clone()]; | |
| let mut signers = vec![*header.author()]; |
niklasad1
reviewed
Oct 23, 2018
| } | ||
| } | ||
|
|
||
| let finalized = epoch_manager.finality_checker.push_hash(chain_head.hash(), vec![chain_head.author().clone()]); |
Collaborator
There was a problem hiding this comment.
Suggested change
| 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()]); |
niklasad1
reviewed
Oct 23, 2018
| if !epoch_manager.zoom_to(&*client, &self.machine, &*self.validators, chain_head) { | ||
| return None; | ||
| } | ||
| let mut hash = chain_head.parent_hash().clone(); |
Collaborator
There was a problem hiding this comment.
Suggested change
| let mut hash = chain_head.parent_hash().clone(); | |
| let mut hash = *chain_head.parent_hash(); |
niklasad1
reviewed
Oct 23, 2018
| let mut ancestry = itertools::repeat_call(move || { | ||
| chain(hash).and_then(|header| { | ||
| if header.number() == 0 { return None } | ||
| hash = header.parent_hash().clone(); |
Collaborator
There was a problem hiding this comment.
Suggested change
| hash = header.parent_hash().clone(); | |
| hash = *header.parent_hash(); |
niklasad1
reviewed
Oct 23, 2018
sorpaas
approved these changes
Oct 25, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopen stale #9113. I couldn't reopen #9113 since I rebased the branch and force-pushed.
ExtendedHeaderis_epoch_endwas updated to take a vec of recently finalized headersis_epoch_end_lightwas added which maintains the previous interface and is used by the light client since the client itself doesn't track finality