def validate_multiple_2(): bls.validate_multiple( pubkeys=(EMPTY_PUBKEY, EMPTY_PUBKEY), message_hashes=(b"\x11" * 32, b"\x12" * 32), signature=EMPTY_SIGNATURE, domain=domain, )
def validate_indexed_attestation_aggregate_signature( state: BeaconState, indexed_attestation: IndexedAttestation, slots_per_epoch: int) -> None: bit_0_indices = indexed_attestation.custody_bit_0_indices bit_1_indices = indexed_attestation.custody_bit_1_indices pubkeys = ( bls.aggregate_pubkeys( tuple(state.validators[i].pubkey for i in bit_0_indices)), bls.aggregate_pubkeys( tuple(state.validators[i].pubkey for i in bit_1_indices)), ) message_hashes = ( AttestationDataAndCustodyBit(data=indexed_attestation.data, custody_bit=False).hash_tree_root, AttestationDataAndCustodyBit(data=indexed_attestation.data, custody_bit=True).hash_tree_root, ) domain = get_domain( state, SignatureDomain.DOMAIN_ATTESTATION, slots_per_epoch, indexed_attestation.data.target.epoch, ) bls.validate_multiple( pubkeys=pubkeys, message_hashes=message_hashes, signature=indexed_attestation.signature, domain=domain, )
def validate_multiple_1(): bls.validate_multiple(pubkeys=(), message_hashes=(), signature=EMPTY_SIGNATURE, domain=domain)