Skip to content

Commit

Permalink
remove kludge to skip large_validator_set on mainnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Sep 18, 2020
1 parent 27d8c80 commit d257926
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions tests/core/pyspec/eth2spec/test/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ def _prepare_state(balances_fn: Callable[[Any], Sequence[int]], threshold_fn: Ca

p0 = phases[PHASE0]
balances = balances_fn(p0)
if balances is None:
return None
activation_threshold = threshold_fn(p0)

state = create_genesis_state(spec=p0, validator_balances=balances,
Expand All @@ -90,9 +88,6 @@ def entry(*args, spec: Spec, phases: SpecForks, **kw):
global _custom_state_cache_dict
if key not in _custom_state_cache_dict:
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()

# Take an entry out of the LRU.
Expand Down Expand Up @@ -166,13 +161,9 @@ def low_single_balance(spec):
def large_validator_set(spec):
"""
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, ...)`
"""
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


Expand Down

0 comments on commit d257926

Please sign in to comment.