`try_...` --> `process_...`
This commit is contained in:
parent
f9d866eb28
commit
8643e28f12
|
@ -31,7 +31,7 @@
|
||||||
- [Light client state updates](#light-client-state-updates)
|
- [Light client state updates](#light-client-state-updates)
|
||||||
- [`validate_light_client_update`](#validate_light_client_update)
|
- [`validate_light_client_update`](#validate_light_client_update)
|
||||||
- [`apply_light_client_update`](#apply_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_update`](#process_light_client_update)
|
||||||
- [`process_light_client_finality_update`](#process_light_client_finality_update)
|
- [`process_light_client_finality_update`](#process_light_client_finality_update)
|
||||||
- [`process_light_client_optimistic_update`](#process_light_client_optimistic_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.
|
- **`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)`.
|
- **`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)`.
|
- **`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`
|
### `validate_light_client_update`
|
||||||
|
|
||||||
|
@ -386,10 +386,10 @@ def apply_light_client_update(store: LightClientStore, update: LightClientUpdate
|
||||||
store.optimistic_header = store.finalized_header
|
store.optimistic_header = store.finalized_header
|
||||||
```
|
```
|
||||||
|
|
||||||
### `try_light_client_store_force_update`
|
### `process_light_client_store_force_update`
|
||||||
|
|
||||||
```python
|
```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 (
|
if (
|
||||||
current_slot > store.finalized_header.slot + UPDATE_TIMEOUT
|
current_slot > store.finalized_header.slot + UPDATE_TIMEOUT
|
||||||
and store.best_valid_update is not None
|
and store.best_valid_update is not None
|
||||||
|
|
|
@ -74,7 +74,7 @@ def get_checks(store):
|
||||||
|
|
||||||
def emit_force_update(test, spec, state):
|
def emit_force_update(test, spec, state):
|
||||||
current_slot = state.slot
|
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
|
yield from [] # Consistently enable `yield from` syntax in calling tests
|
||||||
test.steps.append({
|
test.steps.append({
|
||||||
|
|
|
@ -36,7 +36,7 @@ optimistic_header: {
|
||||||
|
|
||||||
#### `force_update` execution step
|
#### `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:
|
should be executed with the specified parameters:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
Loading…
Reference in New Issue