From 207a963e0ae74a064ccf15b29effa10b72b1f06a Mon Sep 17 00:00:00 2001 From: Nicolas Ochem Date: Fri, 17 Nov 2023 20:37:18 -0800 Subject: [PATCH] when snapshots can't be found for version, pick a random version Right now there are no v18 snapshots on xtz-shots, so it's not possible to kickstart a node. This PR will pick the v17 snapshot instead. --- utils/config-generator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/config-generator.py b/utils/config-generator.py index 2b0648ba2..d17191673 100755 --- a/utils/config-generator.py +++ b/utils/config-generator.py @@ -772,11 +772,14 @@ def create_node_snapshot_config_json(history_mode): and s.get("chain_name") == network_name ] if octez_version: - matching_snapshots = [ + version_matching_snapshots = [ s for s in matching_snapshots if int(octez_version) == s.get("tezos_version").get("version").get("major") ] + if len(version_matching_snapshots): + # If we can't find snapshots of the right octez version, we just pick the most recent available. + matching_snapshots = version_matching_snapshots matching_snapshots = sorted(matching_snapshots, key=lambda s: s.get("block_height")) return matching_snapshots[-1] if len(matching_snapshots) else None