Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions specs/gloas/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [`ExecutionPayloadEnvelope`](#executionpayloadenvelope)
- [`SignedExecutionPayloadEnvelope`](#signedexecutionpayloadenvelope)
- [Modified containers](#modified-containers)
- [`AttestationData`](#attestationdata)
- [`BeaconBlockBody`](#beaconblockbody)
- [`BeaconState`](#beaconstate)
- [Helper functions](#helper-functions)
Expand Down Expand Up @@ -254,6 +255,22 @@ class SignedExecutionPayloadEnvelope(Container):

### Modified containers

#### `AttestationData`

*Note*: The `AttestationData` container is modified.
The field `index` is renamed to `payload_status`.
The `Attestation`, `SingleAttestation` and `IndexedAttestation` containers are modified indirectly.

```python
class AttestationData(Container):
slot: Slot
# [New in Gloas:EIP7732] Formerly 'index'
payload_status: uint64
beacon_block_root: Root
source: Checkpoint
target: Checkpoint
```

#### `BeaconBlockBody`

*Note*: The `BeaconBlockBody` container is modified to contain a
Expand Down Expand Up @@ -589,12 +606,11 @@ def get_attestation_participation_flag_indices(
)
is_matching_payload = False
if is_attestation_same_slot(state, data):
assert data.index == 0
assert data.payload_status == 0
is_matching_payload = True
else:
is_matching_payload = (
data.index
== state.execution_payload_availability[data.slot % SLOTS_PER_HISTORICAL_ROOT]
data.payload_status == state.execution_payload_availability[data.slot % SLOTS_PER_HISTORICAL_ROOT]
)

# [Modified in Gloas:EIP7732]
Expand Down Expand Up @@ -1092,7 +1108,7 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot

# [Modified in Gloas:EIP7732]
assert data.index < 2
assert data.payload_status < 2
committee_indices = get_committee_indices(attestation.committee_bits)
committee_offset = 0
for committee_index in committee_indices:
Expand Down
6 changes: 3 additions & 3 deletions specs/gloas/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def update_latest_messages(
) -> None:
slot = attestation.data.slot
beacon_block_root = attestation.data.beacon_block_root
payload_present = attestation.data.index == 1
payload_present = attestation.data.payload_status == 1
non_equivocating_attesting_indices = [
i for i in attesting_indices if i not in store.equivocating_indices
]
Expand Down Expand Up @@ -658,9 +658,9 @@ def validate_on_attestation(store: Store, attestation: Attestation, is_from_bloc
assert block_slot <= attestation.data.slot

# [New in Gloas:EIP7732]
assert attestation.data.index in [0, 1]
assert attestation.data.payload_status in [0, 1]
if block_slot == attestation.data.slot:
assert attestation.data.index == 0
assert attestation.data.payload_status == 0

# LMD vote must be consistent with FFG vote target
assert target.root == get_checkpoint_block(
Expand Down
8 changes: 4 additions & 4 deletions specs/gloas/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ Let `block` be the beacon block corresponding to

The following validations are added:

- _[REJECT]_ `aggregate.data.index < 2`.
- _[REJECT]_ `aggregate.data.index == 0` if `block.slot == aggregate.data.slot`.
- _[REJECT]_ `aggregate.data.payload_status < 2`.
- _[REJECT]_ `aggregate.data.payload_status == 0` if `block.slot == aggregate.data.slot`.

The following validations are removed:

Expand Down Expand Up @@ -364,8 +364,8 @@ Let `block` be the beacon block corresponding to

The following validations are added:

- _[REJECT]_ `attestation.data.index < 2`.
- _[REJECT]_ `attestation.data.index == 0` if
- _[REJECT]_ `attestation.data.payload_status < 2`.
- _[REJECT]_ `attestation.data.payload_status == 0` if
`block.slot == attestation.data.slot`.

The following validations are removed:
Expand Down
10 changes: 5 additions & 5 deletions specs/gloas/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ All validator responsibilities remain unchanged other than the following:
### Attestation

The attestation deadline is changed with `ATTESTATION_DUE_BPS_GLOAS`. Moreover,
the `attestation.data.index` field is now used to signal the payload status of
the `attestation.data.payload_status` field is used to signal the payload status of
the block being attested to (`attestation.data.beacon_block_root`). With the
alias `data = attestation.data`, the validator should set this field as follows:

- If `block.slot == current_slot` (i.e., `data.slot`), then always set
`data.index = 0`.
- Otherwise, set `data.index` based on the payload status in the validator's
`data.payload_status = 0`.
- Otherwise, set `data.payload_status` based on the payload status in the validator's
fork-choice:
- Set `data.index = 0` to signal that the payload is not present in the
- Set `data.payload_status = 0` to signal that the payload is not present in the
canonical chain (payload status is `EMPTY` in the fork-choice).
- Set `data.index = 1` to signal that the payload is present in the canonical
- Set `data.payload_status = 1` to signal that the payload is present in the canonical
chain (payload status is `FULL` in the fork-choice).

### Sync Committee participations
Expand Down
Loading