From 6c73015562c409248184b6d75bdad9493bd2d57e Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Tue, 18 Oct 2022 19:02:58 +0200 Subject: [PATCH] remove unused `is_valid_indexed_attestation` (#4248) --- .../consensus_object_pools/spec_cache.nim | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/beacon_chain/consensus_object_pools/spec_cache.nim b/beacon_chain/consensus_object_pools/spec_cache.nim index 49b2a3ebe..8dd57812e 100644 --- a/beacon_chain/consensus_object_pools/spec_cache.nim +++ b/beacon_chain/consensus_object_pools/spec_cache.nim @@ -168,35 +168,6 @@ func get_attesting_indices*(shufflingRef: ShufflingRef, for idx in get_attesting_indices(shufflingRef, slot, committee_index, bits): result.add(idx) -# https://github.com/ethereum/consensus-specs/blob/v1.2.0/specs/phase0/beacon-chain.md#is_valid_indexed_attestation -proc is_valid_indexed_attestation*( - fork: Fork, genesis_validators_root: Eth2Digest, - dag: ChainDAGRef, shufflingRef: EpochRef, - attestation: SomeAttestation, flags: UpdateFlags): Result[void, cstring] = - # This is a variation on `is_valid_indexed_attestation` that works directly - # with an attestation instead of first constructing an `IndexedAttestation` - # and then validating it - for the purpose of validating the signature, the - # order doesn't matter and we can proceed straight to validating the - # signature instead - let sigs = attestation.aggregation_bits.countOnes() - if sigs == 0: - return err("is_valid_indexed_attestation: no attesting indices") - - # Verify aggregate signature - if not (skipBlsValidation in flags or attestation.signature is TrustedSig): - var - pubkeys = newSeqOfCap[CookedPubKey](sigs) - for index in get_attesting_indices( - shufflingRef, attestation.data, attestation.aggregation_bits): - pubkeys.add(dag.validatorKey(index).get()) - - if not verify_attestation_signature( - fork, genesis_validators_root, attestation.data, - pubkeys, attestation.signature): - return err("is_valid_indexed_attestation: signature verification failure") - - ok() - func makeAttestationData*( epochRef: EpochRef, bs: BlockSlot, committee_index: CommitteeIndex): AttestationData =