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

Misc fixes of get_next_epoch_crosslink_committees #549

Merged
merged 3 commits into from
Feb 7, 2019
Merged

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Feb 1, 2019

  1. Fix type hintings
  2. Set registry_change clear
  3. Formatting

Question: should get_next_epoch_crosslink_committees return slot as well? My intuition tells me that would be helpful.

@hwwhww hwwhww requested a review from djrtwo February 1, 2019 18:13
@djrtwo
Copy link
Contributor

djrtwo commented Feb 2, 2019

Agreed. Slot will certainly be useful.

Want to add it?
Other than that PR looks good

@hwwhww
Copy link
Contributor Author

hwwhww commented Feb 3, 2019

@djrtwo Yes, will do 👍
And also return if the attester is the selected proposer or not.

@djrtwo
Copy link
Contributor

djrtwo commented Feb 7, 2019

I'm working on these minor updates @hwwhww

@djrtwo
Copy link
Contributor

djrtwo commented Feb 7, 2019

Changes pushed! Can you do a quick review? then I'll approve and merge

@hwwhww
Copy link
Contributor Author

hwwhww commented Feb 7, 2019

@djrtwo
Sorry for the late reply and thanks for the commit! 💯
I was trying to implement it in py-evm (but found that I need to implement other PR first...).
Fixed a tuple layer error and it's runnable in py-evm now.

For the case num_validators=40, epoch_length=16, target_committee_size=1, shard_count=2

validator_index=0
   committee=(31, 39, 0), shard=1, slot=29, is_proposer=True
   committee=(20, 0, 18), shard=1, slot=31, is_proposer=True
#######
validator_index=1
   committee=(17, 1, 35), shard=1, slot=27, is_proposer=False
   committee=(39, 8, 1), shard=1, slot=29, is_proposer=True
#######
validator_index=2
   committee=(9, 19, 2), shard=1, slot=19, is_proposer=False
   committee=(2, 26), shard=0, slot=26, is_proposer=True
#######
validator_index=3
   committee=(5, 3, 11), shard=1, slot=23, is_proposer=False
   committee=(38, 3, 29), shard=1, slot=19, is_proposer=True
#######
validator_index=4
   committee=(15, 12, 4), shard=1, slot=25, is_proposer=False
   committee=(28, 4), shard=0, slot=16, is_proposer=False
#######
validator_index=5
   committee=(5, 3, 11), shard=1, slot=23, is_proposer=False
   committee=(5, 36, 15), shard=1, slot=25, is_proposer=False
#######
validator_index=6
   committee=(6, 32, 23), shard=1, slot=21, is_proposer=True
   committee=(32, 6), shard=0, slot=20, is_proposer=False
#######
validator_index=7
   committee=(36, 7, 10), shard=1, slot=17, is_proposer=False
   committee=(19, 7), shard=0, slot=24, is_proposer=False
#######
validator_index=8
   committee=(18, 8, 33), shard=1, slot=31, is_proposer=True
   committee=(39, 8, 1), shard=1, slot=29, is_proposer=False
#######
validator_index=9
   committee=(9, 19, 2), shard=1, slot=19, is_proposer=False
   committee=(9, 16), shard=0, slot=28, is_proposer=True
#######
validator_index=10
   committee=(36, 7, 10), shard=1, slot=17, is_proposer=True
   committee=(30, 13, 10), shard=1, slot=27, is_proposer=False
#######
validator_index=11
   committee=(5, 3, 11), shard=1, slot=23, is_proposer=True
   committee=(11, 37), shard=0, slot=18, is_proposer=True
#######
validator_index=12
   committee=(15, 12, 4), shard=1, slot=25, is_proposer=True
   committee=(12, 22, 23), shard=1, slot=23, is_proposer=False
#######
validator_index=13
   committee=(13, 34), shard=0, slot=26, is_proposer=True
   committee=(30, 13, 10), shard=1, slot=27, is_proposer=False
#######
validator_index=14
   committee=(26, 14), shard=0, slot=18, is_proposer=False
   committee=(14, 27), shard=0, slot=30, is_proposer=True
#######
validator_index=15
   committee=(15, 12, 4), shard=1, slot=25, is_proposer=False
   committee=(5, 36, 15), shard=1, slot=25, is_proposer=False
#######
validator_index=16
   committee=(16, 28), shard=0, slot=30, is_proposer=True
   committee=(9, 16), shard=0, slot=28, is_proposer=False
#######
validator_index=17
   committee=(17, 1, 35), shard=1, slot=27, is_proposer=True
   committee=(31, 17, 35), shard=1, slot=17, is_proposer=False
#######
validator_index=18
   committee=(18, 8, 33), shard=1, slot=31, is_proposer=False
   committee=(20, 0, 18), shard=1, slot=31, is_proposer=False
#######
validator_index=19
   committee=(9, 19, 2), shard=1, slot=19, is_proposer=True
   committee=(19, 7), shard=0, slot=24, is_proposer=True
#######
validator_index=20
   committee=(24, 20), shard=0, slot=20, is_proposer=False
   committee=(20, 0, 18), shard=1, slot=31, is_proposer=False
#######
validator_index=21
   committee=(21, 27), shard=0, slot=16, is_proposer=True
   committee=(21, 34), shard=0, slot=22, is_proposer=True
#######
validator_index=22
   committee=(37, 22), shard=0, slot=28, is_proposer=False
   committee=(12, 22, 23), shard=1, slot=23, is_proposer=False
#######
validator_index=23
   committee=(6, 32, 23), shard=1, slot=21, is_proposer=False
   committee=(12, 22, 23), shard=1, slot=23, is_proposer=True
#######
validator_index=24
   committee=(24, 20), shard=0, slot=20, is_proposer=True
   committee=(25, 33, 24), shard=1, slot=21, is_proposer=False
#######
validator_index=25
   committee=(30, 25), shard=0, slot=22, is_proposer=False
   committee=(25, 33, 24), shard=1, slot=21, is_proposer=True
#######
validator_index=26
   committee=(26, 14), shard=0, slot=18, is_proposer=True
   committee=(2, 26), shard=0, slot=26, is_proposer=False
#######
validator_index=27
   committee=(21, 27), shard=0, slot=16, is_proposer=False
   committee=(14, 27), shard=0, slot=30, is_proposer=False
#######
validator_index=28
   committee=(16, 28), shard=0, slot=30, is_proposer=False
   committee=(28, 4), shard=0, slot=16, is_proposer=True
#######
validator_index=29
   committee=(38, 29), shard=0, slot=24, is_proposer=False
   committee=(38, 3, 29), shard=1, slot=19, is_proposer=False
#######
validator_index=30
   committee=(30, 25), shard=0, slot=22, is_proposer=True
   committee=(30, 13, 10), shard=1, slot=27, is_proposer=True
#######
validator_index=31
   committee=(31, 39, 0), shard=1, slot=29, is_proposer=False
   committee=(31, 17, 35), shard=1, slot=17, is_proposer=False
#######
validator_index=32
   committee=(6, 32, 23), shard=1, slot=21, is_proposer=False
   committee=(32, 6), shard=0, slot=20, is_proposer=True
#######
validator_index=33
   committee=(18, 8, 33), shard=1, slot=31, is_proposer=False
   committee=(25, 33, 24), shard=1, slot=21, is_proposer=False
#######
validator_index=34
   committee=(13, 34), shard=0, slot=26, is_proposer=False
   committee=(21, 34), shard=0, slot=22, is_proposer=False
#######
validator_index=35
   committee=(17, 1, 35), shard=1, slot=27, is_proposer=False
   committee=(31, 17, 35), shard=1, slot=17, is_proposer=True
#######
validator_index=36
   committee=(36, 7, 10), shard=1, slot=17, is_proposer=False
   committee=(5, 36, 15), shard=1, slot=25, is_proposer=True
#######
validator_index=37
   committee=(37, 22), shard=0, slot=28, is_proposer=True
   committee=(11, 37), shard=0, slot=18, is_proposer=False
#######
validator_index=38
   committee=(38, 29), shard=0, slot=24, is_proposer=True
   committee=(38, 3, 29), shard=1, slot=19, is_proposer=False
#######
validator_index=39
   committee=(31, 39, 0), shard=1, slot=29, is_proposer=False
   committee=(39, 8, 1), shard=1, slot=29, is_proposer=False

@djrtwo djrtwo merged commit cc2df63 into dev Feb 7, 2019
@djrtwo djrtwo deleted the registry_change branch February 7, 2019 20:32
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.

None yet

2 participants