mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-13 13:43:30 +00:00
Only advance slot when the request is for a future epoch (#4501)
This commit is contained in:
parent
7f1900e96c
commit
5077c009c3
@ -69,9 +69,11 @@ func (vs *Server) GetAttestationData(ctx context.Context, req *ethpb.Attestation
|
||||
return nil, status.Errorf(codes.Internal, "Could not hash head block: %v", err)
|
||||
}
|
||||
|
||||
headState, err = state.ProcessSlots(ctx, headState, req.Slot)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not process slots up to %d: %v", req.Slot, err)
|
||||
if helpers.CurrentEpoch(headState) < helpers.SlotToEpoch(req.Slot) {
|
||||
headState, err = state.ProcessSlots(ctx, headState, req.Slot)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not process slots up to %d: %v", req.Slot, err)
|
||||
}
|
||||
}
|
||||
|
||||
targetEpoch := helpers.CurrentEpoch(headState)
|
||||
|
Loading…
Reference in New Issue
Block a user