Skip to content
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 (backport #725) #727

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions protocol/daemons/bridge/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/dydxprotocol/v4-chain/protocol/daemons/bridge/api"
"github.com/dydxprotocol/v4-chain/protocol/daemons/bridge/client/types"
"github.com/dydxprotocol/v4-chain/protocol/daemons/constants"
"github.com/dydxprotocol/v4-chain/protocol/daemons/flags"
daemonflags "github.com/dydxprotocol/v4-chain/protocol/daemons/flags"
daemontypes "github.com/dydxprotocol/v4-chain/protocol/daemons/types"
libeth "github.com/dydxprotocol/v4-chain/protocol/lib/eth"
"github.com/dydxprotocol/v4-chain/protocol/lib/metrics"
Expand All @@ -26,7 +26,7 @@ import (
// Start begins a job that periodically runs the RunBridgeDaemonTaskLoop function.
func Start(
ctx context.Context,
flags flags.DaemonFlags,
flags daemonflags.DaemonFlags,
appFlags appflags.Flags,
logger log.Logger,
grpcClient daemontypes.GrpcClient,
Expand All @@ -36,6 +36,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)
}

// Make a connection to the Cosmos gRPC query services.
queryConn, err := grpcClient.NewTcpConnection(ctx, appFlags.GrpcAddress)
Expand Down
4 changes: 0 additions & 4 deletions protocol/daemons/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ func AddDaemonFlagsToCmd(
df.Bridge.EthRpcEndpoint,
"Ethereum Node Rpc Endpoint",
)
// Require bridge daemon eth RPC endpoint flag.
if err := cmd.MarkFlagRequired(FlagBridgeDaemonEthRpcEndpoint); err != nil {
panic(err)
}

// Liquidation Daemon.
cmd.Flags().Bool(
Expand Down
Loading