ethereum / beacon_chain

MIT License
211 stars 65 forks source link

Assert in Shuffle Function #52

Closed terencechain closed 6 years ago

terencechain commented 6 years ago

Question regarding assert len(lst) <= 16777216 in the shuffle function. The max validator count is 2^22 but 16777216 is 2*24. Is that right?

hwwhww commented 6 years ago

I asked V the same question a few days ago, the answer is: the algorithm very directly depends on the number of validators being less than 2^24 because of how it gets indices three bytes at a time.

djrtwo commented 6 years ago

Yup 2^24 is the size of the datatype whereas 2^22 is the max validators due to imposed protocol limitations (related to approximate max ether supply and the 32 eth deposit size)

terencechain commented 6 years ago

Got it!