Skip to main content

Module attestations

Module attestations 

Source
Expand description

Delta encoding for Phase 0 pending attestation lists.

Phase 0 maintains two attestation lists with different update semantics:

  • current_epoch_attestations grows by appending new attestations during an epoch.
  • previous_epoch_attestations is replaced when the epoch transitions.

This module provides a single diff function that selects the most compact supported representation for both cases. If the target list starts with the exact byte sequence of the base list, only the appended bytes are stored. Otherwise, the complete target list is stored as a full replacement.

Both representations use AttestationsDiff and can be applied with apply_attestations without deserializing individual attestations.

Functionsยง

apply_attestations
Applies an attestation delta to a serialized SSZ list in place.
diff_attestations
Computes a compact delta between two serialized SSZ attestation lists.