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

Fair proposer sampling #733

Merged
merged 2 commits into from
Mar 12, 2019
Merged

Fair proposer sampling #733

merged 2 commits into from
Mar 12, 2019

Conversation

JustinDrake
Copy link
Collaborator

I think we want first_committee[epoch % len(first_committee)] as opposed to first_committee[slot % len(first_committee)]. The reason is that if the shuffling happens infrequently and len(first_committee) is a multiple of SLOTS_PER_EPOCH then the proposers will not be sampled fairly.

Taking this logic further, we may want to avoiding always picking the proposer from first_committee, e.g.:

    validators_at_slot = []
    for crosslink_committee, _ in get_crosslink_committees_at_slot(state, slot, registry_change):
        validators_at_slot.append(crosslink_committee)

    return validators_at_slot[epoch % len(validators_at_slot)]

I think we want `first_committee[epoch % len(first_committee)]` as opposed to `first_committee[slot % len(first_committee)]`. The reason is that if the shuffling happens infrequently and `len(first_committee)` is a multiple of `SLOTS_PER_EPOCH` then the proposers will not be sampled fairly.

Taking this logic further, we may want to avoiding always picking the proposer from `first_committee`, e.g.:

```
    validators_at_slot = []
    for crosslink_committee, _ in get_crosslink_committees_at_slot(state, slot, registry_change):
        validators_at_slot.append(crosslink_committee)

    return validators_at_slot[epoch % len(validators_at_slot)]
```
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.

None yet

2 participants