Skip to content

rs-dapi-client: report a local channel setup failure with its own error, not a gRPC InvalidArgument #6065

Open

Description

@QuantumExplorer

When rs-dapi-client cannot build a channel, for example because the address's host is not a valid TLS server name, it returns a locally made gRPC status Status::invalid_argument (packages/rs-dapi-client/src/transport/grpc.rs:59-62, also :80 and :112; from transport/tonic_channel.rs:72 and :102-112). The executor returns that before any RPC is sent (dapi_client.rs:1210-1256).

A host can't tell that apart from a node's own InvalidArgument refusal of the request:

Proposal: give rs-dapi-client a typed local-setup error variant at the transport boundary, where the origin is known. The FFI and wallet can then classify it as a configuration/network failure, and treat only a status a node actually returned as a refusal.

Tests:

  • a channel construction failure;
  • a node's RPC refusal (InvalidArgument);
  • a proved absence (MissingDependency).

Each should get its own classification.

Activity

  1. QuantumExplorer commented on Nov 22, 2026

    @QuantumExplorer
    MemberAuthor

    Another local cause to cover, from the #6056 review: an empty native trust store.

    • With SSL_CERT_FILE pointing to an empty bundle (and no SSL_CERT_DIR), or a Linux host without a CA bundle, rustls-native-certs loads zero certificates. tonic then returns NativeCertsNotFound (tonic 0.14.6 src/transport/channel/service/tls.rs:85-96) before it adds the bundled roots, even for a valid hostname.
    • rs-dapi-client re-wraps that as a fresh Status::invalid_argument (transport/grpc.rs:27,59,79,111), dropping the source, so rs-sdk-ffi reports it as InvalidParameter, though changing the request will not help.
    • This is desktop only. create_channel compiles with_native_roots() out for iOS, tvOS, watchOS and Android (transport/tonic_channel.rs:46-54).

    Two parts to the fix:

    1. The typed local-setup error proposed above, with a test for this case.
    2. Possibly a root fix in create_channel: when the build with native roots fails, retry with the bundled roots only. The comments at tonic_channel.rs:37-38,45 already describe that behaviour. It changes TLS setup for every native consumer, so it should get its own PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions