mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 16:08:26 -05:00
Pass dependent roots in block events (#15227)
* Pass dependent roots in block events * Check for empty roots
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user