Skip to content

abci_query path parameter interpretation does not match documentation #10020

@gibson042

Description

@gibson042

(updating the auto-closed #9164)

Tendermint version: 0.34.23

ABCI app: https://main.rpc.agoric.net/

What happened:
A GET /abci_query request with path query parameter as documented at https://docs.tendermint.com/v0.34/rpc/#/ABCI/abci_query (i.e., a starting with "/") is rejected:

$ curl -sS 'https://main.rpc.agoric.net/abci_query?path=/custom/vstorage/data/activityhash'
{
  "jsonrpc": "2.0",
  "id": -1,
  "error": {
    "code": -32602,
    "message": "Invalid params",
    "data": "error converting http params to arguments: invalid character '/' looking for beginning of value"
  }
}

Wrapping that path in double quote characters works:

$ curl -sS 'https://main.rpc.agoric.net/abci_query?path="/custom/vstorage/data/activityhash"'
{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "response": {
      "code": 0,
      "log": "",
      "info": "",
      "index": "0",
      "key": null,
      "value": "ewogICJ2YWx1ZSI6ICIyYTk5YmU3NTIwNTk0MTg5MjlkODExYTA0ZGVlYTE4YjM3NGI3M2IxNTA3Y2ZkMjY2NTYwYzVlYWIwMWViOTk4Igp9",
      "proofOps": null,
      "height": "9225800",
      "codespace": ""
    }
  }
}

So does submitting the entire request as POSTed JSON-RPC:

$ curl -sS https://main.rpc.agoric.net --request POST --header 'Content-Type: application/json' --data \
  '{ "jsonrpc": "2.0", "id": -1, "method": "abci_query", "params": { "path": "/custom/vstorage/data/activityhash" } }'
{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "response": {
      "code": 0,
      "log": "",
      "info": "",
      "index": "0",
      "key": null,
      "value": "ewogICJ2YWx1ZSI6ICI2MDMzMDJmZmFlNTVjYmFmYjFiZWE2ZTZmM2E4Y2IxZWU0NGI3ZDBkZGFlYjUzZmE5OTkxMDFiMzcxMzJlOGY3Igp9",
      "proofOps": null,
      "height": "9225809",
      "codespace": ""
    }
  }
}

What you expected to happen:
I expected the unquoted path URL query parameter value to be accepted as documented at https://docs.tendermint.com/v0.34/rpc/#/ABCI/abci_query , rather than rejected for not being JSON.

Have you tried the latest version: no, but httpParamsToArgs has not changed since #4968 three years ago.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stalefor use by stalebot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions