Compare commits

...

1 Commits

3 changed files with 7 additions and 3 deletions

View File

@@ -123,9 +123,6 @@ func (s *Service) internalBroadcastAttestation(ctx context.Context, subnet uint6
if !hasPeer {
attestationBroadcastAttempts.Inc()
if err := func() error {
s.subnetLocker(subnet).Lock()
defer s.subnetLocker(subnet).Unlock()
if err := s.FindAndDialPeersWithSubnets(ctx, AttestationSubnetTopicFormat, forkDigest, minimumPeersPerSubnetForBroadcast, map[uint64]bool{subnet: true}); err != nil {
return errors.Wrap(err, "find peers with subnets")
}

View File

@@ -110,6 +110,11 @@ func (s *Service) FindAndDialPeersWithSubnets(
}
peersToDial, err := func() ([]*enode.Node, error) {
for subnet := range defectiveSubnets {
s.subnetLocker(subnet).Lock()
defer s.subnetLocker(subnet).Unlock()
}
ctx, cancel := context.WithTimeout(ctx, batchPeriod)
defer cancel()

View File

@@ -0,0 +1,2 @@
### Fixed
- Lock the subnet mutex only when trying to find peers, so the mutex is not locked when dialing peers.