Skip to content

Commit

Permalink
move get data after nil check for attestations (#14642)
Browse files Browse the repository at this point in the history
* move getData to after validations

* changelog
  • Loading branch information
james-prysm authored Nov 15, 2024
1 parent be60504 commit 9dbf979
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- EIP7521 - Fixes withdrawal bug by accounting for pending partial withdrawals and deducting already withdrawn amounts from the sweep balance. [PR](https://github.com/prysmaticlabs/prysm/pull/14578)
- unskip electra merkle spec test
- Fix panic in validator REST mode when checking status after removing all keys
- Fix panic on attestation interface since we call data before validation

### Security

Expand Down
3 changes: 1 addition & 2 deletions beacon-chain/sync/validate_aggregate_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ func (s *Service) validateAggregateAndProof(ctx context.Context, pid peer.ID, ms
}

aggregate := m.AggregateAttestationAndProof().AggregateVal()
data := aggregate.GetData()

if err := helpers.ValidateNilAttestation(aggregate); err != nil {
return pubsub.ValidationReject, err
}
data := aggregate.GetData()
// Do not process slot 0 aggregates.
if data.Slot == 0 {
return pubsub.ValidationIgnore, nil
Expand Down
5 changes: 2 additions & 3 deletions beacon-chain/sync/validate_beacon_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p
if !ok {
return pubsub.ValidationReject, errWrongMessage
}

data := att.GetData()

if err := helpers.ValidateNilAttestation(att); err != nil {
return pubsub.ValidationReject, err
}
data := att.GetData()

// Do not process slot 0 attestations.
if data.Slot == 0 {
return pubsub.ValidationIgnore, nil
Expand Down

0 comments on commit 9dbf979

Please sign in to comment.