mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-04-19 03:01:06 -04:00
change idx back to uint64
This commit is contained in:
4
beacon-chain/cache/payload_attestation.go
vendored
4
beacon-chain/cache/payload_attestation.go
vendored
@@ -23,7 +23,7 @@ type PayloadAttestationCache struct {
|
||||
// Seen returns true if a vote for the given Beacon Block Root has already been processed
|
||||
// for this Payload Timeliness Committee index. This will return true even if
|
||||
// the Payload status differs.
|
||||
func (p *PayloadAttestationCache) Seen(root [32]byte, idx primitives.ValidatorIndex) bool {
|
||||
func (p *PayloadAttestationCache) Seen(root [32]byte, idx uint64) bool {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
if p.root != root {
|
||||
@@ -33,7 +33,7 @@ func (p *PayloadAttestationCache) Seen(root [32]byte, idx primitives.ValidatorIn
|
||||
if agg == nil {
|
||||
continue
|
||||
}
|
||||
if agg.AggregationBits.BitAt(uint64(idx)) {
|
||||
if agg.AggregationBits.BitAt(idx) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ func (s *Service) validatePayloadAttestation(ctx context.Context, pid peer.ID, m
|
||||
return pubsub.ValidationReject, err
|
||||
}
|
||||
|
||||
if s.payloadAttestationCache.Seen(pa.BeaconBlockRoot(), pa.ValidatorIndex()) {
|
||||
if s.payloadAttestationCache.Seen(pa.BeaconBlockRoot(), uint64(pa.ValidatorIndex())) {
|
||||
return pubsub.ValidationIgnore, errAlreadySeenPayloadAttestation
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ func (s *Service) payloadAttestationSubscriber(ctx context.Context, msg proto.Me
|
||||
if idx == -1 {
|
||||
return errInvalidValidatorIndex
|
||||
}
|
||||
if s.payloadAttestationCache.Seen(root, primitives.ValidatorIndex(idx)) {
|
||||
if s.payloadAttestationCache.Seen(root, uint64(primitives.ValidatorIndex(idx))) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user