8000 ADR-101: Implement gRPC `BlockService` · Issue #1094 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ADR-101: Implement gRPC BlockService #1094

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

Closed
Tracked by #816
thanethomson opened this issue Jul 6, 2023 · 1 comment
Closed
Tracked by #816

ADR-101: Implement gRPC BlockService #1094

thanethomson opened this issue Jul 6, 2023 · 1 comment
Assignees
Labels
grpc Anything relating to the gRPC API
Milestone

Comments

@thanethomson
Copy link
Contributor
thanethomson commented Jul 6, 2023

We need an implementation of the BlockService from ADR-101 on the feature/adr101-pull-companion branch.

@thanethomson thanethomson changed the title BlockService ADR-101: Implement gRPC BlockService Jul 6, 2023
@thanethomson thanethomson added the grpc Anything relating to the gRPC API label Jul 6, 2023
@thanethomson thanethomson added this to the 2023-Q3 milestone Jul 6, 2023
@andynog andynog self-assigned this Jul 6, 2023
@andynog andynog moved this from Todo to In Progress in CometBFT 2023 Jul 6, 2023
andynog added a commit that referenced this issue Jul 7, 2023
andynog added a commit that referenced this issue Jul 10, 2023
andynog added a commit that referenced this issue Jul 11, 2023
andynog added a commit that referenced this issue Jul 17, 2023
@andynog andynog mentioned this issue Jul 18, 2023
3 tasks
andynog added a commit that referenced this issue Jul 19, 2023
andynog added a commit that referenced this issue Jul 20, 2023
andynog added a commit that referenced this issue Jul 20, 2023
andynog added a commit that referenced this issue Jul 24, 2023
thanethomson added a commit that referenced this issue Aug 1, 2023
* initial logic for the gRPC block service (#1094)

* initial logic for gRPC block client and test (#1094)

* block response and request (#1094)

* add configuration for block service (#1094)

* use pointer for request parameter (#1094)

* change block service GetBlock response (#1094)

* return block information (#1094)

* convert core type to proto type (#1094)

* hookup server (#1094)

* hooking directly to the BlockStore instead of Environment (#1094)

* changing client return type, use core type (#1094)

* convert from proto to core type (#1094)

* implemented proper logic to test block service (#1094)

* return the latest height if height is 0 (#1094)

* adding proper grpc error handling and return (#1094)

* rename rpc and message in proto to match ADR-101 spec (#1094)

* renaming service and client methods structs to match ADR (#1094)

* additional error handling (#1094)

* rename get block request and response (#1094)

* update method name in the client (#1094)

* proto entries for GetLatestHeight logic (#1094)

* added logic for streaming new blocks as part of GetLatestHeight (#1094)

* ensure subcribers have their own unique id (#1094)

* client logic to use a channel parameter (#1094)

* added test for GetLatestHeight (#1094)

* better streaming test to prevent error (#1094)

* remove empty line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* removing UNARY_RPC to prevent lint on server streaming (#1094)

* remove server reflection, doesn't work well with gogoproto (#1094)

* handle negative height parameter (#1094)

* remove `Block` from `GetBlockLatestHeight`

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* changed method name and fixes to test (#1094)

* fixes from PR feedback (#1094)

* remove vars

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* fix declaration

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove var declaration, not needed

Co-authored-by:
6D4E
 Thane Thomson <connect@thanethomson.com>

* use simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error handling

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplified the logic for subscriber id (#1094)

* more fixs based on PR feedback (#1094)

* generated new protos (#1094)

* remove else logic to allow compilation (#1094)

* added logging capabilities to the block service and added log messages (#1094)

* ensure node is a valid testing node (#1094)

* added more conditions to handle subscription cancel (#1094)

* use break in the for loop (#1094)

* renamed ResultBlock to Block (#1094)

* refactored the client logic use a channel for errors (#1094)

* simplify subscriber name

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* adding error to log

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* update logging

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Simplified and improved logging (#1094)

* added logic to drop the height publish if channel full (#194)

* improved test to ensure is not light or seed node (#1094)

* refactored block service to use one channel with result type (#1094)

* blockservice: Apply service name to all logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Capitalize start of all log messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Remove unnecessary logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Add trivial RPC error response tracing mechanism for easier debugging

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Simplify constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Extract type assertion

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update configuration-related content

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc/client: Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc: Extract function to validate or update block height from request

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
@thanethomson
Copy link
Contributor Author

Done in #1142.

@github-project-automation github-project-automation bot moved this from In Progress to Done in CometBFT 2023 Aug 2, 2023
cason pushed a commit that referenced this issue Oct 6, 2023
   * With conflicts to solve

* initial logic for the gRPC block service (#1094)

* initial logic for gRPC block client and test (#1094)

* block response and request (#1094)

* add configuration for block service (#1094)

* use pointer for request parameter (#1094)

* change block service GetBlock response (#1094)

* return block information (#1094)

* convert core type to proto type (#1094)

* hookup server (#1094)

* hooking directly to the BlockStore instead of Environment (#1094)

* changing client return type, use core type (#1094)

* convert from proto to core type (#1094)

* implemented proper logic to test block service (#1094)

* return the latest height if height is 0 (#1094)

* adding proper grpc error handling and return (#1094)

* rename rpc and message in proto to match ADR-101 spec (#1094)

* renaming service and client methods structs to match ADR (#1094)

* additional error handling (#1094)

* rename get block request and response (#1094)

* update method name in the client (#1094)

* proto entries for GetLatestHeight logic (#1094)

* added logic for streaming new blocks as part of GetLatestHeight (#1094)

* ensure subcribers have their own unique id (#1094)

* client logic to use a channel parameter (#1094)

* added test for GetLatestHeight (#1094)

* better streaming test to prevent error (#1094)

* remove empty line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* removing UNARY_RPC to prevent lint on server streaming (#1094)

* remove server reflection, doesn't work well with gogoproto (#1094)

* handle negative height parameter (#1094)

* remove `Block` from `GetBlockLatestHeight`

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* changed method name and fixes to test (#1094)

* fixes from PR feedback (#1094)

* remove vars

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* fix declaration

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove var declaration, not needed

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* use simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error handling

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplified the logic for subscriber id (#1094)

* more fixs based on PR feedback (#1094)

* generated new protos (#1094)

* remove else logic to allow compilation (#1094)

* added logging capabilities to the block service and added log messages (#1094)

* ensure node is a valid testing node (#1094)

* added more conditions to handle subscription cancel (#1094)

* use break in the for loop (#1094)

* renamed ResultBlock to Block (#1094)

* refactored the client logic use a channel for errors (#1094)

* simplify subscriber name

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* adding error to log

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* update logging

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Simplified and improved logging (#1094)

* added logic to drop the height publish if channel full (#194)

* improved test to ensure is not light or seed node (#1094)

* refactored block service to use one channel with result type (#1094)

* blockservice: Apply service name to all logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Capitalize start of all log messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Remove unnecessary logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Add trivial RPC error response tracing mechanism for easier debugging

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Simplify constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Extract type assertion

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update configuration-related content

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc/client: Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc: Extract function to validate or update block height from request

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
cason pushed a commit that referenced this issue Oct 6, 2023
* initial logic for the gRPC block service (#1094)

* initial logic for gRPC block client and test (#1094)

* block response and request (#1094)

* add configuration for block service (#1094)

* use pointer for request parameter (#1094)

* change block service GetBlock response (#1094)

* return block information (#1094)

* convert core type to proto type (#1094)

* hookup server (#1094)

* hooking directly to the BlockStore instead of Environment (#1094)

* changing client return type, use core type (#1094)

* convert from proto to core type (#1094)

* implemented proper logic to test block service (#1094)

* return the latest height if height is 0 (#1094)

* adding proper grpc error handling and return (#1094)

* rename rpc and message in proto to match ADR-101 spec (#1094)

* renaming service and client methods structs to match ADR (#1094)

* additional error handling (#1094)

* rename get block request and response (#1094)

* update method name in the client (#1094)

* proto entries for GetLatestHeight logic (#1094)

* added logic for streaming new blocks as part of GetLatestHeight (#1094)

* ensure subcribers have their own unique id (#1094)

* client logic to use a channel parameter (#1094)

* added test for GetLatestHeight (#1094)

* better streaming test to prevent error (#1094)

* remove empty line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* removing UNARY_RPC to prevent lint on server streaming (#1094)

* remove server reflection, doesn't work well with gogoproto (#1094)

* handle negative height parameter (#1094)

* remove `Block` from `GetBlockLatestHeight`

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* changed method name and fixes to test (#1094)

* fixes from PR feedback (#1094)

* remove vars

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* fix declaration

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove var declaration, not needed

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* use simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error handling

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplified the logic for subscriber id (#1094)

* more fixs based on PR feedback (#1094)

* generated new protos (#1094)

* remove else logic to allow compilation (#1094)

* added logging capabilities to the block service and added log messages (#1094)

* ensure node is a valid testing node (#1094)

* added more conditions to handle subscription cancel (#1094)

* use break in the for loop (#1094)

* renamed ResultBlock to Block (#1094)

* refactored the client logic use a channel for errors (#1094)

* simplify subscriber name

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* adding error to log

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* update logging

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Simplified and improved logging (#1094)

* added logic to drop the height publish if channel full (#194)

* improved test to ensure is not light or seed node (#1094)

* refactored block service to use one channel with result type (#1094)

* blockservice: Apply service name to all logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Capitalize start of all log messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Remove unnecessary logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Add trivial RPC error response tracing mechanism for easier debugging

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Simplify constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Extract type assertion

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update configuration-related content

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc/client: Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc: Extract function to validate or update block height from request

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
jmalicevic added a commit that referenced this issue Oct 10, 2023
…mental (#1440)

* grpc: Add base gRPC server with version service (#818)

* proto: Add VersionService

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* proto: make proto-gen

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* config: Add gRPC server section

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Add server with support for version service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Add gRPC server

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Add client with support for version service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Add gRPC server test of version service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc: Fix test broken by introduction of gRPC service

Some of the RPC tests run Comet nodes in goroutines, causing port
conflicts. This randomizes the port assigned to the gRPC server,
reducing the likelihood of port conflicts.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Update log message format to conform to RPC log style

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Resolved cherry pick conflicts

* grpcs: adding legacy gRPC to e2e test suite

* grpc: added legacy gRPC ping test to e2e test suite

* grpc: fix lint check, used of deprecated method

* Add gRPC block service (#1142)

   * With conflicts to solve

* initial logic for the gRPC block service (#1094)

* initial logic for gRPC block client and test (#1094)

* block response and request (#1094)

* add configuration for block service (#1094)

* use pointer for request parameter (#1094)

* change block service GetBlock response (#1094)

* return block information (#1094)

* convert core type to proto type (#1094)

* hookup server (#1094)

* hooking directly to the BlockStore instead of Environment (#1094)

* changing client return type, use core type (#1094)

* convert from proto to core type (#1094)

* implemented proper logic to test block service (#1094)

* return the latest height if height is 0 (#1094)

* adding proper grpc error handling and return (#1094)

* rename rpc and message in proto to match ADR-101 spec (#1094)

* renaming service and client methods structs to match ADR (#1094)

* additional error handling (#1094)

* rename get block request and response (#1094)

* update method name in the client (#1094)

* proto entries for GetLatestHeight logic (#1094)

* added logic for streaming new blocks as part of GetLatestHeight (#1094)

* ensure subcribers have their own unique id (#1094)

* client logic to use a channel parameter (#1094)

* added test for GetLatestHeight (#1094)

* better streaming test to prevent error (#1094)

* remove empty line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* removing UNARY_RPC to prevent lint on server streaming (#1094)

* remove server reflection, doesn't work well with gogoproto (#1094)

* handle negative height parameter (#1094)

* remove `Block` from `GetBlockLatestHeight`

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* changed method name and fixes to test (#1094)

* fixes from PR feedback (#1094)

* remove vars

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* fix declaration

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove var declaration, not needed

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* use simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error handling

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplified the logic for subscriber id (#1094)

* more fixs based on PR feedback (#1094)

* generated new protos (#1094)

* remove else logic to allow compilation (#1094)

* added logging capabilities to the block service and added log messages (#1094)

* ensure node is a valid testing node (#1094)

* added more conditions to handle subscription cancel (#1094)

* use break in the for loop (#1094)

* renamed ResultBlock to Block (#1094)

* refactored the client logic use a channel for errors (#1094)

* simplify subscriber name

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* adding error to log

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* update logging

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Simplified and improved logging (#1094)

* added logic to drop the height publish if channel full (#194)

* improved test to ensure is not light or seed node (#1094)

* refactored block service to use one channel with result type (#1094)

* blockservice: Apply service name to all logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Capitalize start of all log messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Remove unnecessary logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Add trivial RPC error response tracing mechanism for easier debugging

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Simplify constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Extract type assertion

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update configuration-related content

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc/client: Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc: Extract function to validate or update block height from request

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>

* grpc: docs conflicts, preserving most of original

* grpc: fixing conflicts, preserving both test units

* ADR 101: Add GetLatest method to block service (#1209)

* Add BlockResults gRPC service (#1168)

* Add block results grpc endpoint

* Make requested changes

* Fix linting

* Lint proto

* Fix test race condition

* Update test order

* Update rpc/grpc/server/s
10000
ervices/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update config/toml.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Format protos

* Format upstream changes

* Test height for failing grpc call

* Test w additional logging

* Remove accidental formal

* Revert "Remove accidental formal"

This reverts commit 81cb702.

* Make additional req changes

* Requested changes for formatting/client signature

* Add changelog entry

* Add separate endpoint for latest BlockResults

* Fix linting

* Clean

* Update changelog

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update test

---------

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Reverting changes with no effect in proto files

* Reverted the change in doc that should not be part of this PR

* fixed docs

* Apply suggestions from code review

* gprc: reverting wrong backport changes

* grpc: re-introducing this change for linter

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Co-authored-by: lg <8335464+glnro@users.noreply.github.com>
lasarojc pushed a commit that referenced this issue Nov 13, 2023
…mental (#1440)

* grpc: Add base gRPC server with version service (#818)

* proto: Add VersionService

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* proto: make proto-gen

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* config: Add gRPC server section

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Add server with support for version service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* node: Add gRPC server

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Add client with support for version service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* test/e2e: Add gRPC server test of version service

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc: Fix test broken by introduction of gRPC service

Some of the RPC tests run Comet nodes in goroutines, causing port
conflicts. This randomizes the port assigned to the gRPC server,
reducing the likelihood of port conflicts.

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* rpc/grpc: Update log message format to conform to RPC log style

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Resolved cherry pick conflicts

* grpcs: adding legacy gRPC to e2e test suite

* grpc: added legacy gRPC ping test to e2e test suite

* grpc: fix lint check, used of deprecated method

* Add gRPC block service (#1142)

   * With conflicts to solve

* initial logic for the gRPC block service (#1094)

* initial logic for gRPC block client and test (#1094)

* block response and request (#1094)

* add configuration for block service (#1094)

* use pointer for request parameter (#1094)

* change block service GetBlock response (#1094)

* return block information (#1094)

* convert core type to proto type (#1094)

* hookup server (#1094)

* hooking directly to the BlockStore instead of Environment (#1094)

* changing client return type, use core type (#1094)

* convert from proto to core type (#1094)

* implemented proper logic to test block service (#1094)

* return the latest height if height is 0 (#1094)

* adding proper grpc error handling and return (#1094)

* rename rpc and message in proto to match ADR-101 spec (#1094)

* renaming service and client methods structs to match ADR (#1094)

* additional error handling (#1094)

* rename get block request and response (#1094)

* update method name in the client (#1094)

* proto entries for GetLatestHeight logic (#1094)

* added logic for streaming new blocks as part of GetLatestHeight (#1094)

* ensure subcribers have their own unique id (#1094)

* client logic to use a channel parameter (#1094)

* added test for GetLatestHeight (#1094)

* better streaming test to prevent error (#1094)

* remove empty line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* removing UNARY_RPC to prevent lint on server streaming (#1094)

* remove server reflection, doesn't work well with gogoproto (#1094)

* handle negative height parameter (#1094)

* remove `Block` from `GetBlockLatestHeight`

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* changed method name and fixes to test (#1094)

* fixes from PR feedback (#1094)

* remove vars

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* fix declaration

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove var declaration, not needed

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* use simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error handling

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplified the logic for subscriber id (#1094)

* more fixs based on PR feedback (#1094)

* generated new protos (#1094)

* remove else logic to allow compilation (#1094)

* added logging capabilities to the block service and added log messages (#1094)

* ensure node is a valid testing node (#1094)

* added more conditions to handle subscription cancel (#1094)

* use break in the for loop (#1094)

* renamed ResultBlock to Block (#1094)

* refactored the client logic use a channel for errors (#1094)

* simplify subscriber name

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* adding error to log

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* update logging

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Simplified and improved logging (#1094)

* added logic to drop the height publish if channel full (#194)

* improved test to ensure is not light or seed node (#1094)

* refactored block service to use one channel with result type (#1094)

* blockservice: Apply service name to all logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Capitalize start of all log messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Remove unnecessary logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Add trivial RPC error response tracing mechanism for easier debugging

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Simplify constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Extract type assertion

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update configuration-related content

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc/client: Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc: Extract function to validate or update block height from request

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>

* grpc: docs conflicts, preserving most of original

* grpc: fixing conflicts, preserving both test units

* ADR 101: Add GetLatest method to block service (#1209)

* Add BlockResults gRPC service (#1168)

* Add block results grpc endpoint

* Make requested changes

* Fix linting

* Lint proto

* Fix test race condition

* Update test order

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update config/toml.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Format protos

* Format upstream changes

* Test height for failing grpc call

* Test w additional logging

* Remove accidental formal

* Revert "Remove accidental formal"

This reverts commit 81cb702.

* Make additional req changes

* Requested changes for formatting/client signature

* Add changelog entry

* Add separate endpoint for latest BlockResults

* Fix linting

* Clean

* Update changelog

* Update rpc/grpc/server/services/blockresultservice/service.go

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Update test

---------

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Reverting changes with no effect in proto files

* Reverted the change in doc that should not be part of this PR

* fixed docs

* Apply suggestions from code review

* gprc: reverting wrong backport changes

* grpc: re-introducing this change for linter

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Andy Nogueira <me@andynogueira.dev>
Co-authored-by: lg <8335464+glnro@users.noreply.github.com>
p0mvn pushed a commit to osmosis-labs/cometbft that referenced this issue Jan 21, 2024
* initial logic for the gRPC block service (cometbft#1094)

* initial logic for gRPC block client and test (cometbft#1094)

* block response and request (cometbft#1094)

* add configuration for block service (cometbft#1094)

* use pointer for request parameter (cometbft#1094)

* change block service GetBlock response (cometbft#1094)

* return block information (cometbft#1094)

* convert core type to proto type (cometbft#1094)

* hookup server (cometbft#1094)

* hooking directly to the BlockStore instead of Environment (cometbft#1094)

* changing client return type, use core type (cometbft#1094)

* convert from proto to core type (cometbft#1094)

* implemented proper logic to test block service (cometbft#1094)

* return the latest height if height is 0 (cometbft#1094)

* adding proper grpc error handling and return (cometbft#1094)

* rename rpc and message in proto to match ADR-101 spec (cometbft#1094)

* renaming service and client methods structs to match ADR (cometbft#1094)

* additional error handling (cometbft#1094)

* rename get block request and response (cometbft#1094)

* update method name in the client (cometbft#1094)

* proto entries for GetLatestHeight logic (cometbft#1094)

* added logic for streaming new blocks as part of GetLatestHeight (cometbft#1094)

* ensure subcribers have their own unique id (cometbft#1094)

* client logic to use a channel parameter (cometbft#1094)

* added test for GetLatestHeight (cometbft#1094)

* better streaming test to prevent error (cometbft#1094)

* remove empty line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* removing UNARY_RPC to prevent lint on server streaming (cometbft#1094)

* remove server reflection, doesn't work well with gogoproto (cometbft#1094)

* handle negative height parameter (cometbft#1094)

* remove `Block` from `GetBlockLatestHeight`

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* changed method name and fixes to test (cometbft#1094)

* fixes from PR feedback (cometbft#1094)

* remove vars

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* fix declaration

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove line

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* remove var declaration, not needed

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* use simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplest error return

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplify error handling

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* simplified the logic for subscriber id (cometbft#1094)

* more fixs based on PR feedback (cometbft#1094)

* generated new protos (cometbft#1094)

* remove else logic to allow compilation (cometbft#1094)

* added logging capabilities to the block service and added log messages (cometbft#1094)

* ensure node is a valid testing node (cometbft#1094)

* added more conditions to handle subscription cancel (cometbft#1094)

* use break in the for loop (cometbft#1094)

* renamed ResultBlock to Block (cometbft#1094)

* refactored the client logic use a channel for errors (cometbft#1094)

* simplify subscriber name

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* adding error to log

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* update logging

Co-authored-by: Thane Thomson <connect@thanethomson.com>

* Simplified and improved logging (cometbft#1094)

* added logic to drop the height publish if channel full (cometbft#194)

* improved test to ensure is not light or seed node (cometbft#1094)

* refactored block service to use one channel with result type (cometbft#1094)

* blockservice: Apply service name to all logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Capitalize start of all log messages

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Remove unnecessary logs

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Add trivial RPC error response tracing mechanism for easier debugging

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Simplify constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* blockservice: Extract type assertion

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Add changelog entries

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* docs: Update configuration-related content

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc/client: Format

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* grpc: Extract function to validate or update block height from request

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grpc Anything relating to the gRPC API
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants
0