From 25c73803ba85086efea6e52c2906ce890a39e362 Mon Sep 17 00:00:00 2001 From: Elad Gildnur Date: Mon, 2 Dec 2024 15:37:00 +0200 Subject: [PATCH] Remove unused flag --- protocol/chainlib/chain_router.go | 5 +---- protocol/chainlib/chain_router_test.go | 8 -------- protocol/chainlib/chainlib.go | 5 ----- protocol/rpcprovider/rpcprovider.go | 1 - 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/protocol/chainlib/chain_router.go b/protocol/chainlib/chain_router.go index 7a00cf5b94..9c07a6bdbb 100644 --- a/protocol/chainlib/chain_router.go +++ b/protocol/chainlib/chain_router.go @@ -326,14 +326,11 @@ func newChainRouter(ctx context.Context, nConns uint, rpcProviderEndpoint lavase } } if hasSubscriptionInSpec && apiCollection.Enabled && !webSocketSupported { - err := utils.LavaFormatError("subscriptions are applicable for this chain, but websocket is not provided in 'supported' map. By not setting ws/wss your provider wont be able to accept ws subscriptions, therefore might receive less rewards and lower QOS score.", nil, + return nil, utils.LavaFormatError("subscriptions are applicable for this chain, but websocket is not provided in 'supported' map. By not setting ws/wss your provider wont be able to accept ws subscriptions, therefore might receive less rewards and lower QOS score.", nil, utils.LogAttr("apiInterface", apiCollection.CollectionData.ApiInterface), utils.LogAttr("supportedMap", supportedMap), utils.LogAttr("required", WebSocketExtension), ) - if !IgnoreSubscriptionNotConfiguredError { - return nil, err - } } utils.LavaFormatDebug("router keys", utils.LogAttr("chainProxyRouter", chainProxyRouter)) diff --git a/protocol/chainlib/chain_router_test.go b/protocol/chainlib/chain_router_test.go index aefdc84b1c..7d80f343a1 100644 --- a/protocol/chainlib/chain_router_test.go +++ b/protocol/chainlib/chain_router_test.go @@ -40,8 +40,6 @@ func TestChainRouterWithDisabledWebSocketInSpec(t *testing.T) { chainParser, err := NewChainParser(apiInterface) require.NoError(t, err) - IgnoreSubscriptionNotConfiguredError = false - addonsOptions := []string{"-addon-", "-addon2-"} extensionsOptions := []string{"-test-", "-test2-", "-test3-"} @@ -400,8 +398,6 @@ func TestChainRouterWithEnabledWebSocketInSpec(t *testing.T) { chainParser, err := NewChainParser(apiInterface) require.NoError(t, err) - IgnoreSubscriptionNotConfiguredError = false - addonsOptions := []string{"-addon-", "-addon2-"} extensionsOptions := []string{"-test-", "-test2-", "-test3-"} @@ -795,8 +791,6 @@ func TestChainRouterWithMethodRoutes(t *testing.T) { chainParser, err := NewChainParser(apiInterface) require.NoError(t, err) - IgnoreSubscriptionNotConfiguredError = false - addonsOptions := []string{"-addon-", "-addon2-"} extensionsOptions := []string{"-test-", "-test2-", "-test3-"} @@ -2181,8 +2175,6 @@ func TestChainRouterWithInternalPaths(t *testing.T) { chainParser, err := NewChainParser(play.apiInterface) require.NoError(t, err) - IgnoreSubscriptionNotConfiguredError = false - spec := testcommon.CreateMockSpec() spec.ApiCollections = play.specApiCollections chainParser.SetSpec(spec) diff --git a/protocol/chainlib/chainlib.go b/protocol/chainlib/chainlib.go index 5c3fbd9b7f..41c024ae04 100644 --- a/protocol/chainlib/chainlib.go +++ b/protocol/chainlib/chainlib.go @@ -21,11 +21,6 @@ const ( INTERNAL_ADDRESS = "internal-addr" ) -var ( - IgnoreSubscriptionNotConfiguredError = true - IgnoreSubscriptionNotConfiguredErrorFlag = "ignore-subscription-not-configured-error" -) - func NewChainParser(apiInterface string) (chainParser ChainParser, err error) { switch apiInterface { case spectypes.APIInterfaceJsonRPC: diff --git a/protocol/rpcprovider/rpcprovider.go b/protocol/rpcprovider/rpcprovider.go index 794b64f295..66d99e2519 100644 --- a/protocol/rpcprovider/rpcprovider.go +++ b/protocol/rpcprovider/rpcprovider.go @@ -829,7 +829,6 @@ rpcprovider 127.0.0.1:3333 OSMOSIS tendermintrpc "wss://www.node-path.com:80,htt cmdRPCProvider.Flags().Duration(common.RelayHealthIntervalFlag, RelayHealthIntervalFlagDefault, "interval between relay health checks") cmdRPCProvider.Flags().String(HealthCheckURLPathFlagName, HealthCheckURLPathFlagDefault, "the url path for the provider's grpc health check") cmdRPCProvider.Flags().DurationVar(&updaters.TimeOutForFetchingLavaBlocks, common.TimeOutForFetchingLavaBlocksFlag, time.Second*5, "setting the timeout for fetching lava blocks") - cmdRPCProvider.Flags().BoolVar(&chainlib.IgnoreSubscriptionNotConfiguredError, chainlib.IgnoreSubscriptionNotConfiguredErrorFlag, chainlib.IgnoreSubscriptionNotConfiguredError, "ignore webSocket node url not configured error, when subscription is enabled in spec") cmdRPCProvider.Flags().IntVar(&numberOfRetriesAllowedOnNodeErrors, common.SetRelayCountOnNodeErrorFlag, 2, "set the number of retries attempt on node errors") cmdRPCProvider.Flags().String(common.UseStaticSpecFlag, "", "load offline spec provided path to spec file, used to test specs before they are proposed on chain, example for spec with inheritance: --use-static-spec ./cookbook/specs/ibc.json,./cookbook/specs/tendermint.json,./cookbook/specs/cosmossdk.json,./cookbook/specs/ethermint.json,./cookbook/specs/ethereum.json,./cookbook/specs/evmos.json") cmdRPCProvider.Flags().Uint64(common.RateLimitRequestPerSecondFlag, 0, "Measuring the load relative to this number for feedback - per second - per chain - default unlimited. Given Y simultaneous relay calls, a value of X and will measure Y/X load rate.")