-
Notifications
You must be signed in to change notification settings - Fork 16
feat: support secure grpc connections #576
feat: support secure grpc connections #576
Conversation
WalkthroughThe changes introduced in this diff primarily revolve around the addition of a new flag Changes
Poem
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (19)
- cmd/blobstream/base/config.go (2 hunks)
- cmd/blobstream/common/helpers.go (2 hunks)
- cmd/blobstream/deploy/cmd.go (1 hunks)
- cmd/blobstream/deploy/config.go (4 hunks)
- cmd/blobstream/orchestrator/cmd.go (1 hunks)
- cmd/blobstream/orchestrator/config.go (4 hunks)
- cmd/blobstream/query/cmd.go (2 hunks)
- cmd/blobstream/query/config.go (4 hunks)
- cmd/blobstream/relayer/cmd.go (1 hunks)
- cmd/blobstream/relayer/config.go (4 hunks)
- e2e/qgb_network.go (8 hunks)
- e2e/relayer_test.go (2 hunks)
- e2e/scripts/deploy_blobstream_contract.sh (1 hunks)
- e2e/scripts/start_orchestrator_after_validator_created.sh (1 hunks)
- e2e/scripts/start_relayer.sh (1 hunks)
- orchestrator/orchestrator_test.go (1 hunks)
- rpc/app_querier.go (2 hunks)
- rpc/app_querier_test.go (9 hunks)
- testing/qgb.go (2 hunks)
Files skipped from review due to trivial changes (5)
- cmd/blobstream/base/config.go
- e2e/scripts/deploy_blobstream_contract.sh
- e2e/scripts/start_orchestrator_after_validator_created.sh
- e2e/scripts/start_relayer.sh
- testing/qgb.go
Additional comments: 37
cmd/blobstream/orchestrator/cmd.go (1)
- 57-63: The
NewTmAndAppQuerier
function now accepts an additional argumentconfig.grpcInsecure
. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, make sure that thegrpcInsecure
flag is properly validated before being passed to the function.cmd/blobstream/relayer/cmd.go (1)
- 97-103: The
NewTmAndAppQuerier
function now accepts an additional argumentconfig.grpcInsecure
. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, verify that thegrpcInsecure
flag is being set correctly based on user input or configuration.rpc/app_querier.go (2)
2-11: The imports are correctly organized and necessary for the code in this file.
28-45: The
Start
function has been updated to accept a new parametergrpcInsecure
. This parameter is used to determine whether to establish a secure or insecure gRPC connection. The error handling for thegrpc.Dial
function is correctly implemented. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.rpc/app_querier_test.go (1)
- 126-130: The
Start
function now accepts a boolean argument to indicate whether the gRPC connection should be insecure or not. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, consider the implications of using insecure connections in a production environment. It's generally recommended to use secure connections, especially when dealing with sensitive data.cmd/blobstream/deploy/cmd.go (1)
- 44-50: The
Start
function now accepts a boolean parameter to indicate whether the gRPC connection should be insecure or not. Ensure that all calls to this function throughout the codebase have been updated to match the new signature. Also, consider the implications of allowing insecure gRPC connections. While this may be useful for testing or development environments, it could pose a security risk in a production environment. It's recommended to ensure that this option is clearly documented and that users are warned of the potential risks.e2e/relayer_test.go (2)
183-187: The
Start
method ofappQuerier
is now called withtrue
as an argument, which indicates that the gRPC connection should be insecure. Ensure that this is the intended behavior and that it doesn't introduce any security vulnerabilities.270-274: The
Start
method ofappQuerier
is now called withtrue
as an argument, which indicates that the gRPC connection should be insecure. Ensure that this is the intended behavior and that it doesn't introduce any security vulnerabilities.orchestrator/orchestrator_test.go (1)
- 182-185: The
Start
method ofappQuerier
is now called withtrue
as an argument, which means that the gRPC connection will be insecure. Ensure that this is the intended behavior and that it doesn't introduce any security vulnerabilities.- require.NoError(s.T(), appQuerier.Start(true)) + require.NoError(s.T(), appQuerier.Start(false))cmd/blobstream/relayer/config.go (4)
49-49: The
addRelayerStartFlags
function has been updated to include thegrpcInsecure
flag. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.63-63: The
StartConfig
struct has been updated to include thegrpcInsecure
field. Ensure that all instances of this struct throughout the codebase have been updated to include this new field.140-143: The
parseRelayerStartFlags
function has been updated to parse thegrpcInsecure
flag. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.160-160: The
StartConfig
struct is being returned with thegrpcInsecure
field set. Ensure that all instances where this struct is being used have been updated to handle this new field.cmd/blobstream/orchestrator/config.go (4)
37-41: The
addOrchestratorFlags
function has been updated to include theAddGRPCInsecureFlag
function call. This adds the--grpc-insecure
flag to the command.47-51: The
StartConfig
struct now includes agrpcInsecure
field of typebool
. This field will hold the value of the--grpc-insecure
flag.101-107: The
parseOrchestratorFlags
function has been updated to parse the--grpc-insecure
flag and store its value in thegrpcInsecure
variable.117-123: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [109-121]
The
StartConfig
struct is now initialized with thegrpcInsecure
field set to the value of the--grpc-insecure
flag.cmd/blobstream/deploy/config.go (4)
42-46: The
addDeployFlags
function has been updated to include theAddGRPCInsecureFlag
function call. This adds the--grpc-insecure
flag to the command. Ensure that theAddGRPCInsecureFlag
function correctly adds the flag and that it defaults tofalse
.53-57: The
deployConfig
struct now includes agrpcInsecure
field. This field will hold the value of the--grpc-insecure
flag.103-109: The
parseDeployFlags
function has been updated to parse the--grpc-insecure
flag and assign its value to thegrpcInsecure
field in thedeployConfig
struct. Ensure that the flag is correctly parsed and that any errors are properly handled.119-123: The
grpcInsecure
field is now included in thedeployConfig
struct returned by theparseDeployFlags
function. Ensure that the value of this field is correctly used in the rest of the codebase.cmd/blobstream/common/helpers.go (2)
27-30: The function signature has been updated to include a new parameter
grpcInsecure bool
. Ensure that all calls to this function throughout the codebase have been updated to match the new signature.48-48: The function call
appQuerier.Start()
has been updated toappQuerier.Start(grpcInsecure)
. This change allows the caller to specify whether the gRPC connection should be insecure or not. Ensure that theStart
function in theAppQuerier
struct has been updated to accept this new parameter.cmd/blobstream/query/cmd.go (2)
75-81: The changes made here are correct and align with the pull request summary. The
common.NewTmAndAppQuerier()
function now accepts an additional argumentconfig.grpcInsecure
which is used to determine whether the gRPC connection should be insecure or not. Thestops
variable is also correctly appended with the returnedstops
value fromcommon.NewTmAndAppQuerier()
. Ensure that all calls tocommon.NewTmAndAppQuerier()
throughout the codebase have been updated to match the new signature.358-364: The changes made here are correct and align with the pull request summary. The
common.NewTmAndAppQuerier()
function now accepts an additional argumentconfig.grpcInsecure
which is used to determine whether the gRPC connection should be insecure or not. Thestops
variable is also correctly appended with the returnedstops
value fromcommon.NewTmAndAppQuerier()
. Ensure that all calls tocommon.NewTmAndAppQuerier()
throughout the codebase have been updated to match the new signature.cmd/blobstream/query/config.go (4)
3-10: The new import statement is correctly added. Ensure that the package is available in the project dependencies.
21-24: The new flag is correctly added to the command. Ensure that the flag is documented in the user guide or help command.
30-34: The new field is correctly added to the Config struct. Ensure that the field is used in the rest of the codebase.
58-72: The new flag is correctly parsed and added to the Config struct. Ensure that error handling is consistent with the rest of the codebase.
e2e/qgb_network.go (8)
423-426: Ensure that the
Start
method ofappQuerier
can handle thetrue
argument correctly and that it doesn't introduce any security vulnerabilities due to the insecure gRPC connection.494-497: Same as above.
542-545: Same as above.
605-608: Same as above.
654-657: Same as above.
675-678: Same as above.
697-700: Same as above.
995-998: Same as above.
Codecov Report
@@ Coverage Diff @@
## main #576 +/- ##
==========================================
- Coverage 34.98% 34.84% -0.15%
==========================================
Files 27 27
Lines 2221 2230 +9
==========================================
Hits 777 777
- Misses 1351 1360 +9
Partials 93 93
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- e2e/scripts/start_orchestrator_after_validator_created.sh (2 hunks)
Additional comments: 2
e2e/scripts/start_orchestrator_after_validator_created.sh (2)
53-59: The
--grpc.insecure
flag is added to the command-line arguments. This flag enables insecure gRPC communication. Ensure that this flag is used responsibly and only in environments where security is not a concern, such as local testing or development. In production environments, secure communication should always be used.67-73: The
--grpc.insecure
flag is added to the command-line arguments. This flag enables insecure gRPC communication. Ensure that this flag is used responsibly and only in environments where security is not a concern, such as local testing or development. In production environments, secure communication should always be used.
@@ -46,6 +46,7 @@ const ( | |||
FlagBootstrappers = "p2p.bootstrappers" | |||
FlagP2PListenAddress = "p2p.listen-addr" | |||
FlagP2PNickname = "p2p.nickname" | |||
FlagGRPCInsecure = "grpc.insecure" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does comet/sdk even support secure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Secure grpc is supported not rpc
Overview
Closes #352
Checklist
Summary by CodeRabbit
New Features
--grpc-insecure
flag to enable gRPC communication over insecure channels.Bug Fixes
grpcInsecure
parameter, ensuring correct behavior based on the user's preference for secure or insecure gRPC connections.Tests
grpcInsecure
parameter in function calls.