-
Notifications
You must be signed in to change notification settings - Fork 638
Add gRPC block service #1142
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
Merged
thanethomson
merged 72 commits into
feature/adr101-pull-companion
from
andy/1094-grpc-blockservice
Aug 1, 2023
Merged
Add gRPC block service #1142
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
de75cdd
initial logic for the gRPC block service (#1094)
andynog dabb1b5
initial logic for gRPC block client and test (#1094)
andynog 429e823
block response and request (#1094)
andynog ba22d02
add configuration for block service (#1094)
andynog b7dc596
use pointer for request parameter (#1094)
andynog 13c67f7
change block service GetBlock response (#1094)
andynog b7fed25
return block information (#1094)
andynog c8e5989
convert core type to proto type (#1094)
andynog 229057b
hookup server (#1094)
andynog bbd8521
hooking directly to the BlockStore instead of Environment (#1094)
andynog e985933
changing client return type, use core type (#1094)
andynog 3c72d9e
convert from proto to core type (#1094)
andynog 656723b
implemented proper logic to test block service (#1094)
andynog f13d482
return the latest height if height is 0 (#1094)
andynog f0cb09f
adding proper grpc error handling and return (#1094)
andynog 2b13ef7
rename rpc and message in proto to match ADR-101 spec (#1094)
andynog e5099a4
renaming service and client methods structs to match ADR (#1094)
andynog 103fd19
additional error handling (#1094)
andynog 71fc923
rename get block request and response (#1094)
andynog bd05c10
update method name in the client (#1094)
andynog 2582654
proto entries for GetLatestHeight logic (#1094)
andynog 3fceb9c
added logic for streaming new blocks as part of GetLatestHeight (#1094)
andynog 5dd78bd
ensure subcribers have their own unique id (#1094)
andynog b59cb84
client logic to use a channel parameter (#1094)
andynog be39297
added test for GetLatestHeight (#1094)
andynog e2f7eae
better streaming test to prevent error (#1094)
andynog b66d7c3
remove empty line
andynog 16bb947
removing UNARY_RPC to prevent lint on server streaming (#1094)
andynog 91fef8f
remove server reflection, doesn't work well with gogoproto (#1094)
andynog 59753a0
handle negative height parameter (#1094)
andynog ae544d5
remove `Block` from `GetBlockLatestHeight`
andynog 31d3438
Merge branch 'andy/1094-grpc-blockservice' of github.com:cometbft/com…
andynog e45cde5
changed method name and fixes to test (#1094)
andynog d3512c2
fixes from PR feedback (#1094)
andynog 63c7b35
remove vars
andynog c8544a5
fix declaration
andynog d5c9d97
simplify error return
andynog 82a691b
simplest error return
andynog 01b7787
remove line
andynog 638f1b9
remove var declaration, not needed
andynog 996c7c2
use simplest error return
andynog 3b1c53e
simplest error return
andynog 6ed4345
simplest error return
andynog adfc378
simplify error handling
andynog 7034cce
simplified the logic for subscriber id (#1094)
andynog 0876d41
more fixs based on PR feedback (#1094)
andynog 5771ddf
generated new protos (#1094)
andynog 4a68ee9
remove else logic to allow compilation (#1094)
andynog 11d2e66
added logging capabilities to the block service and added log message…
andynog 7db51f2
ensure node is a valid testing node (#1094)
andynog 0116da0
added more conditions to handle subscription cancel (#1094)
andynog ed3fe8b
use break in the for loop (#1094)
andynog 8393fde
renamed ResultBlock to Block (#1094)
8000
andynog 0879d46
refactored the client logic use a channel for errors (#1094)
andynog 5ddf517
simplify subscriber name
andynog bc564a2
adding error to log
andynog 988a8c6
update logging
andynog 3d32a85
Simplified and improved logging (#1094)
andynog b00f013
added logic to drop the height publish if channel full (#0194)
andynog 883b1fd
improved test to ensure is not light or seed node (#1094)
andynog 5ad35bc
refactored block service to use one channel with result type (#1094)
andynog e6d91da
Merge branch 'feature/adr101-pull-companion' into andy/1094-grpc-bloc…
thanethomson 1eff275
blockservice: Apply service name to all logs
thanethomson 14bf0d4
blockservice: Capitalize start of all log messages
thanethomson ca4cba3
blockservice: Remove unnecessary logs
thanethomson 54d328a
blockservice: Add trivial RPC error response tracing mechanism for ea…
thanethomson 46d1ce4
blockservice: Simplify constructor
thanethomson 4600ec5
blockservice: Extract type assertion
thanethomson 8f2cd3e
Add changelog entries
thanethomson ba57644
docs: Update configuration-related content
thanethomson 36021f5
grpc/client: Format
thanethomson 5d384dd
grpc: Extract function to validate or update block height from request
thanethomson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
.changelog/unreleased/features/1094-grpc-block-service-cfg.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- `[config]` Add `[grpc.block_service]` section to configure gRPC `BlockService` | ||
([\#1094](https://github.com/cometbft/cometbft/issues/1094)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- `[grpc]` Add `BlockService` with client to facilitate fetching of blocks and | ||
streaming of the latest committed block height | ||
([\#1094](https://github.com/cometbft/cometbft/issues/1094)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package rpctrace | ||
|
||
import "github.com/gofrs/uuid" | ||
|
||
// New returns a randomly generated string which can be used to assist in | ||
// tracing RPC errors. | ||
func New() (string, error) { | ||
id, err := uuid.NewV4() | ||
if err != nil { | ||
return "", err | ||
} | ||
return id.String(), nil | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,3 @@ lint: | |
use: | ||
- BASIC | ||
- FILE_LOWER_SNAKE_CASE | ||
- UNARY_RPC |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.