mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-12 03:34:20 +00:00
extend validator set so randomized helpers have more room for operation
This commit is contained in:
parent
513f57f74c
commit
820affd2aa
@ -152,12 +152,13 @@ def misc_balances(spec):
|
||||
return balances
|
||||
|
||||
|
||||
def misc_balances_in_default_range(spec):
|
||||
def misc_balances_in_default_range_with_many_validators(spec):
|
||||
"""
|
||||
Helper method to create a series of balances that includes some misc. balances but
|
||||
none that are below the ``EJECTION_BALANCE``.
|
||||
"""
|
||||
num_validators = spec.SLOTS_PER_EPOCH * 8
|
||||
# Double validators to facilitate randomized testing
|
||||
num_validators = spec.SLOTS_PER_EPOCH * 8 * 2
|
||||
floor = spec.config.EJECTION_BALANCE + spec.EFFECTIVE_BALANCE_INCREMENT
|
||||
balances = [
|
||||
max(spec.MAX_EFFECTIVE_BALANCE * 2 * i // num_validators, floor) for i in range(num_validators)
|
||||
|
@ -3,7 +3,11 @@ import warnings
|
||||
from random import Random
|
||||
from tests.core.pyspec.eth2spec.test.helpers.constants import PHASE0, ALTAIR
|
||||
from typing import Callable
|
||||
from tests.core.pyspec.eth2spec.test.context import misc_balances_in_default_range, with_phases, zero_activation_threshold
|
||||
from tests.core.pyspec.eth2spec.test.context import (
|
||||
misc_balances_in_default_range_with_many_validators,
|
||||
with_phases,
|
||||
zero_activation_threshold,
|
||||
)
|
||||
from eth2spec.test.helpers.multi_operations import (
|
||||
build_random_block_from_state,
|
||||
)
|
||||
@ -323,7 +327,10 @@ def _iter_temporal(spec, callable_or_int):
|
||||
|
||||
@pytest_generate_tests_adapter
|
||||
@with_phases([PHASE0, ALTAIR])
|
||||
@with_custom_state(balances_fn=misc_balances_in_default_range, threshold_fn=zero_activation_threshold)
|
||||
@with_custom_state(
|
||||
balances_fn=misc_balances_in_default_range_with_many_validators,
|
||||
threshold_fn=zero_activation_threshold
|
||||
)
|
||||
@spec_test
|
||||
@single_phase
|
||||
@always_bls
|
||||
|
Loading…
x
Reference in New Issue
Block a user