-
Notifications
You must be signed in to change notification settings - Fork 926
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
Proposal for persistent committees #375
Comments
For proposal 2, is the following how we would calculate the actual persistent committees at any time?
actual_persistent_committees = [
prev_persistent_committees[shard] + persistent_committees[shard]
for shard in range(SHARD_COUNT)
] And if we use one of the shufflings that allows us to directly calculate positions, then we can easily reduce the above routine to a single shard. |
I think I remember @JustinDrake was keen to have slot granular randao mixes for more optionality to expose to use layer. It should be noted that this proposal removes that granularity. I think it's fine. I'm not sure there is much benefit to expose so many mixes. In the event that we have VDFs only the epoch boundaries will be hardened anyway. |
I lean in favor [2] as well. It seems a little less clean due to the varied range of lookahead for each validator, but reducing the overhead required to get the shuffling of a particular shard by 1000x seems like a solid win for resource constrained defines. We need to switch the shuffling alg to something like in #323 to get this benefit, correct? |
I don't care too much about that :) The application layer can use maximally-granular RANDAO mixes extremely simply: just pass in the intermediate values and verify they match the boundary RANDAO mixes. |
That looks right.
Yes. |
One recent desideratum of the spec has been to remove the explicit shufflings (both crosslink and persistent committees) from the state, allowing it to instead be calculated directly from the validator set (see #374 which makes it easy to determine historical validator sets from present state) and a historical RANDAO value. Here is a specific proposal for doing the same for persistent committees.
Preliminaries:
RESHUFFLE_PERIOD = 1024
epochs (~4.5 days). Letget_randao_mix_at_epoch(e) = latest_randao_mixes[e % LATEST_RANDAO_MIXES_LENGTH]
latest_randao_mixes
array so it stores the last 8192 epoch boundary RANDAOs, not the last 8192 slot RANDAOs.reassign_position(validator_index) = validator_index % RESHUFFLE_PERIOD
Proposal 1
For every validator, we calculate a "relevant randao hash" that changes every RESHUFFLE_PERIOD epochs, but where different validators' hashes change at different times. These hashes are then used to determine what shard a validator is in.
epoch(slot) = slot // EPOCH_LENGTH
. Letrelevant_randao_epoch(validator_index, current_slot) = max(0, epoch(current_slot) - (epoch(current_slot) % RESHUFFLE_PERIOD) - RESHUFFLE_PERIOD + reassign_position(validator_index))
relevant_randao_hash(validator_index, current_slot) = get_randao_mix_at_epoch(relevant_randao_epoch(validator_index, current_slot))
To determine what shard a validator with some
validator_index
is on, calculatehash(relevant_randao_hash(validator_index, state.slot) + bytes8(validator_index)) % SHARD_COUNT
.Proposal 2
Let
current_epoch = epoch(current_slot)
,reshuffle_epoch = current_epoch - current_epoch % RESHUFFLE_PERIOD - RESHUFFLE_PERIOD
. Usesplit(shuffle(get_active_validator_set(reshuffle_slot), get_randao_mix_at_epoch(current_epoch))
to calculate the "current shard committees".However, for any individual validator with some
index
, when the shard committee switches, they continue using the old committee for an additionalhash(get_randao_mix_at_epoch(current_epoch) + bytes8(index)) % RESHUFFLE_PERIOD
epochs.Properties
Benefits of both proposals:
Differences between the two proposals:
At present I lean toward proposal 2 or something similar because of the last item especially, though either seems fundamentally workable.
Roadmap strategy notes:
The text was updated successfully, but these errors were encountered: