mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-20 22:38:11 +00:00
remove explicitly handling empty attestation
This commit is contained in:
parent
2af39ad469
commit
dc4869349c
@ -384,11 +384,6 @@ def process_shard_attestations(beacon_state: BeaconState, shard_state: ShardStat
|
||||
pubkeys.append(beacon_state.validators[validator_index].pubkey)
|
||||
process_delta(beacon_state, shard_state, validator_index, get_base_reward(beacon_state, validator_index))
|
||||
attestation_count += 1
|
||||
# Exit early if no participants
|
||||
if not any(pubkeys):
|
||||
assert block.attestations == BLSSignature()
|
||||
return
|
||||
|
||||
# Verify there are no extraneous bits set beyond the shard committee
|
||||
for i in range(len(shard_committee), 2 * MAX_PERIOD_COMMITTEE_SIZE):
|
||||
assert block.aggregation_bits[i] == 0b0
|
||||
|
@ -66,13 +66,16 @@ def build_empty_shard_block(spec,
|
||||
(True,) * len(shard_committee) +
|
||||
(False,) * (spec.MAX_PERIOD_COMMITTEE_SIZE * 2 - len(shard_committee))
|
||||
)
|
||||
block.attestations = sign_shard_attestation(
|
||||
spec,
|
||||
beacon_state,
|
||||
shard_state,
|
||||
block,
|
||||
participants=shard_committee,
|
||||
)
|
||||
else:
|
||||
shard_committee = []
|
||||
|
||||
block.attestations = sign_shard_attestation(
|
||||
spec,
|
||||
beacon_state,
|
||||
shard_state,
|
||||
block,
|
||||
participants=shard_committee,
|
||||
)
|
||||
|
||||
if signed:
|
||||
sign_shard_block(spec, beacon_state, shard_state, block)
|
||||
|
Loading…
x
Reference in New Issue
Block a user