remove kludge to skip large_validator_set on mainnet config

This commit is contained in:
Danny Ryan 2020-09-18 07:59:25 -06:00
parent 27d8c80690
commit d257926e3a
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 0 additions and 9 deletions

View File

@ -62,8 +62,6 @@ def _prepare_state(balances_fn: Callable[[Any], Sequence[int]], threshold_fn: Ca
p0 = phases[PHASE0] p0 = phases[PHASE0]
balances = balances_fn(p0) balances = balances_fn(p0)
if balances is None:
return None
activation_threshold = threshold_fn(p0) activation_threshold = threshold_fn(p0)
state = create_genesis_state(spec=p0, validator_balances=balances, state = create_genesis_state(spec=p0, validator_balances=balances,
@ -90,9 +88,6 @@ def with_custom_state(balances_fn: Callable[[Any], Sequence[int]],
global _custom_state_cache_dict global _custom_state_cache_dict
if key not in _custom_state_cache_dict: if key not in _custom_state_cache_dict:
state = _prepare_state(balances_fn, threshold_fn, spec, phases) state = _prepare_state(balances_fn, threshold_fn, spec, phases)
if state is None:
dump_skipping_message(f"doesn't support this configuration: {spec.CONFIG_NAME}")
return None
_custom_state_cache_dict[key] = state.get_backing() _custom_state_cache_dict[key] = state.get_backing()
# Take an entry out of the LRU. # Take an entry out of the LRU.
@ -166,13 +161,9 @@ def low_single_balance(spec):
def large_validator_set(spec): def large_validator_set(spec):
""" """
Helper method to create a large series of default balances. Helper method to create a large series of default balances.
Return None if too large for standard test processing.
Usage: `@with_custom_state(balances_fn=default_balances, ...)` Usage: `@with_custom_state(balances_fn=default_balances, ...)`
""" """
num_validators = 2 * spec.SLOTS_PER_EPOCH * spec.MAX_COMMITTEES_PER_SLOT * spec.TARGET_COMMITTEE_SIZE num_validators = 2 * spec.SLOTS_PER_EPOCH * spec.MAX_COMMITTEES_PER_SLOT * spec.TARGET_COMMITTEE_SIZE
if num_validators > spec.SLOTS_PER_EPOCH * 256:
# Larger than limit of public/private keys pre-generated
return None
return [spec.MAX_EFFECTIVE_BALANCE] * num_validators return [spec.MAX_EFFECTIVE_BALANCE] * num_validators