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

Refactor get_attesting_indices #8089

Closed
mehdi-aouadi opened this issue Mar 15, 2024 · 0 comments · Fixed by #8090
Closed

Refactor get_attesting_indices #8089

mehdi-aouadi opened this issue Mar 15, 2024 · 0 comments · Fixed by #8090
Assignees
Labels

Comments

@mehdi-aouadi
Copy link
Contributor

mehdi-aouadi commented Mar 15, 2024

Refactor get_attesting_indices

def get_attesting_indices(state: BeaconState,
                          data: AttestationData,
                          bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE]) -> Set[ValidatorIndex]:
    """
    Return the set of attesting indices corresponding to ``data`` and ``bits``.
    """
    committee = get_beacon_committee(state, data.slot, data.index)
    return set(index for i, index in enumerate(committee) if bits[i])

Becomes

def get_attesting_indices(state: BeaconState, attestation: Attestation) -> Set[ValidatorIndex]:
    """
    Return the set of attesting indices corresponding to ``data`` and ``bits``.
    """
    committee = get_beacon_committee(state, attestation.data.slot, attestation.data.index)
    return set(index for i, index in enumerate(committee) if attestation.aggregation_bits[i])

Link to the spec change

@mehdi-aouadi mehdi-aouadi self-assigned this Mar 15, 2024
@mehdi-aouadi mehdi-aouadi changed the title Implement phase 0 changes Refactor get_attesting_indices Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant