clnvm: Make CLN version selection deterministic and bounded#732
Merged
Conversation
The test harness picked the default CLN node version with a lexicographic `max()` over the manifest tags (and a `[... "gl" ...][-1]` in the `paths` fixture). As soon as a new release lands in the shared manifest.json it becomes the default for the whole suite, even if the client and signer do not support it yet. That is how `v26.06gl1` started being used before support was built in. Make selection deterministic and explicitly bounded: - Add `version_sort_key()`/`version_base()` parsing the `vX.Y[.Z][glN]` tags into numeric, ordered keys. The `glN` suffix is a separate component, so ordering is numeric (not lexicographic) and the base version can be compared independently of the greenlight suffix. - Add `ClnVersionManager.supported_versions(lowest, highest)` and `latest_supported(lowest, highest)`, filtering to base versions within `[lowest, highest]` inclusive and dropping non-numbered tags (`main`). - Make the existing `latest()` deterministic too. - In the gl-testing fixtures, pin `LOWEST_SUPPORTED_VERSION` explicitly and derive `HIGHEST_SUPPORTED_VERSION` from `glclient.__version__`, i.e. what the signer (libhsmd) actually supports. The suffix is ignored when comparing, so the signer reporting `v25.12` matches `v25.12gl1` but excludes `v26.06gl1`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No functional change; empty commit to re-run the pipeline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The test harness picked the default CLN node version with a lexicographic
max()over the manifest tags (and a[... "gl" ...][-1]in thepathsfixture). As soon as a new release lands in the sharedmanifest.jsonit becomes the default for the entire suite — even if the client and signer don't support it yet.That is how
v26.06gl1started being used as the default node in CI (e.g. run 28375003252), before support was built into the client/signer — causing failures likeUnknown command 'decodepay'.Change
Make version selection deterministic and explicitly bounded:
version_sort_key()/version_base()that parsevX.Y[.Z][glN]tags into numeric, ordered keys. TheglNsuffix is a separate component, so ordering is numeric (not lexicographic, fixing the latentgl10 < gl2bug) and the base version can be compared independently of the greenlight suffix.ClnVersionManager.supported_versions(lowest, highest)andlatest_supported(lowest, highest), filtering to base versions within[lowest, highest]inclusive and dropping non-numbered tags (main).latest()deterministic too.LOWEST_SUPPORTED_VERSIONexplicitly and deriveHIGHEST_SUPPORTED_VERSIONfromglclient.__version__— i.e. whatever the signer (libhsmd) actually supports. The suffix is ignored when comparing, so the signer reportingv25.12matchesv25.12gl1but excludesv26.06gl1.When the signer is bumped to support a new release, that single
glclient.__version__constant moves and the suite picks it up automatically.Tests
Adds offline unit tests in
test_version_manager.pycovering the sort key, suffix-ignoring base comparison, filtering, and the "default isv25.12gl1, neverv26.06gl1" guarantee. Verified end-to-end against the live manifest: selection yieldsv25.12gl1and excludesv26.06gl1andmain.🤖 Generated with Claude Code