2021-11-15 19:45:18 +00:00
|
|
|
package monitor
|
|
|
|
|
|
|
|
import (
|
2024-02-15 05:46:47 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
|
|
|
|
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
2021-11-15 19:45:18 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2021-12-15 20:42:20 +00:00
|
|
|
// processExitsFromBlock logs the event when a tracked validators' exit was included in a block
|
2023-02-09 09:23:32 +00:00
|
|
|
func (s *Service) processExitsFromBlock(blk interfaces.ReadOnlyBeaconBlock) {
|
2021-11-24 01:56:34 +00:00
|
|
|
s.RLock()
|
|
|
|
defer s.RUnlock()
|
2021-11-15 19:45:18 +00:00
|
|
|
for _, exit := range blk.Body().VoluntaryExits() {
|
|
|
|
idx := exit.Exit.ValidatorIndex
|
2021-11-24 01:56:34 +00:00
|
|
|
if s.trackedIndex(idx) {
|
2021-11-15 19:45:18 +00:00
|
|
|
log.WithFields(logrus.Fields{
|
2024-02-22 22:40:36 +00:00
|
|
|
"validatorIndex": idx,
|
|
|
|
"slot": blk.Slot(),
|
2021-11-15 19:45:18 +00:00
|
|
|
}).Info("Voluntary exit was included")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-15 20:42:20 +00:00
|
|
|
// processExit logs the event when tracked validators' exit was processed
|
2021-11-15 19:45:18 +00:00
|
|
|
func (s *Service) processExit(exit *ethpb.SignedVoluntaryExit) {
|
|
|
|
idx := exit.Exit.ValidatorIndex
|
2021-11-24 01:56:34 +00:00
|
|
|
s.RLock()
|
|
|
|
defer s.RUnlock()
|
|
|
|
if s.trackedIndex(idx) {
|
2021-11-15 19:45:18 +00:00
|
|
|
log.WithFields(logrus.Fields{
|
2024-02-22 22:40:36 +00:00
|
|
|
"validatorIndex": idx,
|
2021-11-15 19:45:18 +00:00
|
|
|
}).Info("Voluntary exit was processed")
|
|
|
|
}
|
|
|
|
}
|