Skip to content

Move ValidateAttestationTime earlier for sync#6755

Merged
prylabs-bulldozer[bot] merged 7 commits into
masterfrom
check-time-first
Jul 29, 2020
Merged

Move ValidateAttestationTime earlier for sync#6755
prylabs-bulldozer[bot] merged 7 commits into
masterfrom
check-time-first

Conversation

@terencechain

@terencechain terencechain commented Jul 29, 2020

Copy link
Copy Markdown
Collaborator

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Moved ValidateAttestationTime before validation steps that required attestation beacon state.

Reasons:
1.) It's a cheaper check (not state required)
2.) During long no finality periods, a node could potentially be attacked by receiving attestations that's outside of ATTESTATION_PROPAGATION_SLOT_RANGE. Although invalid attestation will fail at ValidateAttestationTime, but due to ValidateAttestationTime check is after AttestationPreState, the node would be working extra to retrieve the pre state but later finding out that the attestation is invalid

Other notes for review
Tested run time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants