pyln: relax the grpcio/protobuf pins and regenerate the protos - #9490
Open
cdecker wants to merge 2 commits into
Open
pyln: relax the grpcio/protobuf pins and regenerate the protos#9490cdecker wants to merge 2 commits into
cdecker wants to merge 2 commits into
Conversation
The primitives.proto invocation called a bare `python`, which is not on PATH in the uv-managed environment, so `make protos` died with `make: python: No such file or directory` after regenerating node.proto. The rule declares primitives_pb2.pyi and node_pb2.pyi as outputs, but because the recipe aborted here they were never produced and so were never checked in, even though the package ships py.typed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZoAzNVajT8Udj7XYrurTa
grpcio, grpcio-tools and protobuf were hard-pinned to exact versions, which kept the tree off every newer release and made it the tighter side when compared against Greenlight. Relax them to floors and regenerate the stubs with the resulting toolchain (grpcio-tools 1.81.1). The floors have to move *up* rather than down: generated protobuf code asserts `runtime >= gencode` at import time, and the grpc stubs refuse to load below the grpcio-tools that produced them. So the new gencode pins the floors at protobuf 6.33.5 and grpcio 1.81.1; installing anything older now fails at import rather than at some later, stranger point. Comments next to each bound record that they must be bumped together with a regeneration. The comment claiming the protobuf pin matched .github/scripts/setup.sh was stale; that file carries no protobuf version. Also check in node_pb2.pyi and primitives_pb2.pyi, which the Makefile has always declared as outputs and which the package's py.typed advertises, but which were never generated before the preceding fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZoAzNVajT8Udj7XYrurTa
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.
Summary
grpcio,grpcio-toolsandprotobufwere hard-pinned to exact versions, which kept thetree off every newer release. Relax them to floors and regenerate the checked-in stubs with
the resulting toolchain.
Why the floors move up
This looks backwards for a change whose point is to relax pins, so it is worth spelling out.
Generated protobuf code asserts
runtime >= gencodeat import time, and the grpc stubsrefuse to load below the
grpcio-toolsthat produced them. Regenerating therefore raises theminimum, and the manifests have to say so or a fresh install resolves an older runtime and
dies on import rather than at some later, stranger point:
protobuf >= 6.33.5(was== 6.32.1)grpcio >= 1.81.1,grpcio-tools >= 1.81.1(were== 1.75.1)Comments next to each bound record that they must be bumped together with a regeneration.
The comment claiming the protobuf pin matched
.github/scripts/setup.shwas stale; that filecarries no protobuf version.
Makefile fix
contrib/pyln-grpc-proto/Makefileinvoked a barepythonfor theprimitives.protostep,which is not on
PATHin the uv-managed environment, somake protosdied withmake: python: No such file or directoryafter regeneratingnode.proto. The rule declaresprimitives_pb2.pyiandnode_pb2.pyias outputs, but because the recipe aborted there theywere never produced and so were never checked in — even though the package ships
py.typed.Both stub files are now generated and committed.
Testing
cargo check --allis clean.pyln.grpcimports and round-trips a message against theregenerated stubs on grpcio 1.83.1 / protobuf 6.33.6.
Note
cargo-udepsreports no unused dependencies anywhere in the workspace.Separately, and not addressed here: the tree carries a duplicate HTTP stack
(
reqwest 0.11pullinghyper 0.14,h2 0.3,http 0.2,rustls 0.21) entirely fromplugins/bip353-plugin. The obvious fix —bitcoin-payment-instructions0.7, which dropsreqwest for the much smaller
bitreq— is not viable: bitreq'sProxysupports onlyHTTP CONNECT, with no SOCKS support and no feature to add it. The plugin uses
socks5h://for Tor, where the
halso prevents DNS leaks, so taking that upgrade would silently breakTor for BIP-353 lookups. Worth revisiting if bitreq gains SOCKS.