lodestar icon indicating copy to clipboard operation
lodestar copied to clipboard

`isValidAttestationData` returns invalid result for earlier epochs

Open nazarhussain opened this issue 2 years ago • 0 comments

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.

https://github.com/ChainSafe/lodestar/blob/0886d751c52a9fc9b306bb26a328c0408bbfcd7d/packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts#L435

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.

https://github.com/ChainSafe/lodestar/blob/0886d751c52a9fc9b306bb26a328c0408bbfcd7d/packages/beacon-node/src/chain/opPools/aggregatedAttestationPool.ts#L430-L432

Desktop (please complete the following information):

  • OS: Mac
  • Branch: [unstable]

nazarhussain avatar Sep 14 '22 14:09 nazarhussain