Merge pull request #1842 from ethereum/phase1_on_time_sign_indexed_attestation

Fix phase1 on-time sign_indexed_attestation
This commit is contained in:
Danny Ryan 2020-05-26 10:12:00 -06:00 committed by GitHub
commit d020d49f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -211,6 +211,9 @@ def sign_indexed_attestation(spec, state, indexed_attestation):
indexed_attestation.attestation.aggregation_bits, indexed_attestation.attestation.aggregation_bits,
) )
data = indexed_attestation.attestation.data data = indexed_attestation.attestation.data
if any(indexed_attestation.attestation.custody_bits_blocks):
sign_on_time_attestation(spec, state, indexed_attestation.attestation)
else:
indexed_attestation.attestation.signature = sign_aggregate_attestation(spec, state, data, participants) indexed_attestation.attestation.signature = sign_aggregate_attestation(spec, state, data, participants)

View File

@ -1,6 +1,6 @@
from eth2spec.test.context import ( from eth2spec.test.context import (
PHASE0, PHASE1, PHASE0, PHASE1,
spec_state_test, expect_assertion_error, always_bls, never_bls, with_all_phases, with_phases spec_state_test, expect_assertion_error, always_bls, with_all_phases, with_phases
) )
from eth2spec.test.helpers.attestations import sign_indexed_attestation from eth2spec.test.helpers.attestations import sign_indexed_attestation
from eth2spec.test.helpers.attester_slashings import get_valid_attester_slashing, \ from eth2spec.test.helpers.attester_slashings import get_valid_attester_slashing, \
@ -89,7 +89,6 @@ def test_success_double(spec, state):
@with_all_phases @with_all_phases
@spec_state_test @spec_state_test
@never_bls
def test_success_surround(spec, state): def test_success_surround(spec, state):
next_epoch_via_block(spec, state) next_epoch_via_block(spec, state)