-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
historical votes #2085
Merged
Merged
historical votes #2085
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9b3af6b
historical votes
turuslan 95653c8
pr comment
turuslan be44d95
Merge branch 'master' into feature/historical-votes
kamilsa 3b0dbe9
Merge branch 'master' into feature/historical-votes
kamilsa 8de58d5
Merge remote-tracking branch 'origin/master' into feature/historical-…
turuslan 15a4c8b
rewrite historical votes implementation
turuslan 4109745
Merge remote-tracking branch 'origin/master' into feature/historical-…
turuslan 6c4d98c
Merge remote-tracking branch 'origin/master' into feature/historical-…
turuslan 97d75de
remove unused, comments
turuslan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Copyright Quadrivium LLC | ||
* All Rights Reserved | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "consensus/grandpa/structs.hpp" | ||
|
||
namespace kagome::consensus::grandpa { | ||
/** | ||
* Historical votes seen in a round. | ||
* https://github.com/paritytech/finality-grandpa/blob/8c45a664c05657f0c71057158d3ba555ba7d20de/src/lib.rs#L544 | ||
*/ | ||
struct HistoricalVotes { | ||
SCALE_TIE(3); | ||
|
||
std::vector<SignedMessage> seen; | ||
std::optional<uint64_t> prevote_idx, precommit_idx; | ||
}; | ||
|
||
class SaveHistoricalVotes { | ||
public: | ||
virtual ~SaveHistoricalVotes() = default; | ||
|
||
/** | ||
* Called from `VotingRoundImpl` to `GrandpaImpl` to save historical vote. | ||
*/ | ||
virtual void saveHistoricalVote(AuthoritySetId set, | ||
RoundNumber round, | ||
const SignedMessage &vote, | ||
bool set_index) = 0; | ||
}; | ||
} // namespace kagome::consensus::grandpa |
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.