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

server: add status endpoint from tendermint #1175

Merged
merged 9 commits into from
Jul 8, 2024

Conversation

manav2401
Copy link
Contributor

Description

This PR adds a new generic endpoint to heimdall called /sync_info which responds with the current sync status of the node. The aim behind this change is to expose an API via heimdall directly for bor/erigon to query and find the latest block info instead of querying the /status endpoint of tendermint (which is generally not configured in bor/erigon to query).

The /status endpoint of tendermint also exposes some validator and p2p info which is not needed and hence the endpoint is named as sync info. I believe validator info should be kept behind tendermint's port and p2p info is available via another endpoint named node_info.

Skipping making swagger changes for this PR as it's too sophisticated and doesn't seem immediately relevant.

Example response:

{
  "height": "0",
  "result": {
    "latest_block_hash": "F5BA4E109B8F63FD5F419CEB263B63064E87E73686364F164CAE8CA85CA73373",
    "latest_app_hash": "511BEB8CC884BF57697E806920177C23B8867FDD1DB353FE01D52FBC9990E0D5",
    "latest_block_height": "3505042",
    "latest_block_time": "2024-07-03T10:41:48.749488068Z",
    "catching_up": false
  }
}

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply

Cross repository changes

  • This PR requires changes to bor
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai or amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@manav2401 manav2401 changed the title server: add sync_info endpoint from tendermint server: add status endpoint from tendermint Jul 4, 2024
@manav2401 manav2401 merged commit 135c271 into develop Jul 8, 2024
8 of 9 checks passed
@manav2401 manav2401 deleted the manav/expose-status-endpoint branch July 8, 2024 16:26
manav2401 added a commit that referenced this pull request Jul 16, 2024
* feat: expose status endpoint from rest-server

* call status directly

* remove public endpoint

* remove endpoint from checkpoint module

* server: add /status endpoint

* server: only return sync info

* server: rename fn to sync info

* server: fix milestone grpc endpoint

* server: rename sync_info to status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants