Skip to content

Commit

Permalink
Fix the issue of grpc size being too small
Browse files Browse the repository at this point in the history
  • Loading branch information
millken committed Nov 10, 2023
1 parent a0c6026 commit c4a01a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/votings/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/iotexproject/iotex-proto/golang/iotexapi"
"github.com/iotexproject/iotex-proto/golang/iotextypes"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/protobuf/proto"
)

Expand Down Expand Up @@ -132,7 +133,8 @@ func getStakingBuckets(chainClient iotexapi.APIServiceClient, offset, limit uint
Height: fmt.Sprintf("%d", height),
}
ctx := context.WithValue(context.Background(), &iotexapi.ReadStateRequest{}, iotexapi.ReadStakingDataMethod_COMPOSITE_BUCKETS)
readStateRes, err := chainClient.ReadState(ctx, readStateRequest)
maxSizeOption := grpc.MaxCallRecvMsgSize(32 * 10e6)
readStateRes, err := chainClient.ReadState(ctx, readStateRequest, maxSizeOption)
if err != nil {
return
}
Expand Down

0 comments on commit c4a01a0

Please sign in to comment.