Check for nil duties on checkDependentRoots (#15241)

This commit is contained in:
Potuz
2025-05-01 16:16:55 -03:00
committed by GitHub
parent 5e3a5b877a
commit 8a22df902f
2 changed files with 6 additions and 0 deletions

View File

@@ -1146,6 +1146,9 @@ func (v *validator) checkDependentRoots(ctx context.Context, head *structs.HeadE
if head == nil {
return errors.New("received empty head event")
}
if v.duties == nil {
return errors.New("duties are not initialized")
}
prevDepedentRoot, err := bytesutil.DecodeHexWithLength(head.PreviousDutyDependentRoot, fieldparams.RootLength)
if err != nil {
return errors.Wrap(err, "failed to decode previous duty dependent root")