diff --git a/baking/pyproject.toml b/baking/pyproject.toml index 2da8bf8c8..fada2bf0d 100644 --- a/baking/pyproject.toml +++ b/baking/pyproject.toml @@ -14,7 +14,7 @@ description = "Package that provides systemd services that orchestrate other ser license = { text = "LicenseRef-MIT-OA" } requires-python = ">=3.8" readme = "README.md" -version = "v18.0-rc1" +version = "v18.0-rc1a" [tool.setuptools.packages.find] where= ["src"] diff --git a/baking/src/tezos_baking/tezos_setup_wizard.py b/baking/src/tezos_baking/tezos_setup_wizard.py index 9dabffb39..7a1753c46 100644 --- a/baking/src/tezos_baking/tezos_setup_wizard.py +++ b/baking/src/tezos_baking/tezos_setup_wizard.py @@ -172,6 +172,10 @@ def is_full_snapshot(snapshot_file, import_mode): return False +def get_node_version_hash(): + return get_proc_output("octez-node --version").stdout.decode("ascii").split()[0] + + # Steps network_query = Step( @@ -370,6 +374,9 @@ def get_snapshot_link(self): self.config["snapshot_url"] = None self.config["snapshot_block_hash"] = None + def hashes_comply(s1, s2): + return s1.startswith(s2) or s2.startswith(s1) + json_url = "https://xtz-shots.io/tezos-snapshots.json" try: snapshot_array = None @@ -377,6 +384,8 @@ def get_snapshot_link(self): snapshot_array = json.load(url)["data"] snapshot_array.sort(reverse=True, key=lambda x: x["block_height"]) + node_version_hash = get_node_version_hash() + snapshot_metadata = next( filter( lambda artifact: artifact["artifact_type"] == "tezos-snapshot" @@ -387,6 +396,10 @@ def get_snapshot_link(self): self.config["history_mode"] == "archive" and artifact["history_mode"] == "full" ) + ) + and hashes_comply( + artifact["tezos_version"]["commit_info"]["commit_hash"], + node_version_hash, ), iter(snapshot_array), ), diff --git a/docker/package/model.py b/docker/package/model.py index 4fd7b8c59..4c2b64de9 100644 --- a/docker/package/model.py +++ b/docker/package/model.py @@ -585,7 +585,7 @@ class TezosBakingServicesPackage(AbstractPackage): # native releases, so we append an extra letter to the version of # the package. # This should be reset to "" whenever the native version is bumped. - letter_version = "" + letter_version = "a" buildfile = "setup.py" diff --git a/meta.json b/meta.json index b79b0d8f0..793cf5632 100644 --- a/meta.json +++ b/meta.json @@ -1,5 +1,5 @@ { - "release": "1", + "release": "2", "maintainer": "Serokell ", "tezos_ref": "v18.0-rc1" }