akash-network / support

Akash Support and Issue Tracking
Apache License 2.0
5 stars 4 forks source link

Using the `--state` flag on `query deployment list` gives unexpected behavior #61

Open hydrogen18 opened 3 years ago

hydrogen18 commented 3 years ago

If I run with a flag of --state matched I get this result

~/ovrclk/akash/akash --node=tcp://86.109.8.123:26657 --chain-id=local --home=$PWD/home query deployment list --owner akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh --state matched
Error: rpc error: code = InvalidArgument desc = invalid state value: invalid request

Which seems to indicate the server can't filter by that, or something similar. It should be possible, or we should not even allow the request to go on to the RPC node.

Switching to `--state active' gives even more confusing results

$ ~/ovrclk/akash/akash --node=tcp://86.109.8.123:26657 --chain-id=local --home=$PWD/home query deployment list --owner akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh --limit 1 --state active
deployments:
- deployment:
    deployment_id:
      dseq: "82208"
      owner: akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh
    state: active
    version: 8rXnYMqTxTVIc312SU24mwjYEffptTOqB/2TS/UdZwc=
  groups:
  - group_id:
      dseq: "82208"
      gseq: 1
      owner: akash1sknuhqt6d84h7xxstjpfe2xx2pc75ky07v03wh
    group_spec:
      name: westcoast
      order_bid_duration: "12342"
      requirements:
        attributes: []
        signed_by:
          all_of: []
          any_of: []
      resources:
      - count: 1
        price:
          amount: "9999"
          denom: uakt
        resources:
          cpu:
            attributes: []
            units:
              val: "100"
          endpoints:
          - kind: SHARED_HTTP
          memory:
            attributes: []
            quantity:
              val: "16777216"
          storage:
            attributes: []
            quantity:
              val: "134217728"
    state: matched
  version: null
pagination:
  next_key: YWthc2gxc2tudWhxdDZkODRoN3h4c3RqcGZlMnh4MnBjNzVreTA3djAzd2gAAAAAAAFMcw==
  total: "0"

The returned deployment actually says "state: matched", which does not seem right at all

rsum1 commented 3 years ago

Having the same error when using --state matched

hydrogen18 commented 3 years ago

So I think what is happening here is it only filters on deployment state, not group state (part of a deployment). I'm just going to update the CLI to validate the --state flag before it sends it to the RPC server. There is no reason to send the request if the provided value is invalid.

in-eth commented 10 months ago

There's no matched state for groups. Only the below states are available now.

    "invalid":            0,
    "open":               1,
    "paused":             2,
    "insufficient_funds": 3,
    "closed":             4,