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

Remove the gRPC fallback client from the validator REST API #12051

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
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ type beaconApiValidatorClient struct {
dutiesProvider dutiesProvider
stateValidatorsProvider stateValidatorsProvider
jsonRestHandler jsonRestHandler
fallbackClient iface.ValidatorClient
beaconBlockConverter beaconBlockConverter
}

func NewBeaconApiValidatorClientWithFallback(host string, timeout time.Duration, fallbackClient iface.ValidatorClient) iface.ValidatorClient {
func NewBeaconApiValidatorClient(host string, timeout time.Duration) iface.ValidatorClient {
jsonRestHandler := beaconApiJsonRestHandler{
httpClient: http.Client{Timeout: timeout},
host: host,
Expand All @@ -35,7 +34,6 @@ func NewBeaconApiValidatorClientWithFallback(host string, timeout time.Duration,
stateValidatorsProvider: beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler},
jsonRestHandler: jsonRestHandler,
beaconBlockConverter: beaconApiBeaconBlockConverter{},
fallbackClient: fallbackClient,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import (
)

func NewValidatorClient(validatorConn validatorHelpers.NodeConnection) iface.ValidatorClient {
grpcClient := grpcApi.NewGrpcValidatorClient(validatorConn.GetGrpcClientConn())
featureFlags := features.Get()

if featureFlags.EnableBeaconRESTApi {
return beaconApi.NewBeaconApiValidatorClientWithFallback(validatorConn.GetBeaconApiUrl(), validatorConn.GetBeaconApiTimeout(), grpcClient)
return beaconApi.NewBeaconApiValidatorClient(validatorConn.GetBeaconApiUrl(), validatorConn.GetBeaconApiTimeout())
} else {
return grpcClient
return grpcApi.NewGrpcValidatorClient(validatorConn.GetGrpcClientConn())
}
}