change idx back to uint64

This commit is contained in:
Potuz
2024-08-08 08:06:29 -03:00
parent a46f164068
commit deb063a304
2 changed files with 4 additions and 4 deletions

View File

@@ -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
}
}

View File

@@ -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
}