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

API nearest endpoints return node list in reverse order #905

Closed
Tracked by #935
Neylix opened this issue Feb 20, 2023 · 0 comments · Fixed by #935
Closed
Tracked by #935

API nearest endpoints return node list in reverse order #905

Neylix opened this issue Feb 20, 2023 · 0 comments · Fixed by #935
Assignees
Labels
API Involve API facing user bug Something isn't working good first issue Good for newcomers

Comments

@Neylix
Copy link
Member

Neylix commented Feb 20, 2023

Describe the problem you discovered

Using the public ip 78.122.13.30, the function Resolver.nearest_endpoints(ip) return this list:

[
  %{ip: '78.122.13.30', port: 40000},
  %{ip: '104.248.43.182', port: 40000},
  %{ip: '146.190.18.11', port: 40000},
  %{ip: '176.158.137.220', port: 40000},
  %{ip: '90.114.215.48', port: 40001},
  %{ip: '188.166.234.20', port: 40000},
  %{ip: '24.86.196.220', port: 40000},
  %{ip: '170.64.129.22', port: 40000},
  %{ip: '157.230.52.175', port: 40000},
  %{ip: '138.197.163.138', port: 40000},
  %{ip: '88.160.124.188', port: 4000},
  %{ip: '46.101.13.189', port: 40000}
]

But when requesting the api nearest_endpoint througth graphiql it return the same list but in reverse order:

{
  "data": {
    "nearestEndpoints": [
      {
        "ip": "46.101.13.189",
        "port": 40000
      },
      {
        "ip": "88.160.124.188",
        "port": 4000
      },
      {
        "ip": "157.230.52.175",
        "port": 40000
      },
      {
        "ip": "138.197.163.138",
        "port": 40000
      },
      {
        "ip": "170.64.129.22",
        "port": 40000
      },
      {
        "ip": "24.86.196.220",
        "port": 40000
      },
      {
        "ip": "188.166.234.20",
        "port": 40000
      },
      {
        "ip": "104.248.43.182",
        "port": 40000
      },
      {
        "ip": "146.190.18.11",
        "port": 40000
      },
      {
        "ip": "176.158.137.220",
        "port": 40000
      },
      {
        "ip": "90.114.215.48",
        "port": 40001
      },
      {
        "ip": "78.122.13.30",
        "port": 40000
      }
    ]
  }
}

Describe the solution you'd like

The problem may be in the function resolve of Absinthe.
This function should not change the list order received from the Resolver.

@Neylix Neylix added bug Something isn't working API Involve API facing user labels Feb 20, 2023
@samuelmanzanera samuelmanzanera added the good first issue Good for newcomers label Feb 21, 2023
@apoorv-2204 apoorv-2204 self-assigned this Mar 14, 2023
@samuelmanzanera samuelmanzanera linked a pull request Mar 15, 2023 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involve API facing user bug Something isn't working good first issue Good for newcomers
Projects
Status: Done 🍻
Development

Successfully merging a pull request may close this issue.

3 participants