UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

15 lines 1.12 kB
import { DOMAIN_SELECTION_PROOF } from "@lodestar/params"; import { computeSigningRoot, createSingleSignatureSetFromComponents } from "@lodestar/state-transition"; import { ssz } from "@lodestar/types"; export function getSelectionProofSigningRoot(config, slot) { // previously, we call `const selectionProofDomain = config.getDomain(state.slot, DOMAIN_SELECTION_PROOF, slot)` // at fork boundary, it's required to dial to target epoch https://github.com/ChainSafe/lodestar/blob/v1.11.3/packages/beacon-node/src/chain/validation/attestation.ts#L573 // instead of that, just use the fork of slot in the attestation data const fork = config.getForkName(slot); const selectionProofDomain = config.getDomainAtFork(fork, DOMAIN_SELECTION_PROOF); return computeSigningRoot(ssz.Slot, slot, selectionProofDomain); } export function getSelectionProofSignatureSet(config, slot, aggregator, aggregateAndProof) { return createSingleSignatureSetFromComponents(aggregator, getSelectionProofSigningRoot(config, slot), aggregateAndProof.message.selectionProof); } //# sourceMappingURL=selectionProof.js.map