package beaconv1 import ( "context" "errors" ptypes "github.com/gogo/protobuf/types" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1" "github.com/prysmaticlabs/prysm/proto/migration" "go.opencensus.io/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) // ListPoolAttestations retrieves attestations known by the node but // not necessarily incorporated into any block. func (bs *Server) ListPoolAttestations(ctx context.Context, req *ethpb.AttestationsPoolRequest) (*ethpb.AttestationsPoolResponse, error) { return nil, errors.New("unimplemented") } // SubmitAttestation submits Attestation object to node. If attestation passes all validation // constraints, node MUST publish attestation on appropriate subnet. func (bs *Server) SubmitAttestation(ctx context.Context, req *ethpb.Attestation) (*ptypes.Empty, error) { return nil, errors.New("unimplemented") } // ListPoolAttesterSlashings retrieves attester slashings known by the node but // not necessarily incorporated into any block. func (bs *Server) ListPoolAttesterSlashings(ctx context.Context, req *ptypes.Empty) (*ethpb.AttesterSlashingsPoolResponse, error) { ctx, span := trace.StartSpan(ctx, "beaconv1.ListPoolAttesterSlashings") defer span.End() headState, err := bs.ChainInfoFetcher.HeadState(ctx) if err != nil { return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err) } sourceSlashings := bs.SlashingsPool.PendingAttesterSlashings(ctx, headState, true) slashings := make([]*ethpb.AttesterSlashing, len(sourceSlashings)) for i, s := range sourceSlashings { slashings[i] = migration.V1Alpha1AttSlashingToV1(s) } return ðpb.AttesterSlashingsPoolResponse{ Data: slashings, }, nil } // SubmitAttesterSlashing submits AttesterSlashing object to node's pool and // if passes validation node MUST broadcast it to network. func (bs *Server) SubmitAttesterSlashing(ctx context.Context, req *ethpb.AttesterSlashing) (*ptypes.Empty, error) { return nil, errors.New("unimplemented") } // ListPoolProposerSlashings retrieves proposer slashings known by the node // but not necessarily incorporated into any block. func (bs *Server) ListPoolProposerSlashings(ctx context.Context, req *ptypes.Empty) (*ethpb.ProposerSlashingPoolResponse, error) { return nil, errors.New("unimplemented") } // SubmitProposerSlashing submits AttesterSlashing object to node's pool and if // passes validation node MUST broadcast it to network. func (bs *Server) SubmitProposerSlashing(ctx context.Context, req *ethpb.ProposerSlashing) (*ptypes.Empty, error) { return nil, errors.New("unimplemented") } // ListPoolVoluntaryExits retrieves voluntary exits known by the node but // not necessarily incorporated into any block. func (bs *Server) ListPoolVoluntaryExits(ctx context.Context, req *ptypes.Empty) (*ethpb.VoluntaryExitsPoolResponse, error) { return nil, errors.New("unimplemented") } // SubmitVoluntaryExit submits SignedVoluntaryExit object to node's pool // and if passes validation node MUST broadcast it to network. func (bs *Server) SubmitVoluntaryExit(ctx context.Context, req *ethpb.SignedVoluntaryExit) (*ptypes.Empty, error) { return nil, errors.New("unimplemented") }