Skip to content

Commit

Permalink
Merge pull request #2796 from etan-status/lc-aggregate
Browse files Browse the repository at this point in the history
Rename `sync_committee_aggregate` > `sync_aggregate`
  • Loading branch information
hwwhww authored Jan 13, 2022
2 parents a1719f9 + 48e19b1 commit 16c350e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions specs/altair/sync-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -187,8 +187,8 @@ def validate_light_client_update(store: LightClientStore,
index=get_subtree_index(NEXT_SYNC_COMMITTEE_INDEX),
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
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)

Expand Down Expand Up @@ -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,
)
Expand All @@ -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,
)

Expand Down Expand Up @@ -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,
)
Expand All @@ -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,
)

Expand Down

0 comments on commit 16c350e

Please sign in to comment.