ethereum / beacon_chain

MIT License
211 stars 65 forks source link

Question: `update_ffg_and_crosslink_progress()` #45

Closed paulhauner closed 6 years ago

paulhauner commented 6 years ago

https://github.com/ethereum/beacon_chain/blob/a1618446895896c5924c238cc2b0cbac69d07433/beacon_chain/state/state_transition.py#L282-L288

I'm a bit confused about the logic here, especially lines 285 and 286.

Should 285 be if !has_voted(new_ffg_bitfield, index)?

djrtwo commented 6 years ago

Yes, that was incorrectly translated when adding the has_voted helper method in this commit https://github.com/ethereum/beacon_chain/commit/72c77f9452be50760d46591bd70e6c80a54ddfcd#diff-04e2688581f39b6a4f68a8bd1dcc7ca5R285

Notice the == 0 in the original bit check.

Changing this to a "bug"

djrtwo commented 6 years ago

Also... nice catch!

djrtwo commented 6 years ago

Closed due to updated spec/code