2021-11-15 19:45:18 +00:00
|
|
|
package monitor
|
|
|
|
|
|
|
|
import (
|
2022-05-02 15:43:40 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/consensus-types/block"
|
2021-11-15 19:45:18 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
|
|
"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
|
2021-11-15 19:45:18 +00:00
|
|
|
func (s *Service) processExitsFromBlock(blk block.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")
|
|
|
|
}
|
|
|
|
}
|