remove bad length checks from process attestation; ensure committee count and committee size not equal

This commit is contained in:
Danny Ryan 2019-08-27 09:16:02 -06:00
parent 2abb81d4e9
commit d0b4dc2b01
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 1 additions and 6 deletions

View File

@ -1615,11 +1615,6 @@ def process_attestation(state: BeaconState, attestation: Attestation) -> None:
proposer_index=get_beacon_proposer_index(state),
)
# Check bitlist lengths
committee_size = get_committee_count(state, attestation.data.target.epoch)
assert len(attestation.aggregation_bits) == committee_size
assert len(attestation.custody_bits) == committee_size
if data.target.epoch == get_current_epoch(state):
assert data.source == state.current_justified_checkpoint
parent_crosslink = state.current_crosslinks[data.crosslink.shard]

View File

@ -10,7 +10,7 @@ from .utils import vector_test, with_meta_tags
def with_state(fn):
def entry(*args, **kw):
try:
kw['state'] = create_genesis_state(spec=kw['spec'], num_validators=spec_phase0.SLOTS_PER_EPOCH * 8)
kw['state'] = create_genesis_state(spec=kw['spec'], num_validators=spec_phase0.SLOTS_PER_EPOCH * 9)
except KeyError:
raise TypeError('Spec decorator must come within state decorator to inject spec into state.')
return fn(*args, **kw)