diff --git a/specs/phase1/beacon-chain.md b/specs/phase1/beacon-chain.md index fe5c0d9a7..c30810864 100644 --- a/specs/phase1/beacon-chain.md +++ b/specs/phase1/beacon-chain.md @@ -540,8 +540,12 @@ def is_valid_indexed_attestation(state: BeaconState, indexed_attestation: Indexe if abit: all_pubkeys.append(state.validators[participant].pubkey) # Note: only 2N distinct message hashes - all_signing_roots.append(compute_signing_root( - AttestationCustodyBitWrapper(hash_tree_root(attestation.data), i, cbit), domain)) + attestation_wrapper = AttestationCustodyBitWrapper( + attestation_data_root=hash_tree_root(attestation.data), + block_index=i, + bit=cbit + ) + all_signing_roots.append(compute_signing_root(attestation_wrapper, domain)) else: assert not cbit return bls.AggregateVerify(zip(all_pubkeys, all_signing_roots), signature=attestation.signature) @@ -801,6 +805,7 @@ def get_indices_from_committee( def process_attester_slashing(state: BeaconState, attester_slashing: AttesterSlashing) -> None: indexed_attestation_1 = attester_slashing.attestation_1 indexed_attestation_2 = attester_slashing.attestation_2 + assert is_slashable_attestation_data( indexed_attestation_1.attestation.data, indexed_attestation_2.attestation.data, diff --git a/tests/core/pyspec/eth2spec/test/helpers/attestations.py b/tests/core/pyspec/eth2spec/test/helpers/attestations.py index deebd0356..fea4ea1f6 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/attestations.py +++ b/tests/core/pyspec/eth2spec/test/helpers/attestations.py @@ -202,9 +202,9 @@ def get_attestation_custody_signature(spec, state, attestation_data, block_index domain = spec.get_domain(state, spec.DOMAIN_BEACON_ATTESTER, attestation_data.target.epoch) signing_root = spec.compute_signing_root( spec.AttestationCustodyBitWrapper( - attestation_data.hash_tree_root(), - block_index, - bit, + attestation_data_root=attestation_data.hash_tree_root(), + block_index=block_index, + bit=bit, ), domain, ) diff --git a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py b/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py index c379bb815..e9665e714 100644 --- a/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py +++ b/tests/core/pyspec/eth2spec/test/phase_0/block_processing/test_process_attester_slashing.py @@ -143,10 +143,6 @@ def test_invalid_sig_1(spec, state): @always_bls def test_invalid_sig_2(spec, state): attester_slashing = get_valid_attester_slashing(spec, state, signed_1=True, signed_2=False) - """ - SOMETHING WRONG WITH HASH CACHE OF SEPARATE ATTESTATIONS MAKING SIGS - LOOK CORRECT - """ yield from run_attester_slashing_processing(spec, state, attester_slashing, False)