Skip to content

Commit c9d52e0

Browse files
Fix typos in fork choice compliance runner (#5370)
1 parent dc50745 commit c9d52e0

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

tests/generators/compliance_runners/fork_choice/instantiators/block_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ def _generate_sm_link_tree(
233233
3. Randomly sample all active validators between a set of forks that are being advanced in the epoch.
234234
Validator partitions are disjoint and are changing only at the epoch boundary.
235235
If no new branches are created in the current epoch then partitions from the previous epoch will be used
236-
to advahce the state of every fork to the next epoch.
236+
to advance the state of every fork to the next epoch.
237237
4. Advance every fork to the next epoch respecting a validator partition assigned to it in the current epoch.
238238
Preserve attestations produced but not yet included on chain for potential inclusion in the next epoch.
239239
5. Justify required checkpoints by moving the majority of validators to the justifying fork,
240240
this is taken into account by step (3).
241241
242-
:return: Sequence of signed blocks oredered by a slot number.
242+
:return: Sequence of signed blocks ordered by a slot number.
243243
"""
244244
assert any(sm_links)
245245

tests/generators/compliance_runners/fork_choice/instantiators/helpers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def participants_filter(comm):
428428
target_slot = spec.compute_start_slot_at_epoch(current_epoch + 1)
429429

430430
while state.slot < target_slot:
431-
# Produce block if the proposer is among participanting validators
431+
# Produce block if the proposer is among participating validators
432432
proposer = spec.get_beacon_proposer_index(state)
433433
if state.slot > spec.GENESIS_SLOT and proposer in branch_tip.participants:
434434
signed_block, state, attestations, _, _ = produce_block(spec, state, attestations)
@@ -652,7 +652,7 @@ def yield_fork_choice_test_events(spec, test_data: FCTestData, test_events: list
652652

653653
test_steps = []
654654

655-
def try_add_mesage(runner, message):
655+
def try_add_message(runner, message):
656656
try:
657657
runner(spec, store, message, valid=True)
658658
return True
@@ -685,27 +685,27 @@ def try_add_mesage(runner, message):
685685
elif event_kind == "attestation":
686686
_, attestation, valid = event
687687
if valid is None:
688-
valid = try_add_mesage(run_on_attestation, attestation)
688+
valid = try_add_message(run_on_attestation, attestation)
689689
yield from add_attestation(spec, store, attestation, test_steps, valid=valid)
690690
output_store_checks(spec, store, test_steps)
691691
elif event_kind == "attester_slashing":
692692
_, attester_slashing, valid = event
693693
if valid is None:
694-
valid = try_add_mesage(run_on_attester_slashing, attester_slashing)
694+
valid = try_add_message(run_on_attester_slashing, attester_slashing)
695695
yield from add_attester_slashing(
696696
spec, store, attester_slashing, test_steps, valid=valid
697697
)
698698
output_store_checks(spec, store, test_steps)
699699
elif event_kind == "execution_payload":
700700
_, signed_envelope, valid = event
701701
if valid is None:
702-
valid = try_add_mesage(run_on_execution_payload_envelope, signed_envelope)
702+
valid = try_add_message(run_on_execution_payload_envelope, signed_envelope)
703703
yield from add_execution_payload(spec, store, signed_envelope, test_steps, valid=valid)
704704
output_store_checks(spec, store, test_steps)
705705
elif event_kind == "payload_attestation":
706706
_, ptc_message, valid = event
707707
if valid is None:
708-
valid = try_add_mesage(run_on_payload_attestation_message, ptc_message)
708+
valid = try_add_message(run_on_payload_attestation_message, ptc_message)
709709
yield from add_payload_attestation_message(
710710
spec, store, ptc_message, test_steps, valid=valid
711711
)

tests/generators/compliance_runners/fork_choice/instantiators/scheduler.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def is_early_message(self, item: QueueItem) -> bool:
5757
root not in self.store.blocks for root in item.dependencies
5858
)
5959

60-
def enque_message(self, item: QueueItem):
60+
def enqueue_message(self, item: QueueItem):
6161
self.message_queue.append(item)
6262

6363
def drain_queue(
@@ -72,7 +72,7 @@ def process_queue(self) -> tuple[bool, list]:
7272
updated = False
7373
for item in self.drain_queue():
7474
if self.is_early_message(item):
75-
self.enque_message(item)
75+
self.enqueue_message(item)
7676
elif item.kind == QueueItemKind.ATTESTATION:
7777
if self.process_attestation(item.message):
7878
applied_events.append(("attestation", item.message, True))
@@ -127,7 +127,7 @@ def process_attestation(self, attestation, is_from_block=False):
127127
except AssertionError:
128128
item = QueueItem(attestation, QueueItemKind.ATTESTATION, is_from_block)
129129
if self.is_early_message(item):
130-
self.enque_message(item)
130+
self.enqueue_message(item)
131131
return False
132132

133133
def process_slashing(self, slashing):
@@ -144,7 +144,7 @@ def process_payload_attestation_message(self, ptc_message, is_from_block=False):
144144
except AssertionError:
145145
item = QueueItem(ptc_message, QueueItemKind.PAYLOAD_ATTESTATION, is_from_block)
146146
if self.is_early_message(item):
147-
self.enque_message(item)
147+
self.enqueue_message(item)
148148
return False
149149

150150
def process_block_messages(self, signed_block):
@@ -170,7 +170,7 @@ def process_block(self, signed_block, recovery=False) -> tuple[bool, list]:
170170
except AssertionError:
171171
item = QueueItem(signed_block, QueueItemKind.BLOCK)
172172
if self.is_early_message(item):
173-
self.enque_message(item)
173+
self.enqueue_message(item)
174174
valid = False
175175
if valid:
176176
applied_events.extend(self.purge_queue())
@@ -184,5 +184,5 @@ def process_payload(self, signed_payload) -> bool:
184184
except AssertionError:
185185
item = QueueItem(signed_payload, QueueItemKind.EXECUTION_PAYLOAD)
186186
if self.is_early_message(item):
187-
self.enque_message(item)
187+
self.enqueue_message(item)
188188
return False

0 commit comments

Comments
 (0)