From 8643e28f12380e25933d84a2a81128a8cfacb88c Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Fri, 22 Jul 2022 11:49:07 +0200 Subject: [PATCH] `try_...` --> `process_...` --- specs/altair/light-client/sync-protocol.md | 8 ++++---- .../pyspec/eth2spec/test/altair/light_client/test_sync.py | 2 +- tests/formats/light_client/sync.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specs/altair/light-client/sync-protocol.md b/specs/altair/light-client/sync-protocol.md index 058183fc4..2fda56fc3 100644 --- a/specs/altair/light-client/sync-protocol.md +++ b/specs/altair/light-client/sync-protocol.md @@ -31,7 +31,7 @@ - [Light client state updates](#light-client-state-updates) - [`validate_light_client_update`](#validate_light_client_update) - [`apply_light_client_update`](#apply_light_client_update) - - [`try_light_client_store_force_update`](#try_light_client_store_force_update) + - [`process_light_client_store_force_update`](#process_light_client_store_force_update) - [`process_light_client_update`](#process_light_client_update) - [`process_light_client_finality_update`](#process_light_client_finality_update) - [`process_light_client_optimistic_update`](#process_light_client_optimistic_update) @@ -285,7 +285,7 @@ def initialize_light_client_store(trusted_block_root: Root, - **`update: LightClientUpdate`**: Every `update` triggers `process_light_client_update(store, update, current_slot, genesis_validators_root)` where `current_slot` is the current slot based on a local clock. - **`finality_update: LightClientFinalityUpdate`**: Every `finality_update` triggers `process_light_client_finality_update(store, finality_update, current_slot, genesis_validators_root)`. - **`optimistic_update: LightClientOptimisticUpdate`**: Every `optimistic_update` triggers `process_light_client_optimistic_update(store, optimistic_update, current_slot, genesis_validators_root)`. -- `try_light_client_store_force_update` MAY be called based on use case dependent heuristics if light client sync appears stuck. +- `process_light_client_store_force_update` MAY be called based on use case dependent heuristics if light client sync appears stuck. ### `validate_light_client_update` @@ -386,10 +386,10 @@ def apply_light_client_update(store: LightClientStore, update: LightClientUpdate store.optimistic_header = store.finalized_header ``` -### `try_light_client_store_force_update` +### `process_light_client_store_force_update` ```python -def try_light_client_store_force_update(store: LightClientStore, current_slot: Slot) -> None: +def process_light_client_store_force_update(store: LightClientStore, current_slot: Slot) -> None: if ( current_slot > store.finalized_header.slot + UPDATE_TIMEOUT and store.best_valid_update is not None diff --git a/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py b/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py index ed2d04b4d..47348717b 100644 --- a/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py +++ b/tests/core/pyspec/eth2spec/test/altair/light_client/test_sync.py @@ -74,7 +74,7 @@ def get_checks(store): def emit_force_update(test, spec, state): current_slot = state.slot - spec.try_light_client_store_force_update(test.store, current_slot) + spec.process_light_client_store_force_update(test.store, current_slot) yield from [] # Consistently enable `yield from` syntax in calling tests test.steps.append({ diff --git a/tests/formats/light_client/sync.md b/tests/formats/light_client/sync.md index aa0d593b6..ad597fa1d 100644 --- a/tests/formats/light_client/sync.md +++ b/tests/formats/light_client/sync.md @@ -36,7 +36,7 @@ optimistic_header: { #### `force_update` execution step -The function `try_light_client_store_force_update(store, current_slot)` +The function `process_light_client_store_force_update(store, current_slot)` should be executed with the specified parameters: ```yaml