Skip to main content
Change page

Attestations

A validator is expected to create, sign and broadcast an attestation during every epoch. This page outlines what these attestations look like and how they are processed and communicated between consensus clients.

What is an attestation?

Every (6.4 minutes) a validator broadcasts an attestation to the network. The attestation is for a specific slot in the epoch. The purpose of the attestation is to vote in favor of the validator's view of the chain, in particular the head of the chain, the most recent justified checkpoint and the checkpoint at the start of the current epoch (known as source and target checkpoints). This information is combined for all participating validators, enabling the network to reach consensus about the state of the blockchain.

Since the Pectra upgrade (EIP-7549 (opens in a new tab)), an attestation from a single validator and an aggregated attestation have different formats. A single validator's attestation contains:

  • committee_index: the committee the validator belongs to in the given slot
  • attester_index: the validator's index
  • data: details relating to the attestation, as defined below
  • signature: the validator's BLS signature over the data

The first task for an attesting validator is to build the data. The data contains the following information:

  • slot: The slot number that the attestation refers to
  • index: Set to 0 since Pectra. The committee is identified outside the data (by committee_index, or by committee_bits in an aggregate) so that votes from different committees have identical data and can be aggregated together. Before Pectra, this field identified the committee
  • beacon_block_root: Root hash of the block the validator sees at the head of the chain (the result of applying the fork-choice algorithm)
  • source: Part of the finality vote indicating what the validators see as the most recent justified checkpoint
  • target: Part of the finality vote indicating what the validators see as the checkpoint at the start of the current epoch (the block at its first slot, or the latest block before it if that slot is empty)

Once the data is built, the validator signs it and broadcasts the attestation to the subnet for its committee.

Aggregated attestation

There is a substantial overhead associated with passing this data around the network for every validator. Therefore, the attestations from individual validators are aggregated within subnets before being broadcast more widely. This includes aggregating signatures together so that an attestation that gets broadcast includes the consensus data and a single signature formed by combining the signatures of all the validators that agree with that data. An aggregated attestation contains:

  • aggregation_bits: a bitlist with one bit per member of each included committee, where the position maps to the validator's position in its committee; the value (0/1) indicates whether that validator's signature is included
  • data: the attestation data every included validator signed
  • signature: a BLS signature that aggregates the signatures of the included validators
  • committee_bits: which committees' members are covered by aggregation_bits

Anyone can check the aggregated signature against the combined public keys of the validators whose bits are set.

In every slot, about 16 members of each committee are selected to be its aggregators (TARGET_AGGREGATORS_PER_COMMITTEE). A validator learns whether it was selected from its own signature over the slot number. The aggregators collect all the attestations they hear on their committee's subnet that have the same data as their own, and combine them, recording the sender of each in the aggregation_bits. The aggregators then broadcast the aggregate to the wider network.

When a validator is selected to be a block proposer, they include aggregate attestations from recent slots in the new block. Since Pectra, the proposer can merge aggregates from different committees that share the same data into one attestation, and a block can hold up to 8 of them.

Attestation inclusion lifecycle

  1. Generation
  2. Propagation
  3. Aggregation
  4. Propagation
  5. Inclusion

The attestation lifecycle is outlined in the schematic below:

Fig. 1Attestation lifecycle

ValidatorsValidators assigned to a committee for this slot. Each signs one attestation: its vote for the head block and the source and target checkpoints.AggregatorsA committee member selected for the slot to collect matching attestations from its subnet and combine them into one aggregate.Beacon nodesThe peer-to-peer network of beacon nodes. It gossips aggregates to every node, so the next block proposer hears them.
  • Validators and attestations
  • Structure
Choose scenario
5 steps

Choose a scenario and attest to follow two committees' attestations from signing to inclusion in a block.

Attestations signed
0
Aggregates
0
Attestations in the block
0
Committee A bits
–
Committee B bits
–
Inclusion delay
–

One plate carries the attestation lifecycle, with messages moving from the back to the front. At the back stand two committees, A and B, of 4 validators each. In each, the last member, a taller block, is also the committee's aggregator; one validator in committee B is offline. Each committee's validators are joined to their aggregator by their subnet. The aggregators connect to a block of beacon nodes, which connects to the block proposer. Along the front runs the beacon chain: its head block, then empty slots for the next blocks. Step 1: each online validator signs an attestation. Step 2: the attestations are gossiped on each committee's subnet to its aggregator. Step 3: each aggregator combines the matching attestations into one aggregate, whose aggregation bits mark who signed: 4 of 4 in committee A, 3 of 4 in committee B. Step 4: the aggregates are broadcast to the beacon nodes, which gossip them on to the proposer. Step 5: the two aggregates share the same data, so the proposer merges them into one attestation in the block for the next slot. If that slot's proposer is missing, the slot stays empty and the following proposer includes it instead.

The attestation lifecycle: validators sign attestations, aggregators combine each committee's attestations into one aggregate, and a block proposer merges the aggregates into one attestation in its block.

Rewards

Validators are rewarded for submitting attestations. The attestation reward depends on the participation flags (source, target and head), the base reward and the participation rate.

Each of the participation flags can be either true or false, depending on the submitted attestation and its inclusion delay.

The best scenario occurs when all three flags are true, in which case a validator would earn (per correct flag):

reward += base reward * flag weight * flag attesting rate / 64

The flag attesting rate is measured using the sum of effective balances of all attesting validators for the given flag compared the total active effective balance.

Base reward

The base reward is calculated according to the number of attesting validators and their effective staked ether balances:

base reward = validator effective balance x 2^6 / SQRT(Effective balance of all active validators)

Inclusion delay

At the time when the validators voted on the head of the chain (block n), block n+1 was not proposed yet. Therefore attestations naturally get included one block later so all attestations who voted on block n being the chain head got included in block n+1 and, the inclusion delay is 1. The inclusion delay decides which participation flags an attestation earns:

  • head: only if the inclusion delay is exactly 1 slot
  • source: if the inclusion delay is at most 5 slots (the integer square root of the 32 slots in an epoch)
  • target: whenever the attestation is included (since the Deneb upgrade, EIP-7045 (opens in a new tab))

So an attestation included two slots late loses its head reward but still earns the source and target rewards.

Attestation scenarios

Missing Voting Validator

An attestation can be included in any block from the slot after it was made until the end of the following epoch. If an attestation from epoch 0 is not included in a block during epoch 0, it can still be included in epoch 1, with a longer inclusion delay.

Missing Aggregator

Each committee aims for about 16 aggregators in every slot, so one missing aggregator rarely stops a committee's attestations from being aggregated. Separately, every beacon node stays subscribed to two subnets for 256 epochs at a time, chosen from its node ID, which keeps every subnet well connected.

Missing block proposer

Note that in some cases a lucky aggregator may also become the block proposer. If the attestation was not included because the block proposer has gone missing, the next block proposer would pick the aggregated attestation up and include it into the next block. However, the inclusion delay will increase by one.

Further reading

Know of a community resource that helped you? Edit this page and add it!