diff --git a/specs/altair/beacon-chain.md b/specs/altair/beacon-chain.md index 3877f17d23..5e5d9abf88 100644 --- a/specs/altair/beacon-chain.md +++ b/specs/altair/beacon-chain.md @@ -446,7 +446,7 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None: process_randao(state, block.body) process_eth1_data(state, block.body) process_operations(state, block.body) # [Modified in Altair] - process_sync_committee(state, block.body.sync_aggregate) # [New in Altair] + process_sync_aggregate(state, block.body.sync_aggregate) # [New in Altair] ``` #### Modified `process_attestation` @@ -532,19 +532,19 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: increase_balance(state, index, amount) ``` -#### Sync committee processing +#### Sync aggregate processing -*Note*: The function `process_sync_committee` is new. +*Note*: The function `process_sync_aggregate` is new. ```python -def process_sync_committee(state: BeaconState, aggregate: SyncAggregate) -> None: +def process_sync_aggregate(state: BeaconState, sync_aggregate: SyncAggregate) -> None: # Verify sync committee aggregate signature signing over the previous slot block root committee_pubkeys = state.current_sync_committee.pubkeys - participant_pubkeys = [pubkey for pubkey, bit in zip(committee_pubkeys, aggregate.sync_committee_bits) if bit] + participant_pubkeys = [pubkey for pubkey, bit in zip(committee_pubkeys, sync_aggregate.sync_committee_bits) if bit] previous_slot = max(state.slot, Slot(1)) - Slot(1) domain = get_domain(state, DOMAIN_SYNC_COMMITTEE, compute_epoch_at_slot(previous_slot)) signing_root = compute_signing_root(get_block_root_at_slot(state, previous_slot), domain) - assert eth2_fast_aggregate_verify(participant_pubkeys, signing_root, aggregate.sync_committee_signature) + assert eth2_fast_aggregate_verify(participant_pubkeys, signing_root, sync_aggregate.sync_committee_signature) # Compute participant and proposer rewards total_active_increments = get_total_active_balance(state) // EFFECTIVE_BALANCE_INCREMENT @@ -556,7 +556,7 @@ def process_sync_committee(state: BeaconState, aggregate: SyncAggregate) -> None # Apply participant and proposer rewards all_pubkeys = [v.pubkey for v in state.validators] committee_indices = [ValidatorIndex(all_pubkeys.index(pubkey)) for pubkey in state.current_sync_committee.pubkeys] - for participant_index, participation_bit in zip(committee_indices, aggregate.sync_committee_bits): + for participant_index, participation_bit in zip(committee_indices, sync_aggregate.sync_committee_bits): if participation_bit: increase_balance(state, participant_index, participant_reward) increase_balance(state, get_beacon_proposer_index(state), proposer_reward) diff --git a/tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_sync_committee.py b/tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_sync_aggregate.py similarity index 100% rename from tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_sync_committee.py rename to tests/core/pyspec/eth2spec/test/altair/block_processing/test_process_sync_aggregate.py diff --git a/tests/formats/operations/README.md b/tests/formats/operations/README.md index f562a6f2aa..c69d798d77 100644 --- a/tests/formats/operations/README.md +++ b/tests/formats/operations/README.md @@ -41,7 +41,7 @@ Operations: | `deposit` | `Deposit` | `deposit` | `process_deposit(state, deposit)` | | `proposer_slashing` | `ProposerSlashing` | `proposer_slashing` | `process_proposer_slashing(state, proposer_slashing)` | | `voluntary_exit` | `SignedVoluntaryExit` | `voluntary_exit` | `process_voluntary_exit(state, voluntary_exit)` | -| `sync_aggregate` | `SyncAggregate` | `sync_aggregate` | `process_sync_committee(state, sync_aggregate)` (new in Altair) | +| `sync_aggregate` | `SyncAggregate` | `sync_aggregate` | `process_sync_aggregate(state, sync_aggregate)` (new in Altair) | | `execution_payload` | `ExecutionPayload` | `execution_payload` | `process_execution_payload(state, execution_payload)` (new in Merge) | Note that `block_header` is not strictly an operation (and is a full `Block`), but processed in the same manner, and hence included here. diff --git a/tests/generators/operations/main.py b/tests/generators/operations/main.py index 554d0b30ad..57fc6dd967 100644 --- a/tests/generators/operations/main.py +++ b/tests/generators/operations/main.py @@ -13,7 +13,7 @@ ]} altair_mods = { **{key: 'eth2spec.test.altair.block_processing.test_process_' + key for key in [ - 'sync_committee', + 'sync_aggregate', ]}, **phase_0_mods, } # also run the previous phase 0 tests