Fix remaining merge-rebase-altair tests
This commit is contained in:
parent
bb0848b6f6
commit
8318441474
|
@ -18,12 +18,9 @@ DAS = SpecForkName('das')
|
|||
ALL_PHASES = (PHASE0, ALTAIR, MERGE)
|
||||
# The forks that output to the test vectors.
|
||||
TESTGEN_FORKS = (PHASE0, ALTAIR, MERGE)
|
||||
# TODO: everything runs in parallel to Altair.
|
||||
# After features are rebased on the Altair fork, this can be reduced to just PHASE0.
|
||||
FORKS_BEFORE_ALTAIR = (PHASE0, MERGE, SHARDING, CUSTODY_GAME, DAS)
|
||||
|
||||
# TODO: when rebasing Merge onto Altair, add ALTAIR to this tuple.
|
||||
FORKS_BEFORE_MERGE = (PHASE0,)
|
||||
FORKS_BEFORE_ALTAIR = (PHASE0,)
|
||||
FORKS_BEFORE_MERGE = (PHASE0, ALTAIR)
|
||||
|
||||
#
|
||||
# Config
|
||||
|
|
|
@ -4,9 +4,6 @@ MERGE_FORK_TEST_META_TAGS = {
|
|||
|
||||
|
||||
def run_fork_test(post_spec, pre_state):
|
||||
# Clean up state to be more realistic
|
||||
pre_state.current_epoch_attestations = []
|
||||
|
||||
yield 'pre', pre_state
|
||||
|
||||
post_state = post_spec.upgrade_to_merge(pre_state)
|
||||
|
|
|
@ -16,10 +16,7 @@ from eth2spec.test.helpers.merge.fork import (
|
|||
MERGE_FORK_TEST_META_TAGS,
|
||||
run_fork_test,
|
||||
)
|
||||
from eth2spec.test.helpers.random import (
|
||||
randomize_state,
|
||||
randomize_attestation_participation,
|
||||
)
|
||||
from eth2spec.test.helpers.random import randomize_state
|
||||
|
||||
|
||||
@with_phases(phases=[ALTAIR], other_phases=[MERGE])
|
||||
|
@ -58,39 +55,6 @@ def test_merge_fork_random_3(spec, phases, state):
|
|||
yield from run_fork_test(phases[MERGE], state)
|
||||
|
||||
|
||||
@with_phases(phases=[ALTAIR], other_phases=[MERGE])
|
||||
@spec_test
|
||||
@with_state
|
||||
@with_meta_tags(MERGE_FORK_TEST_META_TAGS)
|
||||
def test_merge_fork_random_duplicate_attestations(spec, phases, state):
|
||||
randomize_state(spec, state, rng=Random(1111))
|
||||
# Note: `run_fork_test` empties `current_epoch_attestations`
|
||||
state.previous_epoch_attestations = state.previous_epoch_attestations + state.previous_epoch_attestations
|
||||
yield from run_fork_test(phases[MERGE], state)
|
||||
|
||||
|
||||
@with_phases(phases=[ALTAIR], other_phases=[MERGE])
|
||||
@spec_test
|
||||
@with_state
|
||||
@with_meta_tags(MERGE_FORK_TEST_META_TAGS)
|
||||
def test_merge_fork_random_mismatched_attestations(spec, phases, state):
|
||||
# Create a random state
|
||||
randomize_state(spec, state, rng=Random(2222))
|
||||
|
||||
# Now make two copies
|
||||
state_0 = state.copy()
|
||||
state_1 = state.copy()
|
||||
|
||||
# Randomize attestation participation of both
|
||||
randomize_attestation_participation(spec, state_0, rng=Random(3333))
|
||||
randomize_attestation_participation(spec, state_1, rng=Random(4444))
|
||||
|
||||
# Note: `run_fork_test` empties `current_epoch_attestations`
|
||||
# Use pending attestations from both random states in a single state for testing
|
||||
state_0.previous_epoch_attestations = state_0.previous_epoch_attestations + state_1.previous_epoch_attestations
|
||||
yield from run_fork_test(phases[MERGE], state_0)
|
||||
|
||||
|
||||
@with_phases(phases=[ALTAIR], other_phases=[MERGE])
|
||||
@spec_test
|
||||
@with_custom_state(balances_fn=low_balances, threshold_fn=lambda spec: spec.config.EJECTION_BALANCE)
|
||||
|
|
Loading…
Reference in New Issue