-
Notifications
You must be signed in to change notification settings - Fork 117
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
[CORE-715] Bridge Daemon: Do not require eth rpc endpoint. Instead panic on startup #725
Conversation
WalkthroughThe changes primarily focus on the handling of the Changes
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: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- protocol/daemons/bridge/client/client.go (1 hunks)
- protocol/daemons/flags/flags.go (1 hunks)
Files skipped from review due to trivial changes (1)
- protocol/daemons/flags/flags.go
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: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- protocol/daemons/bridge/client/client.go (2 hunks)
- protocol/daemons/flags/flags.go (1 hunks)
Files skipped from review due to trivial changes (1)
- protocol/daemons/flags/flags.go
Additional comments: 2
protocol/daemons/bridge/client/client.go (2)
37-43: The check for
EthRpcEndpoint
being empty is a good addition. It ensures that the application will not start without a valid Ethereum RPC endpoint, which is a required parameter for the bridge daemon to function correctly. This is a good practice for error handling and improves the robustness of the application.37-46: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [46-48]
Error handling is done correctly here. If there is an error while establishing a connection, the error is logged and returned immediately. This is a good practice as it prevents the application from proceeding with an invalid state.
@@ -36,6 +37,10 @@ func Start( | |||
"Starting bridge daemon with flags", | |||
"BridgeFlags", flags.Bridge, | |||
) | |||
// Panic if EthRpcEndpoint is empty. | |||
if flags.Bridge.EthRpcEndpoint == "" { | |||
return fmt.Errorf("flag %s is not set", daemonflags.FlagBridgeDaemonEthRpcEndpoint) |
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.
app.go
will panic on this error
…artup if flag is not set
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 (2)
- protocol/daemons/bridge/client/client.go (3 hunks)
- protocol/daemons/flags/flags.go (1 hunks)
Files skipped from review due to trivial changes (2)
- protocol/daemons/bridge/client/client.go
- protocol/daemons/flags/flags.go
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.
Can we add unit or e2e testing retroactively? (non-blocking for this PR submission)
…artup if flag is not set (#725) (#727) (cherry picked from commit 17e3c37) Co-authored-by: Tian <[email protected]>
Changelist
On bridge daemon startup, return an error if eth rpc endpoint is empty (which
app.go
will panic on)Validator
Full node
--non-validating-full-node = true
(or if the flag is set)Test Plan
[Describe how this PR was tested (if applicable)]
Author/Reviewer Checklist
state-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.