Skip to content

Commit 64e8259

Browse files
authored
Expand PTC to PayloadTimelinessCommittee in type names (#5558)
With the exception of BLS, we typically do not use acronyms in the specifications, because first time readers might not know what a PTC is. Expanding this in type names should be helpful & it's not going to break anything in clients.
1 parent 75d8c92 commit 64e8259

8 files changed

Lines changed: 33 additions & 29 deletions

File tree

specs/_features/eip8148/beacon-chain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class BeaconState(ProgressiveContainer(active_fields=[1] * 47)):
148148
builder_pending_withdrawals: BuilderPendingWithdrawals
149149
latest_execution_payload_bid: ExecutionPayloadBid
150150
payload_expected_withdrawals: Withdrawals
151-
ptc_window: PTCWindow
151+
ptc_window: PayloadTimelinessCommitteeWindow
152152
# [New in EIP8148]
153153
validator_sweep_thresholds: SweepThresholds
154154
```

specs/_features/eip8321/beacon-chain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class BeaconState(ProgressiveContainer(active_fields=[1] * 48)):
248248
builder_pending_withdrawals: BuilderPendingWithdrawals
249249
latest_execution_payload_bid: ExecutionPayloadBid
250250
payload_expected_withdrawals: Withdrawals
251-
ptc_window: PTCWindow
251+
ptc_window: PayloadTimelinessCommitteeWindow
252252
# [New in EIP8321]
253253
randao_commitments: RandaoCommitments
254254
# [New in EIP8321]

specs/gloas/beacon-chain.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
- [New `Builders`](#new-builders)
3838
- [New `ExecutionPayloadAvailability`](#new-executionpayloadavailability)
3939
- [New `PayloadAttestations`](#new-payloadattestations)
40-
- [New `PTC`](#new-ptc)
41-
- [New `PTCAttestingIndices`](#new-ptcattestingindices)
42-
- [New `PTCBits`](#new-ptcbits)
43-
- [New `PTCWindow`](#new-ptcwindow)
40+
- [New `PayloadTimelinessCommittee`](#new-payloadtimelinesscommittee)
41+
- [New `PayloadTimelinessCommitteeIndices`](#new-payloadtimelinesscommitteeindices)
42+
- [New `PayloadTimelinessCommitteeBits`](#new-payloadtimelinesscommitteebits)
43+
- [New `PayloadTimelinessCommitteeWindow`](#new-payloadtimelinesscommitteewindow)
4444
- [Constants](#constants)
4545
- [Index flags](#index-flags)
4646
- [Domains](#domains)
@@ -491,38 +491,41 @@ class PayloadAttestations(ProgressiveList[PayloadAttestation]):
491491
"""
492492
```
493493

494-
### New `PTC`
494+
### New `PayloadTimelinessCommittee`
495495

496496
```python
497-
class PTC(Vector[ValidatorIndex, PTC_SIZE]):
497+
class PayloadTimelinessCommittee(Vector[ValidatorIndex, PTC_SIZE]):
498498
"""
499499
The payload timeliness committee of a slot.
500500
"""
501501
```
502502

503-
### New `PTCAttestingIndices`
503+
### New `PayloadTimelinessCommitteeIndices`
504504

505505
```python
506-
class PTCAttestingIndices(List[ValidatorIndex, PTC_SIZE]):
506+
class PayloadTimelinessCommitteeIndices(List[ValidatorIndex, PTC_SIZE]):
507507
"""
508-
The indices of the PTC members participating in a payload attestation.
508+
The indices of payload timeliness committee members, as a list limited
509+
by the size of the committee.
509510
"""
510511
```
511512

512-
### New `PTCBits`
513+
### New `PayloadTimelinessCommitteeBits`
513514

514515
```python
515-
class PTCBits(BitVector[PTC_SIZE]):
516+
class PayloadTimelinessCommitteeBits(BitVector[PTC_SIZE]):
516517
"""
517518
The participation bits of the payload timeliness committee, one bit per
518519
member in committee order.
519520
"""
520521
```
521522

522-
### New `PTCWindow`
523+
### New `PayloadTimelinessCommitteeWindow`
523524

524525
```python
525-
class PTCWindow(Vector[PTC, (2 + MIN_SEED_LOOKAHEAD) * SLOTS_PER_EPOCH]):
526+
class PayloadTimelinessCommitteeWindow(
527+
Vector[PayloadTimelinessCommittee, (2 + MIN_SEED_LOOKAHEAD) * SLOTS_PER_EPOCH]
528+
):
526529
"""
527530
A rolling window of payload timeliness committees for the previous,
528531
current, and lookahead epochs.
@@ -702,7 +705,7 @@ class PayloadAttestationData(Container):
702705

703706
```python
704707
class PayloadAttestation(ProgressiveContainer(active_fields=[1] * 3)):
705-
aggregation_bits: PTCBits
708+
aggregation_bits: PayloadTimelinessCommitteeBits
706709
data: PayloadAttestationData
707710
signature: BLSSignature
708711
```
@@ -720,7 +723,7 @@ class PayloadAttestationMessage(Container):
720723

721724
```python
722725
class IndexedPayloadAttestation(ProgressiveContainer(active_fields=[1] * 3)):
723-
attesting_indices: PTCAttestingIndices
726+
attesting_indices: PayloadTimelinessCommitteeIndices
724727
data: PayloadAttestationData
725728
signature: BLSSignature
726729
```
@@ -900,7 +903,7 @@ class BeaconState(ProgressiveContainer(active_fields=[1] * 46)):
900903
# [New in Gloas:EIP7732]
901904
payload_expected_withdrawals: Withdrawals
902905
# [New in Gloas:EIP7732]
903-
ptc_window: PTCWindow
906+
ptc_window: PayloadTimelinessCommitteeWindow
904907
```
905908

906909
#### `ExecutionPayload`
@@ -1209,7 +1212,7 @@ def compute_proposer_indices(
12091212
#### New `compute_ptc`
12101213

12111214
```python
1212-
def compute_ptc(state: BeaconState, slot: Slot) -> PTC:
1215+
def compute_ptc(state: BeaconState, slot: Slot) -> PayloadTimelinessCommittee:
12131216
"""
12141217
Get the payload timeliness committee, with possible duplicates, for the given ``slot``.
12151218
"""
@@ -1221,7 +1224,7 @@ def compute_ptc(state: BeaconState, slot: Slot) -> PTC:
12211224
for i in range(committees_per_slot):
12221225
committee = get_beacon_committee(state, slot, CommitteeIndex(i))
12231226
indices.extend(committee)
1224-
return PTC(
1227+
return PayloadTimelinessCommittee(
12251228
compute_balance_weighted_selection(
12261229
state, indices, seed, size=PTC_SIZE, shuffle_indices=False
12271230
)
@@ -1335,7 +1338,7 @@ def get_attestation_participation_flag_indices(
13351338
#### New `get_ptc`
13361339

13371340
```python
1338-
def get_ptc(state: BeaconState, slot: Slot) -> PTC:
1341+
def get_ptc(state: BeaconState, slot: Slot) -> PayloadTimelinessCommittee:
13391342
"""
13401343
Get the payload timeliness committee for the given ``slot``.
13411344
"""
@@ -1364,7 +1367,7 @@ def get_indexed_payload_attestation(
13641367
attesting_indices = [index for i, index in enumerate(ptc) if bits[i]]
13651368

13661369
return IndexedPayloadAttestation(
1367-
attesting_indices=PTCAttestingIndices(sorted(attesting_indices)),
1370+
attesting_indices=PayloadTimelinessCommitteeIndices(sorted(attesting_indices)),
13681371
data=payload_attestation.data,
13691372
signature=payload_attestation.signature,
13701373
)

specs/gloas/fork.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ Warning: this configuration is not definitive.
3636
```python
3737
def initialize_ptc_window(
3838
state: BeaconState,
39-
) -> PTCWindow:
39+
) -> PayloadTimelinessCommitteeWindow:
4040
"""
4141
Return the cached PTC window starting from the current epoch.
4242
Used to initialize the ``ptc_window`` field in the beacon state at genesis and after forks.
4343
"""
4444
empty_previous_epoch = [
45-
PTC([ValidatorIndex(0) for _ in range(PTC_SIZE)]) for _ in range(SLOTS_PER_EPOCH)
45+
PayloadTimelinessCommittee([ValidatorIndex(0) for _ in range(PTC_SIZE)])
46+
for _ in range(SLOTS_PER_EPOCH)
4647
]
4748

4849
ptcs = []
@@ -52,7 +53,7 @@ def initialize_ptc_window(
5253
start_slot = compute_start_slot_at_epoch(epoch)
5354
ptcs += [compute_ptc(state, Slot(start_slot + i)) for i in range(SLOTS_PER_EPOCH)]
5455

55-
return PTCWindow(empty_previous_epoch + ptcs)
56+
return PayloadTimelinessCommitteeWindow(empty_previous_epoch + ptcs)
5657
```
5758

5859
### New `onboard_builders_from_pending_deposits`

specs/heze/beacon-chain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class BeaconState(ProgressiveContainer(active_fields=[1] * 46)):
179179
# [Modified in Heze:EIP7805]
180180
latest_execution_payload_bid: ExecutionPayloadBid
181181
payload_expected_withdrawals: Withdrawals
182-
ptc_window: PTCWindow
182+
ptc_window: PayloadTimelinessCommitteeWindow
183183
```
184184

185185
## Helpers

tests/core/pyspec/eth_consensus_specs/test/helpers/genesis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
220220
[spec.BuilderPendingPayment() for _ in range(2 * spec.SLOTS_PER_EPOCH)]
221221
)
222222
state.builder_pending_withdrawals = spec.BuilderPendingWithdrawals()
223-
state.ptc_window = spec.PTCWindow(initialize_ptc_window(spec, state))
223+
state.ptc_window = spec.PayloadTimelinessCommitteeWindow(initialize_ptc_window(spec, state))
224224

225225
if is_post_eip8148(spec):
226226
state.validator_sweep_thresholds = spec.SweepThresholds(

tests/core/pyspec/eth_consensus_specs/test/helpers/gloas/state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def initialize_ptc_window(spec, state):
22
empty_previous_epoch = [
3-
spec.PTC([spec.ValidatorIndex(0) for _ in range(spec.PTC_SIZE)])
3+
spec.PayloadTimelinessCommittee([spec.ValidatorIndex(0) for _ in range(spec.PTC_SIZE)])
44
for _ in range(spec.SLOTS_PER_EPOCH)
55
]
66
ptcs = []

tests/core/pyspec/eth_consensus_specs/test/helpers/p2p_size_bounds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def build_max_size_indexed_attestation(spec):
2727

2828
def build_max_size_payload_attestation(spec):
2929
return spec.PayloadAttestation(
30-
aggregation_bits=spec.PTCBits([True] * spec.PTC_SIZE),
30+
aggregation_bits=spec.PayloadTimelinessCommitteeBits([True] * spec.PTC_SIZE),
3131
data=spec.PayloadAttestationData(),
3232
signature=spec.BLSSignature(),
3333
)

0 commit comments

Comments
 (0)