Skip to content

chain-sdk provider/client: LeaseLogs and LeaseEvents drop service filter and tail at the wire #523

@gosuri

Description

@gosuri

Affected file: go/provider/client/client.go in akash-network/chain-sdk v0.2.11 and main (HEAD as of 2026-05-26).

Three bugs cause the gateway-side service filter and tail to never apply:

  1. (c *client) LeaseLogs (lines 781-805) sends ?services= (plural) but the akash-network/provider gateway middleware reads ?service= (singular) in requestStreamParams. The filter is silently dropped by the gateway.
  2. (c *client) LeaseLogs signature names its tail parameter _ int64 (line 785) and the function never writes it to the query string. The gateway supports ?tail=N; the value never reaches the wire.
  3. (c *client) LeaseEvents signature names its services parameter _ string (line 606) and the function never writes it to the query string. Same class of bug as (1) but for events.

The contract is already broken at the interface level: client.go:70-71 declares

LeaseEvents(ctx, id, services string, follow bool) (*LeaseKubeEvents, error)
LeaseLogs(ctx, id, services string, follow bool, tailLines int64) (*ServiceLogs, error)

but the implementations bind services / tailLines to _. Callers cannot tell the values are discarded without reading the implementation.

Gateway-side reference

Cross-verified against akash-network/provider/main/gateway/rest/middleware.go, function requestStreamParams (lines 199-251):

  • services := vars.Get("service") — singular key; comma-separated list; K8s in (...) selector against the manifest-service label.
  • vars.Get("tail") — parsed as int32, must be >= -1, default -1.
  • vars.Get("follow") — bool.

Repro

Any chain-sdk consumer calling:

client.LeaseLogs(ctx, id, "svc-a", true, 50)

Capture the websocket upgrade request (wireshark / tcpdump -i lo0 -A -s 0 port 8443 / provider gateway access log).

  • Observed query string: services=svc-a&follow=true (no tail, wrong key).
  • Expected: service=svc-a&follow=true&tail=50.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions