Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health-check fails because /consensus_params endpoint is not reliable #1376

Closed
2 of 5 tasks
Tracked by #1350
andynog opened this issue Sep 21, 2021 · 0 comments · Fixed by #1382
Closed
2 of 5 tasks
Tracked by #1350

Health-check fails because /consensus_params endpoint is not reliable #1376

andynog opened this issue Sep 21, 2021 · 0 comments · Fixed by #1382
Labels
A: bug Admin: something isn't working
Milestone

Comments

@andynog
Copy link
Contributor

andynog commented Sep 21, 2021

Crate

  • ibc-relayer

Summary of Bug

When testing the new health-check command in Hermes, realised that the /consensus_params endpoint is not reliable when retrieving information for the latest height

Version

hermes 0.7.1+26087d57

Steps to Reproduce

Run the new hermes health-check against a Cosmos chain (tested with osmosis-1 and cosmoshub-4)

Getting error about JSON-RPC endpoint

hermes -c config.toml health-check
Sep 21 14:25:47.298  INFO [cosmoshub-4] performing health check...
Sep 21 14:25:47.552  WARN Hermes might be misconfigured for chain 'cosmoshub-4'
Sep 21 14:25:47.552  WARN     Reason: semantic config validation failed for option `max_tx_size` chain 'cosmoshub-4', reason: `max_tx_size` = 2097152 is greater than 90% of the genesis block param `max_size` = 200000
Sep 21 14:25:47.552  WARN     Some Hermes features may not work in this mode!
Sep 21 14:25:47.552 ERROR [cosmoshub-4] chain is unhealthy
Sep 21 14:25:47.555  INFO [osmosis-1] performing health check...
Sep 21 14:25:50.132  WARN Hermes might be misconfigured for chain 'osmosis-1'
Sep 21 14:25:50.132  WARN     Reason: semantic config validation: failed to reach endpoint /consensus_params on the JSON-RPC interface of chain osmosis-1:http://osmosis.decentrox.com:26657/
Sep 21 14:25:50.132  WARN     Some Hermes features may not work in this mode!
Sep 21 14:25:50.133 ERROR [osmosis-1] chain is unhealthy

Then checked the endpoint directly in the browser and get lots of erros when calling /consensus_params

{
  "jsonrpc": "2.0",
  "id": -1,
  "error": {
    "code": -32603,
    "message": "Internal error",
    "data": "could not find consensus params for height #1276406: value retrieved from db is empty"
  }
}

But if I keep trying I get eventually a valid response

{
  "jsonrpc": "2.0",
  "id": -1,
  "result": {
    "block_height": "1276410",
    "consensus_params": {
      "block": {
        "max_bytes": "10485760",
        "max_gas": "120000000",
        "time_iota_ms": "1000"
      },
      "evidence": {
        "max_age_num_blocks": "403200",
        "max_age_duration": "1209600000000000",
        "max_bytes": "1048576"
      },
      "validator": {
        "pub_key_types": [
          "ed25519"
        ]
      },
      "version": {
        "app_version": "1"
      }
    }
  }
}

Same thing with Hermes, running several times eventually don't get the RPC endpoint error

hermes -c config.toml health-check
Sep 21 14:27:53.918  INFO [cosmoshub-4] performing health check...
Sep 21 14:27:54.199  WARN Hermes might be misconfigured for chain 'cosmoshub-4'
Sep 21 14:27:54.200  WARN     Reason: semantic config validation failed for option `max_tx_size` chain 'cosmoshub-4', reason: `max_tx_size` = 2097152 is greater than 90% of the genesis block param `max_size` = 200000
Sep 21 14:27:54.200  WARN     Some Hermes features may not work in this mode!
Sep 21 14:27:54.200 ERROR [cosmoshub-4] chain is unhealthy
Sep 21 14:27:54.203  INFO [osmosis-1] performing health check...
Sep 21 14:27:56.181  INFO [osmosis-1] chain is healthy

Also, querying the /consensus_params?height=[HEIGHT] works fine

Acceptance Criteria

Since we are only calling this endpoint to get the max_bytes and the chances of this changing (only through governance) I'd suggest we change the logic instead of calling the lastest_consensus_params, we find the latest height and then query the specifying a height that is a few blocks behind the latest


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@andynog andynog added the A: bug Admin: something isn't working label Sep 21, 2021
@romac romac changed the title Health-check fails because consensus_params endpoint is not reliable Health-check fails because /consensus_params endpoint is not reliable Sep 22, 2021
@adizere adizere added this to the 09.2021 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants