osmosis-labs / osmosis-rust

Rust libraries for osmosis
Apache License 2.0
59 stars 52 forks source link

Osmosis (cosmos-sdk v0.46.10) GetNodeInfo transport error #75

Closed Philipp-Sc closed 1 year ago

Philipp-Sc commented 1 year ago

Hi,

I am having troubles interacting via gRPC with Osmosis nodes (other Cosmos blockchains work).

I think this is might related to Proto-build fails for SDK 0.46 #318 (cosmos-rust) due to the recent proto changes. Can you confirm that?

docker run fullstorydev/grpcurl osmosis-grpc.lavenderfive.com:443 cosmos.base.tendermint.v1beta1.Service/GetNodeInfo

works, but using the latest cosmos-rust I get

status: Unknow, message: "transport error"

code:

cosmos_sdk_proto::cosmos::base::tendermint::v1beta1::service_client::ServiceClient::new(c).get_node_info(GetNodeInfoRequest{}).await    

full code can be found here

Do you have any ideas why this might be happening?

Any help is appreciated, thanks in advance.

Philipp-Sc commented 1 year ago

It seems to be a different issue: GoAway(b"", FRAME_SIZE_ERROR, Library)

Not sure what it means.

[2023-04-02T08:21:40Z ERROR cosmos_rust_package::api::core::cosmos::channels] GetNodeInfoRequest failed for http://osmosis-grpc.lavenderfive.com:443: Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Http2, Error { kind: GoAway(b"", FRAME_SIZE_ERROR, Library) }))) }
[2023-04-02T08:21:40Z ERROR cosmos_rust_package::api::core::cosmos::channels] GetNodeInfoRequest failed for http://grpc-osmosis-ia.cosmosia.notional.ventures:443: Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Http2, Error { kind: GoAway(b"", FRAME_SIZE_ERROR, Library) }))) }
[2023-04-02T08:21:40Z ERROR cosmos_rust_package::api::core::cosmos::channels] GetNodeInfoRequest failed for http://osmosis.grpc.stakin-nodes.com:443: Status { code: Unknown, message: "transport error", source: Some(tonic::transport::Error(Transport, hyper::Error(Io, Custom { kind: BrokenPipe, error: "stream closed because of a broken pipe" }))) }
[2023-04-02T08:21:42Z ERROR cosmos_rust_package::api::core::cosmos::channels] Unable to establish a connection to http://osmosis.grpc.interchain.ivaldilabs.xyz:433: transport error

    Caused by:
        0: error trying to connect: tcp connect error: No route to host (os error 113)
        1: tcp connect error: No route to host (os error 113)
        2: No route to host (os error 113)
Philipp-Sc commented 1 year ago

Closing this issue, the solution was to use the https:// schema and add the tonic feature flag "tls-roots":

tonic = { version = "^0.8", features = ["transport","tls","tls-roots","tls-webpki-roots"] }