Skip to content

Commit

Permalink
fix: correctly get signature from single attestation bytes (#7266)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored and ensi321 committed Dec 17, 2024
1 parent 56d083a commit b12b205
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/beacon-node/src/chain/validation/attestation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
getAttesterIndexFromSingleAttestationSerialized,
getCommitteeIndexFromSingleAttestationSerialized,
getSignatureFromAttestationSerialized,
getSignatureFromSingleAttestationSerialized,
} from "../../util/sszBytes.js";
import {Result, wrapError} from "../../util/wrapError.js";
import {AttestationError, AttestationErrorCode, GossipAction} from "../errors/index.js";
Expand Down Expand Up @@ -480,7 +481,9 @@ async function validateAttestationNoSignatureCheck(
let attDataRootHex: RootHex;
const signature = attestationOrCache.attestation
? attestationOrCache.attestation.signature
: getSignatureFromAttestationSerialized(attestationOrCache.serializedData);
: !isForkPostElectra(fork)
? getSignatureFromAttestationSerialized(attestationOrCache.serializedData)
: getSignatureFromSingleAttestationSerialized(attestationOrCache.serializedData);
if (signature === null) {
throw new AttestationError(GossipAction.REJECT, {
code: AttestationErrorCode.INVALID_SERIALIZED_BYTES,
Expand Down

0 comments on commit b12b205

Please sign in to comment.