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

assertion in get_active_index_root too strong #515

Closed
djrtwo opened this issue Jan 29, 2019 · 0 comments
Closed

assertion in get_active_index_root too strong #515

djrtwo opened this issue Jan 29, 2019 · 0 comments
Labels
general:bug Something isn't working

Comments

@djrtwo
Copy link
Contributor

djrtwo commented Jan 29, 2019

Issue

In validator registry and shuffling seed data we set state.current_calculation_epoch = next_epoch and then do state.current_epoch_seed = generate_seed(state, state.current_calculation_epoch), but the assertion in get_active_index_root (used in generate_seed) asserts that the largest epoch you can access is current_epoch.

Proposed Solution

Allow access of next_epoch (current_epoch + 1). This is safe as long as we make sure we run "Set state.latest_index_roots[next_epoch % LATEST_INDEX_ROOTS_LENGTH] = hash_tree_root(get_active_validator_indices(state, next_epoch)) before any calls to get_active_index_root which we currently do.

@djrtwo djrtwo added the general:bug Something isn't working label Jan 29, 2019
tersec added a commit to status-im/nimbus-eth2 that referenced this issue Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant