You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During GENESIS_EPOCH, get_crosslink_committees_at_slot(..) reads state.previous_shuffling_epoch when epoch == current_epoch.
Detail
get_crosslink_committees_at_slot(...) first checks for epoch == previous_epoch, then checks for epoch == current_epoch.
During the genesis epoch, current_epoch == previous_epoch and the function so uses state.previous_shuffling_epoch == ZERO_HASH for shuffling.
During the next epoch (GENESIS_EPOCH + 1), when you wish to get the shuffling for GENESIS_EPOCH, you also trigger the current_epoch == previous_epoch path. However, state.previous_shuffling_epoch != ZERO_HASH anymore -- it is now the value that was set during get_genesis_beacon_state(...) (a.k.a. current_shuffling_seed during GENESIS_EPOCH).
Proposed Solutions
(Preferred) Swap the if statements for so we first check for epoch == current_epoch, then epoch == previous_epoch.
(Seems wrong) During get_genesis_beacon_state(..) ensure state.previous_shuffling_seed is also set to generate_seed(state, GENESIS_EPOCH).
The text was updated successfully, but these errors were encountered:
paulhauner
added a commit
to paulhauner/eth2.0-specs
that referenced
this issue
Feb 16, 2019
Problem
Summary
During
GENESIS_EPOCH
,get_crosslink_committees_at_slot(..)
readsstate.previous_shuffling_epoch
whenepoch == current_epoch
.Detail
get_crosslink_committees_at_slot(...)
first checks forepoch == previous_epoch
, then checks forepoch == current_epoch
.During the genesis epoch,
current_epoch == previous_epoch
and the function so usesstate.previous_shuffling_epoch == ZERO_HASH
for shuffling.During the next epoch (
GENESIS_EPOCH + 1
), when you wish to get the shuffling forGENESIS_EPOCH
, you also trigger thecurrent_epoch == previous_epoch
path. However,state.previous_shuffling_epoch != ZERO_HASH
anymore -- it is now the value that was set duringget_genesis_beacon_state(...)
(a.k.a.current_shuffling_seed
duringGENESIS_EPOCH
).Proposed Solutions
if
statements for so we first check forepoch == current_epoch
, thenepoch == previous_epoch
.get_genesis_beacon_state(..)
ensurestate.previous_shuffling_seed
is also set togenerate_seed(state, GENESIS_EPOCH)
.The text was updated successfully, but these errors were encountered: