DefiantLabs / cosmos-upgrades

a tool to search for scheduled cosmos upgrades
MIT License
4 stars 2 forks source link

Semver matching function is matching on pre-release tags when it should skip those #32

Open pharr117 opened 1 year ago

pharr117 commented 1 year ago

The find_best_semver_for_versions function seems to be matching on pre-release tags.

User reports say that the persistence network was reporting the following info before their upgrade today:

{
  "type": "mainnet",
  "network": "persistence",
  "rpc_server": "https://rpc-persistence.architectnodes.com/",
  "rest_server": "https://api-persistence.cosmos-spaces.cloud/",
  "latest_block_height": 13870121,
  "upgrade_found": true,
  "upgrade_name": "v10",
  "source": "current_upgrade_plan",
  "upgrade_block_height": 13870350,
  "estimated_upgrade_time": "2023-11-02T14:34:22.177132",
  "upgrade_plan": {
    "height": 13870350,
    "binaries": [],
    "name": "v10",
    "upgraded_client_state": null
  },
  "version": "v10.1.0",
  "error": null
}

Notice v10.1.0. This was found in a pre-release tag:

image

We need to fix the find_best_semver_for_versions so it skips prerelease tags.