threefoldtech / tfchain_graphql

Graphql for TFchain
Apache License 2.0
2 stars 3 forks source link

Free ips on graphql not matched ones on polkadot UI #102

Closed sameh-farouk closed 1 year ago

sameh-farouk commented 1 year ago

the free IPs statuses differ between graphql and polkadot UI, e.g. the IP address 185.206.122.39, when checked on Polkadot UI, is reserved by contract with id 17,661, but querying the graphql endpoint shows that it is not reserved.

details: on Devnet, when I checked freefarm's public IPs on polkadot UI, I saw none are available

{
  version: 4
  id: 1
  name: Freefarm
  twinId: 2
  pricingPolicyId: 1
  certification: NotCertified
  publicIps: [
    {
      ip: 185.206.122.33/24
      gateway: 185.206.122.1
      contractId: 7,002
    }
    {
      ip: 185.206.122.34/24
      gateway: 185.206.122.1
      contractId: 6,945
    }
    {
      ip: 185.206.122.35/24
      gateway: 185.206.122.1
      contractId: 6,946
    }
    {
      ip: 185.206.122.36/24
      gateway: 185.206.122.1
      contractId: 19,980
    }
    {
      ip: 185.206.122.37/24
      gateway: 185.206.122.1
      contractId: 16,342
    }
    {
      ip: 185.206.122.38/24
      gateway: 185.206.122.1
      contractId: 10,216
    }
    {
      ip: 185.206.122.39/24
      gateway: 185.206.122.1
      contractId: 17,661
    }
    {
      ip: 185.206.122.40/24
      gateway: 185.206.122.1
      contractId: 12,780
    }
    {
      ip: 185.206.122.41/24
      gateway: 185.206.122.1
      contractId: 14,776
    }
    {
      ip: 185.206.122.42/24
      gateway: 185.206.122.1
      contractId: 11,338
    }
    {
      ip: 185.206.122.43/24
      gateway: 185.206.122.1
      contractId: 7,004
    }
    {
      ip: 185.206.122.44/24
      gateway: 185.206.122.1
      contractId: 14,788
    }
    {
      ip: 185.206.122.45/24
      gateway: 185.206.122.1
      contractId: 19,640
    }
    {
      ip: 185.206.122.46/24
      gateway: 185.206.122.1
      contractId: 14,823
    }
    {
      ip: 185.206.122.47/24
      gateway: 185.206.122.1
      contractId: 14,793
    }
    {
      ip: 185.206.122.48/24
      gateway: 185.206.122.1
      contractId: 11,290
    }
    {
      ip: 185.206.122.49/24
      gateway: 185.206.122.1
      contractId: 16,525
    }
    {
      ip: 185.206.122.50/24
      gateway: 185.206.122.1
      contractId: 14,821
    }
  ]
  dedicatedFarm: false
  farmingPolicyLimits: {
    farmingPolicyId: 3
    cu: null
    su: null
    end: null
    nodeCount: null
    nodeCertification: true
  }
}

but on graphql, running the below query it shows some free IPs

query MyQuery {
  publicIps(where: {farm: {farmID_eq: 1}}) {
    id
    contractId
    ip
    gateway
  }
}

query response:

{
  "data": {
    "publicIps": [
      {
        "id": "0000000991-000001-aa42e",
        "contractId": "7002",
        "ip": "185.206.122.33/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001075-000001-3b1ee",
        "contractId": "7004",
        "ip": "185.206.122.43/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000000999-000001-01080",
        "contractId": "6945",
        "ip": "185.206.122.34/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001006-000001-f899f",
        "contractId": "6946",
        "ip": "185.206.122.35/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001174-000001-db2a3",
        "contractId": "0",
        "ip": "185.206.122.50/24",
        "gateway": "185.206.122.50"
      },
      {
        "id": "0000001101-000001-63193",
        "contractId": "14793",
        "ip": "185.206.122.47/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001106-000001-c4f32",
        "contractId": "11290",
        "ip": "185.206.122.48/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001019-000001-5001b",
        "contractId": "16342",
        "ip": "185.206.122.37/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001032-000001-5cfae",
        "contractId": "10216",
        "ip": "185.206.122.38/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001037-000001-dad97",
        "contractId": "0",
        "ip": "185.206.122.39/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001042-000001-f65e8",
        "contractId": "0",
        "ip": "185.206.122.40/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001047-000001-f6e0d",
        "contractId": "14776",
        "ip": "185.206.122.41/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001070-000001-3e7e7",
        "contractId": "11338",
        "ip": "185.206.122.42/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001096-000001-5f6c1",
        "contractId": "14823",
        "ip": "185.206.122.46/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001084-000001-670af",
        "contractId": "14788",
        "ip": "185.206.122.44/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001168-000001-34245",
        "contractId": "0",
        "ip": "185.206.122.49/24",
        "gateway": "185.206.122.50"
      },
      {
        "id": "0000001091-000001-c5b37",
        "contractId": "19640",
        "ip": "185.206.122.45/24",
        "gateway": "185.206.122.1"
      },
      {
        "id": "0000001012-000001-23923",
        "contractId": "19980",
        "ip": "185.206.122.36/24",
        "gateway": "185.206.122.1"
      }
    ]
  }
}
DylanVerstraete commented 1 year ago

Verified on devnet, this release is also deployed on other networks so closing