Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Questions about get_shuffling() #39

Closed
paulhauner opened this issue Jul 10, 2018 · 4 comments
Closed

Questions about get_shuffling() #39

paulhauner opened this issue Jul 10, 2018 · 4 comments

Comments

@paulhauner
Copy link

paulhauner commented Jul 10, 2018

if validator_count < rand_max:
replacement_pos = (m % remaining) + i
o[i], o[replacement_pos] = o[replacement_pos], o[i]
i += 1

I'm going through the get_shuffling() function and I don't quite understand the logic here regarding rand_max. As I understand it, the program says presently that if validator_count > (max_validators / 2) then we should not shuffle and go into an infinite loop.

I assume the infinite loop thing is an extra indentation where there shouldn't be on line 62. However, I don't understand the "don't shuffle if validator_count < rand_max logic" (this condition is true whenever validator_count <= (max_validators / 2)).

Thanks! 🙂

@paulhauner
Copy link
Author

FYI I have a get_shuffling() implementation here which expresses how I understand it should work.

@djrtwo
Copy link
Contributor

djrtwo commented Jul 11, 2018

Closed in favor of #18

@djrtwo djrtwo closed this as completed Jul 11, 2018
@djrtwo djrtwo reopened this Jul 11, 2018
@djrtwo
Copy link
Contributor

djrtwo commented Jul 11, 2018

Whoops, wrong closure

@paulhauner
Copy link
Author

Closed in favor of #57

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants