Spec update: remove BeaconState.shard_committees_at_slots in favor of crosslink committees; validator_registry_latest_change_slot -> validator_registry_update_slot mechanical renaming #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This works more or less, but fails at slot 128 due to some epoch boundary ethereum/consensus-specs#492. https://github.com/ethereum/eth2.0-specs/blob/master/specs/core/0_beacon-chain.md#get_crosslink_committees_at_slot has
assert state_epoch_slot <= slot + EPOCH_LENGTH
i.e.assert state.slot - (state.slot % EPOCH_LENGTH) <= slot + EPOCH_LENGTH
and https://github.com/ethereum/eth2.0-specs/blob/master/specs/core/0_beacon-chain.md#crosslinks hasFor every slot in range(state.slot - 2 * EPOCH_LENGTH, state.slot), let crosslink_committees_at_slot = get_crosslink_committees_at_slot(state, slot)
.At
state.slot == 128
, these conflict, resolving toFor every slot in range(0, 64), let crosslink_committees_at_slot = get_crosslink_committees_at_slot(state, slot)
which enumerates throughget_crosslink_committees_at_slot(state, 0)
, butassert state.slot - (state.slot % EPOCH_LENGTH) <= slot + EPOCH_LENGTH
i.e. assert128 - 0 <= 0 + 64
then fails.A previous variation on this bug also showed up at ethereum/consensus-specs#409
I don't want this PR to include them, but next steps are:
(1) when ethereum/consensus-specs#492 or something similar is merged, pull that in, to fix the slot 128 issue.
(2) address the ugliness and clumsiness around
ShardCommittee
being replaced by this by-hand-constructed, hierarchically composed type. It's why I named the fieldsa
andb
; otherwise they're just too verbose in type signatures, etc.(3) Incrementally remove the remaining references to/adapters for the previous
ShardCommittee
-based world.