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

handle unknown lora region in config service gateway api #431

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

jeffgrunewald
Copy link
Contributor

@jeffgrunewald jeffgrunewald commented Apr 6, 2023

This change is needed to handle gateways requesting region params when they do not have a valid or known default/fallback region set in their local settings.toml files when they make a request to the config service to get the current transmit parameters for their region.

The lookup/response from the config service will be prioritized as follows:

  • If the gateway's pubkey/address is found on the current chain with an asserted location, that location will be mapped to a region and from there to region parameters and both will be returned to the gateway
  • If the gateway supplies a valid lora region as its fallback and no gateway is found on-chain or the gateway is found to be not asserted the parameters for the fallback region supplied in the request will be returned to the gateway, along with the fallback region
  • If the gateway's fallback region is not set or explicitly set to the new "Unknown" region, and no asserted region can be found, the "Unknown" region will be returned along with an empty parameters list

This change also changes the behavior of the API if the fallback region argument supplied in the gateway's request is not found to be a valid region. Where previously this would be converted to the enum default (first enum variant, us915) now it will return an "invalid argument" error to the client. For the purposes of this validation, the "unknown" region is considered a valid region.

@jeffgrunewald jeffgrunewald force-pushed the jg/handle-unknown-lora-region branch from cc71cc0 to a7fac58 Compare April 6, 2023 21:31
@jeffgrunewald jeffgrunewald force-pushed the jg/handle-unknown-lora-region branch from a7fac58 to 501b237 Compare April 6, 2023 22:14
@bbalser bbalser merged commit 65e1ca4 into main Apr 7, 2023
@bbalser bbalser deleted the jg/handle-unknown-lora-region branch April 7, 2023 12:58
bbalser pushed a commit that referenced this pull request Apr 7, 2023
* handle unknown lora region in config service gateway api

* handle load region api re: unknown region variant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants