Skip to content

Commit

Permalink
Update EIP-7688: Include EIP-7549 attestation data structure changes
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
etan-status authored May 14, 2024
1 parent cf3e04b commit 8fda943
Showing 1 changed file with 44 additions and 8 deletions.
52 changes: 44 additions & 8 deletions EIPS/eip-7688.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ status: Draft
type: Standards Track
category: Core
created: 2024-04-15
requires: 7495
requires: 7495, 7549
---

## Abstract
Expand Down Expand Up @@ -45,15 +45,34 @@ The fork specific `Variant` definitions use the same serialization as the legacy

| Name | Value | Description |
| - | - | - |
| `MAX_EXECUTION_PAYLOAD_FIELDS` | `uint64(2**6)` (= 64) | Maximum number of fields to which `ExecutionPayload` can ever grow in the future |
| `MAX_BEACON_BLOCK_BODY_FIELDS` | `uint64(2**6)` (= 64) | Maximum number of fields to which `BeaconBlockBody` can ever grow in the future |
| `MAX_BEACON_STATE_FIELDS` | `uint64(2**7)` (= 128) | Maximum number of fields to which `BeaconState` can ever grow in the future |
| `MAX_ATTESTATION_FIELDS` | `uint64(2**3)` (= 8) | Maximum number of fields to which `StableAttestation` can ever grow in the future |
| `MAX_INDEXED_ATTESTATION_FIELDS` | `uint64(2**3)` (= 8) | Maximum number of fields to which `StableIndexedAttestation` can ever grow in the future |
| `MAX_EXECUTION_PAYLOAD_FIELDS` | `uint64(2**6)` (= 64) | Maximum number of fields to which `StableExecutionPayload` can ever grow in the future |
| `MAX_BEACON_BLOCK_BODY_FIELDS` | `uint64(2**6)` (= 64) | Maximum number of fields to which `StableBeaconBlockBody` can ever grow in the future |
| `MAX_BEACON_STATE_FIELDS` | `uint64(2**7)` (= 128) | Maximum number of fields to which `StableBeaconState` can ever grow in the future |

### Fork-agnostic `StableContainer` definitions

These type definitions are fork independent and shared across all forks. They are not exchanged over libp2p.

```python
class StableAttestation(StableContainer[MAX_ATTESTATION_FIELDS]):
data: AttestationData
signature: BLSSignature
aggregation_bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT]
... # Additional features from the fork that introduces this EIP

class StableIndexedAttestation(StableContainer[MAX_INDEXED_ATTESTATION_FIELDS]):
data: AttestationData
signature: BLSSignature
attesting_indices: List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
... # Additional features from the fork that introduces this EIP

class StableAttesterSlashing(Container):
attestation_1: StableIndexedAttestation
attestation_2: StableIndexedAttestation

class StableExecutionPayload(StableContainer[MAX_EXECUTION_PAYLOAD_FIELDS]):
# Execution block header fields
parent_hash: Hash32
Expand Down Expand Up @@ -104,8 +123,8 @@ class StableBeaconBlockBody(StableContainer[MAX_BEACON_BLOCK_BODY_FIELDS]):
graffiti: Bytes32 # Arbitrary data
# Operations
proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS]
attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS]
attestations: List[Attestation, MAX_ATTESTATIONS]
attester_slashings: List[StableAttesterSlashing, MAX_ATTESTER_SLASHINGS_ELECTRA]
attestations: List[StableAttestation, MAX_ATTESTATIONS_ELECTRA]
deposits: List[Deposit, MAX_DEPOSITS]
voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS]
sync_aggregate: SyncAggregate
Expand Down Expand Up @@ -165,6 +184,23 @@ class StableBeaconState(StableContainer[MAX_BEACON_STATE_FIELDS]):
These type definitions are specific to the fork that introduces this EIP. They are used in place of the legacy fork-specific `Container` definitions.

```python
class Attestation(Variant[StableAttestation]):
data: AttestationData
signature: BLSSignature
aggregation_bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT]
... # Additional features from the fork that introduces this EIP

class IndexedAttestation(Variant[StableIndexedAttestation]):
data: AttestationData
signature: BLSSignature
attesting_indices: List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
... # Additional features from the fork that introduces this EIP

class AttesterSlashing(Variant[StableAttesterSlashing]):
attestation_1: IndexedAttestation
attestation_2: IndexedAttestation

class ExecutionPayload(Variant[StableExecutionPayload]):
# Execution block header fields
parent_hash: Hash32
Expand Down Expand Up @@ -215,8 +251,8 @@ class BeaconBlockBody(Variant[StableBeaconBlockBody]):
graffiti: Bytes32 # Arbitrary data
# Operations
proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS]
attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS]
attestations: List[Attestation, MAX_ATTESTATIONS]
attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS_ELECTRA]
attestations: List[Attestation, MAX_ATTESTATIONS_ELECTRA]
deposits: List[Deposit, MAX_DEPOSITS]
voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS]
sync_aggregate: SyncAggregate
Expand Down

0 comments on commit 8fda943

Please sign in to comment.