Reduce state copies for SubmitAggregateSelectionProof (#5813)

* `GetValidatorPerformance` return `Unavailable` when syncing
* Merge branch 'master' of github.com:prysmaticlabs/prysm
* Reduce state copies for SubmitAggregateAndProof
* Merge branch 'master' into reduce-state-copies
This commit is contained in:
terence tsao
2020-05-11 09:21:34 -07:00
committed by GitHub
parent 42278359d9
commit 4c9ff7012c

View File

@@ -6,6 +6,7 @@ import (
ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/shared/bytesutil"
"github.com/prysmaticlabs/prysm/shared/params"
"github.com/sirupsen/logrus"
"go.opencensus.io/trace"
"google.golang.org/grpc/codes"
@@ -35,11 +36,11 @@ func (as *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb.
}
epoch := helpers.SlotToEpoch(req.Slot)
activeValidatorIndices, err := as.HeadFetcher.HeadValidatorsIndices(epoch)
activeValidatorIndices, err := helpers.ActiveValidatorIndices(st, epoch)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not get validators: %v", err)
}
seed, err := as.HeadFetcher.HeadSeed(epoch)
seed, err := helpers.Seed(st, epoch, params.BeaconConfig().DomainBeaconAttester)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not get seed: %v", err)
}