Voting Manager fix to ignore duplicate collateral members (1.1.0.0)#672
Merged
quantumagi merged 5 commits intostratisproject:release/1.1.0.0from Aug 25, 2021
Merged
Conversation
Contributor
Author
fassadlr
reviewed
Aug 23, 2021
| if (poll.VotingData.Key == VoteKey.AddFederationMember) | ||
| federation.Add(federationMember); | ||
| { | ||
| if (!federation.Any(m => m is CollateralFederationMember colMember && federationMember is CollateralFederationMember colMember2 && colMember.CollateralMainchainAddress == colMember2.CollateralMainchainAddress)) |
Contributor
There was a problem hiding this comment.
Shouldnt the federationMember is CollateralFederationMember colMember2 part here be outside of the Any ?
It probs amounts to the same but it reads better and also the type doesnt happen for every member in the federation?
Contributor
There was a problem hiding this comment.
Or is this acting as a compare then?
fassadlr
approved these changes
Aug 23, 2021
Contributor
Author
|
We need a PR to bump the NBitcoin version. Some other PR somehow got merged with a change to NBitcoin without bumping the version... |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

PR #272 specified that voting, which would otherwise result in adding a member, would not do so if collateral address re-use is detected.
Similarly (this PR) such members should also be omitted when the federation is later re-created from the polls.
On a side-note, a follow-up PR is required to somehow strengthen/fix the
VotingRequestValidationRuleto prevent such duplicate addresses from appearing in voting requests when already in a voting request, the active federation, pending or approved polls. I.e. these duplications should never reach the VM in the first place.