-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix epmb solution duplicate issue + add remote mining apparatus to epm #8585
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
cad2d2a
fix epmb solution duplicate issue + add remote mining apparatus to epm
kianenigma 6ccaf5d
fmt
kianenigma ce38f37
Update from github-actions[bot] running command 'prdoc --bump patch'
github-actions[bot] f157289
feature-gate it
kianenigma 55f52b9
Merge branch 'kiz-ep-fix-duplicate' of github.com:paritytech/polkadot…
kianenigma f929b20
fix test ordering
kianenigma 32e7fe8
small fixes
kianenigma 1e2988e
Update substrate/frame/election-provider-multi-block/src/verifier/tes…
kianenigma 7ae1d15
Update substrate/frame/election-provider-multi-phase/src/remote_minin…
kianenigma b7f3508
Merge branch 'master' of github.com:paritytech/polkadot-sdk into kiz-…
kianenigma 059a2f1
Merge branch 'kiz-ep-fix-duplicate' of github.com:paritytech/polkadot…
kianenigma 7ea47a8
taplo
kianenigma 048d7fb
Apply suggestions from code review
kianenigma 4d4baa9
Apply suggestions from code review
kianenigma f11e18c
Empty-Commit
kianenigma 98e2b3f
Merge branch 'kiz-ep-fix-duplicate' of github.com:paritytech/polkadot…
kianenigma aecd4ee
Empty-Commit
kianenigma 0a809f1
Merge branch 'master' into kiz-ep-fix-duplicate
kianenigma 11f2af1
ignore flaky test
kianenigma 873f8bb
Merge branch 'kiz-ep-fix-duplicate' of github.com:paritytech/polkadot…
kianenigma 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| title: fix epmb solution duplicate issue + add remote mining apparatus to epm | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: | | ||
| Prevents the NPoS election process from accepting duplicate voters and targets. | ||
| crates: | ||
| - name: pallet-election-provider-multi-block | ||
| bump: patch | ||
| - name: pallet-election-provider-multi-phase | ||
| bump: patch | ||
| - name: frame-election-provider-solution-type | ||
| bump: patch | ||
| - name: frame-election-provider-support | ||
| bump: patch | ||
| - name: sp-npos-elections | ||
| bump: patch | ||
kianenigma marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1036,7 +1036,7 @@ mod trimming { | |
| (40, Support { total: 40, voters: vec![(40, 40)] }) | ||
| ], | ||
| vec![ | ||
| (30, Support { total: 11, voters: vec![(7, 7), (5, 2), (6, 2)] }), | ||
| (30, Support { total: 11, voters: vec![(5, 2), (6, 2), (7, 7)] }), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these ordering changes are irrelevant -- the order within |
||
| (40, Support { total: 7, voters: vec![(5, 3), (6, 4)] }) | ||
| ], | ||
| vec![(40, Support { total: 9, voters: vec![(2, 2), (3, 3), (4, 4)] })] | ||
|
|
@@ -1080,7 +1080,7 @@ mod trimming { | |
| // page only. | ||
| vec![(40, Support { total: 40, voters: vec![(40, 40)] })], | ||
| vec![ | ||
| (30, Support { total: 11, voters: vec![(7, 7), (5, 2), (6, 2)] }), | ||
| (30, Support { total: 11, voters: vec![(5, 2), (6, 2), (7, 7)] }), | ||
| (40, Support { total: 7, voters: vec![(5, 3), (6, 4)] }) | ||
| ], | ||
| vec![(40, Support { total: 9, voters: vec![(2, 2), (3, 3), (4, 4)] })] | ||
|
|
@@ -1122,7 +1122,7 @@ mod trimming { | |
| vec![ | ||
| vec![], | ||
| vec![ | ||
| (30, Support { total: 11, voters: vec![(7, 7), (5, 2), (6, 2)] }), | ||
| (30, Support { total: 11, voters: vec![(5, 2), (6, 2), (7, 7)] }), | ||
| (40, Support { total: 7, voters: vec![(5, 3), (6, 4)] }) | ||
| ], | ||
| vec![(40, Support { total: 9, voters: vec![(2, 2), (3, 3), (4, 4)] })] | ||
|
|
@@ -1160,11 +1160,11 @@ mod trimming { | |
| assert!(VerifierPallet::queued_score().is_some()); | ||
|
|
||
| assert_eq!( | ||
| dbg!(supports), | ||
| supports, | ||
| vec![ | ||
| vec![], | ||
| vec![ | ||
| (30, Support { total: 9, voters: vec![(7, 7), (6, 2)] }), | ||
| (30, Support { total: 9, voters: vec![(6, 2), (7, 7)] }), | ||
| (40, Support { total: 4, voters: vec![(6, 4)] }) | ||
| ], | ||
| vec![(40, Support { total: 9, voters: vec![(2, 2), (3, 3), (4, 4)] })] | ||
|
|
@@ -1203,7 +1203,7 @@ mod trimming { | |
| (40, Support { total: 40, voters: vec![(40, 40)] }) | ||
| ], | ||
| vec![ | ||
| (30, Support { total: 9, voters: vec![(7, 7), (6, 2)] }), | ||
| (30, Support { total: 9, voters: vec![(6, 2), (7, 7)] }), | ||
| (40, Support { total: 9, voters: vec![(5, 5), (6, 4)] }) /* notice how | ||
| * 5's stake is | ||
| * re-distributed | ||
|
|
@@ -1287,7 +1287,7 @@ mod trimming { | |
| (40, Support { total: 40, voters: vec![(40, 40)] }) | ||
| ], | ||
| vec![ | ||
| (30, Support { total: 14, voters: vec![(5, 5), (7, 7), (6, 2)] }), | ||
| (30, Support { total: 14, voters: vec![(5, 5), (6, 2), (7, 7)] }), | ||
| (40, Support { total: 4, voters: vec![(6, 4)] }) | ||
| ], | ||
| vec![(40, Support { total: 7, voters: vec![(3, 3), (4, 4)] })] | ||
|
|
@@ -1412,12 +1412,12 @@ mod base_miner { | |
| assert_eq!( | ||
| supports, | ||
| vec![vec![ | ||
| (10, Support { total: 30, voters: vec![(1, 10), (8, 10), (4, 5), (5, 5)] }), | ||
| (10, Support { total: 30, voters: vec![(1, 10), (4, 5), (5, 5), (8, 10)] }), | ||
| ( | ||
| 40, | ||
| Support { | ||
| total: 40, | ||
| voters: vec![(2, 10), (3, 10), (6, 10), (4, 5), (5, 5)] | ||
| voters: vec![(2, 10), (3, 10), (4, 5), (5, 5), (6, 10)] | ||
| } | ||
| ) | ||
| ]] | ||
|
|
@@ -1472,7 +1472,7 @@ mod base_miner { | |
| // voter 6 (index 1) is backing 40 (index 3). | ||
| // voter 8 (index 3) is backing 10 (index 0) | ||
| votes1: vec![(1, 3), (3, 0)], | ||
| // voter 5 (index 0) is backing 40 (index 10) and 10 (index 0) | ||
| // voter 5 (index 0) is backing 40 (index 3) and 10 (index 0) | ||
| votes2: vec![(0, [(0, PerU16::from_parts(32768))], 3)], | ||
| ..Default::default() | ||
| }, | ||
|
|
@@ -1500,8 +1500,8 @@ mod base_miner { | |
| vec![ | ||
| // page0, supports from voters 5, 6, 7, 8 | ||
| vec![ | ||
| (10, Support { total: 15, voters: vec![(8, 10), (5, 5)] }), | ||
| (40, Support { total: 15, voters: vec![(6, 10), (5, 5)] }) | ||
| (10, Support { total: 15, voters: vec![(5, 5), (8, 10)] }), | ||
| (40, Support { total: 15, voters: vec![(5, 5), (6, 10)] }) | ||
| ], | ||
| // page1 supports from voters 1, 2, 3, 4 | ||
| vec![ | ||
|
|
@@ -1591,13 +1591,13 @@ mod base_miner { | |
| ], | ||
| // page 1: 5, 6, 7, 8 | ||
| vec![ | ||
| (30, Support { total: 20, voters: vec![(7, 10), (5, 5), (6, 5)] }), | ||
| (30, Support { total: 20, voters: vec![(5, 5), (6, 5), (7, 10)] }), | ||
| (40, Support { total: 10, voters: vec![(5, 5), (6, 5)] }) | ||
| ], | ||
| // page 2: 1, 2, 3, 4 | ||
| vec![ | ||
| (30, Support { total: 5, voters: vec![(2, 5)] }), | ||
| (40, Support { total: 25, voters: vec![(3, 10), (4, 10), (2, 5)] }) | ||
| (40, Support { total: 25, voters: vec![(2, 5), (3, 10), (4, 10)] }) | ||
| ] | ||
| ] | ||
| .try_from_unbounded_paged() | ||
|
|
@@ -1761,8 +1761,8 @@ mod base_miner { | |
| vec![], | ||
| // supports from voters 5, 6, 7, 8 | ||
| vec![ | ||
| (10, Support { total: 15, voters: vec![(8, 10), (5, 5)] }), | ||
| (40, Support { total: 15, voters: vec![(6, 10), (5, 5)] }) | ||
| (10, Support { total: 15, voters: vec![(5, 5), (8, 10)] }), | ||
| (40, Support { total: 15, voters: vec![(5, 5), (6, 10)] }) | ||
| ], | ||
| // supports from voters 1, 2, 3, 4 | ||
| vec![ | ||
|
|
||
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.