2021-11-15 19:45:18 +00:00
|
|
|
package monitor
|
|
|
|
|
|
|
|
import (
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/consensus-types/interfaces"
|
|
|
|
ethpb "github.com/prysmaticlabs/prysm/v3/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
|
2022-05-02 18:32:37 +00:00
|
|
|
func (s *Service) processExitsFromBlock(blk interfaces.BeaconBlock) {
|
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{
|
|
|
|
"ValidatorIndex": idx,
|
|
|
|
"Slot": blk.Slot(),
|
|
|
|
}).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{
|
|
|
|
"ValidatorIndex": idx,
|
|
|
|
}).Info("Voluntary exit was processed")
|
|
|
|
}
|
|
|
|
}
|