diff --git a/protocol/chainlib/base_chain_parser.go b/protocol/chainlib/base_chain_parser.go index d25e9f175b..dbaae96a98 100644 --- a/protocol/chainlib/base_chain_parser.go +++ b/protocol/chainlib/base_chain_parser.go @@ -338,7 +338,7 @@ func (apip *BaseChainParser) getApiCollection(connectionType, internalPath, addo // Return an error if spec does not exist if !ok { - return nil, utils.LavaFormatError("api not supported", nil, utils.Attribute{Key: "connectionType", Value: connectionType}) + return nil, utils.LavaFormatWarning("api not supported", common.APINotSupportedError, utils.Attribute{Key: "connectionType", Value: connectionType}) } // Return an error if api is disabled diff --git a/protocol/lavasession/consumer_session_manager.go b/protocol/lavasession/consumer_session_manager.go index 4027b8ff1a..a8d327862c 100644 --- a/protocol/lavasession/consumer_session_manager.go +++ b/protocol/lavasession/consumer_session_manager.go @@ -363,11 +363,11 @@ func (csm *ConsumerSessionManager) getSessionWithProviderOrError(usedProviders U if errGetRegularProvider != nil { return nil, err // return original error (getValidConsumerSessionsWithProvider) } - for _, session := range sessionWithProviderMap { - session.RemoveExtensions = true + for key := range sessionWithProviderMap { + sessionWithProviderMap[key].RemoveExtensions = true } // print a warning in case we got a provider who does not support that addon or extension. - utils.LavaFormatWarning("No Providers For Addon Or Extension, using regular provider for relay", errOnRetry, utils.LogAttr("addon", addon), utils.LogAttr("extensions", extensionNames)) + utils.LavaFormatWarning("No Providers For Addon Or Extension, using regular provider for relay", errOnRetry, utils.LogAttr("addon", addon), utils.LogAttr("extensions", extensionNames), utils.LogAttr("providers_chosen", sessionWithProviderMap)) } else { return nil, err // return original error (getValidConsumerSessionsWithProvider) } @@ -421,7 +421,7 @@ func (csm *ConsumerSessionManager) GetSessions(ctx context.Context, cuNeededForS // we can get here if we wanted 3 archive and got 2 only because one couldn't connect, // so we tried getting more sessions and got a regular provider due to no pairings available. // in that case just return the current sessions that we do have. - if sessionWithProvider.RemoveExtensions && len(sessions) > 1 { + if sessionWithProvider.RemoveExtensions && len(sessions) >= 1 { utils.LavaFormatDebug("Too many sessions when using RemoveAddonAndExtensions session", utils.LogAttr("sessions", sessions), utils.LogAttr("wanted_to_add", sessionWithProvider)) // in that case we just return the sessions we already have. return sessions, nil diff --git a/protocol/performance/validators/validators.go b/protocol/performance/validators/validators.go index c07d096910..222a72a89d 100644 --- a/protocol/performance/validators/validators.go +++ b/protocol/performance/validators/validators.go @@ -115,18 +115,19 @@ func checkValidatorPerformance(ctx context.Context, clientCtx client.Context, va if err != nil { return retInfo, utils.LavaFormatError("failed compiling regex", err, utils.LogAttr("regex", strings.ReplaceAll(valAddr, " ", ""))) } - valAddr := "" + valAddr = "" foundMoniker := "" for _, validator := range allValidators.GetValidators() { - if (exact && validator.Description.Moniker == valAddr) || (!exact && (re.MatchString(validator.Description.Moniker) || re2.MatchString(validator.Description.Moniker))) { + if (exact && validator.Description.Moniker == valAddr) || (regex && (re.MatchString(validator.Description.Moniker) || re2.MatchString(validator.Description.Moniker))) { + if valAddr != "" { + return retInfo, utils.LavaFormatError("regex matched two validators", nil, utils.LogAttr("first", foundMoniker), utils.LogAttr("second", validator.Description.Moniker)) + } foundMoniker = validator.Description.Moniker valAddr = validator.OperatorAddress valCons, err = extractValcons(clientCtx.Codec, validator, hrp) if err != nil { continue } - } else { - return retInfo, utils.LavaFormatError("regex matched two validators", nil, utils.LogAttr("first", foundMoniker), utils.LogAttr("second", validator.Description.Moniker)) } } if valAddr == "" {