Eth2.0-specs: issues when disparity between actual epoch and shuffling epoch

Created on 19 Mar 2019  路  3Comments  路  Source: ethereum/eth2.0-specs

issues in get_active_validator_indices

We use current_epoch and previous_epoch when calling get_active_validator_indices in many places rather than using current_shuffling_epoch and previous_shuffling_epoch.

In some places, this functionality is equivalent either way, but the calls to get_active_validator_indices that use previous_epoch rather than previous_shuffling_epoch are incorrect.
For example:

  • get_previous_total_balance uses previous_epoch instead of previous_shuffling_epoch and so in many cases the total balance gathered here would be from the incorrect validator set.
  • in compute_normal_justification_and_finalization_deltas we iterate through the previous validator set but are using previous_epoch. This can causes a mismatch between the v-set iterated through and the actual v-set attesting for that previous epoch.

I suggest that we use current_shuffling_epoch and previous_shuffling_epoch throughout when calling `get_active_validator_indices

issues in latest_active_index_roots

A related issue...
The way we are setting the latest_active_index_roots means that often the root store in the state cache is different from the actual active validator root.

In final updates we set latest_active_index_roots to be the active validator set for the epoch ACTIVE_EXIT_DELAY epochs in the future. Are we concerned that this isn't the _actual_ active validator set during that epoch given that the shuffling epoch could lag behind? In the extreme case when a registry change does not happen for more than LATEST_ACTIVE_INDEX_ROOTS_LENGTH, the state would not even have the correct active_index_root cached anymore.

bug

Most helpful comment

808 removes it because previous_shuffling_epoch just always equals previous_epoch, as shuffling happens every epoch. This _seems_ like it resolves all of these issues.

All 3 comments

808 removes previous_shuffling_epoch. Should we keep it?

808 removes it because previous_shuffling_epoch just always equals previous_epoch, as shuffling happens every epoch. This _seems_ like it resolves all of these issues.

closed due to #808 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dangerousfood picture dangerousfood  路  5Comments

ralexstokes picture ralexstokes  路  3Comments

hwwhww picture hwwhww  路  3Comments

paulhauner picture paulhauner  路  4Comments

mratsim picture mratsim  路  5Comments