Skip to content

Commit 972c22b

Browse files
authored
SingleAttestation support in the monitor service (#14965)
* `SingleAttestation` support in the monitor service * changelog <3
1 parent 93c2734 commit 972c22b

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

beacon-chain/monitor/process_attestation.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,23 @@ func (s *Service) processIncludedAttestation(ctx context.Context, state state.Be
166166
}
167167
}
168168

169+
// processSingleAttestation logs when the beacon node observes a single attestation from tracked validator.
170+
func (s *Service) processSingleAttestation(att ethpb.Att) {
171+
s.RLock()
172+
defer s.RUnlock()
173+
174+
single, ok := att.(*ethpb.SingleAttestation)
175+
if !ok {
176+
log.Errorf("Wrong attestation type (expected %T, got %T)", &ethpb.SingleAttestation{}, att)
177+
return
178+
}
179+
180+
if s.canUpdateAttestedValidator(single.AttesterIndex, single.GetData().Slot) {
181+
logFields := logMessageTimelyFlagsForIndex(single.AttesterIndex, att.GetData())
182+
log.WithFields(logFields).Info("Processed unaggregated attestation")
183+
}
184+
}
185+
169186
// processUnaggregatedAttestation logs when the beacon node observes an unaggregated attestation from tracked validator.
170187
func (s *Service) processUnaggregatedAttestation(ctx context.Context, att ethpb.Att) {
171188
s.RLock()

beacon-chain/monitor/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func (s *Service) monitorRoutine(stateChannel chan *feed.Event, stateSub event.S
241241
if !ok {
242242
log.Error("Event feed data is not of type *operation.SingleAttReceivedData")
243243
} else {
244-
s.processUnaggregatedAttestation(s.ctx, data.Attestation)
244+
s.processSingleAttestation(data.Attestation)
245245
}
246246
case operation.ExitReceived:
247247
data, ok := e.Data.(*operation.ExitReceivedData)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Fixed
2+
3+
- Dedicated processing of `SingleAttestation` in the monitor service.

0 commit comments

Comments
 (0)