Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/beacon-node/src/api/impl/beacon/pool/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {routes, ServerApi} from "@lodestar/api";
import {CommitteeIndex, Epoch, isElectraAttestation, ssz} from "@lodestar/types";
import {Epoch, ssz} from "@lodestar/types";
import {ForkName, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
import {validateApiAttestation} from "../../../../chain/validation/index.js";
import {validateApiAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import {
import {IBeaconChain} from "..";
import {AttestationError, AttestationErrorCode, GossipAction} from "../errors/index.js";
import {RegenCaller} from "../regen/index.js";
import {
getSeenAttDataKeyFromSignedAggregateAndProof,
} from "../../util/sszBytes.js";
import {getSeenAttDataKeyFromSignedAggregateAndProof} from "../../util/sszBytes.js";
import {getSelectionProofSignatureSet, getAggregateAndProofSignatureSet} from "./signatureSets/index.js";
import {
getAttestationDataSigningRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("validate gossip attestation", () => {
attestation: null,
serializedData,
attSlot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet0
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("validateAttestation", () => {
const {chain, subnet} = getValidData();
await expectGossipError(
chain,
{attestation: null, serializedData: Buffer.alloc(0), attSlot: 0, seenAttestationDataKey: "invalid"},
{attestation: null, serializedData: Buffer.alloc(0), attSlot: 0, seenAttestationKey: "invalid"},
subnet,
GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE
);
Expand All @@ -72,7 +72,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.BAD_TARGET_EPOCH
Expand All @@ -91,7 +91,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.PAST_SLOT
Expand All @@ -110,7 +110,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.FUTURE_SLOT
Expand All @@ -135,7 +135,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.NOT_EXACTLY_ONE_AGGREGATION_BIT_SET
Expand All @@ -155,7 +155,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.NOT_EXACTLY_ONE_AGGREGATION_BIT_SET
Expand All @@ -179,7 +179,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.UNKNOWN_OR_PREFINALIZED_BEACON_BLOCK_ROOT
Expand All @@ -199,7 +199,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.INVALID_TARGET_ROOT
Expand All @@ -226,7 +226,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.WRONG_NUMBER_OF_AGGREGATION_BITS
Expand All @@ -245,7 +245,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
invalidSubnet,
AttestationErrorCode.INVALID_SUBNET_ID
Expand All @@ -265,7 +265,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.ATTESTATION_ALREADY_KNOWN
Expand All @@ -287,7 +287,7 @@ describe("validateAttestation", () => {
attestation: null,
serializedData,
attSlot: attestation.data.slot,
seenAttestationDataKey: getSeenAttDataKeyPhase0(serializedData),
seenAttestationKey: getSeenAttDataKeyPhase0(serializedData),
},
subnet,
AttestationErrorCode.INVALID_SIGNATURE
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/src/services/attestation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {toHexString} from "@chainsafe/ssz";
import {allForks, BLSSignature, electra, isElectraAttestation, phase0, Slot, ssz} from "@lodestar/types";
import {allForks, BLSSignature, phase0, Slot, ssz} from "@lodestar/types";
import {computeEpochAtSlot, isAggregatorFromCommitteeLength} from "@lodestar/state-transition";
import {sleep} from "@lodestar/utils";
import {Api, ApiError, routes} from "@lodestar/api";
Expand Down
5 changes: 1 addition & 4 deletions packages/validator/src/services/validatorStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
bellatrix,
BLSPubkey,
BLSSignature,
electra,
Epoch,
phase0,
Root,
Expand Down Expand Up @@ -803,9 +802,7 @@ export class ValidatorStore {
);
}
if (isAfterElectra && data.index !== 0) {
throw Error(
`Non-zero committee index post-electra during signing: att.committeeIndex ${data.index}`
);
throw Error(`Non-zero committee index post-electra during signing: att.committeeIndex ${data.index}`);
}
if (this.config.getForkSeq(duty.slot) >= ForkSeq.electra && data.index !== 0) {
throw Error(`Attestataion data index must be 0 post electra: index ${data.index}`);
Expand Down