mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 08:37:37 +00:00
parent
8143cc36bc
commit
8e6c16d416
@ -2,11 +2,13 @@ package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
|
||||
pb "github.com/prysmaticlabs/prysm/proto/beacon/rpc/v1"
|
||||
"github.com/prysmaticlabs/prysm/shared/bytesutil"
|
||||
"github.com/prysmaticlabs/prysm/shared/params"
|
||||
"go.opencensus.io/trace"
|
||||
"google.golang.org/grpc/codes"
|
||||
@ -69,9 +71,11 @@ func run(ctx context.Context, v Validator) {
|
||||
return // Exit if context is canceled.
|
||||
case slot := <-v.NextSlot():
|
||||
span.AddAttributes(trace.Int64Attribute("slot", int64(slot)))
|
||||
slotCtx, cancel := context.WithDeadline(ctx, v.SlotDeadline(slot))
|
||||
deadline := v.SlotDeadline(slot)
|
||||
slotCtx, cancel := context.WithDeadline(ctx, deadline)
|
||||
// Report this validator client's rewards and penalties throughout its lifecycle.
|
||||
log := log.WithField("slot", slot)
|
||||
log.WithField("deadline", deadline).Debug("Set deadline for proposals and attestations")
|
||||
if err := v.LogValidatorGainsAndLosses(slotCtx, slot); err != nil {
|
||||
log.WithError(err).Error("Could not report validator's rewards/penalties")
|
||||
}
|
||||
@ -109,7 +113,7 @@ func run(ctx context.Context, v Validator) {
|
||||
case pb.ValidatorRole_AGGREGATOR:
|
||||
go v.SubmitAggregateAndProof(slotCtx, slot, id)
|
||||
case pb.ValidatorRole_UNKNOWN:
|
||||
log.Debug("No active roles, doing nothing")
|
||||
log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(id[:]))).Trace("No active roles, doing nothing")
|
||||
default:
|
||||
log.Warnf("Unhandled role %v", role)
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
|
||||
@ -115,7 +116,7 @@ func (v *validator) signSlot(ctx context.Context, pubKey [48]byte, slot uint64)
|
||||
|
||||
sig, err := v.keyManager.Sign(pubKey, slotRoot, domain.SignatureDomain)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrap(err, "Failed to sign slot")
|
||||
}
|
||||
|
||||
return sig.Marshal(), nil
|
||||
|
Loading…
Reference in New Issue
Block a user