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

isValidAttestationData returns invalid result for earlier epochs #4547

Closed
nazarhussain opened this issue Sep 14, 2022 · 0 comments · Fixed by #4573
Closed

isValidAttestationData returns invalid result for earlier epochs #4547

nazarhussain opened this issue Sep 14, 2022 · 0 comments · Fixed by #4573
Assignees

Comments

@nazarhussain
Copy link
Contributor

Describe the bug

When called isValidAttestationData for the an attestation which is targeting last slot of the second epoch it results to zero.

It's because of the following condition always evaluates to -1 for which we don't have a block header.

const pivotSlot = computeStartSlotAtEpoch(targetEpoch - 1) - 1;

Expected behavior

Instead of a hardcoded condition for first 2 epochs, we should simply rely if the pivotSlot is not the negative. That will suffice the few first epochs condition as well.

if (stateEpoch < 2) {
return true;
}

Desktop (please complete the following information):

  • OS: Mac
  • Branch: [unstable]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant