From ea2bdd5766cdeb2c5b19906b81b3e611d08be8b8 Mon Sep 17 00:00:00 2001 From: cdecker Date: Mon, 24 Aug 2026 22:31:49 +0200 Subject: [PATCH 1/6] gl-testing: Use uv run python in the testgrpc target The target invoked a bare `python`, which is not on PATH here, so regenerating the scheduler stubs failed with "No such file or directory". The sibling gl-client-py Makefile already goes through `uv run`; do the same. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q6i275r245hhRHT1PvVKrR --- libs/gl-testing/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gl-testing/Makefile b/libs/gl-testing/Makefile index 1f6b6d5d5..13edd6cba 100644 --- a/libs/gl-testing/Makefile +++ b/libs/gl-testing/Makefile @@ -23,7 +23,7 @@ check-testing-py: cd ${TESTINGDIR}; poetry install --with=dev; poetry run pytest tests -n 4 -vvv testgrpc: ${REPO_ROOT}/libs/proto/glclient/scheduler.proto - python -m grpc_tools.protoc ${TESTPROTOC_OPTS} glclient/scheduler.proto + uv run python -m grpc_tools.protoc ${TESTPROTOC_OPTS} glclient/scheduler.proto mv ${TESTINGDIR}/gltesting/glclient/scheduler_grpc.py ${TESTINGDIR}/gltesting/scheduler_grpc.py rm -rf ${TESTINGDIR}/gltesting/glclient From 3d290bf079eaff8c244bec7126136f62b9cbf1ef Mon Sep 17 00:00:00 2001 From: cdecker Date: Mon, 24 Aug 2026 22:42:17 +0200 Subject: [PATCH 2/6] proto: Add Scheduler.CheckLightningAvailability Reports whether the Lightning account backed by a node_id may be surfaced to the user, so an application that offers Lightning alongside other account types can gate it. Greenlight relays the question to its LSP, which answers based on whether it has previously granted the node a slot, or has capacity to grant one now. Unlike the other node-scoped calls this one is unauthenticated and takes the node_id explicitly. An application has to decide whether to offer Lightning *before* it creates a node, so at the time of asking there is no node-bound certificate to derive the node from. This commit only affects the protos and the generated files. Note that the regenerated Python stubs carry unrelated churn from grpcio-tools 1.83 (the committed ones came from 1.78); the dependency is specified as >=1.66 with no upper bound. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q6i275r245hhRHT1PvVKrR --- libs/gl-client-py/glclient/scheduler.proto | 37 ++++- libs/gl-client-py/glclient/scheduler_pb2.py | 124 ++++++++------- libs/gl-client-py/glclient/scheduler_pb2.pyi | 148 +++++++++++++++++- .../glclient/scheduler_pb2_grpc.py | 98 ++++++++++-- .../glclient/scheduler_pb2_grpc.pyi | 81 +++++++++- .../.resources/proto/glclient/scheduler.proto | 37 ++++- libs/gl-testing/gltesting/scheduler_grpc.py | 20 +++ libs/proto/glclient/scheduler.proto | 37 ++++- 8 files changed, 491 insertions(+), 91 deletions(-) diff --git a/libs/gl-client-py/glclient/scheduler.proto b/libs/gl-client-py/glclient/scheduler.proto index 3bb15f32e..73880cd8c 100644 --- a/libs/gl-client-py/glclient/scheduler.proto +++ b/libs/gl-client-py/glclient/scheduler.proto @@ -26,8 +26,10 @@ import "glclient/greenlight.proto"; // Users are authenticated using mTLS authentication. Applications are // provisioned with an anonymous keypair that is not bound to a node, // allowing access only to the unauthenticated endpoints -// `Scheduler.GetChallenge`, `Scheduler.Register` and -// `Scheduler.Recover`. This allows them to register or recover a +// `Scheduler.GetChallenge`, `Scheduler.Register`, +// `Scheduler.Recover` and +// `Scheduler.CheckLightningAvailability`. This allows them to +// register or recover a // node, but doesn't give access to the node itself. Upon registering // or recovering an account the user receives a keypair that is bound // to the specific node. Once the user receives their personal mTLS @@ -82,6 +84,25 @@ service Scheduler { // error being returned. rpc GetChallenge(ChallengeRequest) returns (ChallengeResponse) {} + // Reports whether the Lightning account backed by `node_id` may + // be surfaced to the user. This is a feature gate for downstream + // applications: greenlight relays the question to its Lightning + // Service Provider, which answers based on whether it has + // previously granted this node a slot (grants are sticky) or has + // the capacity to grant one now. + // + // Unlike the other node-scoped calls this one is deliberately + // available *before* registration, since an application has to + // decide whether to offer Lightning at all before it creates a + // node. There is therefore no mTLS identity to derive the node + // from, and the caller names the `node_id` it is asking about. + // + // The answer is advisory and may change: a node that is not + // available today may become available once the LSP has capacity + // again. Applications should treat an error as "unknown" rather + // than as a negative answer. + rpc CheckLightningAvailability(CheckLightningAvailabilityRequest) returns (CheckLightningAvailabilityResponse) {} + // Scheduling takes a previously registered node, locates a // free slot in greenlight's infrastructure and allocates it // to run the node. The node then goes through the startup @@ -248,6 +269,18 @@ enum ChallengeScope { RECOVER = 1; } +message CheckLightningAvailabilityRequest { + // 33 bytes node public key. The node need not be registered + // with greenlight yet. + bytes node_id = 1; +}; + +message CheckLightningAvailabilityResponse { + // Whether the Lightning account backed by this node may be + // surfaced to the user. + bool available = 1; +}; + message RegistrationRequest { // 33 bytes node public key. bytes node_id = 1; diff --git a/libs/gl-client-py/glclient/scheduler_pb2.py b/libs/gl-client-py/glclient/scheduler_pb2.py index 0acdb1461..8d4ec7e81 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.py +++ b/libs/gl-client-py/glclient/scheduler_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: glclient/scheduler.proto -# Protobuf Python Version: 6.31.1 +# Protobuf Python Version: 7.35.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,8 +11,8 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 6, - 31, + 7, + 35, 1, '', 'glclient/scheduler.proto' @@ -25,7 +25,7 @@ from glclient import greenlight_pb2 as glclient_dot_greenlight__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18glclient/scheduler.proto\x12\tscheduler\x1a\x19glclient/greenlight.proto\"9\n\x19\x41\x64\x64OutgoingWebhookRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03uri\x18\x02 \x01(\t\"8\n\x1a\x41\x64\x64OutgoingWebhookResponse\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0e\n\x06secret\x18\x02 \x01(\t\".\n\x1bListOutgoingWebhooksRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\"\"\n\x07Webhook\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0b\n\x03uri\x18\x02 \x01(\t\"M\n\x1cListOutgoingWebhooksResponse\x12-\n\x11outgoing_webhooks\x18\x01 \x03(\x0b\x32\x12.scheduler.Webhook\"=\n\x1d\x44\x65leteOutgoingWebhooksRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03ids\x18\x02 \x03(\x03\"I\n\"RotateOutgoingWebhookSecretRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x12\n\nwebhook_id\x18\x02 \x01(\x03\"\'\n\x15WebhookSecretResponse\x12\x0e\n\x06secret\x18\x01 \x01(\t\"M\n\x10\x43hallengeRequest\x12(\n\x05scope\x18\x01 \x01(\x0e\x32\x19.scheduler.ChallengeScope\x12\x0f\n\x07node_id\x18\x02 \x01(\x0c\"&\n\x11\x43hallengeResponse\x12\x11\n\tchallenge\x18\x01 \x01(\x0c\"\xea\x01\n\x13RegistrationRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x11\n\tbip32_key\x18\x02 \x01(\x0c\x12\x0f\n\x07network\x18\x04 \x01(\t\x12\x11\n\tchallenge\x18\x05 \x01(\x0c\x12\x11\n\tsignature\x18\x06 \x01(\x0c\x12\x14\n\x0csigner_proto\x18\x07 \x01(\t\x12\x10\n\x08init_msg\x18\x08 \x01(\x0c\x12\x0b\n\x03\x63sr\x18\t \x01(\x0c\x12\x13\n\x0binvite_code\x18\n \x01(\t\x12.\n\x0bstartupmsgs\x18\x03 \x03(\x0b\x32\x19.scheduler.StartupMessage\"\\\n\x14RegistrationResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\x12\x0c\n\x04rune\x18\x03 \x01(\t\x12\r\n\x05\x63reds\x18\x04 \x01(\x0c\"\"\n\x0fScheduleRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\"0\n\x0fNodeInfoRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0c\n\x04wait\x18\x02 \x01(\x08\"I\n\x10NodeInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x10\n\x08grpc_uri\x18\x02 \x01(\t\x12\x12\n\nsession_id\x18\x03 \x01(\x04\"U\n\x0fRecoveryRequest\x12\x11\n\tchallenge\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x0f\n\x07node_id\x18\x03 \x01(\x0c\x12\x0b\n\x03\x63sr\x18\t \x01(\x0c\"X\n\x10RecoveryResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\x12\x0c\n\x04rune\x18\x03 \x01(\t\x12\r\n\x05\x63reds\x18\x04 \x01(\x0c\"m\n\x0eUpgradeRequest\x12\x16\n\x0esigner_version\x18\x01 \x01(\t\x12\x13\n\x07initmsg\x18\x02 \x01(\x0c\x42\x02\x18\x01\x12.\n\x0bstartupmsgs\x18\x03 \x03(\x0b\x32\x19.scheduler.StartupMessage\"&\n\x0fUpgradeResponse\x12\x13\n\x0bold_version\x18\x01 \x01(\t\"3\n\x0eStartupMessage\x12\x0f\n\x07request\x18\x01 \x01(\x0c\x12\x10\n\x08response\x18\x02 \x01(\x0c\"\x18\n\x16ListInviteCodesRequest\"J\n\x17ListInviteCodesResponse\x12/\n\x10invite_code_list\x18\x01 \x03(\x0b\x32\x15.scheduler.InviteCode\"/\n\nInviteCode\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x13\n\x0bis_redeemed\x18\x02 \x01(\x08\"\x13\n\x11\x45xportNodeRequest\"!\n\x12\x45xportNodeResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"m\n\x0fSignerRejection\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.greenlight.HsmRequest\x12\x13\n\x0bgit_version\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\x0c\"s\n\x11PairDeviceRequest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0b\n\x03\x63sr\x18\x02 \x01(\x0c\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0crestrictions\x18\x05 \x01(\t\"m\n\x12PairDeviceResponse\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65vice_cert\x18\x02 \x01(\t\x12\x12\n\ndevice_key\x18\x03 \x01(\t\x12\x0c\n\x04rune\x18\x04 \x01(\t\x12\r\n\x05\x63reds\x18\x05 \x01(\x0c\"*\n\x15GetPairingDataRequest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\"x\n\x16GetPairingDataResponse\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0b\n\x03\x63sr\x18\x02 \x01(\x0c\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0crestrictions\x18\x05 \x01(\t\"\x93\x01\n\x15\x41pprovePairingRequest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\t\x12\x14\n\x0crestrictions\x18\x04 \x01(\t\x12\x0b\n\x03sig\x18\x05 \x01(\x0c\x12\x0e\n\x06pubkey\x18\x06 \x01(\x0c\x12\x0c\n\x04rune\x18\x07 \x01(\t\"J\n\x16\x41pprovePairingResponse\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x0c\x12\x0c\n\x04rune\x18\x03 \x01(\t\"k\n\rSignerRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12;\n\x0f\x61pprove_pairing\x18\x02 \x01(\x0b\x32 .scheduler.ApprovePairingRequestH\x00\x42\t\n\x07request\"\x92\x01\n\x0eSignerResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12\"\n\x05\x65mpty\x18\x02 \x01(\x0b\x32\x11.greenlight.EmptyH\x00\x12<\n\x0f\x61pprove_pairing\x18\x03 \x01(\x0b\x32!.scheduler.ApprovePairingResponseH\x00\x42\n\n\x08response*+\n\x0e\x43hallengeScope\x12\x0c\n\x08REGISTER\x10\x00\x12\x0b\n\x07RECOVER\x10\x01\x32\xd6\x08\n\tScheduler\x12M\n\x08Register\x12\x1e.scheduler.RegistrationRequest\x1a\x1f.scheduler.RegistrationResponse\"\x00\x12\x44\n\x07Recover\x12\x1a.scheduler.RecoveryRequest\x1a\x1b.scheduler.RecoveryResponse\"\x00\x12K\n\x0cGetChallenge\x12\x1b.scheduler.ChallengeRequest\x1a\x1c.scheduler.ChallengeResponse\"\x00\x12\x45\n\x08Schedule\x12\x1a.scheduler.ScheduleRequest\x1a\x1b.scheduler.NodeInfoResponse\"\x00\x12H\n\x0bGetNodeInfo\x12\x1a.scheduler.NodeInfoRequest\x1a\x1b.scheduler.NodeInfoResponse\"\x00\x12G\n\x0cMaybeUpgrade\x12\x19.scheduler.UpgradeRequest\x1a\x1a.scheduler.UpgradeResponse\"\x00\x12Z\n\x0fListInviteCodes\x12!.scheduler.ListInviteCodesRequest\x1a\".scheduler.ListInviteCodesResponse\"\x00\x12K\n\nExportNode\x12\x1c.scheduler.ExportNodeRequest\x1a\x1d.scheduler.ExportNodeResponse\"\x00\x12\x63\n\x12\x41\x64\x64OutgoingWebhook\x12$.scheduler.AddOutgoingWebhookRequest\x1a%.scheduler.AddOutgoingWebhookResponse\"\x00\x12i\n\x14ListOutgoingWebhooks\x12&.scheduler.ListOutgoingWebhooksRequest\x1a\'.scheduler.ListOutgoingWebhooksResponse\"\x00\x12O\n\x0e\x44\x65leteWebhooks\x12(.scheduler.DeleteOutgoingWebhooksRequest\x1a\x11.greenlight.Empty\"\x00\x12p\n\x1bRotateOutgoingWebhookSecret\x12-.scheduler.RotateOutgoingWebhookSecretRequest\x1a .scheduler.WebhookSecretResponse\"\x00\x12Q\n\x14SignerRequestsStream\x12\x19.scheduler.SignerResponse\x1a\x18.scheduler.SignerRequest\"\x00(\x01\x30\x01\x32Q\n\x05\x44\x65\x62ug\x12H\n\x15ReportSignerRejection\x12\x1a.scheduler.SignerRejection\x1a\x11.greenlight.Empty\"\x00\x32\xf8\x01\n\x07Pairing\x12K\n\nPairDevice\x12\x1c.scheduler.PairDeviceRequest\x1a\x1d.scheduler.PairDeviceResponse\"\x00\x12W\n\x0eGetPairingData\x12 .scheduler.GetPairingDataRequest\x1a!.scheduler.GetPairingDataResponse\"\x00\x12G\n\x0e\x41pprovePairing\x12 .scheduler.ApprovePairingRequest\x1a\x11.greenlight.Empty\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18glclient/scheduler.proto\x12\tscheduler\x1a\x19glclient/greenlight.proto\"9\n\x19\x41\x64\x64OutgoingWebhookRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03uri\x18\x02 \x01(\t\"8\n\x1a\x41\x64\x64OutgoingWebhookResponse\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0e\n\x06secret\x18\x02 \x01(\t\".\n\x1bListOutgoingWebhooksRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\"\"\n\x07Webhook\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0b\n\x03uri\x18\x02 \x01(\t\"M\n\x1cListOutgoingWebhooksResponse\x12-\n\x11outgoing_webhooks\x18\x01 \x03(\x0b\x32\x12.scheduler.Webhook\"=\n\x1d\x44\x65leteOutgoingWebhooksRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0b\n\x03ids\x18\x02 \x03(\x03\"I\n\"RotateOutgoingWebhookSecretRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x12\n\nwebhook_id\x18\x02 \x01(\x03\"\'\n\x15WebhookSecretResponse\x12\x0e\n\x06secret\x18\x01 \x01(\t\"M\n\x10\x43hallengeRequest\x12(\n\x05scope\x18\x01 \x01(\x0e\x32\x19.scheduler.ChallengeScope\x12\x0f\n\x07node_id\x18\x02 \x01(\x0c\"&\n\x11\x43hallengeResponse\x12\x11\n\tchallenge\x18\x01 \x01(\x0c\"4\n!CheckLightningAvailabilityRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\"7\n\"CheckLightningAvailabilityResponse\x12\x11\n\tavailable\x18\x01 \x01(\x08\"\xea\x01\n\x13RegistrationRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x11\n\tbip32_key\x18\x02 \x01(\x0c\x12\x0f\n\x07network\x18\x04 \x01(\t\x12\x11\n\tchallenge\x18\x05 \x01(\x0c\x12\x11\n\tsignature\x18\x06 \x01(\x0c\x12\x14\n\x0csigner_proto\x18\x07 \x01(\t\x12\x10\n\x08init_msg\x18\x08 \x01(\x0c\x12\x0b\n\x03\x63sr\x18\t \x01(\x0c\x12\x13\n\x0binvite_code\x18\n \x01(\t\x12.\n\x0bstartupmsgs\x18\x03 \x03(\x0b\x32\x19.scheduler.StartupMessage\"\\\n\x14RegistrationResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\x12\x0c\n\x04rune\x18\x03 \x01(\t\x12\r\n\x05\x63reds\x18\x04 \x01(\x0c\"\"\n\x0fScheduleRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\"0\n\x0fNodeInfoRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0c\n\x04wait\x18\x02 \x01(\x08\"I\n\x10NodeInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x10\n\x08grpc_uri\x18\x02 \x01(\t\x12\x12\n\nsession_id\x18\x03 \x01(\x04\"U\n\x0fRecoveryRequest\x12\x11\n\tchallenge\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\x0c\x12\x0f\n\x07node_id\x18\x03 \x01(\x0c\x12\x0b\n\x03\x63sr\x18\t \x01(\x0c\"X\n\x10RecoveryResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\x12\x0c\n\x04rune\x18\x03 \x01(\t\x12\r\n\x05\x63reds\x18\x04 \x01(\x0c\"m\n\x0eUpgradeRequest\x12\x16\n\x0esigner_version\x18\x01 \x01(\t\x12\x13\n\x07initmsg\x18\x02 \x01(\x0c\x42\x02\x18\x01\x12.\n\x0bstartupmsgs\x18\x03 \x03(\x0b\x32\x19.scheduler.StartupMessage\"&\n\x0fUpgradeResponse\x12\x13\n\x0bold_version\x18\x01 \x01(\t\"3\n\x0eStartupMessage\x12\x0f\n\x07request\x18\x01 \x01(\x0c\x12\x10\n\x08response\x18\x02 \x01(\x0c\"\x18\n\x16ListInviteCodesRequest\"J\n\x17ListInviteCodesResponse\x12/\n\x10invite_code_list\x18\x01 \x03(\x0b\x32\x15.scheduler.InviteCode\"/\n\nInviteCode\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x13\n\x0bis_redeemed\x18\x02 \x01(\x08\"\x13\n\x11\x45xportNodeRequest\"!\n\x12\x45xportNodeResponse\x12\x0b\n\x03url\x18\x01 \x01(\t\"m\n\x0fSignerRejection\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.greenlight.HsmRequest\x12\x13\n\x0bgit_version\x18\x03 \x01(\t\x12\x0f\n\x07node_id\x18\x04 \x01(\x0c\"s\n\x11PairDeviceRequest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0b\n\x03\x63sr\x18\x02 \x01(\x0c\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0crestrictions\x18\x05 \x01(\t\"m\n\x12PairDeviceResponse\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65vice_cert\x18\x02 \x01(\t\x12\x12\n\ndevice_key\x18\x03 \x01(\t\x12\x0c\n\x04rune\x18\x04 \x01(\t\x12\r\n\x05\x63reds\x18\x05 \x01(\x0c\"*\n\x15GetPairingDataRequest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\"x\n\x16GetPairingDataResponse\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0b\n\x03\x63sr\x18\x02 \x01(\x0c\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0crestrictions\x18\x05 \x01(\t\"\x93\x01\n\x15\x41pprovePairingRequest\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x11\n\ttimestamp\x18\x02 \x01(\x04\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\t\x12\x14\n\x0crestrictions\x18\x04 \x01(\t\x12\x0b\n\x03sig\x18\x05 \x01(\x0c\x12\x0e\n\x06pubkey\x18\x06 \x01(\x0c\x12\x0c\n\x04rune\x18\x07 \x01(\t\"J\n\x16\x41pprovePairingResponse\x12\x11\n\tdevice_id\x18\x01 \x01(\t\x12\x0f\n\x07node_id\x18\x02 \x01(\x0c\x12\x0c\n\x04rune\x18\x03 \x01(\t\"k\n\rSignerRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12;\n\x0f\x61pprove_pairing\x18\x02 \x01(\x0b\x32 .scheduler.ApprovePairingRequestH\x00\x42\t\n\x07request\"\x92\x01\n\x0eSignerResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12\"\n\x05\x65mpty\x18\x02 \x01(\x0b\x32\x11.greenlight.EmptyH\x00\x12<\n\x0f\x61pprove_pairing\x18\x03 \x01(\x0b\x32!.scheduler.ApprovePairingResponseH\x00\x42\n\n\x08response*+\n\x0e\x43hallengeScope\x12\x0c\n\x08REGISTER\x10\x00\x12\x0b\n\x07RECOVER\x10\x01\x32\xd3\t\n\tScheduler\x12M\n\x08Register\x12\x1e.scheduler.RegistrationRequest\x1a\x1f.scheduler.RegistrationResponse\"\x00\x12\x44\n\x07Recover\x12\x1a.scheduler.RecoveryRequest\x1a\x1b.scheduler.RecoveryResponse\"\x00\x12K\n\x0cGetChallenge\x12\x1b.scheduler.ChallengeRequest\x1a\x1c.scheduler.ChallengeResponse\"\x00\x12{\n\x1a\x43heckLightningAvailability\x12,.scheduler.CheckLightningAvailabilityRequest\x1a-.scheduler.CheckLightningAvailabilityResponse\"\x00\x12\x45\n\x08Schedule\x12\x1a.scheduler.ScheduleRequest\x1a\x1b.scheduler.NodeInfoResponse\"\x00\x12H\n\x0bGetNodeInfo\x12\x1a.scheduler.NodeInfoRequest\x1a\x1b.scheduler.NodeInfoResponse\"\x00\x12G\n\x0cMaybeUpgrade\x12\x19.scheduler.UpgradeRequest\x1a\x1a.scheduler.UpgradeResponse\"\x00\x12Z\n\x0fListInviteCodes\x12!.scheduler.ListInviteCodesRequest\x1a\".scheduler.ListInviteCodesResponse\"\x00\x12K\n\nExportNode\x12\x1c.scheduler.ExportNodeRequest\x1a\x1d.scheduler.ExportNodeResponse\"\x00\x12\x63\n\x12\x41\x64\x64OutgoingWebhook\x12$.scheduler.AddOutgoingWebhookRequest\x1a%.scheduler.AddOutgoingWebhookResponse\"\x00\x12i\n\x14ListOutgoingWebhooks\x12&.scheduler.ListOutgoingWebhooksRequest\x1a\'.scheduler.ListOutgoingWebhooksResponse\"\x00\x12O\n\x0e\x44\x65leteWebhooks\x12(.scheduler.DeleteOutgoingWebhooksRequest\x1a\x11.greenlight.Empty\"\x00\x12p\n\x1bRotateOutgoingWebhookSecret\x12-.scheduler.RotateOutgoingWebhookSecretRequest\x1a .scheduler.WebhookSecretResponse\"\x00\x12Q\n\x14SignerRequestsStream\x12\x19.scheduler.SignerResponse\x1a\x18.scheduler.SignerRequest\"\x00(\x01\x30\x01\x32Q\n\x05\x44\x65\x62ug\x12H\n\x15ReportSignerRejection\x12\x1a.scheduler.SignerRejection\x1a\x11.greenlight.Empty\"\x00\x32\xf8\x01\n\x07Pairing\x12K\n\nPairDevice\x12\x1c.scheduler.PairDeviceRequest\x1a\x1d.scheduler.PairDeviceResponse\"\x00\x12W\n\x0eGetPairingData\x12 .scheduler.GetPairingDataRequest\x1a!.scheduler.GetPairingDataResponse\"\x00\x12G\n\x0e\x41pprovePairing\x12 .scheduler.ApprovePairingRequest\x1a\x11.greenlight.Empty\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -34,8 +34,8 @@ DESCRIPTOR._loaded_options = None _globals['_UPGRADEREQUEST'].fields_by_name['initmsg']._loaded_options = None _globals['_UPGRADEREQUEST'].fields_by_name['initmsg']._serialized_options = b'\030\001' - _globals['_CHALLENGESCOPE']._serialized_start=2713 - _globals['_CHALLENGESCOPE']._serialized_end=2756 + _globals['_CHALLENGESCOPE']._serialized_start=2824 + _globals['_CHALLENGESCOPE']._serialized_end=2867 _globals['_ADDOUTGOINGWEBHOOKREQUEST']._serialized_start=66 _globals['_ADDOUTGOINGWEBHOOKREQUEST']._serialized_end=123 _globals['_ADDOUTGOINGWEBHOOKRESPONSE']._serialized_start=125 @@ -56,58 +56,62 @@ _globals['_CHALLENGEREQUEST']._serialized_end=602 _globals['_CHALLENGERESPONSE']._serialized_start=604 _globals['_CHALLENGERESPONSE']._serialized_end=642 - _globals['_REGISTRATIONREQUEST']._serialized_start=645 - _globals['_REGISTRATIONREQUEST']._serialized_end=879 - _globals['_REGISTRATIONRESPONSE']._serialized_start=881 - _globals['_REGISTRATIONRESPONSE']._serialized_end=973 - _globals['_SCHEDULEREQUEST']._serialized_start=975 - _globals['_SCHEDULEREQUEST']._serialized_end=1009 - _globals['_NODEINFOREQUEST']._serialized_start=1011 - _globals['_NODEINFOREQUEST']._serialized_end=1059 - _globals['_NODEINFORESPONSE']._serialized_start=1061 - _globals['_NODEINFORESPONSE']._serialized_end=1134 - _globals['_RECOVERYREQUEST']._serialized_start=1136 - _globals['_RECOVERYREQUEST']._serialized_end=1221 - _globals['_RECOVERYRESPONSE']._serialized_start=1223 - _globals['_RECOVERYRESPONSE']._serialized_end=1311 - _globals['_UPGRADEREQUEST']._serialized_start=1313 - _globals['_UPGRADEREQUEST']._serialized_end=1422 - _globals['_UPGRADERESPONSE']._serialized_start=1424 - _globals['_UPGRADERESPONSE']._serialized_end=1462 - _globals['_STARTUPMESSAGE']._serialized_start=1464 - _globals['_STARTUPMESSAGE']._serialized_end=1515 - _globals['_LISTINVITECODESREQUEST']._serialized_start=1517 - _globals['_LISTINVITECODESREQUEST']._serialized_end=1541 - _globals['_LISTINVITECODESRESPONSE']._serialized_start=1543 - _globals['_LISTINVITECODESRESPONSE']._serialized_end=1617 - _globals['_INVITECODE']._serialized_start=1619 - _globals['_INVITECODE']._serialized_end=1666 - _globals['_EXPORTNODEREQUEST']._serialized_start=1668 - _globals['_EXPORTNODEREQUEST']._serialized_end=1687 - _globals['_EXPORTNODERESPONSE']._serialized_start=1689 - _globals['_EXPORTNODERESPONSE']._serialized_end=1722 - _globals['_SIGNERREJECTION']._serialized_start=1724 - _globals['_SIGNERREJECTION']._serialized_end=1833 - _globals['_PAIRDEVICEREQUEST']._serialized_start=1835 - _globals['_PAIRDEVICEREQUEST']._serialized_end=1950 - _globals['_PAIRDEVICERESPONSE']._serialized_start=1952 - _globals['_PAIRDEVICERESPONSE']._serialized_end=2061 - _globals['_GETPAIRINGDATAREQUEST']._serialized_start=2063 - _globals['_GETPAIRINGDATAREQUEST']._serialized_end=2105 - _globals['_GETPAIRINGDATARESPONSE']._serialized_start=2107 - _globals['_GETPAIRINGDATARESPONSE']._serialized_end=2227 - _globals['_APPROVEPAIRINGREQUEST']._serialized_start=2230 - _globals['_APPROVEPAIRINGREQUEST']._serialized_end=2377 - _globals['_APPROVEPAIRINGRESPONSE']._serialized_start=2379 - _globals['_APPROVEPAIRINGRESPONSE']._serialized_end=2453 - _globals['_SIGNERREQUEST']._serialized_start=2455 - _globals['_SIGNERREQUEST']._serialized_end=2562 - _globals['_SIGNERRESPONSE']._serialized_start=2565 - _globals['_SIGNERRESPONSE']._serialized_end=2711 - _globals['_SCHEDULER']._serialized_start=2759 - _globals['_SCHEDULER']._serialized_end=3869 - _globals['_DEBUG']._serialized_start=3871 - _globals['_DEBUG']._serialized_end=3952 - _globals['_PAIRING']._serialized_start=3955 - _globals['_PAIRING']._serialized_end=4203 + _globals['_CHECKLIGHTNINGAVAILABILITYREQUEST']._serialized_start=644 + _globals['_CHECKLIGHTNINGAVAILABILITYREQUEST']._serialized_end=696 + _globals['_CHECKLIGHTNINGAVAILABILITYRESPONSE']._serialized_start=698 + _globals['_CHECKLIGHTNINGAVAILABILITYRESPONSE']._serialized_end=753 + _globals['_REGISTRATIONREQUEST']._serialized_start=756 + _globals['_REGISTRATIONREQUEST']._serialized_end=990 + _globals['_REGISTRATIONRESPONSE']._serialized_start=992 + _globals['_REGISTRATIONRESPONSE']._serialized_end=1084 + _globals['_SCHEDULEREQUEST']._serialized_start=1086 + _globals['_SCHEDULEREQUEST']._serialized_end=1120 + _globals['_NODEINFOREQUEST']._serialized_start=1122 + _globals['_NODEINFOREQUEST']._serialized_end=1170 + _globals['_NODEINFORESPONSE']._serialized_start=1172 + _globals['_NODEINFORESPONSE']._serialized_end=1245 + _globals['_RECOVERYREQUEST']._serialized_start=1247 + _globals['_RECOVERYREQUEST']._serialized_end=1332 + _globals['_RECOVERYRESPONSE']._serialized_start=1334 + _globals['_RECOVERYRESPONSE']._serialized_end=1422 + _globals['_UPGRADEREQUEST']._serialized_start=1424 + _globals['_UPGRADEREQUEST']._serialized_end=1533 + _globals['_UPGRADERESPONSE']._serialized_start=1535 + _globals['_UPGRADERESPONSE']._serialized_end=1573 + _globals['_STARTUPMESSAGE']._serialized_start=1575 + _globals['_STARTUPMESSAGE']._serialized_end=1626 + _globals['_LISTINVITECODESREQUEST']._serialized_start=1628 + _globals['_LISTINVITECODESREQUEST']._serialized_end=1652 + _globals['_LISTINVITECODESRESPONSE']._serialized_start=1654 + _globals['_LISTINVITECODESRESPONSE']._serialized_end=1728 + _globals['_INVITECODE']._serialized_start=1730 + _globals['_INVITECODE']._serialized_end=1777 + _globals['_EXPORTNODEREQUEST']._serialized_start=1779 + _globals['_EXPORTNODEREQUEST']._serialized_end=1798 + _globals['_EXPORTNODERESPONSE']._serialized_start=1800 + _globals['_EXPORTNODERESPONSE']._serialized_end=1833 + _globals['_SIGNERREJECTION']._serialized_start=1835 + _globals['_SIGNERREJECTION']._serialized_end=1944 + _globals['_PAIRDEVICEREQUEST']._serialized_start=1946 + _globals['_PAIRDEVICEREQUEST']._serialized_end=2061 + _globals['_PAIRDEVICERESPONSE']._serialized_start=2063 + _globals['_PAIRDEVICERESPONSE']._serialized_end=2172 + _globals['_GETPAIRINGDATAREQUEST']._serialized_start=2174 + _globals['_GETPAIRINGDATAREQUEST']._serialized_end=2216 + _globals['_GETPAIRINGDATARESPONSE']._serialized_start=2218 + _globals['_GETPAIRINGDATARESPONSE']._serialized_end=2338 + _globals['_APPROVEPAIRINGREQUEST']._serialized_start=2341 + _globals['_APPROVEPAIRINGREQUEST']._serialized_end=2488 + _globals['_APPROVEPAIRINGRESPONSE']._serialized_start=2490 + _globals['_APPROVEPAIRINGRESPONSE']._serialized_end=2564 + _globals['_SIGNERREQUEST']._serialized_start=2566 + _globals['_SIGNERREQUEST']._serialized_end=2673 + _globals['_SIGNERRESPONSE']._serialized_start=2676 + _globals['_SIGNERRESPONSE']._serialized_end=2822 + _globals['_SCHEDULER']._serialized_start=2870 + _globals['_SCHEDULER']._serialized_end=4105 + _globals['_DEBUG']._serialized_start=4107 + _globals['_DEBUG']._serialized_end=4188 + _globals['_PAIRING']._serialized_start=4191 + _globals['_PAIRING']._serialized_end=4439 # @@protoc_insertion_point(module_scope) diff --git a/libs/gl-client-py/glclient/scheduler_pb2.pyi b/libs/gl-client-py/glclient/scheduler_pb2.pyi index 507b0ec95..44c7cd91c 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.pyi +++ b/libs/gl-client-py/glclient/scheduler_pb2.pyi @@ -13,10 +13,10 @@ import builtins as _builtins import sys import typing as _typing -if sys.version_info >= (3, 10): - from typing import TypeAlias as _TypeAlias +if sys.version_info >= (3, 11): + from typing import TypeAlias as _TypeAlias, Never as _Never else: - from typing_extensions import TypeAlias as _TypeAlias + from typing_extensions import TypeAlias as _TypeAlias, Never as _Never if sys.version_info >= (3, 13): from warnings import deprecated as _deprecated @@ -55,8 +55,11 @@ class AddOutgoingWebhookRequest(_message.Message): node_id: _builtins.bytes = ..., uri: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "uri", b"uri"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___AddOutgoingWebhookRequest: _TypeAlias = AddOutgoingWebhookRequest # noqa: Y015 @@ -74,8 +77,11 @@ class AddOutgoingWebhookResponse(_message.Message): id: _builtins.int = ..., secret: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["id", b"id", "secret", b"secret"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___AddOutgoingWebhookResponse: _TypeAlias = AddOutgoingWebhookResponse # noqa: Y015 @@ -90,8 +96,11 @@ class ListOutgoingWebhooksRequest(_message.Message): *, node_id: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListOutgoingWebhooksRequest: _TypeAlias = ListOutgoingWebhooksRequest # noqa: Y015 @@ -109,8 +118,11 @@ class Webhook(_message.Message): id: _builtins.int = ..., uri: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["id", b"id", "uri", b"uri"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___Webhook: _TypeAlias = Webhook # noqa: Y015 @@ -126,8 +138,11 @@ class ListOutgoingWebhooksResponse(_message.Message): *, outgoing_webhooks: _abc.Iterable[Global___Webhook] | None = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["outgoing_webhooks", b"outgoing_webhooks"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListOutgoingWebhooksResponse: _TypeAlias = ListOutgoingWebhooksResponse # noqa: Y015 @@ -146,8 +161,11 @@ class DeleteOutgoingWebhooksRequest(_message.Message): node_id: _builtins.bytes = ..., ids: _abc.Iterable[_builtins.int] | None = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["ids", b"ids", "node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___DeleteOutgoingWebhooksRequest: _TypeAlias = DeleteOutgoingWebhooksRequest # noqa: Y015 @@ -165,8 +183,11 @@ class RotateOutgoingWebhookSecretRequest(_message.Message): node_id: _builtins.bytes = ..., webhook_id: _builtins.int = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "webhook_id", b"webhook_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RotateOutgoingWebhookSecretRequest: _TypeAlias = RotateOutgoingWebhookSecretRequest # noqa: Y015 @@ -181,8 +202,11 @@ class WebhookSecretResponse(_message.Message): *, secret: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["secret", b"secret"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___WebhookSecretResponse: _TypeAlias = WebhookSecretResponse # noqa: Y015 @@ -200,8 +224,11 @@ class ChallengeRequest(_message.Message): scope: Global___ChallengeScope.ValueType = ..., node_id: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "scope", b"scope"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ChallengeRequest: _TypeAlias = ChallengeRequest # noqa: Y015 @@ -216,11 +243,58 @@ class ChallengeResponse(_message.Message): *, challenge: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["challenge", b"challenge"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ChallengeResponse: _TypeAlias = ChallengeResponse # noqa: Y015 +@_typing.final +class CheckLightningAvailabilityRequest(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + NODE_ID_FIELD_NUMBER: _builtins.int + node_id: _builtins.bytes + """33 bytes node public key. The node need not be registered + with greenlight yet. + """ + def __init__( + self, + *, + node_id: _builtins.bytes = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___CheckLightningAvailabilityRequest: _TypeAlias = CheckLightningAvailabilityRequest # noqa: Y015 + +@_typing.final +class CheckLightningAvailabilityResponse(_message.Message): + DESCRIPTOR: _descriptor.Descriptor + + AVAILABLE_FIELD_NUMBER: _builtins.int + available: _builtins.bool + """Whether the Lightning account backed by this node may be + surfaced to the user. + """ + def __init__( + self, + *, + available: _builtins.bool = ..., + ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _typing.Literal["available", b"available"] # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... + +Global___CheckLightningAvailabilityResponse: _TypeAlias = CheckLightningAvailabilityResponse # noqa: Y015 + @_typing.final class RegistrationRequest(_message.Message): DESCRIPTOR: _descriptor.Descriptor @@ -297,8 +371,11 @@ class RegistrationRequest(_message.Message): invite_code: _builtins.str = ..., startupmsgs: _abc.Iterable[Global___StartupMessage] | None = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["bip32_key", b"bip32_key", "challenge", b"challenge", "csr", b"csr", "init_msg", b"init_msg", "invite_code", b"invite_code", "network", b"network", "node_id", b"node_id", "signature", b"signature", "signer_proto", b"signer_proto", "startupmsgs", b"startupmsgs"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RegistrationRequest: _TypeAlias = RegistrationRequest # noqa: Y015 @@ -337,8 +414,11 @@ class RegistrationResponse(_message.Message): rune: _builtins.str = ..., creds: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["creds", b"creds", "device_cert", b"device_cert", "device_key", b"device_key", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RegistrationResponse: _TypeAlias = RegistrationResponse # noqa: Y015 @@ -360,8 +440,11 @@ class ScheduleRequest(_message.Message): *, node_id: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ScheduleRequest: _TypeAlias = ScheduleRequest # noqa: Y015 @@ -385,8 +468,11 @@ class NodeInfoRequest(_message.Message): node_id: _builtins.bytes = ..., wait: _builtins.bool = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "wait", b"wait"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___NodeInfoRequest: _TypeAlias = NodeInfoRequest # noqa: Y015 @@ -407,8 +493,11 @@ class NodeInfoResponse(_message.Message): grpc_uri: _builtins.str = ..., session_id: _builtins.int = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["grpc_uri", b"grpc_uri", "node_id", b"node_id", "session_id", b"session_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___NodeInfoResponse: _TypeAlias = NodeInfoResponse # noqa: Y015 @@ -436,8 +525,11 @@ class RecoveryRequest(_message.Message): node_id: _builtins.bytes = ..., csr: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["challenge", b"challenge", "csr", b"csr", "node_id", b"node_id", "signature", b"signature"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RecoveryRequest: _TypeAlias = RecoveryRequest # noqa: Y015 @@ -469,8 +561,11 @@ class RecoveryResponse(_message.Message): rune: _builtins.str = ..., creds: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["creds", b"creds", "device_cert", b"device_cert", "device_key", b"device_key", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RecoveryResponse: _TypeAlias = RecoveryResponse # noqa: Y015 @@ -512,8 +607,11 @@ class UpgradeRequest(_message.Message): initmsg: _builtins.bytes = ..., startupmsgs: _abc.Iterable[Global___StartupMessage] | None = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["initmsg", b"initmsg", "signer_version", b"signer_version", "startupmsgs", b"startupmsgs"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___UpgradeRequest: _TypeAlias = UpgradeRequest # noqa: Y015 @@ -531,8 +629,11 @@ class UpgradeResponse(_message.Message): *, old_version: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["old_version", b"old_version"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___UpgradeResponse: _TypeAlias = UpgradeResponse # noqa: Y015 @@ -557,8 +658,11 @@ class StartupMessage(_message.Message): request: _builtins.bytes = ..., response: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["request", b"request", "response", b"response"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___StartupMessage: _TypeAlias = StartupMessage # noqa: Y015 @@ -569,6 +673,11 @@ class ListInviteCodesRequest(_message.Message): def __init__( self, ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListInviteCodesRequest: _TypeAlias = ListInviteCodesRequest # noqa: Y015 @@ -584,8 +693,11 @@ class ListInviteCodesResponse(_message.Message): *, invite_code_list: _abc.Iterable[Global___InviteCode] | None = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["invite_code_list", b"invite_code_list"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListInviteCodesResponse: _TypeAlias = ListInviteCodesResponse # noqa: Y015 @@ -603,8 +715,11 @@ class InviteCode(_message.Message): code: _builtins.str = ..., is_redeemed: _builtins.bool = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["code", b"code", "is_redeemed", b"is_redeemed"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___InviteCode: _TypeAlias = InviteCode # noqa: Y015 @@ -619,6 +734,11 @@ class ExportNodeRequest(_message.Message): def __init__( self, ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... + _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 + def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ExportNodeRequest: _TypeAlias = ExportNodeRequest # noqa: Y015 @@ -634,8 +754,11 @@ class ExportNodeResponse(_message.Message): *, url: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["url", b"url"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ExportNodeResponse: _TypeAlias = ExportNodeResponse # noqa: Y015 @@ -665,6 +788,7 @@ class SignerRejection(_message.Message): def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["git_version", b"git_version", "msg", b"msg", "node_id", b"node_id", "request", b"request"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___SignerRejection: _TypeAlias = SignerRejection # noqa: Y015 @@ -706,8 +830,11 @@ class PairDeviceRequest(_message.Message): description: _builtins.str = ..., restrictions: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["csr", b"csr", "description", b"description", "device_id", b"device_id", "device_name", b"device_name", "restrictions", b"restrictions"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___PairDeviceRequest: _TypeAlias = PairDeviceRequest # noqa: Y015 @@ -751,8 +878,11 @@ class PairDeviceResponse(_message.Message): rune: _builtins.str = ..., creds: _builtins.bytes = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["creds", b"creds", "device_cert", b"device_cert", "device_id", b"device_id", "device_key", b"device_key", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___PairDeviceResponse: _TypeAlias = PairDeviceResponse # noqa: Y015 @@ -768,8 +898,11 @@ class GetPairingDataRequest(_message.Message): *, device_id: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["device_id", b"device_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___GetPairingDataRequest: _TypeAlias = GetPairingDataRequest # noqa: Y015 @@ -810,8 +943,11 @@ class GetPairingDataResponse(_message.Message): description: _builtins.str = ..., restrictions: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["csr", b"csr", "description", b"description", "device_id", b"device_id", "device_name", b"device_name", "restrictions", b"restrictions"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___GetPairingDataResponse: _TypeAlias = GetPairingDataResponse # noqa: Y015 @@ -859,8 +995,11 @@ class ApprovePairingRequest(_message.Message): pubkey: _builtins.bytes = ..., rune: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["device_id", b"device_id", "device_name", b"device_name", "pubkey", b"pubkey", "restrictions", b"restrictions", "rune", b"rune", "sig", b"sig", "timestamp", b"timestamp"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ApprovePairingRequest: _TypeAlias = ApprovePairingRequest # noqa: Y015 @@ -881,8 +1020,11 @@ class ApprovePairingResponse(_message.Message): node_id: _builtins.bytes = ..., rune: _builtins.str = ..., ) -> None: ... + _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 + def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["device_id", b"device_id", "node_id", b"node_id", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... + def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ApprovePairingResponse: _TypeAlias = ApprovePairingResponse # noqa: Y015 diff --git a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py index 97a4bd5bd..f5a0172a9 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py +++ b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py @@ -6,7 +6,7 @@ from glclient import greenlight_pb2 as glclient_dot_greenlight__pb2 from glclient import scheduler_pb2 as glclient_dot_scheduler__pb2 -GRPC_GENERATED_VERSION = '1.78.0' +GRPC_GENERATED_VERSION = '1.83.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -26,7 +26,7 @@ ) -class SchedulerStub(object): +class SchedulerStub: """The scheduler service is the endpoint which allows users to register a new node with greenlight, recover access to an existing node if the owner lost its credentials, schedule the node to be run @@ -50,8 +50,10 @@ class SchedulerStub(object): Users are authenticated using mTLS authentication. Applications are provisioned with an anonymous keypair that is not bound to a node, allowing access only to the unauthenticated endpoints - `Scheduler.GetChallenge`, `Scheduler.Register` and - `Scheduler.Recover`. This allows them to register or recover a + `Scheduler.GetChallenge`, `Scheduler.Register`, + `Scheduler.Recover` and + `Scheduler.CheckLightningAvailability`. This allows them to + register or recover a node, but doesn't give access to the node itself. Upon registering or recovering an account the user receives a keypair that is bound to the specific node. Once the user receives their personal mTLS @@ -83,6 +85,11 @@ def __init__(self, channel): request_serializer=glclient_dot_scheduler__pb2.ChallengeRequest.SerializeToString, response_deserializer=glclient_dot_scheduler__pb2.ChallengeResponse.FromString, _registered_method=True) + self.CheckLightningAvailability = channel.unary_unary( + '/scheduler.Scheduler/CheckLightningAvailability', + request_serializer=glclient_dot_scheduler__pb2.CheckLightningAvailabilityRequest.SerializeToString, + response_deserializer=glclient_dot_scheduler__pb2.CheckLightningAvailabilityResponse.FromString, + _registered_method=True) self.Schedule = channel.unary_unary( '/scheduler.Scheduler/Schedule', request_serializer=glclient_dot_scheduler__pb2.ScheduleRequest.SerializeToString, @@ -135,7 +142,7 @@ def __init__(self, channel): _registered_method=True) -class SchedulerServicer(object): +class SchedulerServicer: """The scheduler service is the endpoint which allows users to register a new node with greenlight, recover access to an existing node if the owner lost its credentials, schedule the node to be run @@ -159,8 +166,10 @@ class SchedulerServicer(object): Users are authenticated using mTLS authentication. Applications are provisioned with an anonymous keypair that is not bound to a node, allowing access only to the unauthenticated endpoints - `Scheduler.GetChallenge`, `Scheduler.Register` and - `Scheduler.Recover`. This allows them to register or recover a + `Scheduler.GetChallenge`, `Scheduler.Register`, + `Scheduler.Recover` and + `Scheduler.CheckLightningAvailability`. This allows them to + register or recover a node, but doesn't give access to the node itself. Upon registering or recovering an account the user receives a keypair that is bound to the specific node. Once the user receives their personal mTLS @@ -228,6 +237,29 @@ def GetChallenge(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def CheckLightningAvailability(self, request, context): + """Reports whether the Lightning account backed by `node_id` may + be surfaced to the user. This is a feature gate for downstream + applications: greenlight relays the question to its Lightning + Service Provider, which answers based on whether it has + previously granted this node a slot (grants are sticky) or has + the capacity to grant one now. + + Unlike the other node-scoped calls this one is deliberately + available *before* registration, since an application has to + decide whether to offer Lightning at all before it creates a + node. There is therefore no mTLS identity to derive the node + from, and the caller names the `node_id` it is asking about. + + The answer is advisory and may change: a node that is not + available today may become available once the LSP has capacity + again. Applications should treat an error as "unknown" rather + than as a negative answer. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def Schedule(self, request, context): """Scheduling takes a previously registered node, locates a free slot in greenlight's infrastructure and allocates it @@ -369,6 +401,11 @@ def add_SchedulerServicer_to_server(servicer, server): request_deserializer=glclient_dot_scheduler__pb2.ChallengeRequest.FromString, response_serializer=glclient_dot_scheduler__pb2.ChallengeResponse.SerializeToString, ), + 'CheckLightningAvailability': grpc.unary_unary_rpc_method_handler( + servicer.CheckLightningAvailability, + request_deserializer=glclient_dot_scheduler__pb2.CheckLightningAvailabilityRequest.FromString, + response_serializer=glclient_dot_scheduler__pb2.CheckLightningAvailabilityResponse.SerializeToString, + ), 'Schedule': grpc.unary_unary_rpc_method_handler( servicer.Schedule, request_deserializer=glclient_dot_scheduler__pb2.ScheduleRequest.FromString, @@ -427,7 +464,7 @@ def add_SchedulerServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. -class Scheduler(object): +class Scheduler: """The scheduler service is the endpoint which allows users to register a new node with greenlight, recover access to an existing node if the owner lost its credentials, schedule the node to be run @@ -451,8 +488,10 @@ class Scheduler(object): Users are authenticated using mTLS authentication. Applications are provisioned with an anonymous keypair that is not bound to a node, allowing access only to the unauthenticated endpoints - `Scheduler.GetChallenge`, `Scheduler.Register` and - `Scheduler.Recover`. This allows them to register or recover a + `Scheduler.GetChallenge`, `Scheduler.Register`, + `Scheduler.Recover` and + `Scheduler.CheckLightningAvailability`. This allows them to + register or recover a node, but doesn't give access to the node itself. Upon registering or recovering an account the user receives a keypair that is bound to the specific node. Once the user receives their personal mTLS @@ -544,6 +583,33 @@ def GetChallenge(request, metadata, _registered_method=True) + @staticmethod + def CheckLightningAvailability(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/scheduler.Scheduler/CheckLightningAvailability', + glclient_dot_scheduler__pb2.CheckLightningAvailabilityRequest.SerializeToString, + glclient_dot_scheduler__pb2.CheckLightningAvailabilityResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def Schedule(request, target, @@ -815,7 +881,7 @@ def SignerRequestsStream(request_iterator, _registered_method=True) -class DebugStub(object): +class DebugStub: """A service to collect debugging information from clients. """ @@ -832,7 +898,7 @@ def __init__(self, channel): _registered_method=True) -class DebugServicer(object): +class DebugServicer: """A service to collect debugging information from clients. """ @@ -865,7 +931,7 @@ def add_DebugServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. -class Debug(object): +class Debug: """A service to collect debugging information from clients. """ @@ -897,7 +963,7 @@ def ReportSignerRejection(request, _registered_method=True) -class PairingStub(object): +class PairingStub: """A service to pair signer-less clients with an existing signer. """ @@ -924,7 +990,7 @@ def __init__(self, channel): _registered_method=True) -class PairingServicer(object): +class PairingServicer: """A service to pair signer-less clients with an existing signer. """ @@ -981,7 +1047,7 @@ def add_PairingServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. -class Pairing(object): +class Pairing: """A service to pair signer-less clients with an existing signer. """ diff --git a/libs/gl-client-py/glclient/scheduler_pb2_grpc.pyi b/libs/gl-client-py/glclient/scheduler_pb2_grpc.pyi index d2c12cfd6..fe39fd725 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2_grpc.pyi +++ b/libs/gl-client-py/glclient/scheduler_pb2_grpc.pyi @@ -51,8 +51,10 @@ class SchedulerStub: Users are authenticated using mTLS authentication. Applications are provisioned with an anonymous keypair that is not bound to a node, allowing access only to the unauthenticated endpoints - `Scheduler.GetChallenge`, `Scheduler.Register` and - `Scheduler.Recover`. This allows them to register or recover a + `Scheduler.GetChallenge`, `Scheduler.Register`, + `Scheduler.Recover` and + `Scheduler.CheckLightningAvailability`. This allows them to + register or recover a node, but doesn't give access to the node itself. Upon registering or recovering an account the user receives a keypair that is bound to the specific node. Once the user receives their personal mTLS @@ -111,6 +113,25 @@ class SchedulerStub: or use a challenge with a different scope will result in an error being returned. """ + CheckLightningAvailability: _grpc.UnaryUnaryMultiCallable[_scheduler_pb2.CheckLightningAvailabilityRequest, _scheduler_pb2.CheckLightningAvailabilityResponse] + """Reports whether the Lightning account backed by `node_id` may + be surfaced to the user. This is a feature gate for downstream + applications: greenlight relays the question to its Lightning + Service Provider, which answers based on whether it has + previously granted this node a slot (grants are sticky) or has + the capacity to grant one now. + + Unlike the other node-scoped calls this one is deliberately + available *before* registration, since an application has to + decide whether to offer Lightning at all before it creates a + node. There is therefore no mTLS identity to derive the node + from, and the caller names the `node_id` it is asking about. + + The answer is advisory and may change: a node that is not + available today may become available once the LSP has capacity + again. Applications should treat an error as "unknown" rather + than as a negative answer. + """ Schedule: _grpc.UnaryUnaryMultiCallable[_scheduler_pb2.ScheduleRequest, _scheduler_pb2.NodeInfoResponse] """Scheduling takes a previously registered node, locates a free slot in greenlight's infrastructure and allocates it @@ -216,8 +237,10 @@ class SchedulerAsyncStub(SchedulerStub): Users are authenticated using mTLS authentication. Applications are provisioned with an anonymous keypair that is not bound to a node, allowing access only to the unauthenticated endpoints - `Scheduler.GetChallenge`, `Scheduler.Register` and - `Scheduler.Recover`. This allows them to register or recover a + `Scheduler.GetChallenge`, `Scheduler.Register`, + `Scheduler.Recover` and + `Scheduler.CheckLightningAvailability`. This allows them to + register or recover a node, but doesn't give access to the node itself. Upon registering or recovering an account the user receives a keypair that is bound to the specific node. Once the user receives their personal mTLS @@ -273,6 +296,25 @@ class SchedulerAsyncStub(SchedulerStub): or use a challenge with a different scope will result in an error being returned. """ + CheckLightningAvailability: _aio.UnaryUnaryMultiCallable[_scheduler_pb2.CheckLightningAvailabilityRequest, _scheduler_pb2.CheckLightningAvailabilityResponse] # type: ignore[assignment] + """Reports whether the Lightning account backed by `node_id` may + be surfaced to the user. This is a feature gate for downstream + applications: greenlight relays the question to its Lightning + Service Provider, which answers based on whether it has + previously granted this node a slot (grants are sticky) or has + the capacity to grant one now. + + Unlike the other node-scoped calls this one is deliberately + available *before* registration, since an application has to + decide whether to offer Lightning at all before it creates a + node. There is therefore no mTLS identity to derive the node + from, and the caller names the `node_id` it is asking about. + + The answer is advisory and may change: a node that is not + available today may become available once the LSP has capacity + again. Applications should treat an error as "unknown" rather + than as a negative answer. + """ Schedule: _aio.UnaryUnaryMultiCallable[_scheduler_pb2.ScheduleRequest, _scheduler_pb2.NodeInfoResponse] # type: ignore[assignment] """Scheduling takes a previously registered node, locates a free slot in greenlight's infrastructure and allocates it @@ -377,8 +419,10 @@ class SchedulerServicer(metaclass=_abc_1.ABCMeta): Users are authenticated using mTLS authentication. Applications are provisioned with an anonymous keypair that is not bound to a node, allowing access only to the unauthenticated endpoints - `Scheduler.GetChallenge`, `Scheduler.Register` and - `Scheduler.Recover`. This allows them to register or recover a + `Scheduler.GetChallenge`, `Scheduler.Register`, + `Scheduler.Recover` and + `Scheduler.CheckLightningAvailability`. This allows them to + register or recover a node, but doesn't give access to the node itself. Upon registering or recovering an account the user receives a keypair that is bound to the specific node. Once the user receives their personal mTLS @@ -451,6 +495,31 @@ class SchedulerServicer(metaclass=_abc_1.ABCMeta): error being returned. """ + @_abc_1.abstractmethod + def CheckLightningAvailability( + self, + request: _scheduler_pb2.CheckLightningAvailabilityRequest, + context: _ServicerContext, + ) -> _typing.Union[_scheduler_pb2.CheckLightningAvailabilityResponse, _abc.Awaitable[_scheduler_pb2.CheckLightningAvailabilityResponse]]: + """Reports whether the Lightning account backed by `node_id` may + be surfaced to the user. This is a feature gate for downstream + applications: greenlight relays the question to its Lightning + Service Provider, which answers based on whether it has + previously granted this node a slot (grants are sticky) or has + the capacity to grant one now. + + Unlike the other node-scoped calls this one is deliberately + available *before* registration, since an application has to + decide whether to offer Lightning at all before it creates a + node. There is therefore no mTLS identity to derive the node + from, and the caller names the `node_id` it is asking about. + + The answer is advisory and may change: a node that is not + available today may become available once the LSP has capacity + again. Applications should treat an error as "unknown" rather + than as a negative answer. + """ + @_abc_1.abstractmethod def Schedule( self, diff --git a/libs/gl-client/.resources/proto/glclient/scheduler.proto b/libs/gl-client/.resources/proto/glclient/scheduler.proto index 3bb15f32e..73880cd8c 100644 --- a/libs/gl-client/.resources/proto/glclient/scheduler.proto +++ b/libs/gl-client/.resources/proto/glclient/scheduler.proto @@ -26,8 +26,10 @@ import "glclient/greenlight.proto"; // Users are authenticated using mTLS authentication. Applications are // provisioned with an anonymous keypair that is not bound to a node, // allowing access only to the unauthenticated endpoints -// `Scheduler.GetChallenge`, `Scheduler.Register` and -// `Scheduler.Recover`. This allows them to register or recover a +// `Scheduler.GetChallenge`, `Scheduler.Register`, +// `Scheduler.Recover` and +// `Scheduler.CheckLightningAvailability`. This allows them to +// register or recover a // node, but doesn't give access to the node itself. Upon registering // or recovering an account the user receives a keypair that is bound // to the specific node. Once the user receives their personal mTLS @@ -82,6 +84,25 @@ service Scheduler { // error being returned. rpc GetChallenge(ChallengeRequest) returns (ChallengeResponse) {} + // Reports whether the Lightning account backed by `node_id` may + // be surfaced to the user. This is a feature gate for downstream + // applications: greenlight relays the question to its Lightning + // Service Provider, which answers based on whether it has + // previously granted this node a slot (grants are sticky) or has + // the capacity to grant one now. + // + // Unlike the other node-scoped calls this one is deliberately + // available *before* registration, since an application has to + // decide whether to offer Lightning at all before it creates a + // node. There is therefore no mTLS identity to derive the node + // from, and the caller names the `node_id` it is asking about. + // + // The answer is advisory and may change: a node that is not + // available today may become available once the LSP has capacity + // again. Applications should treat an error as "unknown" rather + // than as a negative answer. + rpc CheckLightningAvailability(CheckLightningAvailabilityRequest) returns (CheckLightningAvailabilityResponse) {} + // Scheduling takes a previously registered node, locates a // free slot in greenlight's infrastructure and allocates it // to run the node. The node then goes through the startup @@ -248,6 +269,18 @@ enum ChallengeScope { RECOVER = 1; } +message CheckLightningAvailabilityRequest { + // 33 bytes node public key. The node need not be registered + // with greenlight yet. + bytes node_id = 1; +}; + +message CheckLightningAvailabilityResponse { + // Whether the Lightning account backed by this node may be + // surfaced to the user. + bool available = 1; +}; + message RegistrationRequest { // 33 bytes node public key. bytes node_id = 1; diff --git a/libs/gl-testing/gltesting/scheduler_grpc.py b/libs/gl-testing/gltesting/scheduler_grpc.py index d3220e865..39fa9ed80 100644 --- a/libs/gl-testing/gltesting/scheduler_grpc.py +++ b/libs/gl-testing/gltesting/scheduler_grpc.py @@ -13,6 +13,9 @@ async def Recover(self, input_message): async def GetChallenge(self, input_message): raise NotImplementedError() + async def CheckLightningAvailability(self, input_message): + raise NotImplementedError() + async def Schedule(self, input_message): raise NotImplementedError() @@ -75,6 +78,15 @@ def service(self) -> purerpc.Service: glclient_dot_scheduler__pb2.ChallengeResponse, ) ) + service_obj.add_method( + "CheckLightningAvailability", + self.CheckLightningAvailability, + purerpc.RPCSignature( + purerpc.Cardinality.UNARY_UNARY, + glclient_dot_scheduler__pb2.CheckLightningAvailabilityRequest, + glclient_dot_scheduler__pb2.CheckLightningAvailabilityResponse, + ) + ) service_obj.add_method( "Schedule", self.Schedule, @@ -198,6 +210,14 @@ def __init__(self, channel): glclient_dot_scheduler__pb2.ChallengeResponse, ) ) + self.CheckLightningAvailability = self._client.get_method_stub( + "CheckLightningAvailability", + purerpc.RPCSignature( + purerpc.Cardinality.UNARY_UNARY, + glclient_dot_scheduler__pb2.CheckLightningAvailabilityRequest, + glclient_dot_scheduler__pb2.CheckLightningAvailabilityResponse, + ) + ) self.Schedule = self._client.get_method_stub( "Schedule", purerpc.RPCSignature( diff --git a/libs/proto/glclient/scheduler.proto b/libs/proto/glclient/scheduler.proto index 3bb15f32e..73880cd8c 100644 --- a/libs/proto/glclient/scheduler.proto +++ b/libs/proto/glclient/scheduler.proto @@ -26,8 +26,10 @@ import "glclient/greenlight.proto"; // Users are authenticated using mTLS authentication. Applications are // provisioned with an anonymous keypair that is not bound to a node, // allowing access only to the unauthenticated endpoints -// `Scheduler.GetChallenge`, `Scheduler.Register` and -// `Scheduler.Recover`. This allows them to register or recover a +// `Scheduler.GetChallenge`, `Scheduler.Register`, +// `Scheduler.Recover` and +// `Scheduler.CheckLightningAvailability`. This allows them to +// register or recover a // node, but doesn't give access to the node itself. Upon registering // or recovering an account the user receives a keypair that is bound // to the specific node. Once the user receives their personal mTLS @@ -82,6 +84,25 @@ service Scheduler { // error being returned. rpc GetChallenge(ChallengeRequest) returns (ChallengeResponse) {} + // Reports whether the Lightning account backed by `node_id` may + // be surfaced to the user. This is a feature gate for downstream + // applications: greenlight relays the question to its Lightning + // Service Provider, which answers based on whether it has + // previously granted this node a slot (grants are sticky) or has + // the capacity to grant one now. + // + // Unlike the other node-scoped calls this one is deliberately + // available *before* registration, since an application has to + // decide whether to offer Lightning at all before it creates a + // node. There is therefore no mTLS identity to derive the node + // from, and the caller names the `node_id` it is asking about. + // + // The answer is advisory and may change: a node that is not + // available today may become available once the LSP has capacity + // again. Applications should treat an error as "unknown" rather + // than as a negative answer. + rpc CheckLightningAvailability(CheckLightningAvailabilityRequest) returns (CheckLightningAvailabilityResponse) {} + // Scheduling takes a previously registered node, locates a // free slot in greenlight's infrastructure and allocates it // to run the node. The node then goes through the startup @@ -248,6 +269,18 @@ enum ChallengeScope { RECOVER = 1; } +message CheckLightningAvailabilityRequest { + // 33 bytes node public key. The node need not be registered + // with greenlight yet. + bytes node_id = 1; +}; + +message CheckLightningAvailabilityResponse { + // Whether the Lightning account backed by this node may be + // surfaced to the user. + bool available = 1; +}; + message RegistrationRequest { // 33 bytes node public key. bytes node_id = 1; From 0615a2124776e76aa140afb08ffd52c69b8a7f48 Mon Sep 17 00:00:00 2001 From: cdecker Date: Mon, 24 Aug 2026 22:43:09 +0200 Subject: [PATCH 3/6] gl-client: Add check_lightning_availability Sits in the unbounded `Scheduler` impl alongside register and recover, rather than the authenticated one: the call is meant to be made before the node exists, so it must work on Nobody credentials and cannot take the node_id from the credentials. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q6i275r245hhRHT1PvVKrR --- libs/gl-client/CHANGELOG.md | 4 ++++ libs/gl-client/src/scheduler.rs | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/libs/gl-client/CHANGELOG.md b/libs/gl-client/CHANGELOG.md index 098d31659..301ac9440 100644 --- a/libs/gl-client/CHANGELOG.md +++ b/libs/gl-client/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +### Added + +- `Scheduler::check_lightning_availability(node_id)` and the corresponding `Scheduler.CheckLightningAvailability` RPC — reports whether the Lightning account backed by `node_id` may be surfaced to the user. Unauthenticated and callable before the node is registered, so the `node_id` is passed explicitly rather than taken from the credentials. + ### Changed - Signer version updated from `v25.12` to `v26.06` (VLS 0.14.0 / CLN v26.06.1) diff --git a/libs/gl-client/src/scheduler.rs b/libs/gl-client/src/scheduler.rs index 8a5f68724..41d45d1d9 100644 --- a/libs/gl-client/src/scheduler.rs +++ b/libs/gl-client/src/scheduler.rs @@ -97,6 +97,38 @@ where } impl Scheduler { + /// Asks whether the Lightning account backed by `node_id` may be + /// surfaced to the user. + /// + /// This is a feature gate for applications that offer Lightning + /// alongside other account types: greenlight relays the question + /// to its Lightning Service Provider, which answers based on + /// whether it has previously granted this node a slot, or has the + /// capacity to grant one now. + /// + /// Unlike the other node-scoped calls this one does not require + /// the node to be registered, and does not require authenticated + /// credentials, since an application has to decide whether to + /// offer Lightning before it creates a node. The `node_id` is + /// therefore passed explicitly rather than taken from the + /// credentials. + /// + /// The answer is advisory and may change over time. Treat an + /// error as "unknown" rather than as a negative answer. + pub async fn check_lightning_availability( + &self, + node_id: Vec, + ) -> Result { + let res = self + .client + .clone() + .check_lightning_availability(pb::scheduler::CheckLightningAvailabilityRequest { + node_id, + }) + .await?; + Ok(res.into_inner()) + } + /// Registers a new node with the scheduler service. /// /// # Arguments From 89d46e92e796932d30690129d4f95a8e6aca548e Mon Sep 17 00:00:00 2001 From: cdecker Date: Mon, 24 Aug 2026 23:30:08 +0200 Subject: [PATCH 4/6] gl-sdk: Add Scheduler.lightning_available Exposes the gate to the bindings as `lightningAvailable(nodeId)` in Swift and Kotlin, `lightning_available(node_id)` in Python. It goes on the existing Scheduler object, which is already Nobody-only, so no authenticated scheduler surface had to be introduced. Regenerated bindings for Python, Kotlin and Swift. Ruby is left stale: its backend rejects the SDK's callback interfaces ("No support for coercing callback interfaces yet"), which predates this change. The gl-sdk-swift package vendors its own copy of the Swift bindings and is a separate repository, so it needs a sync of its own. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q6i275r245hhRHT1PvVKrR --- libs/gl-sdk/CHANGELOG.md | 4 ++ libs/gl-sdk/bindings/glsdk.swift | 49 +++++++++++++++++ libs/gl-sdk/bindings/glsdkFFI.h | 11 ++++ libs/gl-sdk/bindings/uniffi/glsdk/glsdk.kt | 60 +++++++++++++++++++++ libs/gl-sdk/glsdk/glsdk.py | 63 ++++++++++++++++++++++ libs/gl-sdk/src/scheduler.rs | 32 +++++++++++ 6 files changed, 219 insertions(+) diff --git a/libs/gl-sdk/CHANGELOG.md b/libs/gl-sdk/CHANGELOG.md index 2a3830326..d60373474 100644 --- a/libs/gl-sdk/CHANGELOG.md +++ b/libs/gl-sdk/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +### Added + +- `Scheduler.lightning_available(node_id)` — asks whether the Lightning account backed by `node_id` may be surfaced to the user. Intended as a feature gate for applications that offer Lightning alongside other account types. Callable before `register()` and without credentials, since the decision has to be made before a node exists. The answer is advisory; treat an error as "unknown" rather than as a negative answer. Greenlight currently reports every account as unavailable while the backing Lightning Service Provider integration is being built. + ## [0.4.0] - 2026-05-21 ### Added diff --git a/libs/gl-sdk/bindings/glsdk.swift b/libs/gl-sdk/bindings/glsdk.swift index bf1f5d475..b10a33f9c 100644 --- a/libs/gl-sdk/bindings/glsdk.swift +++ b/libs/gl-sdk/bindings/glsdk.swift @@ -2320,6 +2320,26 @@ public func FfiConverterTypeNodeEventStream_lower(_ value: NodeEventStream) -> U public protocol SchedulerProtocol: AnyObject, Sendable { + /** + * Asks whether the Lightning account backed by `node_id` may be + * surfaced to the user. + * + * This is a feature gate for applications that offer Lightning + * alongside other account types. Greenlight relays the question + * to its Lightning Service Provider, which answers based on + * whether it has previously granted this node a slot, or has the + * capacity to grant one now. + * + * Deliberately callable before `register()`, since an + * application has to decide whether to offer Lightning at all + * before it creates a node. It needs no credentials, and the + * `node_id` is passed explicitly. + * + * The answer is advisory and may change over time. Treat an + * error as "unknown" rather than as a negative answer. + */ + func lightningAvailable(nodeId: Data) throws -> Bool + func recover(signer: Signer) throws -> Credentials func register(signer: Signer, code: String?) throws -> Credentials @@ -2399,6 +2419,32 @@ public convenience init(network: Network)throws { + /** + * Asks whether the Lightning account backed by `node_id` may be + * surfaced to the user. + * + * This is a feature gate for applications that offer Lightning + * alongside other account types. Greenlight relays the question + * to its Lightning Service Provider, which answers based on + * whether it has previously granted this node a slot, or has the + * capacity to grant one now. + * + * Deliberately callable before `register()`, since an + * application has to decide whether to offer Lightning at all + * before it creates a node. It needs no credentials, and the + * `node_id` is passed explicitly. + * + * The answer is advisory and may change over time. Treat an + * error as "unknown" rather than as a negative answer. + */ +open func lightningAvailable(nodeId: Data)throws -> Bool { + return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeError_lift) { + uniffi_glsdk_fn_method_scheduler_lightning_available(self.uniffiClonePointer(), + FfiConverterData.lower(nodeId),$0 + ) +}) +} + open func recover(signer: Signer)throws -> Credentials { return try FfiConverterTypeCredentials_lift(try rustCallWithError(FfiConverterTypeError_lift) { uniffi_glsdk_fn_method_scheduler_recover(self.uniffiClonePointer(), @@ -9674,6 +9720,9 @@ private let initializationResult: InitializationResult = { if (uniffi_glsdk_checksum_method_nodeeventstream_next() != 12635) { return InitializationResult.apiChecksumMismatch } + if (uniffi_glsdk_checksum_method_scheduler_lightning_available() != 7327) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_glsdk_checksum_method_scheduler_recover() != 55514) { return InitializationResult.apiChecksumMismatch } diff --git a/libs/gl-sdk/bindings/glsdkFFI.h b/libs/gl-sdk/bindings/glsdkFFI.h index 17533ab28..327e93234 100644 --- a/libs/gl-sdk/bindings/glsdkFFI.h +++ b/libs/gl-sdk/bindings/glsdkFFI.h @@ -552,6 +552,11 @@ void uniffi_glsdk_fn_free_scheduler(void*_Nonnull ptr, RustCallStatus *_Nonnull void*_Nonnull uniffi_glsdk_fn_constructor_scheduler_new(RustBuffer network, RustCallStatus *_Nonnull out_status ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_GLSDK_FN_METHOD_SCHEDULER_LIGHTNING_AVAILABLE +#define UNIFFI_FFIDEF_UNIFFI_GLSDK_FN_METHOD_SCHEDULER_LIGHTNING_AVAILABLE +int8_t uniffi_glsdk_fn_method_scheduler_lightning_available(void*_Nonnull ptr, RustBuffer node_id, RustCallStatus *_Nonnull out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_GLSDK_FN_METHOD_SCHEDULER_RECOVER #define UNIFFI_FFIDEF_UNIFFI_GLSDK_FN_METHOD_SCHEDULER_RECOVER void*_Nonnull uniffi_glsdk_fn_method_scheduler_recover(void*_Nonnull ptr, void*_Nonnull signer, RustCallStatus *_Nonnull out_status @@ -1132,6 +1137,12 @@ uint16_t uniffi_glsdk_checksum_method_nodebuilder_with_event_listener(void #define UNIFFI_FFIDEF_UNIFFI_GLSDK_CHECKSUM_METHOD_NODEEVENTSTREAM_NEXT uint16_t uniffi_glsdk_checksum_method_nodeeventstream_next(void +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_GLSDK_CHECKSUM_METHOD_SCHEDULER_LIGHTNING_AVAILABLE +#define UNIFFI_FFIDEF_UNIFFI_GLSDK_CHECKSUM_METHOD_SCHEDULER_LIGHTNING_AVAILABLE +uint16_t uniffi_glsdk_checksum_method_scheduler_lightning_available(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_GLSDK_CHECKSUM_METHOD_SCHEDULER_RECOVER diff --git a/libs/gl-sdk/bindings/uniffi/glsdk/glsdk.kt b/libs/gl-sdk/bindings/uniffi/glsdk/glsdk.kt index dd17f6af0..f09b505e9 100644 --- a/libs/gl-sdk/bindings/uniffi/glsdk/glsdk.kt +++ b/libs/gl-sdk/bindings/uniffi/glsdk/glsdk.kt @@ -869,6 +869,8 @@ internal open class UniffiVTableCallbackInterfaceNodeEventListener( + + @@ -961,6 +963,8 @@ fun uniffi_glsdk_checksum_method_nodebuilder_with_event_listener( ): Short fun uniffi_glsdk_checksum_method_nodeeventstream_next( ): Short +fun uniffi_glsdk_checksum_method_scheduler_lightning_available( +): Short fun uniffi_glsdk_checksum_method_scheduler_recover( ): Short fun uniffi_glsdk_checksum_method_scheduler_register( @@ -1150,6 +1154,8 @@ fun uniffi_glsdk_fn_free_scheduler(`ptr`: Pointer,uniffi_out_err: UniffiRustCall ): Unit fun uniffi_glsdk_fn_constructor_scheduler_new(`network`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, ): Pointer +fun uniffi_glsdk_fn_method_scheduler_lightning_available(`ptr`: Pointer,`nodeId`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, +): Byte fun uniffi_glsdk_fn_method_scheduler_recover(`ptr`: Pointer,`signer`: Pointer,uniffi_out_err: UniffiRustCallStatus, ): Pointer fun uniffi_glsdk_fn_method_scheduler_register(`ptr`: Pointer,`signer`: Pointer,`code`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus, @@ -1419,6 +1425,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_glsdk_checksum_method_nodeeventstream_next() != 12635.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_glsdk_checksum_method_scheduler_lightning_available() != 7327.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_glsdk_checksum_method_scheduler_recover() != 55514.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -4608,6 +4617,26 @@ public object FfiConverterTypeNodeEventStream: FfiConverter + UniffiLib.INSTANCE.uniffi_glsdk_fn_method_scheduler_lightning_available( + it, FfiConverterByteArray.lower(`nodeId`),_status) +} + } + ) + } + + + @Throws(Exception::class)override fun `recover`(`signer`: Signer): Credentials { return FfiConverterTypeCredentials.lift( callWithPointer { diff --git a/libs/gl-sdk/glsdk/glsdk.py b/libs/gl-sdk/glsdk/glsdk.py index 2be7cebb5..86b90b14e 100644 --- a/libs/gl-sdk/glsdk/glsdk.py +++ b/libs/gl-sdk/glsdk/glsdk.py @@ -534,6 +534,8 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_glsdk_checksum_method_nodeeventstream_next() != 12635: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_glsdk_checksum_method_scheduler_lightning_available() != 7327: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_glsdk_checksum_method_scheduler_recover() != 55514: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_glsdk_checksum_method_scheduler_register() != 20821: @@ -994,6 +996,12 @@ class _UniffiVTableCallbackInterfaceNodeEventListener(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_glsdk_fn_constructor_scheduler_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_glsdk_fn_method_scheduler_lightning_available.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_glsdk_fn_method_scheduler_lightning_available.restype = ctypes.c_int8 _UniffiLib.uniffi_glsdk_fn_method_scheduler_recover.argtypes = ( ctypes.c_void_p, ctypes.c_void_p, @@ -1457,6 +1465,9 @@ class _UniffiVTableCallbackInterfaceNodeEventListener(ctypes.Structure): _UniffiLib.uniffi_glsdk_checksum_method_nodeeventstream_next.argtypes = ( ) _UniffiLib.uniffi_glsdk_checksum_method_nodeeventstream_next.restype = ctypes.c_uint16 +_UniffiLib.uniffi_glsdk_checksum_method_scheduler_lightning_available.argtypes = ( +) +_UniffiLib.uniffi_glsdk_checksum_method_scheduler_lightning_available.restype = ctypes.c_uint16 _UniffiLib.uniffi_glsdk_checksum_method_scheduler_recover.argtypes = ( ) _UniffiLib.uniffi_glsdk_checksum_method_scheduler_recover.restype = ctypes.c_uint16 @@ -8589,6 +8600,27 @@ def read(cls, buf: _UniffiRustBuffer): def write(cls, value: NodeEventStreamProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class SchedulerProtocol(typing.Protocol): + def lightning_available(self, node_id: "bytes"): + """ + Asks whether the Lightning account backed by `node_id` may be + surfaced to the user. + + This is a feature gate for applications that offer Lightning + alongside other account types. Greenlight relays the question + to its Lightning Service Provider, which answers based on + whether it has previously granted this node a slot, or has the + capacity to grant one now. + + Deliberately callable before `register()`, since an + application has to decide whether to offer Lightning at all + before it creates a node. It needs no credentials, and the + `node_id` is passed explicitly. + + The answer is advisory and may change over time. Treat an + error as "unknown" rather than as a negative answer. + """ + + raise NotImplementedError def recover(self, signer: "Signer"): raise NotImplementedError def register(self, signer: "Signer",code: "typing.Optional[str]"): @@ -8637,6 +8669,37 @@ def _make_instance_(cls, pointer): return inst + def lightning_available(self, node_id: "bytes") -> "bool": + """ + Asks whether the Lightning account backed by `node_id` may be + surfaced to the user. + + This is a feature gate for applications that offer Lightning + alongside other account types. Greenlight relays the question + to its Lightning Service Provider, which answers based on + whether it has previously granted this node a slot, or has the + capacity to grant one now. + + Deliberately callable before `register()`, since an + application has to decide whether to offer Lightning at all + before it creates a node. It needs no credentials, and the + `node_id` is passed explicitly. + + The answer is advisory and may change over time. Treat an + error as "unknown" rather than as a negative answer. + """ + + _UniffiConverterBytes.check_lower(node_id) + + return _UniffiConverterBool.lift( + _uniffi_rust_call_with_error(_UniffiConverterTypeError,_UniffiLib.uniffi_glsdk_fn_method_scheduler_lightning_available,self._uniffi_clone_pointer(), + _UniffiConverterBytes.lower(node_id)) + ) + + + + + def recover(self, signer: "Signer") -> "Credentials": _UniffiConverterTypeSigner.check_lower(signer) diff --git a/libs/gl-sdk/src/scheduler.rs b/libs/gl-sdk/src/scheduler.rs index c31a70256..a2090f5d4 100644 --- a/libs/gl-sdk/src/scheduler.rs +++ b/libs/gl-sdk/src/scheduler.rs @@ -52,6 +52,38 @@ impl Scheduler { } } + /// Asks whether the Lightning account backed by `node_id` may be + /// surfaced to the user. + /// + /// This is a feature gate for applications that offer Lightning + /// alongside other account types. Greenlight relays the question + /// to its Lightning Service Provider, which answers based on + /// whether it has previously granted this node a slot, or has the + /// capacity to grant one now. + /// + /// Deliberately callable before `register()`, since an + /// application has to decide whether to offer Lightning at all + /// before it creates a node. It needs no credentials, and the + /// `node_id` is passed explicitly. + /// + /// The answer is advisory and may change over time. Treat an + /// error as "unknown" rather than as a negative answer. + pub fn lightning_available(&self, node_id: Vec) -> Result { + let nobody = self.nobody(); + exec(async move { + let inner = gl_client::scheduler::Scheduler::new(self.network, nobody) + .await + .map_err(|e| Error::other(e.to_string()))?; + + let res = inner + .check_lightning_availability(node_id) + .await + .map_err(|e| Error::rpc(e.to_string()))?; + + Ok(res.available) + }) + } + pub fn register(&self, signer: &Signer, code: Option) -> Result { let nobody = self.nobody(); exec(async move { From be13f6ed3f7c1eb3b38498bd6fa928820bc42294 Mon Sep 17 00:00:00 2001 From: cdecker Date: Tue, 25 Aug 2026 12:22:09 +0200 Subject: [PATCH 5/6] gl-testing: Answer CheckLightningAvailability in the mock scheduler purerpc requires every method on the servicer, so this is needed for any test to run once the proto lands, not just tests of the gate. Defaults to unavailable, matching the real scheduler while no LSP is wired up. Tests that need the other answer set `lightning_available` on the fixture. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q6i275r245hhRHT1PvVKrR --- libs/gl-testing/gltesting/scheduler.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/gl-testing/gltesting/scheduler.py b/libs/gl-testing/gltesting/scheduler.py index 97b43c67d..36ebd858d 100644 --- a/libs/gl-testing/gltesting/scheduler.py +++ b/libs/gl-testing/gltesting/scheduler.py @@ -87,6 +87,9 @@ def __init__( self.versions = enumerate_cln_versions() self.bitcoind = bitcoind self.invite_codes: List[str] = [] + # Answer given to CheckLightningAvailability. Defaults to the + # production behaviour while no LSP is wired up: unavailable. + self.lightning_available: bool = False self.next_webhook_id: int = 1 self.received_invite_code = None self.debugger = DebugServicer() @@ -365,6 +368,16 @@ async def ListInviteCodes(self, req) -> schedpb.ListInviteCodesResponse: codes = [schedpb.InviteCode(**c) for c in self.invite_codes] return schedpb.ListInviteCodesResponse(invite_code_list=codes) + async def CheckLightningAvailability( + self, req + ) -> schedpb.CheckLightningAvailabilityResponse: + # Mirrors the real scheduler, which relays this to an LSP and + # reports unavailable while none is configured. Tests that care + # flip `lightning_available` on the fixture. + return schedpb.CheckLightningAvailabilityResponse( + available=self.lightning_available + ) + async def add_outgoing_webhook(self, req) -> schedpb.AddOutgoingWebhookResponse: n = self.get_node(req.node_id) secret = generate_secret() From 33ada3c487b2e699e82b87299d8d2f7e0506f3aa Mon Sep 17 00:00:00 2001 From: cdecker Date: Thu, 27 Aug 2026 10:41:52 +0200 Subject: [PATCH 6/6] proto: Pin the Python codegen toolchain The protobuf gencode embeds a hard assertion that the runtime is at least as new as the protoc that produced it. Regenerating with whatever grpcio-tools the ambient venv happens to resolve therefore breaks every consumer at import time as soon as the generator runs ahead of the deployed runtime: VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading glclient/scheduler.proto: gencode 7.35.1 runtime 6.33.5 `grpcio-tools` was specified as >=1.66 and `protobuf` as >=6, both without an upper bound, so the checked-in stubs silently depended on who last regenerated them. This has broken CI three times. Pin the generators and run them isolated from the project venv, so the output is a function of the Makefile rather than of the developer's machine, and cap the protobuf runtime below the next major so gencode and runtime cannot drift apart again. mypy-protobuf is pinned too: it generates the .pyi files and was contributing its own churn. Regenerating now reproduces the previously committed files byte for byte, so the diff is limited to the proto that actually changed. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Q6i275r245hhRHT1PvVKrR --- libs/gl-client-py/Makefile | 17 ++- libs/gl-client-py/glclient/scheduler_pb2.py | 6 +- libs/gl-client-py/glclient/scheduler_pb2.pyi | 110 +----------------- .../glclient/scheduler_pb2_grpc.py | 20 ++-- libs/gl-client-py/pyproject.toml | 4 +- libs/gl-testing/Makefile | 11 +- 6 files changed, 43 insertions(+), 125 deletions(-) diff --git a/libs/gl-client-py/Makefile b/libs/gl-client-py/Makefile index 63cf91168..d277e1e71 100644 --- a/libs/gl-client-py/Makefile +++ b/libs/gl-client-py/Makefile @@ -10,6 +10,19 @@ PYVERSION=$(shell cd libs && cargo metadata --format-version 1 | jq -r '.package PYDIR=${REPO}/libs/gl-client-py PROTODIR=${REPO}/libs/proto +# The protobuf gencode embeds a hard assertion that the runtime is at +# least as new as the protoc that produced it, so regenerating with a +# newer toolchain than the deployed runtime breaks every consumer at +# import time. Pin the generator and run it isolated from the ambient +# venv, so the checked-in stubs do not depend on who regenerated them. +# Bump deliberately, together with the `protobuf` runtime bound in +# pyproject.toml. +PROTOC_TOOLCHAIN = \ + uv run --no-project \ + --with grpcio-tools==1.78.0 \ + --with mypy-protobuf==5.0.0 \ + python -m grpc_tools.protoc + PYPROTOC_OPTS = \ -I ${PROTODIR} \ --python_out=${PYDIR} \ @@ -35,8 +48,8 @@ ${PYPROTOS}: pygrpc pygrpc: ${PROTOSRC} cp ${PYDIR}/../proto/glclient/scheduler.proto ${PYDIR}/glclient/ cp ${PYDIR}/../proto/glclient/greenlight.proto ${PYDIR}/glclient/ - cd ${PYDIR}; uv run python -m grpc_tools.protoc ${PYPROTOC_OPTS} glclient/scheduler.proto - cd ${PYDIR}; uv run python -m grpc_tools.protoc ${PYPROTOC_OPTS} glclient/greenlight.proto + cd ${PYDIR}; ${PROTOC_TOOLCHAIN} ${PYPROTOC_OPTS} glclient/scheduler.proto + cd ${PYDIR}; ${PROTOC_TOOLCHAIN} ${PYPROTOC_OPTS} glclient/greenlight.proto check-py: #uv run --reinstall-package='gl-sdk' --all-packages mypy ${PYDIR}/glclient diff --git a/libs/gl-client-py/glclient/scheduler_pb2.py b/libs/gl-client-py/glclient/scheduler_pb2.py index 8d4ec7e81..e2280a7b8 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.py +++ b/libs/gl-client-py/glclient/scheduler_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: glclient/scheduler.proto -# Protobuf Python Version: 7.35.1 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,8 +11,8 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 7, - 35, + 6, + 31, 1, '', 'glclient/scheduler.proto' diff --git a/libs/gl-client-py/glclient/scheduler_pb2.pyi b/libs/gl-client-py/glclient/scheduler_pb2.pyi index 44c7cd91c..0e3c81e33 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.pyi +++ b/libs/gl-client-py/glclient/scheduler_pb2.pyi @@ -13,10 +13,10 @@ import builtins as _builtins import sys import typing as _typing -if sys.version_info >= (3, 11): - from typing import TypeAlias as _TypeAlias, Never as _Never +if sys.version_info >= (3, 10): + from typing import TypeAlias as _TypeAlias else: - from typing_extensions import TypeAlias as _TypeAlias, Never as _Never + from typing_extensions import TypeAlias as _TypeAlias if sys.version_info >= (3, 13): from warnings import deprecated as _deprecated @@ -55,11 +55,8 @@ class AddOutgoingWebhookRequest(_message.Message): node_id: _builtins.bytes = ..., uri: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "uri", b"uri"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___AddOutgoingWebhookRequest: _TypeAlias = AddOutgoingWebhookRequest # noqa: Y015 @@ -77,11 +74,8 @@ class AddOutgoingWebhookResponse(_message.Message): id: _builtins.int = ..., secret: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["id", b"id", "secret", b"secret"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___AddOutgoingWebhookResponse: _TypeAlias = AddOutgoingWebhookResponse # noqa: Y015 @@ -96,11 +90,8 @@ class ListOutgoingWebhooksRequest(_message.Message): *, node_id: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListOutgoingWebhooksRequest: _TypeAlias = ListOutgoingWebhooksRequest # noqa: Y015 @@ -118,11 +109,8 @@ class Webhook(_message.Message): id: _builtins.int = ..., uri: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["id", b"id", "uri", b"uri"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___Webhook: _TypeAlias = Webhook # noqa: Y015 @@ -138,11 +126,8 @@ class ListOutgoingWebhooksResponse(_message.Message): *, outgoing_webhooks: _abc.Iterable[Global___Webhook] | None = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["outgoing_webhooks", b"outgoing_webhooks"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListOutgoingWebhooksResponse: _TypeAlias = ListOutgoingWebhooksResponse # noqa: Y015 @@ -161,11 +146,8 @@ class DeleteOutgoingWebhooksRequest(_message.Message): node_id: _builtins.bytes = ..., ids: _abc.Iterable[_builtins.int] | None = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["ids", b"ids", "node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___DeleteOutgoingWebhooksRequest: _TypeAlias = DeleteOutgoingWebhooksRequest # noqa: Y015 @@ -183,11 +165,8 @@ class RotateOutgoingWebhookSecretRequest(_message.Message): node_id: _builtins.bytes = ..., webhook_id: _builtins.int = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "webhook_id", b"webhook_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RotateOutgoingWebhookSecretRequest: _TypeAlias = RotateOutgoingWebhookSecretRequest # noqa: Y015 @@ -202,11 +181,8 @@ class WebhookSecretResponse(_message.Message): *, secret: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["secret", b"secret"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___WebhookSecretResponse: _TypeAlias = WebhookSecretResponse # noqa: Y015 @@ -224,11 +200,8 @@ class ChallengeRequest(_message.Message): scope: Global___ChallengeScope.ValueType = ..., node_id: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "scope", b"scope"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ChallengeRequest: _TypeAlias = ChallengeRequest # noqa: Y015 @@ -243,11 +216,8 @@ class ChallengeResponse(_message.Message): *, challenge: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["challenge", b"challenge"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ChallengeResponse: _TypeAlias = ChallengeResponse # noqa: Y015 @@ -265,11 +235,8 @@ class CheckLightningAvailabilityRequest(_message.Message): *, node_id: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___CheckLightningAvailabilityRequest: _TypeAlias = CheckLightningAvailabilityRequest # noqa: Y015 @@ -287,11 +254,8 @@ class CheckLightningAvailabilityResponse(_message.Message): *, available: _builtins.bool = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["available", b"available"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___CheckLightningAvailabilityResponse: _TypeAlias = CheckLightningAvailabilityResponse # noqa: Y015 @@ -371,11 +335,8 @@ class RegistrationRequest(_message.Message): invite_code: _builtins.str = ..., startupmsgs: _abc.Iterable[Global___StartupMessage] | None = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["bip32_key", b"bip32_key", "challenge", b"challenge", "csr", b"csr", "init_msg", b"init_msg", "invite_code", b"invite_code", "network", b"network", "node_id", b"node_id", "signature", b"signature", "signer_proto", b"signer_proto", "startupmsgs", b"startupmsgs"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RegistrationRequest: _TypeAlias = RegistrationRequest # noqa: Y015 @@ -414,11 +375,8 @@ class RegistrationResponse(_message.Message): rune: _builtins.str = ..., creds: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["creds", b"creds", "device_cert", b"device_cert", "device_key", b"device_key", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RegistrationResponse: _TypeAlias = RegistrationResponse # noqa: Y015 @@ -440,11 +398,8 @@ class ScheduleRequest(_message.Message): *, node_id: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ScheduleRequest: _TypeAlias = ScheduleRequest # noqa: Y015 @@ -468,11 +423,8 @@ class NodeInfoRequest(_message.Message): node_id: _builtins.bytes = ..., wait: _builtins.bool = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["node_id", b"node_id", "wait", b"wait"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___NodeInfoRequest: _TypeAlias = NodeInfoRequest # noqa: Y015 @@ -493,11 +445,8 @@ class NodeInfoResponse(_message.Message): grpc_uri: _builtins.str = ..., session_id: _builtins.int = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["grpc_uri", b"grpc_uri", "node_id", b"node_id", "session_id", b"session_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___NodeInfoResponse: _TypeAlias = NodeInfoResponse # noqa: Y015 @@ -525,11 +474,8 @@ class RecoveryRequest(_message.Message): node_id: _builtins.bytes = ..., csr: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["challenge", b"challenge", "csr", b"csr", "node_id", b"node_id", "signature", b"signature"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RecoveryRequest: _TypeAlias = RecoveryRequest # noqa: Y015 @@ -561,11 +507,8 @@ class RecoveryResponse(_message.Message): rune: _builtins.str = ..., creds: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["creds", b"creds", "device_cert", b"device_cert", "device_key", b"device_key", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___RecoveryResponse: _TypeAlias = RecoveryResponse # noqa: Y015 @@ -607,11 +550,8 @@ class UpgradeRequest(_message.Message): initmsg: _builtins.bytes = ..., startupmsgs: _abc.Iterable[Global___StartupMessage] | None = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["initmsg", b"initmsg", "signer_version", b"signer_version", "startupmsgs", b"startupmsgs"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___UpgradeRequest: _TypeAlias = UpgradeRequest # noqa: Y015 @@ -629,11 +569,8 @@ class UpgradeResponse(_message.Message): *, old_version: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["old_version", b"old_version"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___UpgradeResponse: _TypeAlias = UpgradeResponse # noqa: Y015 @@ -658,11 +595,8 @@ class StartupMessage(_message.Message): request: _builtins.bytes = ..., response: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["request", b"request", "response", b"response"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___StartupMessage: _TypeAlias = StartupMessage # noqa: Y015 @@ -673,11 +607,6 @@ class ListInviteCodesRequest(_message.Message): def __init__( self, ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... - _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 - def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListInviteCodesRequest: _TypeAlias = ListInviteCodesRequest # noqa: Y015 @@ -693,11 +622,8 @@ class ListInviteCodesResponse(_message.Message): *, invite_code_list: _abc.Iterable[Global___InviteCode] | None = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["invite_code_list", b"invite_code_list"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ListInviteCodesResponse: _TypeAlias = ListInviteCodesResponse # noqa: Y015 @@ -715,11 +641,8 @@ class InviteCode(_message.Message): code: _builtins.str = ..., is_redeemed: _builtins.bool = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["code", b"code", "is_redeemed", b"is_redeemed"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___InviteCode: _TypeAlias = InviteCode # noqa: Y015 @@ -734,11 +657,6 @@ class ExportNodeRequest(_message.Message): def __init__( self, ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... - _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 - def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ExportNodeRequest: _TypeAlias = ExportNodeRequest # noqa: Y015 @@ -754,11 +672,8 @@ class ExportNodeResponse(_message.Message): *, url: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["url", b"url"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ExportNodeResponse: _TypeAlias = ExportNodeResponse # noqa: Y015 @@ -788,7 +703,6 @@ class SignerRejection(_message.Message): def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["git_version", b"git_version", "msg", b"msg", "node_id", b"node_id", "request", b"request"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___SignerRejection: _TypeAlias = SignerRejection # noqa: Y015 @@ -830,11 +744,8 @@ class PairDeviceRequest(_message.Message): description: _builtins.str = ..., restrictions: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["csr", b"csr", "description", b"description", "device_id", b"device_id", "device_name", b"device_name", "restrictions", b"restrictions"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___PairDeviceRequest: _TypeAlias = PairDeviceRequest # noqa: Y015 @@ -878,11 +789,8 @@ class PairDeviceResponse(_message.Message): rune: _builtins.str = ..., creds: _builtins.bytes = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["creds", b"creds", "device_cert", b"device_cert", "device_id", b"device_id", "device_key", b"device_key", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___PairDeviceResponse: _TypeAlias = PairDeviceResponse # noqa: Y015 @@ -898,11 +806,8 @@ class GetPairingDataRequest(_message.Message): *, device_id: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["device_id", b"device_id"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___GetPairingDataRequest: _TypeAlias = GetPairingDataRequest # noqa: Y015 @@ -943,11 +848,8 @@ class GetPairingDataResponse(_message.Message): description: _builtins.str = ..., restrictions: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["csr", b"csr", "description", b"description", "device_id", b"device_id", "device_name", b"device_name", "restrictions", b"restrictions"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___GetPairingDataResponse: _TypeAlias = GetPairingDataResponse # noqa: Y015 @@ -995,11 +897,8 @@ class ApprovePairingRequest(_message.Message): pubkey: _builtins.bytes = ..., rune: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["device_id", b"device_id", "device_name", b"device_name", "pubkey", b"pubkey", "restrictions", b"restrictions", "rune", b"rune", "sig", b"sig", "timestamp", b"timestamp"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ApprovePairingRequest: _TypeAlias = ApprovePairingRequest # noqa: Y015 @@ -1020,11 +919,8 @@ class ApprovePairingResponse(_message.Message): node_id: _builtins.bytes = ..., rune: _builtins.str = ..., ) -> None: ... - _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 - def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... _ClearFieldArgType: _TypeAlias = _typing.Literal["device_id", b"device_id", "node_id", b"node_id", "rune", b"rune"] # noqa: Y015 def ClearField(self, field_name: _ClearFieldArgType) -> None: ... - def WhichOneof(self, oneof_group: _Never) -> None: ... Global___ApprovePairingResponse: _TypeAlias = ApprovePairingResponse # noqa: Y015 diff --git a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py index f5a0172a9..2d2f5bb84 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py +++ b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py @@ -6,7 +6,7 @@ from glclient import greenlight_pb2 as glclient_dot_greenlight__pb2 from glclient import scheduler_pb2 as glclient_dot_scheduler__pb2 -GRPC_GENERATED_VERSION = '1.83.0' +GRPC_GENERATED_VERSION = '1.78.0' GRPC_VERSION = grpc.__version__ _version_not_supported = False @@ -26,7 +26,7 @@ ) -class SchedulerStub: +class SchedulerStub(object): """The scheduler service is the endpoint which allows users to register a new node with greenlight, recover access to an existing node if the owner lost its credentials, schedule the node to be run @@ -142,7 +142,7 @@ def __init__(self, channel): _registered_method=True) -class SchedulerServicer: +class SchedulerServicer(object): """The scheduler service is the endpoint which allows users to register a new node with greenlight, recover access to an existing node if the owner lost its credentials, schedule the node to be run @@ -464,7 +464,7 @@ def add_SchedulerServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. -class Scheduler: +class Scheduler(object): """The scheduler service is the endpoint which allows users to register a new node with greenlight, recover access to an existing node if the owner lost its credentials, schedule the node to be run @@ -881,7 +881,7 @@ def SignerRequestsStream(request_iterator, _registered_method=True) -class DebugStub: +class DebugStub(object): """A service to collect debugging information from clients. """ @@ -898,7 +898,7 @@ def __init__(self, channel): _registered_method=True) -class DebugServicer: +class DebugServicer(object): """A service to collect debugging information from clients. """ @@ -931,7 +931,7 @@ def add_DebugServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. -class Debug: +class Debug(object): """A service to collect debugging information from clients. """ @@ -963,7 +963,7 @@ def ReportSignerRejection(request, _registered_method=True) -class PairingStub: +class PairingStub(object): """A service to pair signer-less clients with an existing signer. """ @@ -990,7 +990,7 @@ def __init__(self, channel): _registered_method=True) -class PairingServicer: +class PairingServicer(object): """A service to pair signer-less clients with an existing signer. """ @@ -1047,7 +1047,7 @@ def add_PairingServicer_to_server(servicer, server): # This class is part of an EXPERIMENTAL API. -class Pairing: +class Pairing(object): """A service to pair signer-less clients with an existing signer. """ diff --git a/libs/gl-client-py/pyproject.toml b/libs/gl-client-py/pyproject.toml index 38211de61..ac67a08f3 100644 --- a/libs/gl-client-py/pyproject.toml +++ b/libs/gl-client-py/pyproject.toml @@ -5,7 +5,7 @@ description = "" readme = "README.md" requires-python = ">=3.8,<4" dependencies = [ - "protobuf>=6", + "protobuf>=6,<7", "pyln-grpc-proto>=0.1", ] authors = [ @@ -27,7 +27,7 @@ dev = [ "mypy>=1.14.1", "mypy-protobuf>=3.6.0", "patchelf>=0.17.2.2", - "protobuf>=6", + "protobuf>=6,<7", "pyln-grpc-proto>=0.1.2", "python-kacl>=0.6.7", "types-protobuf>=5.29.1.20241207", diff --git a/libs/gl-testing/Makefile b/libs/gl-testing/Makefile index 13edd6cba..4b51d3739 100644 --- a/libs/gl-testing/Makefile +++ b/libs/gl-testing/Makefile @@ -22,8 +22,17 @@ check-testing-py: #cd ${TESTINGDIR}; mypy gltesting cd ${TESTINGDIR}; poetry install --with=dev; poetry run pytest tests -n 4 -vvv +# Pinned and isolated for the same reason as gl-client-py's PROTOC_TOOLCHAIN: +# the generated stubs must not depend on whose venv produced them. Keep the +# grpcio-tools version in step with that one. +TESTPROTOC_TOOLCHAIN = \ + uv run --no-project \ + --with grpcio-tools==1.78.0 \ + --with purerpc \ + python -m grpc_tools.protoc + testgrpc: ${REPO_ROOT}/libs/proto/glclient/scheduler.proto - uv run python -m grpc_tools.protoc ${TESTPROTOC_OPTS} glclient/scheduler.proto + ${TESTPROTOC_TOOLCHAIN} ${TESTPROTOC_OPTS} glclient/scheduler.proto mv ${TESTINGDIR}/gltesting/glclient/scheduler_grpc.py ${TESTINGDIR}/gltesting/scheduler_grpc.py rm -rf ${TESTINGDIR}/gltesting/glclient