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

epoch processing before block processing #480

Closed
wants to merge 2 commits into from
Closed

Conversation

djrtwo
Copy link
Contributor

@djrtwo djrtwo commented Jan 21, 2019

Note: get_crosslink_committees_at_slot can access shufflings arbitrarily in the future, but this is not guaranteed to remain stable if a state transition changes the shuffling between state.slot and the future slot (validator registry change, or power of 2 reshuffling).

Note: The per-slot transition line "Set state.validator_registry[get_beacon_proposer_index(state, state.slot)].randao_layers += 1" is still broken at the state transition epochs because the shuffling is not yet updated at this point, but I'm leaving it in because it is very likely to be removed after our discussion about removing the hash-onion entirely.

@djrtwo djrtwo changed the title epoch processing before block processing [WIP] epoch processing before block processing Jan 21, 2019
@djrtwo
Copy link
Contributor Author

djrtwo commented Jan 21, 2019

EDIT: ready for review

@djrtwo djrtwo changed the title [WIP] epoch processing before block processing epoch processing before block processing Jan 21, 2019

if slot < state_epoch_slot:
if slot < state.current_epoch_calculation_slot:
committees_per_slot = get_previous_epoch_committee_count_per_slot(state)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this is wrong, and state_epoch_slot is correct. The current_epoch_calculation_slot is the slot the data from which is used to calculate the current shuffling, which could be prior to the current slot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right and if it is prior, we fall through to the else and use the current_ seed, calc slot, etc.

I think this is essentially doing to same thing but more explicitly uses the slots we stored in state and I think is clearer.

The future slots is not generally safe so I'll add the restriction back in.

@djrtwo
Copy link
Contributor Author

djrtwo commented Jan 25, 2019

closing in favor of #492

@djrtwo djrtwo closed this Jan 25, 2019
@hwwhww hwwhww deleted the epoch-trans-at-begin branch January 31, 2019 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants