Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ When writing tests, use these decorators:
- `@with_electra_and_later` - Run on Electra and all subsequent forks
- `@spec_state_test` - State transition test
- `@spec_test` - General spec test
- `@always_bls` - Always enable BLS verification

### Test pattern

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import random

from eth_consensus_specs.test.context import (
always_bls,
default_activation_threshold,
default_balances_electra,
single_phase,
Expand Down Expand Up @@ -36,7 +35,6 @@

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_bad_domain(spec, state):
committee_indices = compute_committee_indices(state)

Expand All @@ -57,7 +55,6 @@ def test_invalid_signature_bad_domain(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_missing_participant(spec, state):
committee_indices = compute_committee_indices(state)
rng = random.Random(2020)
Expand All @@ -80,7 +77,6 @@ def test_invalid_signature_missing_participant(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_no_participants(spec, state):
block = build_empty_block_for_next_slot(spec, state)
# No participants is an allowed case, but needs a specific signature, not the full-zeroed signature.
Expand All @@ -96,7 +92,6 @@ def test_invalid_signature_no_participants(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_infinite_signature_with_all_participants(spec, state):
block = build_empty_block_for_next_slot(spec, state)
# Include all participants, try the special-case signature for no-participants
Expand All @@ -109,7 +104,6 @@ def test_invalid_signature_infinite_signature_with_all_participants(spec, state)

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_infinite_signature_with_single_participant(spec, state):
block = build_empty_block_for_next_slot(spec, state)
# Try include a single participant with the special-case signature for no-participants.
Expand All @@ -123,7 +117,6 @@ def test_invalid_signature_infinite_signature_with_single_participant(spec, stat

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_extra_participant(spec, state):
committee_indices = compute_committee_indices(state)
rng = random.Random(3030)
Expand Down Expand Up @@ -330,7 +323,6 @@ def test_sync_committee_rewards_duplicate_committee_max_effective_balance_only_p

@with_altair_and_later
@spec_state_test
@always_bls
def test_sync_committee_rewards_not_full_participants(spec, state):
committee_indices = compute_committee_indices(state)
rng = random.Random(1010)
Expand All @@ -341,7 +333,6 @@ def test_sync_committee_rewards_not_full_participants(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_sync_committee_rewards_empty_participants(spec, state):
committee_indices = compute_committee_indices(state)
committee_bits = [False for _ in committee_indices]
Expand All @@ -351,7 +342,6 @@ def test_sync_committee_rewards_empty_participants(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_invalid_signature_past_block(spec, state):
committee_indices = compute_committee_indices(state)

Expand Down Expand Up @@ -390,7 +380,6 @@ def test_invalid_signature_past_block(spec, state):
@with_altair_and_later
@with_presets([MINIMAL], reason="to produce different committee sets")
@spec_state_test
@always_bls
def test_invalid_signature_previous_committee(spec, state):
# NOTE: the `state` provided is at genesis and the process to select
# sync committees currently returns the same committee for the first and second
Expand Down Expand Up @@ -430,7 +419,6 @@ def test_invalid_signature_previous_committee(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
@with_presets([MINIMAL], reason="too slow")
def test_valid_signature_future_committee(spec, state):
# NOTE: the `state` provided is at genesis and the process to select
Expand Down Expand Up @@ -476,7 +464,6 @@ def test_valid_signature_future_committee(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
@with_presets([MINIMAL], reason="prefer short search to find matching proposer")
def test_proposer_in_committee_without_participation(spec, state):
committee_indices = compute_committee_indices(state, state.current_sync_committee)
Expand Down Expand Up @@ -522,7 +509,6 @@ def test_proposer_in_committee_without_participation(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
@with_presets([MINIMAL], reason="prefer short search to find matching proposer")
def test_proposer_in_committee_with_participation(spec, state):
committee_indices = compute_committee_indices(state, state.current_sync_committee)
Expand Down Expand Up @@ -582,7 +568,6 @@ def _exit_validator_from_committee_and_transition_state(

@with_altair_and_later
@spec_state_test
@always_bls
def test_sync_committee_with_participating_exited_member(spec, state):
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
Expand Down Expand Up @@ -621,7 +606,6 @@ def test_sync_committee_with_participating_exited_member(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_sync_committee_with_nonparticipating_exited_member(spec, state):
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
Expand Down Expand Up @@ -664,7 +648,6 @@ def test_sync_committee_with_nonparticipating_exited_member(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_sync_committee_with_participating_withdrawable_member(spec, state):
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
Expand Down Expand Up @@ -703,7 +686,6 @@ def test_sync_committee_with_participating_withdrawable_member(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_sync_committee_with_nonparticipating_withdrawable_member(spec, state):
# move state forward SHARD_COMMITTEE_PERIOD epochs to allow for exit
state.slot += spec.config.SHARD_COMMITTEE_PERIOD * spec.SLOTS_PER_EPOCH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from eth_consensus_specs.test.context import (
always_bls,
spec_state_test,
with_altair_and_later,
with_phases,
Expand All @@ -14,7 +13,6 @@

@with_phases([ALTAIR])
@spec_state_test
@always_bls
def test_effective_deposit_with_previous_fork_version(spec, state):
assert state.fork.previous_version != state.fork.current_version

Expand All @@ -29,7 +27,6 @@ def test_effective_deposit_with_previous_fork_version(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
def test_ineffective_deposit_with_current_fork_version(spec, state):
yield from run_deposit_processing_with_specific_fork_version(
spec,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from eth_consensus_specs.test.context import (
always_bls,
misc_balances,
single_phase,
spec_state_test,
Expand All @@ -16,7 +15,7 @@

#
# Note:
# Calculating sync committees requires pubkey aggregation, thus all tests are generated with `always_bls`
# Calculating sync committees requires pubkey aggregation, bls always enabled, thus decorator no needed.
#


Expand Down Expand Up @@ -56,7 +55,6 @@ def run_sync_committees_progress_test(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
@with_presets([MINIMAL], reason="too slow")
def test_sync_committees_progress_genesis(spec, state):
# Genesis epoch period has an exceptional case
Expand All @@ -67,7 +65,6 @@ def test_sync_committees_progress_genesis(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
@with_presets([MINIMAL], reason="too slow")
def test_sync_committees_progress_not_genesis(spec, state):
# Transition out of the genesis epoch period to test non-exceptional case
Expand All @@ -84,7 +81,6 @@ def test_sync_committees_progress_not_genesis(spec, state):
)
@spec_test
@single_phase
@always_bls
@with_presets([MINIMAL], reason="too slow")
def test_sync_committees_progress_misc_balances_genesis(spec, state):
# Genesis epoch period has an exceptional case
Expand All @@ -99,7 +95,6 @@ def test_sync_committees_progress_misc_balances_genesis(spec, state):
)
@spec_test
@single_phase
@always_bls
@with_presets([MINIMAL], reason="too slow")
def test_sync_committees_progress_misc_balances_not_genesis(spec, state):
# Transition out of the genesis epoch period to test non-exceptional case
Expand All @@ -112,7 +107,6 @@ def test_sync_committees_progress_misc_balances_not_genesis(spec, state):

@with_altair_and_later
@spec_state_test
@always_bls
@with_presets([MINIMAL], reason="too slow")
def test_sync_committees_no_progress_not_at_period_boundary(spec, state):
assert spec.get_current_epoch(state) == spec.GENESIS_EPOCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""

from eth_consensus_specs.test.context import (
always_bls,
misc_balances_in_default_range_with_many_validators,
only_generator,
single_phase,
Expand All @@ -28,7 +27,6 @@
)
@spec_test
@single_phase
@always_bls
def test_randomized_0(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -100,7 +98,6 @@ def test_randomized_0(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_1(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -172,7 +169,6 @@ def test_randomized_1(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_2(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -244,7 +240,6 @@ def test_randomized_2(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_3(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -316,7 +311,6 @@ def test_randomized_3(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_4(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -388,7 +382,6 @@ def test_randomized_4(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_5(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -460,7 +453,6 @@ def test_randomized_5(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_6(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -532,7 +524,6 @@ def test_randomized_6(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_7(spec, state):
# scenario as high-level, informal text:
# epochs:0,slots:0,with-block:no_block
Expand Down Expand Up @@ -604,7 +595,6 @@ def test_randomized_7(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_8(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -676,7 +666,6 @@ def test_randomized_8(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_9(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -748,7 +737,6 @@ def test_randomized_9(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_10(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -820,7 +808,6 @@ def test_randomized_10(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_11(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -892,7 +879,6 @@ def test_randomized_11(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_12(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -964,7 +950,6 @@ def test_randomized_12(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_13(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -1036,7 +1021,6 @@ def test_randomized_13(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_14(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down Expand Up @@ -1108,7 +1092,6 @@ def test_randomized_14(spec, state):
)
@spec_test
@single_phase
@always_bls
def test_randomized_15(spec, state):
# scenario as high-level, informal text:
# epochs:epochs_until_leak,slots:0,with-block:no_block
Expand Down
Loading
Loading