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

Refactor get_persistent_committee #604

Merged
merged 2 commits into from
Feb 12, 2019

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Feb 11, 2019

  1. Fix typo and remove some redundant blanks.
  2. Add get_shuffled_committee for both earlier_ and later_ cases to reduce repeated logic.

@hwwhww hwwhww added the phase1 label Feb 11, 2019
def get_switchover_epoch(index):
return (
bytes_to_int(hash(earlier_seed + bytes3(index))[0:8]) %
PERSISTENT_COMMITTEE_PERIOD
)

# Take not-yet-cycled-out validators from earlier committee and already-cycled-in validators from
# later committee; return a sorted list of the union of the two, deduplicated
return sorted(list(set(
Copy link
Contributor

Choose a reason for hiding this comment

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

@hwwhww does this list -> set -> list operation preserve order in python?

@JustinDrake JustinDrake merged commit 41e95cf into dev Feb 12, 2019
@hwwhww hwwhww deleted the hwwhww/refactor_get_persistent_committee branch March 29, 2019 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants