Handle AttesterSlashingElectra everywhere in the codebase (#14823)

* Handle `AttesterSlashingElectra` everywhere in the codebase

* simplify `TestProcessAttesterSlashings_AppliesCorrectStatus`
This commit is contained in:
Radosław Kapka
2025-01-28 16:06:37 +01:00
committed by GitHub
parent b4220e35c4
commit 9cf6b93356
21 changed files with 456 additions and 385 deletions

View File

@@ -122,18 +122,14 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot,
return
}
// TODO: Extend to Electra
phase0Att, ok := indexedAtt.(*ethpb.IndexedAttestation)
if ok {
// Send the attestation to the beacon node.
if err := v.db.SlashableAttestationCheck(ctx, phase0Att, pubKey, signingRoot, v.emitAccountMetrics, ValidatorAttestFailVec); err != nil {
log.WithError(err).Error("Failed attestation slashing protection check")
log.WithFields(
attestationLogFields(pubKey, indexedAtt),
).Debug("Attempted slashable attestation details")
tracing.AnnotateError(span, err)
return
}
// Send the attestation to the beacon node.
if err := v.db.SlashableAttestationCheck(ctx, indexedAtt, pubKey, signingRoot, v.emitAccountMetrics, ValidatorAttestFailVec); err != nil {
log.WithError(err).Error("Failed attestation slashing protection check")
log.WithFields(
attestationLogFields(pubKey, indexedAtt),
).Debug("Attempted slashable attestation details")
tracing.AnnotateError(span, err)
return
}
var aggregationBitfield bitfield.Bitlist