mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
Remove Balances Timeout (#9957)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
parent
cd6d0d9cf1
commit
7cbef104b0
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
|
||||||
|
|
||||||
types "github.com/prysmaticlabs/eth2-types"
|
types "github.com/prysmaticlabs/eth2-types"
|
||||||
"github.com/prysmaticlabs/prysm/api/pagination"
|
"github.com/prysmaticlabs/prysm/api/pagination"
|
||||||
@ -27,9 +26,6 @@ import (
|
|||||||
"google.golang.org/protobuf/types/known/emptypb"
|
"google.golang.org/protobuf/types/known/emptypb"
|
||||||
)
|
)
|
||||||
|
|
||||||
// BalancesTimeout for gRPC requests to ListValidatorBalances.
|
|
||||||
const BalancesTimeout = time.Second * 30
|
|
||||||
|
|
||||||
// ListValidatorBalances retrieves the validator balances for a given set of public keys.
|
// ListValidatorBalances retrieves the validator balances for a given set of public keys.
|
||||||
// An optional Epoch parameter is provided to request historical validator balances from
|
// An optional Epoch parameter is provided to request historical validator balances from
|
||||||
// archived, persistent data.
|
// archived, persistent data.
|
||||||
@ -37,8 +33,6 @@ func (bs *Server) ListValidatorBalances(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
req *ethpb.ListValidatorBalancesRequest,
|
req *ethpb.ListValidatorBalancesRequest,
|
||||||
) (*ethpb.ValidatorBalances, error) {
|
) (*ethpb.ValidatorBalances, error) {
|
||||||
ctx, cancel := context.WithTimeout(ctx, BalancesTimeout)
|
|
||||||
defer cancel()
|
|
||||||
if int(req.PageSize) > cmd.Get().MaxRPCPageSize {
|
if int(req.PageSize) > cmd.Get().MaxRPCPageSize {
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "Requested page size %d can not be greater than max size %d",
|
return nil, status.Errorf(codes.InvalidArgument, "Requested page size %d can not be greater than max size %d",
|
||||||
req.PageSize, cmd.Get().MaxRPCPageSize)
|
req.PageSize, cmd.Get().MaxRPCPageSize)
|
||||||
|
Loading…
Reference in New Issue
Block a user