Skip to content
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

Dao permute blindvotelist if not majority hash #2361

Conversation

ManfredKarrer
Copy link
Member

No description provided.

@ManfredKarrer
Copy link
Member Author

I don't know why travis was complaining as in that PR the throws is not needed. I added it as in another PR the exception handling is changed and then its needed anyway. Hope Travis gets with the update its cache cleaned....

…hash

# Conflicts:
#	core/src/main/java/bisq/core/dao/governance/votereveal/VoteRevealService.java
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

I think it would be better to do the permutations starting with the more likely outcomes but the PR seems otherwise correct after applying my other suggestions.

common/src/main/java/bisq/common/util/PermutationUtil.java Outdated Show resolved Hide resolved
* @param <T> Type of list items
* @return List of possible permutations of the original list
*/
public static <T> List<List<T>> findAllPermutations(List<T> list, int maxIterations) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function will build permutations starting from shorter lists. If it reaches the max number of permutations it will skip the more likely cases with regard to voting. It's more likely that one or a few votes are missing rather than most of them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes agree. Not trivial though to optimize it in that direction...

common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
common/src/test/java/bisq/common/util/PermutationTest.java Outdated Show resolved Hide resolved
@ManfredKarrer ManfredKarrer merged commit 2befc7d into bisq-network:master Feb 3, 2019
@ManfredKarrer ManfredKarrer deleted the dao-permute-blindvotelist-if-not-majority-hash branch February 3, 2019 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants