Skip to content

docs: ADR-106: gRPC API - #850

Merged
andynog merged 10 commits into
mainfrom
thane/81-grpc-adr
Mar 27, 2024
Merged

andynog merged 10 commits into
mainfrom
thane/81-grpc-adr

Conversation

@thanethomson

@thanethomson thanethomson commented May 17, 2023 •

Copy link
Copy Markdown
Contributor

Partially addresses #81.

📖 Rendered

There's already a partial implementation of this on the feature/adr101-pull-companion branch. See #818.


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@thanethomson thanethomson added this to the 2023-Q2 milestone May 17, 2023
@thanethomson
thanethomson requested a review from a team as a code owner May 17, 2023 10:29
@thanethomson thanethomson mentioned this pull request May 17, 2023
2 of 3 tasks
Comment thread docs/architecture/adr-105-grpc-api.md Resolved
Comment thread docs/architecture/adr-105-grpc-api.md Resolved
@romac

romac commented May 17, 2023

Copy link
Copy Markdown
Contributor

Looks great!

@thanethomson

Copy link
Copy Markdown
Contributor Author

Looks great!

Glad to hear you think so! Are there any other endpoints that you'd like to see exposed here @romac?

@hdevalence

Copy link
Copy Markdown

This looks great for us, I think it would cover our use-case and replace our current proxy service.

It could also be helpful to have access to the /genesis and /net_info endpoints, which we use to implement an auto-configurator (pd testnet join, which pulls config data from a running node and uses it to build a skeleton set of configs), but this is less important to us than the RPCs required for processing transactions.

@romac

romac commented May 18, 2023 •

Copy link
Copy Markdown
Contributor

Glad to hear you think so! Are there any other endpoints that you'd like to see exposed here @romac?

Here's the full list of RPC endpoints we use from Hermes: https://github.com/informalsystems/hermes/blob/master/docs/spec/relayer/Data-Requirements.md

Aside from the first two endpoints which are strictly required for relaying (/health & /consensus_params), the gRPC list is missing these three endpoints:

  • /header
  • /tx_search
  • /block_search

While it would be nice to get rid of JSON-RPC altogether, since we'll have to maintain multi-version support for some time we could initially do without and keep hitting the JSON-RPC endpoints for those, and wait until they are added at a later time.

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale For use by stalebot label May 29, 2023
@jmalicevic jmalicevic removed the stale For use by stalebot label May 29, 2023
@thanethomson thanethomson added the wip Work in progress label Jun 6, 2023
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
@thanethomson
thanethomson requested a review from a team July 4, 2023 22:05
@thanethomson

Copy link
Copy Markdown
Contributor Author

@hdevalence I've added a NetworkService from which you can query the genesis data and currently connected peers - does that suffice? Do you need the listener info that the /net_info provides?

@romac I've updated the endpoints - will this suffice for the relayer?

@lasarojc
lasarojc self-requested a review July 5, 2023 10:36
@thanethomson thanethomson modified the milestones: 2023-Q2, 2023-Q3 Jul 14, 2023
@romac

romac commented Jul 14, 2023

Copy link
Copy Markdown
Contributor

@romac I've updated the endpoints - will this suffice for the relayer?

I might be missing something but I believe the /latest_commit, /commit, and /validators endpoints are missing. Those are required by the light client to fetch and verify light blocks.

Aside from that, looks great! 🙏

@tony-iqlusion

Copy link
Copy Markdown

@thanethomson what about privval support? (previously tracked as tendermint/tendermint#9256)

If that's in the cards, I have some feedback on the design of that API based on some recent experiences (namely it would be nice if there were an error which KMS systems can use to communicate the last signed h/r/s back to CometBFT in the event of double signing, so CometBFT could potentially update its round counter in response)

@thanethomson

Copy link
Copy Markdown
Contributor Author

what about privval support?

That could definitely be on the cards @tony-iqlusion. We do have a separate tracking issue for that in #476, but we'd be very interested to hear what your ideal API/interaction model would look like.

@tony-iqlusion

tony-iqlusion commented Aug 3, 2023 •

Copy link
Copy Markdown

Really all I'd like is a documented standard way of communicating a double signing error from sign_vote and sign_proposal and including metadata that CometBFT can parse and use to inform future signing requests. Something like the following:

  • On double signing error, return 409 Conflict to indicate a signature at the requested height already exists
  • The error should include metadata for last_height in h/r/s format, which reflects the last height a signature was computed for

If last_height reflects the current block height, but CometBFT's round counter is lower than the KMS's, then CometBFT can advance the round counter to one more than the one included in last_height.

Right now CometBFT does not handle privval errors very well. This was pretty painful with the last Neutron halt, where the chain halted for several hours and validators needed to resync. When the halt height was reached syncing, it took an additional hour for validators using TMKMS to reach the correct round to participate in consensus. It seems settings like timeout_prevote(_delta) and timeout_precommit(_delta) are not properly honored in this case (which perhaps I should report as a separate bug).

Edit: see also RemoteSignerError

@thanethomson thanethomson modified the milestones: 2023-Q3, 2023-Q4 Aug 14, 2023
@thanethomson
thanethomson marked this pull request as draft October 31, 2023 19:05
@adizere adizere modified the milestones: 2023-Q4, 2024-Q1 Jan 10, 2024
@melekes

melekes commented Jan 31, 2024

Copy link
Copy Markdown
Collaborator

@thanethomson what's the state of this work? Should we take over here?

@thanethomson

Copy link
Copy Markdown
Contributor Author

@thanethomson what's the state of this work? Should we take over here?

Yes please @melekes!

@andynog andynog changed the title ADR 105: gRPC API docs: ADR 105: gRPC API Mar 27, 2024
@andynog andynog self-assigned this Mar 27, 2024
@adizere adizere added this to the 2024-Q1 milestone Mar 27, 2024

@adizere adizere left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-approving based on a sync review with Andy today.

What is left:

  • double-check comments from Henry & Tony & Romain
  • validate the Go API server instantiation
  • double-check potential name conflict "ADR 105"

@andynog andynog changed the title docs: ADR 105: gRPC API docs: ADR-106: gRPC API Mar 27, 2024
@andynog
andynog marked this pull request as ready for review March 27, 2024 21:56
@andynog
andynog added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 0147e63 Mar 27, 2024
@andynog
andynog deleted the thane/81-grpc-adr branch March 27, 2024 22:03
aljo242 pushed a commit that referenced this pull request Sep 3, 2025
Partially addresses #81.

[:book:
Rendered](https://github.com/cometbft/cometbft/blob/thane/81-grpc-adr/docs/references/architecture/adr-106-grpc-api.md)

There's already a partial implementation of this on the
`feature/adr101-pull-companion` branch. See #818.

---

- [ ] Tests written/updated
- [ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Signed-off-by: Thane Thomson <[email protected]>
Co-authored-by: Andy Nogueira <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip Work in progress

Projects

No open projects
Status: Done
Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

9 participants