diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d99941e53d2..00b6cfb0a173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,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. * (server) [#18251](https://github.com/cosmos/cosmos-sdk/pull/18251) Call `baseapp.Close()` when app started as grpc only. * (baseapp) [#17769](https://github.com/cosmos/cosmos-sdk/pull/17769) Ensure we respect block size constraints in the `DefaultProposalHandler`'s `PrepareProposal` handler when a nil or no-op mempool is used. We provide a `TxSelector` type to assist in making transaction selection generalized. We also fix a comparison bug in tx selection when `req.maxTxBytes` is reached. * (config) [#17649](https://github.com/cosmos/cosmos-sdk/pull/17649) Fix `mempool.max-txs` configuration is invalid in `app.config`. diff --git a/server/start.go b/server/start.go index aa8f5c47734b..9827f0a4c293 100644 --- a/server/start.go +++ b/server/start.go @@ -528,7 +528,7 @@ func startAPIserver(config serverconfig.Config, genDocProvider node.GenesisDocPr clientCtx := clientCtx.WithHomeDir(home).WithChainID(genDoc.ChainID) if config.GRPC.Enable { - _, port, err := net.SplitHostPort(config.GRPC.Address) + _, _, err := net.SplitHostPort(config.GRPC.Address) if err != nil { return nil, err } @@ -543,10 +543,8 @@ func startAPIserver(config serverconfig.Config, genDocProvider node.GenesisDocPr maxRecvMsgSize = serverconfig.DefaultGRPCMaxRecvMsgSize } - grpcAddress := fmt.Sprintf("127.0.0.1:%s", port) - grpcClient, err := grpc.Dial( - grpcAddress, + config.GRPC.Address, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions( grpc.ForceCodec(codec.NewProtoCodec(clientCtx.InterfaceRegistry).GRPCCodec()), @@ -559,7 +557,7 @@ func startAPIserver(config serverconfig.Config, genDocProvider node.GenesisDocPr } clientCtx = clientCtx.WithGRPCClient(grpcClient) - ctx.Logger.Debug("grpc client assigned to client context", "target", grpcAddress) + ctx.Logger.Debug("grpc client assigned to client context", "target", config.GRPC.Address) } apiSrv = api.New(clientCtx, ctx.Logger.With("module", "api-server"))