Pass dependent roots in block events (#15227)

* Pass dependent roots in block events

* Check for empty roots
This commit is contained in:
Potuz
2025-04-27 21:00:48 -03:00
committed by GitHub
parent 0a48fafc71
commit 3c463d8171
6 changed files with 43 additions and 22 deletions

View File

@@ -1148,6 +1148,9 @@ func (v *validator) checkDependentRoots(ctx context.Context, head *structs.HeadE
if err != nil {
return errors.Wrap(err, "failed to decode previous duty dependent root")
}
if bytes.Equal(prevDepedentRoot, params.BeaconConfig().ZeroHash[:]) {
return nil
}
uintSlot, err := strconv.ParseUint(head.Slot, 10, 64)
if err != nil {
return errors.Wrap(err, "Failed to parse slot")
@@ -1169,6 +1172,9 @@ func (v *validator) checkDependentRoots(ctx context.Context, head *structs.HeadE
if err != nil {
return errors.Wrap(err, "failed to decode current duty dependent root")
}
if bytes.Equal(currDepedentRoot, params.BeaconConfig().ZeroHash[:]) {
return nil
}
if !bytes.Equal(currDepedentRoot, v.duties.CurrDependentRoot) {
if err := v.UpdateDuties(ctx, currEpochStart); err != nil {
return errors.Wrap(err, "failed to update duties")