Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use signing slot to determine fork #7112

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
6 changes: 3 additions & 3 deletions packages/validator/src/services/validatorStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export class ValidatorStore {
data: attestationData,
};

if (this.config.getForkSeq(duty.slot) >= ForkSeq.electra) {
if (this.config.getForkSeq(signingSlot) >= ForkSeq.electra) {
return {
aggregationBits: BitArray.fromSingleBit(duty.committeeLength, duty.validatorCommitteeIndex),
data: attestationData,
Expand Down Expand Up @@ -562,7 +562,7 @@ export class ValidatorStore {

const signingSlot = aggregate.data.slot;
const domain = this.config.getDomain(signingSlot, DOMAIN_AGGREGATE_AND_PROOF);
const isPostElectra = this.config.getForkSeq(duty.slot) >= ForkSeq.electra;
const isPostElectra = this.config.getForkSeq(signingSlot) >= ForkSeq.electra;
const signingRoot = isPostElectra
? computeSigningRoot(ssz.electra.AggregateAndProof, aggregateAndProof, domain)
: computeSigningRoot(ssz.phase0.AggregateAndProof, aggregateAndProof, domain);
Expand Down Expand Up @@ -802,7 +802,7 @@ export class ValidatorStore {
throw Error(`Inconsistent duties during signing: duty.slot ${duty.slot} != att.slot ${data.slot}`);
}

const isPostElectra = this.config.getForkSeq(duty.slot) >= ForkSeq.electra;
const isPostElectra = this.config.getForkSeq(data.slot) >= ForkSeq.electra;
if (!isPostElectra && duty.committeeIndex != data.index) {
throw Error(
`Inconsistent duties during signing: duty.committeeIndex ${duty.committeeIndex} != att.committeeIndex ${data.index}`
Expand Down
Loading