Skip to content

Commit

Permalink
bugfix: use right test tool to construct Electra AttesterSlashing f…
Browse files Browse the repository at this point in the history
…rom Deneb attestations
  • Loading branch information
ralexstokes committed Apr 5, 2024
1 parent e4068b5 commit a626a79
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/core/pyspec/eth2spec/test/helpers/fork_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
PHASE0,
POST_FORK_OF,
PREVIOUS_FORK_OF,
DENEB,
)
from eth2spec.test.helpers.deposits import (
prepare_state_and_deposit,
Expand Down Expand Up @@ -296,8 +297,15 @@ def run_transition_with_operation(state,
operation_dict = {'proposer_slashings': [proposer_slashing]}
else:
# operation_type == OperationType.ATTESTER_SLASHING:
if is_at_fork and spec.fork == DENEB:
# NOTE: attestation format changes between Deneb and Electra
# so attester slashing must be made with the `post_spec`
target_spec = post_spec
else:
target_spec = spec

attester_slashing = get_valid_attester_slashing_by_indices(
spec, state,
target_spec, state,
[selected_validator_index],
signed_1=True, signed_2=True,
)
Expand Down

0 comments on commit a626a79

Please sign in to comment.