mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
df33ce3309
* slasher beacon node changes * remaining beacon node items * moar changes * gaz * flag fix * rem slashable * builds * imports * fix up * pruning faster test * deepsource * fix wrong item * node node feature flags * broken test * preston review * more preston comments * comment Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
29 lines
862 B
Go
29 lines
862 B
Go
package slasher
|
|
|
|
import (
|
|
"context"
|
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/status"
|
|
)
|
|
|
|
// IsSlashableBlock returns a proposer slashing if an input
|
|
// signed beacon block header is found to be slashable.
|
|
func (s *Server) IsSlashableBlock(
|
|
ctx context.Context, req *ethpb.SignedBeaconBlockHeader,
|
|
) (*ethpb.ProposerSlashingResponse, error) {
|
|
proposerSlashing, err := s.SlashingChecker.IsSlashableBlock(ctx, req)
|
|
if err != nil {
|
|
return nil, status.Errorf(codes.Internal, "Could not determine if block is slashable: %v", err)
|
|
}
|
|
if proposerSlashing == nil {
|
|
return ðpb.ProposerSlashingResponse{
|
|
ProposerSlashings: []*ethpb.ProposerSlashing{},
|
|
}, nil
|
|
}
|
|
return ðpb.ProposerSlashingResponse{
|
|
ProposerSlashings: []*ethpb.ProposerSlashing{proposerSlashing},
|
|
}, nil
|
|
}
|