This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Refactor election solution trimming for efficiency #8614
Merged
Merged
Changes from 31 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
50a24bc
Refactor election solution trimming for efficiency
coriolinus d3cba7b
rework length-trim tests to work with the new interface
coriolinus 919c98d
simplify
coriolinus 9160387
add a fuzzer which can validate `Compact::encoded_size_for`
coriolinus b7fe186
Revert "add a fuzzer which can validate `Compact::encoded_size_for`"
coriolinus 47dceb8
revert changes to `trait CompactSolution`
coriolinus 25cd75e
WIP: restructure trim_assignments_length by actually encoding
coriolinus f9055e2
fix compiler errors
coriolinus 24bf2ad
don't sort voters, just assignments
coriolinus 983cac1
WIP: add `IndexAssignment` type to speed up repeatedly creating `Comp…
coriolinus e4287c7
Add IndexAssignment and conversion method to CompactSolution
coriolinus 232ec2b
use `CompactSolution::from_index_assignment` and clean up dead code
coriolinus c209b80
get rid of `from_index_assignments` in favor of `TryFrom`
coriolinus 60ee91e
cause `pallet-election-provider-multi-phase` tests to compile success…
coriolinus 4e42ed4
fix infinite binary search loop
coriolinus 859ebf3
fix a test failure
coriolinus 1a3987b
fix the rest of test failures
coriolinus 9601dd4
remove unguarded subtraction
coriolinus b04e165
fix npos-elections tests compilation
coriolinus 31222ca
ensure we use sp_std::vec::Vec in assignments
coriolinus 5602e93
Merge remote-tracking branch 'origin/master' into prgn-multi-phase-ef…
coriolinus 3dda173
add IndexAssignmentOf to sp_npos_elections
coriolinus 0c76b22
move miner types to `unsigned`
coriolinus 9960342
use stable sort
coriolinus 859555a
rewrap some long comments
coriolinus dd80c95
use existing cache instead of building a dedicated stake map
coriolinus 32ed1ec
generalize the TryFrom bound on CompactSolution
coriolinus 0edfca5
undo adding sp-core dependency
coriolinus e4d2823
consume assignments to produce index_assignments
coriolinus 73d3fdd
Add a test of Assignment -> IndexAssignment -> Compact
coriolinus 1a174aa
fix `IndexAssignmentOf` doc
coriolinus eed1c21
move compact test from sp-npos-elections-compact to sp-npos-elections
coriolinus 8f0e9c5
rename assignments -> sorted_assignments
coriolinus 26726f8
sort after reducing to avoid potential re-sort issues
coriolinus c9f2517
add runtime benchmark, fix critical binary search error
coriolinus 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.
out of curiosity why is it needed ?
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.
Not sure, actually; I just put it back into the dev-dependencies where it was before this PR. Looks like I assumed (wrongly) that it had previously been alphabetized.
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.
ah I wanted to ask about the requirement of
default-features = false
.For now we always test with std. thus we usually don't specify
default-features = false
.(Anyway I expect sp-core std feature to be activated by other crate when running the tests)