Skip to content

abci_query path parameter interpretation does not match documentation #666

@gibson042

Description

@gibson042

(cloning tendermint/tendermint#10020)

Bug Report

Setup

CometBFT version (use cometbft version or git rev-parse --verify HEAD if installed from source): Tendermint 0.34.23

Have you tried the latest version: no

ABCI app (name for built-in, URL for self-written if it's publicly available): https://main.rpc.agoric.net/

What happened?

A GET /abci_query request with path query parameter as documented at https://docs.cometbft.com/v0.37/rpc/#/ABCI/abci_query (i.e., 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 (as at https://github.com/cometbft/cometbft/blob/main/spec/rpc/README.md#abciquery but without the unexpected =IHAVENOIDEA) 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 did you expect 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.

How to reproduce it

See above.

Logs

n/a

dump_consensus_state output

n/a

Anything else we need to know

The culprit is likely httpParamsToArgs, which has not changed since tendermint/tendermint#4968 was merged in 2020.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions