Skip to content

Commit f2e0db4

Browse files
authored
Remove slot from get_indexed_payload_attestation (#4797)
Get PTC members corresponding to the `payload_attestation` by deriving the slot from the attestation itself
1 parent 9af3143 commit f2e0db4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

specs/gloas/beacon-chain.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,12 @@ def get_ptc(state: BeaconState, slot: Slot) -> Vector[ValidatorIndex, PTC_SIZE]:
609609

610610
```python
611611
def get_indexed_payload_attestation(
612-
state: BeaconState, slot: Slot, payload_attestation: PayloadAttestation
612+
state: BeaconState, payload_attestation: PayloadAttestation
613613
) -> IndexedPayloadAttestation:
614614
"""
615615
Return the indexed payload attestation corresponding to ``payload_attestation``.
616616
"""
617+
slot = payload_attestation.data.slot
617618
ptc = get_ptc(state, slot)
618619
bits = payload_attestation.aggregation_bits
619620
attesting_indices = [index for i, index in enumerate(ptc) if bits[i]]
@@ -1154,9 +1155,7 @@ def process_payload_attestation(
11541155
# Check that the attestation is for the previous slot
11551156
assert data.slot + 1 == state.slot
11561157
# Verify signature
1157-
indexed_payload_attestation = get_indexed_payload_attestation(
1158-
state, data.slot, payload_attestation
1159-
)
1158+
indexed_payload_attestation = get_indexed_payload_attestation(state, payload_attestation)
11601159
assert is_valid_indexed_payload_attestation(state, indexed_payload_attestation)
11611160
```
11621161

specs/gloas/fork-choice.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ def notify_ptc_messages(
178178
if state.slot == 0:
179179
return
180180
for payload_attestation in payload_attestations:
181-
indexed_payload_attestation = get_indexed_payload_attestation(
182-
state, Slot(state.slot - 1), payload_attestation
183-
)
181+
indexed_payload_attestation = get_indexed_payload_attestation(state, payload_attestation)
184182
for idx in indexed_payload_attestation.attesting_indices:
185183
on_payload_attestation_message(
186184
store,

0 commit comments

Comments
 (0)