Skip to content

Commit c45158a

Browse files
committed
replace PayloadStatus payload_status bu uint64 payload_revealed
1 parent 07cdcbb commit c45158a

File tree

4 files changed

+22
-34
lines changed

4 files changed

+22
-34
lines changed

specs/gloas/beacon-chain.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
- [`SignedExecutionPayloadBid`](#signedexecutionpayloadbid)
2626
- [`ExecutionPayloadEnvelope`](#executionpayloadenvelope)
2727
- [`SignedExecutionPayloadEnvelope`](#signedexecutionpayloadenvelope)
28-
- [`PayloadStatus`](#payloadstatus)
2928
- [Modified containers](#modified-containers)
3029
- [`AttestationData`](#attestationdata)
3130
- [`BeaconBlockBody`](#beaconblockbody)
@@ -254,30 +253,20 @@ class SignedExecutionPayloadEnvelope(Container):
254253
signature: BLSSignature
255254
```
256255

257-
#### `PayloadStatus`
258-
259-
```python
260-
class PayloadStatus(enum.Enum):
261-
EMPTY = 0
262-
FULL = 1
263-
```
264-
265256
### Modified containers
266257

267258
#### `AttestationData`
268259

269-
*Note*: The `AttestationData` container is modified to contain a
270-
`PayloadStatus`. The `Attestation`, `SingleAttestation` and `IndexedAttestation` containers are modified indirectly.
271-
The field `index` is removed from the `AttestationData` and a new field `payload_status` is added.
260+
*Note*: The `AttestationData` container is modified.
261+
The field `index` is renamed to `payload_revealed`.
262+
The `Attestation`, `SingleAttestation` and `IndexedAttestation` containers are modified indirectly.
272263

273264
```python
274265
class AttestationData(Container):
275266
slot: Slot
276-
# [Modified in Gloas:EIP7732]
277-
# Removed index
267+
# [New in Gloas:EIP7732] Formerly 'index'
268+
payload_revealed: uint64
278269
beacon_block_root: Root
279-
# [New in Gloas:EIP7732]
280-
payload_status: PayloadStatus
281270
source: Checkpoint
282271
target: Checkpoint
283272
```
@@ -617,12 +606,11 @@ def get_attestation_participation_flag_indices(
617606
)
618607
is_matching_payload = False
619608
if is_attestation_same_slot(state, data):
620-
assert data.payload_status == PayloadStatus.EMPTY
609+
assert data.payload_revealed == 0
621610
is_matching_payload = True
622611
else:
623612
is_matching_payload = (
624-
data.payload_status.value
625-
== state.execution_payload_availability[data.slot % SLOTS_PER_HISTORICAL_ROOT]
613+
data.payload_revealed == state.execution_payload_availability[data.slot % SLOTS_PER_HISTORICAL_ROOT]
626614
)
627615

628616
# [Modified in Gloas:EIP7732]
@@ -1119,7 +1107,7 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
11191107
assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot
11201108

11211109
# [Modified in Gloas:EIP7732]
1122-
assert data.payload_status in (PayloadStatus.EMPTY, PayloadStatus.FULL)
1110+
assert data.payload_revealed < 2
11231111
committee_indices = get_committee_indices(attestation.committee_bits)
11241112
committee_offset = 0
11251113
for committee_index in committee_indices:

specs/gloas/fork-choice.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def update_latest_messages(
9797
) -> None:
9898
slot = attestation.data.slot
9999
beacon_block_root = attestation.data.beacon_block_root
100-
payload_present = attestation.data.payload_status == PayloadStaus.FULL
100+
payload_present = attestation.data.payload_revealed == 1
101101
non_equivocating_attesting_indices = [
102102
i for i in attesting_indices if i not in store.equivocating_indices
103103
]
@@ -658,9 +658,9 @@ def validate_on_attestation(store: Store, attestation: Attestation, is_from_bloc
658658
assert block_slot <= attestation.data.slot
659659

660660
# [New in Gloas:EIP7732]
661-
assert attestation.data.payload_status in in (PayloadStatus.EMPTY, PayloadStatus.FULL)
661+
assert attestation.data.payload_revealed in [0, 1]
662662
if block_slot == attestation.data.slot:
663-
assert attestation.data.payload_status == EMPTY
663+
assert attestation.data.payload_revealed == 0
664664

665665
# LMD vote must be consistent with FFG vote target
666666
assert target.root == get_checkpoint_block(

specs/gloas/p2p-interface.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ Let `block` be the beacon block corresponding to
136136

137137
The following validations are added:
138138

139-
- _[REJECT]_ `aggregate.data.payload_status in (PayloadStatus.EMPTY, PayloadStatus.FULL)`.
140-
- _[REJECT]_ `aggregate.data.payload_status == EMPTY` if `block.slot == aggregate.data.slot`.
139+
- _[REJECT]_ `aggregate.data.payload_revealed < 2`.
140+
- _[REJECT]_ `aggregate.data.payload_revealed == 0` if `block.slot == aggregate.data.slot`.
141141

142142
The following validations are removed:
143143

@@ -330,8 +330,8 @@ Let `block` be the beacon block corresponding to
330330

331331
The following validations are added:
332332

333-
- _[REJECT]_ `attestation.data.payload_status in (PayloadStatus.EMPTY, PayloadStatus.FULL)`.
334-
- _[REJECT]_ `attestation.data.payload_status == EMPTY` if
333+
- _[REJECT]_ `attestation.data.payload_revealed < 2`.
334+
- _[REJECT]_ `attestation.data.payload_revealed == 0` if
335335
`block.slot == attestation.data.slot`.
336336

337337
The following validations are removed:

specs/gloas/validator.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,18 @@ All validator responsibilities remain unchanged other than the following:
9191
### Attestation
9292

9393
The attestation deadline is changed with `ATTESTATION_DUE_BPS_GLOAS`. Moreover,
94-
the `attestation.data.payload_status` field is used to signal the payload status of
94+
the `attestation.data.payload_revealed` field is used to signal the payload status of
9595
the block being attested to (`attestation.data.beacon_block_root`). With the
9696
alias `data = attestation.data`, the validator should set this field as follows:
9797

9898
- If `block.slot == current_slot` (i.e., `data.slot`), then always set
99-
`data.payload_status = EMPTY`.
100-
- Otherwise, set `data.payload_status` based on the payload status in the validator's
99+
`data.payload_revealed = 0`.
100+
- Otherwise, set `data.payload_revealed` based on the payload status in the validator's
101101
fork-choice:
102-
- Set `data.payload_status = EMPTY` to signal that the payload is not present in the
103-
canonical chain (payload status is `EMPTY` in the fork-choice).
104-
- Set `data.payload_status = FULL` to signal that the payload is present in the canonical
105-
chain (payload status is `FULL` in the fork-choice).
102+
- Set `data.payload_revealed = 0` to signal that the payload is not present in the
103+
canonical chain (payload status is `0` in the fork-choice).
104+
- Set `data.payload_revealed = 1` to signal that the payload is present in the canonical
105+
chain (payload status is `1` in the fork-choice).
106106

107107
### Sync Committee participations
108108

0 commit comments

Comments
 (0)