diff --git a/CHANGELOG.md b/CHANGELOG.md index c785974cad67..91bb448b50ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,8 +53,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +<<<<<<< HEAD * (x/gov) [#18173](https://github.com/cosmos/cosmos-sdk/pull/18173) Gov hooks now return an error and are *blocking* when they fail. Expect for `AfterProposalFailedMinDeposit` and `AfterProposalVotingPeriodEnded` which log the error and continue. * (x/gov) [#17873](https://github.com/cosmos/cosmos-sdk/pull/17873) Fail any inactive and active proposals that cannot be decoded. +======= +* (server) [#18254](https://github.com/cosmos/cosmos-sdk/pull/18254) Don't hardcode gRPC address to localhost. +>>>>>>> 894bebc21 (fix(server): don't hardcode grpc address to localhost (#18254)) * (x/slashing) [#18016](https://github.com/cosmos/cosmos-sdk/pull/18016) Fixed builder function for missed blocks key (`validatorMissedBlockBitArrayPrefixKey`) in slashing/migration/v4 * (x/bank) [#18107](https://github.com/cosmos/cosmos-sdk/pull/18107) Add missing keypair of SendEnabled to restore legacy param set before migration. diff --git a/server/start.go b/server/start.go index a8e250f0e03d..037c5c47697f 100644 --- a/server/start.go +++ b/server/start.go @@ -472,7 +472,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 } @@ -487,11 +487,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()), @@ -504,7 +502,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 {