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

Add in Attestation Validity Check #6983

Merged
merged 12 commits into from
Aug 13, 2020
Merged

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Aug 13, 2020

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

  • Validate Attestation Indices in Batch Attestation Processing.
  • Add Regression test to validate indices from attestation.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

@nisdas nisdas requested a review from a team as a code owner August 13, 2020 08:24
@nisdas nisdas added Ready For Review A pull request ready for code review Priority: Critical Highest, immediate priority item labels Aug 13, 2020
farazdagi
farazdagi previously approved these changes Aug 13, 2020
shayzluf
shayzluf previously approved these changes Aug 13, 2020
// the signature in that attestation.
func VerifyAttestation(ctx context.Context, beaconState *stateTrie.BeaconState, att *ethpb.Attestation) error {
if att == nil || att.Data == nil || att.AggregationBits.Count() == 0 {
return fmt.Errorf("nil or missing attestation data: %v", att)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fmt.Errorf("nil or missing attestation data: %v", att)
return fmt.Errorf("nil, missing attestation data or no attesting indices: %v", att)

Copy link
Member

@terencechain terencechain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To confirm, you just shift the ordering of the two functions and added att.AggregationBits.Count() == 0 right?

@nisdas
Copy link
Member Author

nisdas commented Aug 13, 2020

No , there was a valid indexed attestation check that was missing completely. It deviated from the spec and our old core methods. When changing it to batch verify attestations we missed this whole check.

@terencechain
Copy link
Member

No , there was a valid indexed attestation check that was missing completely. It deviated from the spec and our old core methods. When changing it to batch verify attestations we missed this whole check.

I see the `VerifyAttestation

@prylabs-bulldozer prylabs-bulldozer bot merged commit 282398f into master Aug 13, 2020
@farazdagi farazdagi deleted the fixAttestationNoVerify branch August 21, 2020 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Critical Highest, immediate priority item Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants