diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c478d1c17e4..912cf67d7bea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (server) [#18254](https://github.com/cosmos/cosmos-sdk/pull/18254) Don't hardcode gRPC address to localhost. * (x/slashing) [#18016](https://github.com/cosmos/cosmos-sdk/pull/18016) Fixed builder function for missed blocks key (`validatorMissedBlockBitArrayPrefixKey`) in slashing/migration/v4 * (x/gov) [#17873](https://github.com/cosmos/cosmos-sdk/pull/17873) Fail any inactive and active proposals whose messages cannot be decoded. * (simulation) [#17911](https://github.com/cosmos/cosmos-sdk/pull/17911) Fix all problems with executing command `make test-sim-custom-genesis-fast` for simulation test. diff --git a/server/start.go b/server/start.go index 008fb2e1864e..6e013111e925 100644 --- a/server/start.go +++ b/server/start.go @@ -483,7 +483,7 @@ func startGrpcServer( // return grpcServer as nil if gRPC is disabled return nil, clientCtx, nil } - _, port, err := net.SplitHostPort(config.Address) + _, _, err := net.SplitHostPort(config.Address) if err != nil { return nil, clientCtx, err } @@ -498,11 +498,9 @@ func startGrpcServer( maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize } - grpcAddress := fmt.Sprintf("127.0.0.1:%s", port) - // if gRPC is enabled, configure gRPC client for gRPC gateway grpcClient, err := grpc.Dial( - grpcAddress, + config.Address, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions( grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), @@ -515,7 +513,7 @@ func startGrpcServer( } clientCtx = clientCtx.WithGRPCClient(grpcClient) - svrCtx.Logger.Debug("gRPC client assigned to client context", "target", grpcAddress) + svrCtx.Logger.Debug("gRPC client assigned to client context", "target", config.Address) grpcSrv, err := servergrpc.NewGRPCServer(clientCtx, app, config) if err != nil {