Merge pull request #2796 from etan-status/lc-aggregate

Rename `sync_committee_aggregate` > `sync_aggregate`
This commit is contained in:
Hsiao-Wei Wang 2022-01-13 21:07:50 +08:00 committed by GitHub
commit 16c350ebcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -69,7 +69,7 @@ class LightClientUpdate(Container):
finalized_header: BeaconBlockHeader
finality_branch: Vector[Bytes32, floorlog2(FINALIZED_ROOT_INDEX)]
# Sync committee aggregate signature
sync_committee_aggregate: SyncAggregate
sync_aggregate: SyncAggregate
# Fork version for the aggregate signature
fork_version: Version
```
@ -188,7 +188,7 @@ def validate_light_client_update(store: LightClientStore,
root=active_header.state_root,
)
sync_aggregate = update.sync_committee_aggregate
sync_aggregate = update.sync_aggregate
# Verify sync committee has sufficient participants
assert sum(sync_aggregate.sync_committee_bits) >= MIN_SYNC_COMMITTEE_PARTICIPANTS
@ -225,12 +225,12 @@ def process_light_client_update(store: LightClientStore,
genesis_validators_root: Root) -> None:
validate_light_client_update(store, update, current_slot, genesis_validators_root)
sync_committee_bits = update.sync_committee_aggregate.sync_committee_bits
sync_committee_bits = update.sync_aggregate.sync_committee_bits
# Update the best update in case we have to force-update to it if the timeout elapses
if (
store.best_valid_update is None
or sum(sync_committee_bits) > sum(store.best_valid_update.sync_committee_aggregate.sync_committee_bits)
or sum(sync_committee_bits) > sum(store.best_valid_update.sync_aggregate.sync_committee_bits)
):
store.best_valid_update = update

View File

@ -58,7 +58,7 @@ def test_process_light_client_update_not_timeout(spec, state):
block_header.slot,
committee,
)
sync_committee_aggregate = spec.SyncAggregate(
sync_aggregate = spec.SyncAggregate(
sync_committee_bits=sync_committee_bits,
sync_committee_signature=sync_committee_signature,
)
@ -76,7 +76,7 @@ def test_process_light_client_update_not_timeout(spec, state):
next_sync_committee_branch=next_sync_committee_branch,
finalized_header=finality_header,
finality_branch=finality_branch,
sync_committee_aggregate=sync_committee_aggregate,
sync_aggregate=sync_aggregate,
fork_version=state.fork.current_version,
)
@ -123,7 +123,7 @@ def test_process_light_client_update_timeout(spec, state):
committee,
block_root=spec.Root(block_header.hash_tree_root()),
)
sync_committee_aggregate = spec.SyncAggregate(
sync_aggregate = spec.SyncAggregate(
sync_committee_bits=sync_committee_bits,
sync_committee_signature=sync_committee_signature,
)
@ -140,7 +140,7 @@ def test_process_light_client_update_timeout(spec, state):
next_sync_committee_branch=next_sync_committee_branch,
finalized_header=finality_header,
finality_branch=finality_branch,
sync_committee_aggregate=sync_committee_aggregate,
sync_aggregate=sync_aggregate,
fork_version=state.fork.current_version,
)
@ -201,7 +201,7 @@ def test_process_light_client_update_finality_updated(spec, state):
committee,
block_root=spec.Root(block_header.hash_tree_root()),
)
sync_committee_aggregate = spec.SyncAggregate(
sync_aggregate = spec.SyncAggregate(
sync_committee_bits=sync_committee_bits,
sync_committee_signature=sync_committee_signature,
)
@ -212,7 +212,7 @@ def test_process_light_client_update_finality_updated(spec, state):
next_sync_committee_branch=next_sync_committee_branch,
finalized_header=finalized_block_header,
finality_branch=finality_branch,
sync_committee_aggregate=sync_committee_aggregate,
sync_aggregate=sync_aggregate,
fork_version=state.fork.current_version,
)