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

Update the beacon block body #8102

Open
mehdi-aouadi opened this issue Mar 19, 2024 · 0 comments
Open

Update the beacon block body #8102

mehdi-aouadi opened this issue Mar 19, 2024 · 0 comments
Labels

Comments

@mehdi-aouadi
Copy link
Contributor

mehdi-aouadi commented Mar 19, 2024

Block proposal

Constructing the BeaconBlockBody

Attestations

The network attestation aggregates contain only the assigned committee attestations.
Attestation aggregates received by the block proposer from the committee aggregators with disjoint committee_bits sets and equal AttestationData SHOULD be consolidated into a single Attestation object.
The proposer should run the following function to construct an on chain final aggregate form a list of network aggregates with equal AttestationData:

def compute_on_chain_aggregate(network_aggregates: List[Attestation]) -> Attestation:
    aggregates = sorted(network_aggregates, key=lambda a: get_committee_indices(a.committee_bits)[0])

    data = aggregates[0].data
    aggregation_bits = Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]()
    for a in aggregates:
        for b in a.aggregation_bits:
            aggregation_bits.append(b)

    signature = bls.Aggregate([a.signature for a in aggregates])

    committee_indices = [get_committee_indices(a.committee_bits)[0] for a in aggregates]
    committee_flags = [(index in committee_indices) for index in range(0, MAX_COMMITTEES_PER_SLOT)]        
    committee_bits = Bitvector[MAX_COMMITTEES_PER_SLOT](committee_flags)

    return Attestation(aggregation_bits, data, committee_bits, signature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant