From 9affaa8b4f618ec3443dfdac59bb145459041e75 Mon Sep 17 00:00:00 2001 From: Randall Naar Date: Wed, 30 Aug 2023 10:02:25 -0400 Subject: [PATCH 01/15] Added support for lightning addresses as per the lud16 spec. --- libs/gl-client/src/lnurl/pay/mod.rs | 187 +++++++++++++++++++++++++--- 1 file changed, 170 insertions(+), 17 deletions(-) diff --git a/libs/gl-client/src/lnurl/pay/mod.rs b/libs/gl-client/src/lnurl/pay/mod.rs index ab66d990d..fdfef6cdf 100644 --- a/libs/gl-client/src/lnurl/pay/mod.rs +++ b/libs/gl-client/src/lnurl/pay/mod.rs @@ -12,27 +12,20 @@ use sha256; pub async fn resolve_lnurl_to_invoice( http_client: &T, - lnurl: &str, + lnurl_identifier: &str, amount_msats: u64, ) -> Result { - let url = parse_lnurl(lnurl)?; + let url = match is_lnurl(lnurl_identifier) { + true => parse_lnurl(lnurl_identifier)?, + false => parse_lightning_address(lnurl_identifier)?, + }; + + debug!("Domain: {}", Url::parse(&url).unwrap().host().unwrap()); let lnurl_pay_request_response: PayRequestResponse = http_client.get_pay_request_response(&url).await?; - if lnurl_pay_request_response.tag != "payRequest" { - return Err(anyhow!("Expected tag to say 'payRequest'")); - } - - ensure_amount_is_within_range(&lnurl_pay_request_response, amount_msats)?; - let description = extract_description(&lnurl_pay_request_response)?; - - debug!("Domain: {}", Url::parse(&url).unwrap().host().unwrap()); - debug!("Description: {}", description); - debug!( - "Accepted range (in millisatoshis): {} - {}", - lnurl_pay_request_response.min_sendable, lnurl_pay_request_response.max_sendable - ); + validate_pay_request_response(lnurl_identifier, &lnurl_pay_request_response, amount_msats)?; let callback_url = build_callback_url(&lnurl_pay_request_response, amount_msats)?; let callback_response: PayRequestCallbackResponse = http_client @@ -48,6 +41,60 @@ pub async fn resolve_lnurl_to_invoice( Ok(invoice.to_string()) } +fn is_lnurl(lnurl_identifier: &str) -> bool { + const LNURL_PREFIX: &str = "LNURL"; + lnurl_identifier + .trim() + .to_uppercase() + .starts_with(LNURL_PREFIX) +} + +pub fn validate_pay_request_response( + lnurl_identifier: &str, + lnurl_pay_request_response: &PayRequestResponse, + amount_msats: u64, +) -> Result<()> { + if lnurl_pay_request_response.tag != "payRequest" { + return Err(anyhow!("Expected tag to say 'payRequest'")); + } + ensure_amount_is_within_range(&lnurl_pay_request_response, amount_msats)?; + let description = extract_description(&lnurl_pay_request_response)?; + + debug!("Description: {}", description); + debug!( + "Accepted range (in millisatoshis): {} - {}", + lnurl_pay_request_response.min_sendable, lnurl_pay_request_response.max_sendable + ); + + if !is_lnurl(lnurl_identifier) { + let deserialized_metadata: Vec> = + serde_json::from_str(&lnurl_pay_request_response.metadata.to_owned()) + .map_err(|e| anyhow!("Failed to deserialize metadata: {}", e))?; + + let mut identifier = String::new(); + + let metadata_entry_types = ["text/email", "text/identifier"]; + + for metadata in deserialized_metadata { + let x = &*metadata[0].clone(); + if metadata_entry_types.contains(&x) { + identifier = String::from(metadata[1].clone()); + break; + } + } + + if identifier.is_empty() { + return Err(anyhow!("Could not find an entry of type ")); + } + + if identifier != lnurl_identifier { + return Err(anyhow!("The lightning address specified in the original request does not match what was found in the metadata array")); + } + } + + Ok(()) +} + // Validates the invoice on the pay request's callback response pub fn validate_invoice_from_callback_response( invoice: &Bolt11Invoice, @@ -65,7 +112,9 @@ pub fn validate_invoice_from_callback_response( ensure!( description_hash == sha256::digest(metadata), - "description_hash does not match the hash of the metadata" + "description_hash {} does not match the hash of the metadata {}", + description_hash, + sha256::digest(metadata) ); Ok(()) @@ -123,6 +172,40 @@ fn ensure_amount_is_within_range( Ok(()) } +//LUD-16: Paying to static internet identifiers. +pub fn parse_lightning_address(lightning_address: &str) -> Result { + let lightning_address_components: Vec<&str> = lightning_address.split("@").collect(); + + if lightning_address_components.len() != 2 { + return Err(anyhow!("The provided lightning address is improperly formatted")); + } + + let username = match lightning_address_components.get(0) { + None => return Err(anyhow!("Could not parse username in lightning address")), + Some(u) => { + if u.is_empty() { + return Err(anyhow!("Username can not be empty")) + } + + u + } + }; + + let domain = match lightning_address_components.get(1) { + None => return Err(anyhow!("Could not parse domain in lightning address")), + Some(d) => { + if d.is_empty() { + return Err(anyhow!("Domain can not be empty")) + } + + d + } + }; + + let pay_request_url = ["https://", domain, "/.well-known/lnurlp/", username].concat(); + return Ok(pay_request_url); +} + #[cfg(test)] mod tests { use crate::lnurl::models::MockLnUrlHttpClient; @@ -169,7 +252,77 @@ mod tests { let lnurl = "LNURL1DP68GURN8GHJ7CMFWP5X2UNSW4HXKTNRDAKJ7CTSDYHHVVF0D3H82UNV9UCSAXQZE2"; let amount = 100000; - let _ = resolve_lnurl_to_invoice(&mock_http_client, lnurl, amount).await; + let invoice = resolve_lnurl_to_invoice(&mock_http_client, &lnurl, amount).await; + assert!(invoice.is_ok()); + } + + #[tokio::test] + async fn test_lnurl_pay_with_lightning_address() { + let mut mock_http_client = MockLnUrlHttpClient::new(); + let lightning_address_username = "satoshi"; + let lightning_address_domain = "cipherpunk.com"; + let lnurl = format!( + "{}@{}", + lightning_address_username, lightning_address_domain + ); + + let lnurl_clone = lnurl.clone(); + mock_http_client.expect_get_pay_request_response().returning(move |url| { + let expected_url = format!("https://{}/.well-known/lnurlp/{}", lightning_address_domain, lightning_address_username); + assert_eq!(expected_url, url); + + let pay_request_json = format!("{{\"callback\": \"https://cipherpunk.com/lnurlp/api/v1/lnurl/cb/1\", \"maxSendable\": 100000, \"minSendable\": 100, \"tag\": \"payRequest\", \"metadata\": \"[[\\\"text/plain\\\", \\\"Start the CoinTrain\\\"], [\\\"text/identifier\\\", \\\"{}\\\"]]\" }}", lnurl_clone); + + let x: PayRequestResponse = serde_json::from_str(&pay_request_json).unwrap(); + convert_to_async_return_value(Ok(x)) + }); + + mock_http_client.expect_get_pay_request_callback_response().returning(|_url| { + let invoice = "lnbcrt1u1pj0ypx6sp5hzczugdw9eyw3fcsjkssux7awjlt68vpj7uhmen7sup0hdlrqxaqpp5gp5fm2sn5rua2jlzftkf5h22rxppwgszs7ncm73pmwhvjcttqp3qdy2tddjyar90p6z7urvv95kug3vyq39xarpwf6zqargv5syxmmfde28yctfdc396tpqtv38getcwshkjer9de6xjenfv4ezytpqyfekzar0wd5xjsrrd9cxsetjwp6ku6ewvdhk6gjat5xqyjw5qcqp29qxpqysgqujuf5zavazln2q9gks7nqwdgjypg2qlvv7aqwfmwg7xmjt8hy4hx2ctr5fcspjvmz9x5wvmur8vh6nkynsvateafm73zwg5hkf7xszsqajqwcf"; + let callback_response_json = format!("{{\"pr\":\"{}\",\"routes\":[]}}", invoice).to_string(); + let x = serde_json::from_str(&callback_response_json).unwrap(); + convert_to_async_return_value(Ok(x)) + }); + + let amount = 100000; + + let invoice = resolve_lnurl_to_invoice(&mock_http_client, &lnurl, amount).await; + assert!(invoice.is_ok()); + } + + + #[tokio::test] + async fn test_lnurl_pay_with_lightning_address_fails_with_empty_username() { + let mock_http_client = MockLnUrlHttpClient::new(); + let lightning_address_username = ""; + let lightning_address_domain = "cipherpunk.com"; + let lnurl = format!( + "{}@{}", + lightning_address_username, lightning_address_domain + ); + + let amount = 100000; + + let error = resolve_lnurl_to_invoice(&mock_http_client, &lnurl, amount).await; + assert!(error.is_err()); + assert!(error.unwrap_err().to_string().contains("Username can not be empty")); + } + + #[tokio::test] + async fn test_lnurl_pay_with_lightning_address_fails_with_empty_domain() { + let mock_http_client = MockLnUrlHttpClient::new(); + let lightning_address_username = "satoshi"; + let lightning_address_domain = ""; + let lnurl = format!( + "{}@{}", + lightning_address_username, lightning_address_domain + ); + + let amount = 100000; + + let error = resolve_lnurl_to_invoice(&mock_http_client, &lnurl, amount).await; + assert!(error.is_err()); + assert!(error.unwrap_err().to_string().contains("Domain can not be empty")); } #[tokio::test] From 83a8bc7e7ebf89c61bbcf259a07b16812dfb36ea Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 9 Aug 2023 14:37:19 +0200 Subject: [PATCH 02/15] client: Extract the approval parsing into its own method --- libs/gl-client/src/signer/mod.rs | 37 ++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index ab8c843c1..ebd8c3b4c 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -3,6 +3,7 @@ use crate::pb::scheduler::{scheduler_client::SchedulerClient, NodeInfoRequest, U /// caller thread, streaming incoming requests, verifying them, /// signing if ok, and then shipping the response to the node. use crate::pb::{node_client::NodeClient, Empty, HsmRequest, HsmRequestContext, HsmResponse}; +use crate::signer::resolve::Resolver; use crate::tls::TlsConfig; use crate::{node, node::Client}; use anyhow::anyhow; @@ -25,8 +26,10 @@ use vls_protocol_signer::approver::{Approval, Approve, MemoApprover, PositiveApp use vls_protocol_signer::handler; use vls_protocol_signer::handler::Handler; +mod approver; mod auth; pub mod model; +mod resolve; const VERSION: &str = "v23.08"; const GITHASH: &str = env!("GIT_HASH"); @@ -65,8 +68,8 @@ pub enum Error { #[error("scheduler returned faulty URI: {0}")] InvalidUri(#[from] InvalidUri), - #[error("signer refused a request: {0}")] - Signer(#[from] vls_protocol::Error), + #[error("resolver error: request {0:?}, context: {1:?}")] + Resolver(Vec, Vec), #[error("other: {0}")] Other(anyhow::Error), @@ -75,7 +78,8 @@ pub enum Error { impl Signer { pub fn new(secret: Vec, network: Network, tls: TlsConfig) -> Result { use lightning_signer::policy::{ - filter::PolicyFilter, simple_validator::SimpleValidatorFactory, + filter::{FilterRule, PolicyFilter}, + simple_validator::SimpleValidatorFactory, }; use lightning_signer::signer::ClockStartingTimeFactory; use lightning_signer::util::clock::StandardClock; @@ -96,6 +100,10 @@ impl Signer { #[cfg(not(feature = "permissive"))] { policy.filter = PolicyFilter::default(); + policy.filter.merge(PolicyFilter { + // TODO: Remove once we have fully switched over to zero-fee anchors + rules: vec![FilterRule::new_warn("policy-channel-safe-type-anchors")], + }); } let validator_factory = Arc::new(SimpleValidatorFactory::new_with_policy(policy)); @@ -288,7 +296,11 @@ impl Signer { } } - fn authenticate_request(&self, req: &HsmRequest) -> Result, Error> { + fn authenticate_request( + &self, + msg: &vls_protocol::msgs::Message, + req: &HsmRequest, + ) -> Result, Error> { let ctxrequests: Vec = self .check_request_auth(req.requests.clone()) .into_iter() @@ -303,6 +315,12 @@ impl Signer { }) .collect::>(); + log::trace!( + "Resolving signature request against pending grpc commands: {:?}", + req.requests + ); + Resolver::try_resolve(msg, &ctxrequests)?; + use auth::Authorizer; let auth = auth::GreenlightAuthorizer {}; let approvals = auth.authorize(ctxrequests).map_err(|e| Error::Auth(e))?; @@ -311,8 +329,7 @@ impl Signer { } async fn process_request(&self, req: HsmRequest) -> Result { - let approvals = self.authenticate_request(&req)?; - let diff: crate::persist::State = req.signer_state.into(); + let diff: crate::persist::State = req.signer_state.clone().into(); let prestate = { debug!("Updating local signer state with state from node"); @@ -342,7 +359,9 @@ impl Signer { log::debug!("Handling message {:?}", msg); log::trace!("Signer state {}", serde_json::to_string(&prestate).unwrap()); - let approver = Arc::new(MemoApprover::new(PositiveApprover())); + let approver = Arc::new(MemoApprover::new(approver::ReportingApprover::new( + PositiveApprover(), + ))); approver.approve(approvals); let root_handler = self.handler_with_approver(approver)?; @@ -499,7 +518,7 @@ impl Signer { .collect(), }) .await - .map_err(|e| anyhow!("error asking scheduler to upgrade: {}", e))?; + .context("Error asking scheduler to upgrade")?; loop { debug!("Calling scheduler.get_node_info"); @@ -700,7 +719,7 @@ mod tests { requests: Vec::new(), },) .await - .is_err()) + .is_err()); } /// We should reject a signing request with an empty message. From 3183ab863d5e716e8dbbe0b3962c6a513ca9b703 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 16 Aug 2023 16:17:49 +0200 Subject: [PATCH 03/15] signer: Add a ReportingApprover The approvers build a chain, so anything ending up at the report level is an issue. We can then switch between permissive and enforcement mode by switching the inner Approver from PositiveApprover to NegativeApprover, making that switch very simple. --- libs/gl-client/src/signer/approver.rs | 48 +++++++++++++++++++++++++++ libs/gl-client/src/signer/mod.rs | 15 ++++++--- libs/gl-testing/Dockerfile | 3 ++ libs/gl-testing/tests/test_node.py | 5 +++ 4 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 libs/gl-client/src/signer/approver.rs diff --git a/libs/gl-client/src/signer/approver.rs b/libs/gl-client/src/signer/approver.rs new file mode 100644 index 000000000..57113d069 --- /dev/null +++ b/libs/gl-client/src/signer/approver.rs @@ -0,0 +1,48 @@ +use lightning_signer::prelude::SendSync; +use vls_protocol_signer::approver::Approve; + +// An approver that will collect any request it gets and files a +// report that may be relayed to developers to debug policies. It +// defers actual decisions to an `inner` approver, and provides access +// to the captured reports. If this approver is wrapped in a real +// approver, that outer approver will process the requests, and not +// forward to this. Hence only prospective failures are collected. +pub struct ReportingApprover { + inner: A, +} + +impl ReportingApprover { + pub fn new(delegate: A) -> Self { + ReportingApprover { inner: delegate } + } +} + +impl Approve for ReportingApprover { + fn approve_invoice(&self, inv: &lightning_signer::invoice::Invoice) -> bool { + log::warn!("unapproved invoice: {:?}", inv); + self.inner.approve_invoice(inv) + } + fn approve_keysend( + &self, + hash: lightning_signer::lightning::ln::PaymentHash, + amount_msat: u64, + ) -> bool { + log::warn!("unapproved keysend {:?} {:?}", hash, amount_msat); + self.inner.approve_keysend(hash, amount_msat) + } + fn approve_onchain( + &self, + tx: &lightning_signer::bitcoin::Transaction, + values_sat: &[u64], + unknown_indices: &[usize], + ) -> bool { + log::warn!( + "unapproved onchain {:?} {:?} {:?}", + tx, + values_sat, + unknown_indices + ); + self.inner.approve_onchain(tx, values_sat, unknown_indices) + } +} +impl SendSync for ReportingApprover {} diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index ebd8c3b4c..79340da55 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -71,6 +71,12 @@ pub enum Error { #[error("resolver error: request {0:?}, context: {1:?}")] Resolver(Vec, Vec), + #[error("error asking node to be upgraded: {0}")] + Upgrade(tonic::Status), + + #[error("protocol error: {0}")] + Protocol(#[from] vls_protocol::Error), + #[error("other: {0}")] Other(anyhow::Error), } @@ -78,8 +84,7 @@ pub enum Error { impl Signer { pub fn new(secret: Vec, network: Network, tls: TlsConfig) -> Result { use lightning_signer::policy::{ - filter::{FilterRule, PolicyFilter}, - simple_validator::SimpleValidatorFactory, + filter::PolicyFilter, simple_validator::SimpleValidatorFactory, }; use lightning_signer::signer::ClockStartingTimeFactory; use lightning_signer::util::clock::StandardClock; @@ -355,10 +360,12 @@ impl Signer { _ => {} } - let msg = vls_protocol::msgs::from_vec(req.raw).map_err(|e| Error::Signer(e))?; + let msg = vls_protocol::msgs::from_vec(req.raw.clone()).map_err(|e| Error::Protocol(e))?; log::debug!("Handling message {:?}", msg); log::trace!("Signer state {}", serde_json::to_string(&prestate).unwrap()); + let approvals = self.authenticate_request(&msg, &req)?; + let approver = Arc::new(MemoApprover::new(approver::ReportingApprover::new( PositiveApprover(), ))); @@ -518,7 +525,7 @@ impl Signer { .collect(), }) .await - .context("Error asking scheduler to upgrade")?; + .map_err(|s| Error::Upgrade(s))?; loop { debug!("Calling scheduler.get_node_info"); diff --git a/libs/gl-testing/Dockerfile b/libs/gl-testing/Dockerfile index 6321d7d58..e547d04f4 100644 --- a/libs/gl-testing/Dockerfile +++ b/libs/gl-testing/Dockerfile @@ -85,6 +85,9 @@ ENV RUST_VERSION=1.70.0 RUN groupadd -g $GID -o $DOCKER_USER &&\ useradd -m -u $UID -g $GID -o -s /bin/bash $DOCKER_USER +# Set up a default logging filter. This includes all trace-level messages from greenlight components and validating lightning signer +ENV RUST_LOG=gl_client=trace,tracing=warn,gl_signerproxy=trace,gl_plugin=trace,lightning_signer=trace,vls_protocol_signer=trace,vls_core=trace,vls_persist=trace,vls_protocol=trace,info + # grpcio == 1.46 produces spammy log messages, silence them ENV GRPC_ENABLE_FORK_SUPPORT=0 diff --git a/libs/gl-testing/tests/test_node.py b/libs/gl-testing/tests/test_node.py index ba709ae1a..892a548b5 100644 --- a/libs/gl-testing/tests/test_node.py +++ b/libs/gl-testing/tests/test_node.py @@ -225,7 +225,12 @@ def test_node_listpays_preimage(clients, node_factory, bitcoind): 'preimage': preimage, }) + from rich.rule import Rule + from rich.console import Console + console = Console() + console.rule("[bold red]") gl1.pay(i['bolt11']) + console.rule("[bold red]") pay = gl1.listpays() assert len(pay.pays) == 1 From 3c7c5d077271c79989c5e3aaade9f122b6081a6e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 23 Aug 2023 00:09:30 +0200 Subject: [PATCH 04/15] e2e: Filling in the verification rules --- libs/gl-client/src/signer/model/mod.rs | 5 +- libs/gl-client/src/signer/resolve.rs | 105 +++++++++++++++++++++++++ libs/gl-testing/Dockerfile | 2 +- 3 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 libs/gl-client/src/signer/resolve.rs diff --git a/libs/gl-client/src/signer/model/mod.rs b/libs/gl-client/src/signer/model/mod.rs index a8d61a946..5f7fd8e67 100644 --- a/libs/gl-client/src/signer/model/mod.rs +++ b/libs/gl-client/src/signer/model/mod.rs @@ -1,4 +1,3 @@ - // This file was generated by `gengrpc` from the CLN JSON-Schema. // Do not edit this file. // @@ -7,7 +6,7 @@ pub mod cln; pub mod greenlight; /// Variants prefixed with `Gl` are deprecated and will eventually be removed. -#[derive(Debug)] +#[derive(Clone, Debug)] pub enum Request { GlGetinfo(greenlight::GetInfoRequest), GlStop(greenlight::StopRequest), @@ -71,4 +70,4 @@ pub enum Request { SetChannel(cln::SetchannelRequest), SignMessage(cln::SignmessageRequest), Stop(cln::StopRequest), -} \ No newline at end of file +} diff --git a/libs/gl-client/src/signer/resolve.rs b/libs/gl-client/src/signer/resolve.rs new file mode 100644 index 000000000..a127343c0 --- /dev/null +++ b/libs/gl-client/src/signer/resolve.rs @@ -0,0 +1,105 @@ +//! Resolver utilities to match incoming requests against the request +//! context and find a justifications. + +use crate::signer::{model::Request, Error}; +use vls_protocol::msgs::Message; +pub struct Resolver {} + +impl Resolver { + /// Attempt to find a resolution for a given request. We default + /// to failing, and allowlist individual matches between pending + /// context requests and the signer request being resolved. Where + /// possible we also verify the contents of the request against + /// the contents of the context request. TODOs in here may + /// indicate ways to strengthen the verification. + pub fn try_resolve(req: &Message, reqctx: &Vec) -> Result<(), Error> { + log::trace!("Resolving {:?}", req); + // Some requests do not need a justification. For example we + // reconnect automatically, so there may not even be a context + // request pending which would skip the entire stack below, so + // we do an early pass: + let accept = match req { + // Commands that simply have no context to check against + Message::Ecdh(_) => true, + Message::Ping(_) => true, + Message::Pong(_) => true, + Message::SignChannelAnnouncement(_) => true, + Message::SignChannelUpdate(_) => true, + Message::SignNodeAnnouncement(_) => true, + Message::CheckPubKey(_) => true, + // Duplicate verification with VLS, we defer to VLS + Message::GetChannelBasepoints(_) => true, + Message::ValidateCommitmentTx(_) => true, + Message::SignWithdrawal(_) => true, + Message::ReadyChannel(_) => true, + Message::GetPerCommitmentPoint(_) => true, + Message::ValidateRevocation(_) => true, + Message::NewChannel(_) => true, + Message::SignCommitmentTx(_) => true, + Message::SignGossipMessage(_) => true, + Message::SignMutualCloseTx(_) => true, + Message::SignMutualCloseTx2(_) => true, + Message::SignRemoteCommitmentTx(_) => true, + Message::SignRemoteCommitmentTx2(_) => true, + Message::SignRemoteHtlcTx(_) => true, + // Resolution of an existing HTLC, we should never not try + // to grab funds if we can. + Message::SignPenaltyToUs(_) => true, + Message::SignAnyPenaltyToUs(_) => true, + Message::SignAnyDelayedPaymentToUs(_) => true, + Message::SignAnyLocalHtlcTx(_) => true, + Message::SignAnyRemoteHtlcToUs(_) => true, + // Default to rejecting, punting the decision to the next + // step. + _ => false, + }; + + // If we found a resolution, then there is no point in trying + // to match up further. + if accept { + log::trace!( + "Request {:?} resolved with no context request required", + req + ); + return Ok(()); + } + + for cr in reqctx { + let accept = match (dbg!(req), dbg!(cr)) { + (Message::SignMessage(m1), Request::SignMessage(m2)) => { + m1.message.0.clone() == m2.message.as_bytes() + } + (Message::NewChannel(m1), Request::FundChannel(m2)) => { + // Different node_id? Reject! + m1.node_id.0 == m2.id.as_slice() + // TODO: Add `close_to` to allowlist for the close + // later on + } + (Message::NewChannel(m1), Request::GlFundChannel(m2)) => { + // Different node_id? Reject! + m1.node_id.0 == m2.node_id.as_slice() + } + (Message::SignInvoice(_l), Request::GlCreateInvoice(_r)) => true, + (Message::SignInvoice(_l), Request::Invoice(_r)) => { + // TODO: This could be strengthened by parsing the + // invoice from `l.u5bytes` and verify the + // description, amount and (maybe) payment_hash + true + } + (Message::PreapproveInvoice(l), Request::Pay(r)) => { + l.invstring.0 == r.bolt11.as_bytes() + } + (_, _) => false, + }; + + // Did we find a resolution? If yes we can stop here. + if accept { + log::trace!("Request {:?} approved with context request {:?}", req, cr); + return Ok(()); + } + } + + let ser = vls_protocol::serde_bolt::to_vec(req).unwrap(); + Err(Error::Resolver(ser, reqctx.to_vec())) + } +} diff --git a/libs/gl-testing/Dockerfile b/libs/gl-testing/Dockerfile index e547d04f4..abb80b7b4 100644 --- a/libs/gl-testing/Dockerfile +++ b/libs/gl-testing/Dockerfile @@ -54,7 +54,7 @@ RUN mkdir /tmp/protoc && \ RUN python3 -m pip install -U \ pip tomli &&\ python3 -m pip install \ - maturin \ + maturin[patchelf] \ mrkd \ mako ADD . /repo From 5cd6c39f9f3da3a632a3c36716be248f37b3afd4 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 30 Aug 2023 15:23:38 +0200 Subject: [PATCH 05/15] proto: Add reporting endpoint to report signer rejections These reports are useful for us to debug potential false negatives, i.e., when the signer rejected but the operation should have been accepted. This is because we default to rejecting, allowing only combinations that are known to work, but doing it this way around means we may stumble over new combinations of RPC methods triggering signer requests that we have not seen before. --- libs/gl-client-py/Makefile | 1 + libs/gl-client-py/glclient/greenlight_pb2.py | 824 ++++++++++++++---- libs/gl-client-py/glclient/greenlight_pb2.pyi | 76 +- libs/gl-client-py/glclient/scheduler_pb2.py | 239 ++++- libs/gl-client-py/glclient/scheduler_pb2.pyi | 40 +- .../glclient/scheduler_pb2_grpc.py | 34 + libs/gl-client-py/pyproject.toml | 1 + libs/gl-testing/gltesting/fixtures.py | 9 + libs/gl-testing/gltesting/scheduler.py | 13 + libs/gl-testing/gltesting/scheduler_grpc.py | 38 + libs/proto/scheduler.proto | 21 + 11 files changed, 1020 insertions(+), 276 deletions(-) diff --git a/libs/gl-client-py/Makefile b/libs/gl-client-py/Makefile index 9ac7f80dd..47ecf020b 100644 --- a/libs/gl-client-py/Makefile +++ b/libs/gl-client-py/Makefile @@ -36,6 +36,7 @@ ${PYPROTOS}: ${PROTOSRC} python -m grpc_tools.protoc ${PYPROTOC_OPTS} scheduler.proto python -m grpc_tools.protoc ${PYPROTOC_OPTS} greenlight.proto sed -i 's/import scheduler_pb2 as scheduler__pb2/from . import scheduler_pb2 as scheduler__pb2/g' ${PYDIR}/glclient/scheduler_pb2_grpc.py + sed -i 's/import greenlight_pb2 as greenlight__pb2/from . import greenlight_pb2 as greenlight__pb2/g' ${PYDIR}/glclient/scheduler_pb2.py sed -i 's/import greenlight_pb2 as greenlight__pb2/from . import greenlight_pb2 as greenlight__pb2/g' ${PYDIR}/glclient/greenlight_pb2_grpc.py check-py: diff --git a/libs/gl-client-py/glclient/greenlight_pb2.py b/libs/gl-client-py/glclient/greenlight_pb2.py index 1761543de..cfde2b36b 100644 --- a/libs/gl-client-py/glclient/greenlight_pb2.py +++ b/libs/gl-client-py/glclient/greenlight_pb2.py @@ -2,10 +2,12 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: greenlight.proto """Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -15,9 +17,539 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10greenlight.proto\x12\ngreenlight\"H\n\x11HsmRequestContext\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x0c\n\x04\x64\x62id\x18\x02 \x01(\x04\x12\x14\n\x0c\x63\x61pabilities\x18\x03 \x01(\x04\"b\n\x0bHsmResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12\x0b\n\x03raw\x18\x02 \x01(\x0c\x12\x32\n\x0csigner_state\x18\x05 \x03(\x0b\x32\x1c.greenlight.SignerStateEntry\"\xbf\x01\n\nHsmRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12.\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x1d.greenlight.HsmRequestContext\x12\x0b\n\x03raw\x18\x03 \x01(\x0c\x12\x32\n\x0csigner_state\x18\x04 \x03(\x0b\x32\x1c.greenlight.SignerStateEntry\x12,\n\x08requests\x18\x05 \x03(\x0b\x32\x1a.greenlight.PendingRequest\"\x07\n\x05\x45mpty\"O\n\x07\x41\x64\x64ress\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.greenlight.NetAddressType\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\"\x10\n\x0eGetInfoRequest\"\xb2\x01\n\x0fGetInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12&\n\taddresses\x18\x05 \x03(\x0b\x32\x13.greenlight.Address\x12\x0f\n\x07version\x18\x06 \x01(\t\x12\x13\n\x0b\x62lockheight\x18\x07 \x01(\r\x12\x0f\n\x07network\x18\x08 \x01(\t\"\r\n\x0bStopRequest\"\x0e\n\x0cStopResponse\"/\n\x0e\x43onnectRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\t\"4\n\x0f\x43onnectResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\t\"#\n\x10ListPeersRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\"\x81\x01\n\x04Htlc\x12\x11\n\tdirection\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x04\x12\x0e\n\x06\x61mount\x18\x03 \x01(\t\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\t\x12\r\n\x05state\x18\x06 \x01(\t\x12\x15\n\rlocal_trimmed\x18\x07 \x01(\x08\"(\n\x07\x41liases\x12\r\n\x05local\x18\x01 \x01(\t\x12\x0e\n\x06remote\x18\x02 \x01(\t\"\x8f\x03\n\x07\x43hannel\x12\r\n\x05state\x18\x01 \x01(\t\x12\r\n\x05owner\x18\x02 \x01(\t\x12\"\n\x05\x61lias\x18\x12 \x01(\x0b\x32\x13.greenlight.Aliases\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x11\n\tdirection\x18\x04 \x01(\r\x12\x12\n\nchannel_id\x18\x05 \x01(\t\x12\x14\n\x0c\x66unding_txid\x18\x06 \x01(\t\x12\x15\n\rclose_to_addr\x18\x07 \x01(\t\x12\x10\n\x08\x63lose_to\x18\x08 \x01(\t\x12\x0f\n\x07private\x18\t \x01(\x08\x12\r\n\x05total\x18\n \x01(\t\x12\x12\n\ndust_limit\x18\x0b \x01(\t\x12\x11\n\tspendable\x18\x0c \x01(\t\x12\x12\n\nreceivable\x18\r \x01(\t\x12\x1b\n\x13their_to_self_delay\x18\x0e \x01(\r\x12\x19\n\x11our_to_self_delay\x18\x0f \x01(\r\x12\x0e\n\x06status\x18\x10 \x03(\t\x12\x1f\n\x05htlcs\x18\x11 \x03(\x0b\x32\x10.greenlight.Htlc\"\x86\x01\n\x04Peer\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12&\n\taddresses\x18\x03 \x03(\x0b\x32\x13.greenlight.Address\x12\x10\n\x08\x66\x65\x61tures\x18\x04 \x01(\t\x12%\n\x08\x63hannels\x18\x05 \x03(\x0b\x32\x13.greenlight.Channel\"4\n\x11ListPeersResponse\x12\x1f\n\x05peers\x18\x01 \x03(\x0b\x32\x10.greenlight.Peer\"3\n\x11\x44isconnectRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\"\x14\n\x12\x44isconnectResponse\"B\n\x0eNewAddrRequest\x12\x30\n\x0c\x61\x64\x64ress_type\x18\x01 \x01(\x0e\x32\x1a.greenlight.BtcAddressType\"T\n\x0fNewAddrResponse\x12\x30\n\x0c\x61\x64\x64ress_type\x18\x01 \x01(\x0e\x32\x1a.greenlight.BtcAddressType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\"=\n\x10ListFundsRequest\x12)\n\x07minconf\x18\x01 \x01(\x0b\x32\x18.greenlight.Confirmation\"\xc3\x01\n\x0fListFundsOutput\x12$\n\x06output\x18\x01 \x01(\x0b\x32\x14.greenlight.Outpoint\x12\"\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x12.greenlight.Amount\x12\x0f\n\x07\x61\x64\x64ress\x18\x04 \x01(\t\x12(\n\x06status\x18\x05 \x01(\x0e\x32\x18.greenlight.OutputStatus\x12\x10\n\x08reserved\x18\x06 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x07 \x01(\r\"\xac\x01\n\x10ListFundsChannel\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12\x18\n\x10short_channel_id\x18\x03 \x01(\x04\x12\x17\n\x0four_amount_msat\x18\x04 \x01(\x04\x12\x13\n\x0b\x61mount_msat\x18\x05 \x01(\x04\x12\x14\n\x0c\x66unding_txid\x18\x06 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x07 \x01(\r\"q\n\x11ListFundsResponse\x12,\n\x07outputs\x18\x01 \x03(\x0b\x32\x1b.greenlight.ListFundsOutput\x12.\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x1c.greenlight.ListFundsChannel\"a\n\x07\x46\x65\x65rate\x12+\n\x06preset\x18\x01 \x01(\x0e\x32\x19.greenlight.FeeratePresetH\x00\x12\x0f\n\x05perkw\x18\x05 \x01(\x04H\x00\x12\x0f\n\x05perkb\x18\x06 \x01(\x04H\x00\x42\x07\n\x05value\"\x1e\n\x0c\x43onfirmation\x12\x0e\n\x06\x62locks\x18\x01 \x01(\r\"\xc0\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12\"\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x12.greenlight.Amount\x12$\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\x13.greenlight.Feerate\x12)\n\x07minconf\x18\x07 \x01(\x0b\x32\x18.greenlight.Confirmation\x12#\n\x05utxos\x18\x08 \x03(\x0b\x32\x14.greenlight.Outpoint\",\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\"\xbe\x01\n\x12\x46undChannelRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\"\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x12.greenlight.Amount\x12$\n\x07\x66\x65\x65rate\x18\x03 \x01(\x0b\x32\x13.greenlight.Feerate\x12\x10\n\x08\x61nnounce\x18\x07 \x01(\x08\x12)\n\x07minconf\x18\x08 \x01(\x0b\x32\x18.greenlight.Confirmation\x12\x10\n\x08\x63lose_to\x18\n \x01(\t\"(\n\x08Outpoint\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06outnum\x18\x02 \x01(\r\"o\n\x13\x46undChannelResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12&\n\x08outpoint\x18\x02 \x01(\x0b\x32\x14.greenlight.Outpoint\x12\x12\n\nchannel_id\x18\x03 \x01(\x0c\x12\x10\n\x08\x63lose_to\x18\x04 \x01(\t\"\x1a\n\x07Timeout\x12\x0f\n\x07seconds\x18\x01 \x01(\r\"!\n\x0e\x42itcoinAddress\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\"\x87\x01\n\x13\x43loseChannelRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12.\n\x11unilateraltimeout\x18\x02 \x01(\x0b\x32\x13.greenlight.Timeout\x12/\n\x0b\x64\x65stination\x18\x03 \x01(\x0b\x32\x1a.greenlight.BitcoinAddress\"b\n\x14\x43loseChannelResponse\x12\x30\n\nclose_type\x18\x01 \x01(\x0e\x32\x1c.greenlight.CloseChannelType\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c\"l\n\x06\x41mount\x12\x16\n\x0cmillisatoshi\x18\x01 \x01(\x04H\x00\x12\x11\n\x07satoshi\x18\x02 \x01(\x04H\x00\x12\x11\n\x07\x62itcoin\x18\x03 \x01(\x04H\x00\x12\r\n\x03\x61ll\x18\x04 \x01(\x08H\x00\x12\r\n\x03\x61ny\x18\x05 \x01(\x08H\x00\x42\x06\n\x04unit\"j\n\x0eInvoiceRequest\x12\"\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x12.greenlight.Amount\x12\r\n\x05label\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08preimage\x18\x04 \x01(\x0c\"\x8d\x02\n\x07Invoice\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\"\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.greenlight.Amount\x12$\n\x08received\x18\x04 \x01(\x0b\x32\x12.greenlight.Amount\x12)\n\x06status\x18\x05 \x01(\x0e\x32\x19.greenlight.InvoiceStatus\x12\x14\n\x0cpayment_time\x18\x06 \x01(\r\x12\x13\n\x0b\x65xpiry_time\x18\x07 \x01(\r\x12\x0e\n\x06\x62olt11\x18\x08 \x01(\t\x12\x14\n\x0cpayment_hash\x18\t \x01(\x0c\x12\x18\n\x10payment_preimage\x18\n \x01(\x0c\"\x8c\x01\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\"\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x12.greenlight.Amount\x12\x0f\n\x07timeout\x18\x03 \x01(\r\x12\x15\n\rmaxfeepercent\x18\x04 \x01(\x01\x12\"\n\x06maxfee\x18\x05 \x01(\x0b\x32\x12.greenlight.Amount\"\xfc\x01\n\x07Payment\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x18\n\x10payment_preimage\x18\x03 \x01(\x0c\x12%\n\x06status\x18\x04 \x01(\x0e\x32\x15.greenlight.PayStatus\x12\"\n\x06\x61mount\x18\x05 \x01(\x0b\x32\x12.greenlight.Amount\x12\'\n\x0b\x61mount_sent\x18\x06 \x01(\x0b\x32\x12.greenlight.Amount\x12\x0e\n\x06\x62olt11\x18\x07 \x01(\t\x12\x12\n\ncreated_at\x18\x08 \x01(\x01\x12\x14\n\x0c\x63ompleted_at\x18\t \x01(\x04\"C\n\x11PaymentIdentifier\x12\x10\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x12\x16\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x00\x42\x04\n\x02id\"H\n\x13ListPaymentsRequest\x12\x31\n\nidentifier\x18\x01 \x01(\x0b\x32\x1d.greenlight.PaymentIdentifier\"=\n\x14ListPaymentsResponse\x12%\n\x08payments\x18\x01 \x03(\x0b\x32\x13.greenlight.Payment\"W\n\x11InvoiceIdentifier\x12\x0f\n\x05label\x18\x01 \x01(\tH\x00\x12\x13\n\tinvstring\x18\x02 \x01(\tH\x00\x12\x16\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x00\x42\x04\n\x02id\"H\n\x13ListInvoicesRequest\x12\x31\n\nidentifier\x18\x01 \x01(\x0b\x32\x1d.greenlight.InvoiceIdentifier\"\x16\n\x14StreamIncomingFilter\"=\n\x14ListInvoicesResponse\x12%\n\x08invoices\x18\x01 \x03(\x0b\x32\x13.greenlight.Invoice\"\'\n\x08TlvField\x12\x0c\n\x04type\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\"\xa5\x01\n\x0fOffChainPayment\x12\r\n\x05label\x18\x01 \x01(\t\x12\x10\n\x08preimage\x18\x02 \x01(\x0c\x12\"\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.greenlight.Amount\x12\'\n\textratlvs\x18\x04 \x03(\x0b\x32\x14.greenlight.TlvField\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x0e\n\x06\x62olt11\x18\x06 \x01(\t\"M\n\x0fIncomingPayment\x12/\n\x08offchain\x18\x01 \x01(\x0b\x32\x1b.greenlight.OffChainPaymentH\x00\x42\t\n\x07\x64\x65tails\"x\n\x0cRoutehintHop\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x02 \x01(\t\x12\x10\n\x08\x66\x65\x65_base\x18\x03 \x01(\x04\x12\x10\n\x08\x66\x65\x65_prop\x18\x04 \x01(\r\x12\x19\n\x11\x63ltv_expiry_delta\x18\x05 \x01(\r\"3\n\tRoutehint\x12&\n\x04hops\x18\x01 \x03(\x0b\x32\x18.greenlight.RoutehintHop\"\xa8\x01\n\x0eKeysendRequest\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\"\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x12.greenlight.Amount\x12\r\n\x05label\x18\x03 \x01(\t\x12)\n\nroutehints\x18\x04 \x03(\x0b\x32\x15.greenlight.Routehint\x12\'\n\textratlvs\x18\x05 \x03(\x0b\x32\x14.greenlight.TlvField\"\x12\n\x10StreamLogRequest\"\x18\n\x08LogEntry\x12\x0c\n\x04line\x18\x01 \x01(\t\"?\n\x10SignerStateEntry\x12\x0f\n\x07version\x18\x01 \x01(\x04\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\x0c\"d\n\x0ePendingRequest\x12\x0f\n\x07request\x18\x01 \x01(\x0c\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\x0e\n\x06pubkey\x18\x04 \x01(\x0c\x12\x11\n\ttimestamp\x18\x05 \x01(\x04\"=\n\nNodeConfig\x12/\n\x0bstartupmsgs\x18\x01 \x03(\x0b\x32\x1a.greenlight.StartupMessage\"3\n\x0eStartupMessage\x12\x0f\n\x07request\x18\x01 \x01(\x0c\x12\x10\n\x08response\x18\x02 \x01(\x0c\"\x18\n\x16StreamCustommsgRequest\"-\n\tCustommsg\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c*:\n\x0eNetAddressType\x12\x08\n\x04Ipv4\x10\x00\x12\x08\n\x04Ipv6\x10\x01\x12\t\n\x05TorV2\x10\x02\x12\t\n\x05TorV3\x10\x03*-\n\x0e\x42tcAddressType\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x0f\n\x0bP2SH_SEGWIT\x10\x01*.\n\x0cOutputStatus\x12\r\n\tCONFIRMED\x10\x00\x12\x0f\n\x0bUNCONFIRMED\x10\x01*1\n\rFeeratePreset\x12\n\n\x06NORMAL\x10\x00\x12\x08\n\x04SLOW\x10\x01\x12\n\n\x06URGENT\x10\x02*.\n\x10\x43loseChannelType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01*2\n\rInvoiceStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02*2\n\tPayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x32\xec\x0b\n\x04Node\x12G\n\x07GetInfo\x12\x1a.greenlight.GetInfoRequest\x1a\x1b.greenlight.GetInfoResponse\"\x03\x88\x02\x01\x12>\n\x04Stop\x12\x17.greenlight.StopRequest\x1a\x18.greenlight.StopResponse\"\x03\x88\x02\x01\x12K\n\x0b\x43onnectPeer\x12\x1a.greenlight.ConnectRequest\x1a\x1b.greenlight.ConnectResponse\"\x03\x88\x02\x01\x12M\n\tListPeers\x12\x1c.greenlight.ListPeersRequest\x1a\x1d.greenlight.ListPeersResponse\"\x03\x88\x02\x01\x12P\n\nDisconnect\x12\x1d.greenlight.DisconnectRequest\x1a\x1e.greenlight.DisconnectResponse\"\x03\x88\x02\x01\x12G\n\x07NewAddr\x12\x1a.greenlight.NewAddrRequest\x1a\x1b.greenlight.NewAddrResponse\"\x03\x88\x02\x01\x12M\n\tListFunds\x12\x1c.greenlight.ListFundsRequest\x1a\x1d.greenlight.ListFundsResponse\"\x03\x88\x02\x01\x12J\n\x08Withdraw\x12\x1b.greenlight.WithdrawRequest\x1a\x1c.greenlight.WithdrawResponse\"\x03\x88\x02\x01\x12S\n\x0b\x46undChannel\x12\x1e.greenlight.FundChannelRequest\x1a\x1f.greenlight.FundChannelResponse\"\x03\x88\x02\x01\x12V\n\x0c\x43loseChannel\x12\x1f.greenlight.CloseChannelRequest\x1a .greenlight.CloseChannelResponse\"\x03\x88\x02\x01\x12\x45\n\rCreateInvoice\x12\x1a.greenlight.InvoiceRequest\x1a\x13.greenlight.Invoice\"\x03\x88\x02\x01\x12\x37\n\x03Pay\x12\x16.greenlight.PayRequest\x1a\x13.greenlight.Payment\"\x03\x88\x02\x01\x12?\n\x07Keysend\x12\x1a.greenlight.KeysendRequest\x1a\x13.greenlight.Payment\"\x03\x88\x02\x01\x12S\n\x0cListPayments\x12\x1f.greenlight.ListPaymentsRequest\x1a .greenlight.ListPaymentsResponse\"\x00\x12S\n\x0cListInvoices\x12\x1f.greenlight.ListInvoicesRequest\x1a .greenlight.ListInvoicesResponse\"\x00\x12S\n\x0eStreamIncoming\x12 .greenlight.StreamIncomingFilter\x1a\x1b.greenlight.IncomingPayment\"\x00\x30\x01\x12\x43\n\tStreamLog\x12\x1c.greenlight.StreamLogRequest\x1a\x14.greenlight.LogEntry\"\x00\x30\x01\x12P\n\x0fStreamCustommsg\x12\".greenlight.StreamCustommsgRequest\x1a\x15.greenlight.Custommsg\"\x00\x30\x01\x12\x42\n\x11StreamHsmRequests\x12\x11.greenlight.Empty\x1a\x16.greenlight.HsmRequest\"\x00\x30\x01\x12\x41\n\x11RespondHsmRequest\x12\x17.greenlight.HsmResponse\x1a\x11.greenlight.Empty\"\x00\x32s\n\x03Hsm\x12<\n\x07Request\x12\x16.greenlight.HsmRequest\x1a\x17.greenlight.HsmResponse\"\x00\x12.\n\x04Ping\x12\x11.greenlight.Empty\x1a\x11.greenlight.Empty\"\x00\x62\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'greenlight_pb2', _globals) +_NETADDRESSTYPE = DESCRIPTOR.enum_types_by_name['NetAddressType'] +NetAddressType = enum_type_wrapper.EnumTypeWrapper(_NETADDRESSTYPE) +_BTCADDRESSTYPE = DESCRIPTOR.enum_types_by_name['BtcAddressType'] +BtcAddressType = enum_type_wrapper.EnumTypeWrapper(_BTCADDRESSTYPE) +_OUTPUTSTATUS = DESCRIPTOR.enum_types_by_name['OutputStatus'] +OutputStatus = enum_type_wrapper.EnumTypeWrapper(_OUTPUTSTATUS) +_FEERATEPRESET = DESCRIPTOR.enum_types_by_name['FeeratePreset'] +FeeratePreset = enum_type_wrapper.EnumTypeWrapper(_FEERATEPRESET) +_CLOSECHANNELTYPE = DESCRIPTOR.enum_types_by_name['CloseChannelType'] +CloseChannelType = enum_type_wrapper.EnumTypeWrapper(_CLOSECHANNELTYPE) +_INVOICESTATUS = DESCRIPTOR.enum_types_by_name['InvoiceStatus'] +InvoiceStatus = enum_type_wrapper.EnumTypeWrapper(_INVOICESTATUS) +_PAYSTATUS = DESCRIPTOR.enum_types_by_name['PayStatus'] +PayStatus = enum_type_wrapper.EnumTypeWrapper(_PAYSTATUS) +Ipv4 = 0 +Ipv6 = 1 +TorV2 = 2 +TorV3 = 3 +BECH32 = 0 +P2SH_SEGWIT = 1 +CONFIRMED = 0 +UNCONFIRMED = 1 +NORMAL = 0 +SLOW = 1 +URGENT = 2 +MUTUAL = 0 +UNILATERAL = 1 +UNPAID = 0 +PAID = 1 +EXPIRED = 2 +PENDING = 0 +COMPLETE = 1 +FAILED = 2 + + +_HSMREQUESTCONTEXT = DESCRIPTOR.message_types_by_name['HsmRequestContext'] +_HSMRESPONSE = DESCRIPTOR.message_types_by_name['HsmResponse'] +_HSMREQUEST = DESCRIPTOR.message_types_by_name['HsmRequest'] +_EMPTY = DESCRIPTOR.message_types_by_name['Empty'] +_ADDRESS = DESCRIPTOR.message_types_by_name['Address'] +_GETINFOREQUEST = DESCRIPTOR.message_types_by_name['GetInfoRequest'] +_GETINFORESPONSE = DESCRIPTOR.message_types_by_name['GetInfoResponse'] +_STOPREQUEST = DESCRIPTOR.message_types_by_name['StopRequest'] +_STOPRESPONSE = DESCRIPTOR.message_types_by_name['StopResponse'] +_CONNECTREQUEST = DESCRIPTOR.message_types_by_name['ConnectRequest'] +_CONNECTRESPONSE = DESCRIPTOR.message_types_by_name['ConnectResponse'] +_LISTPEERSREQUEST = DESCRIPTOR.message_types_by_name['ListPeersRequest'] +_HTLC = DESCRIPTOR.message_types_by_name['Htlc'] +_ALIASES = DESCRIPTOR.message_types_by_name['Aliases'] +_CHANNEL = DESCRIPTOR.message_types_by_name['Channel'] +_PEER = DESCRIPTOR.message_types_by_name['Peer'] +_LISTPEERSRESPONSE = DESCRIPTOR.message_types_by_name['ListPeersResponse'] +_DISCONNECTREQUEST = DESCRIPTOR.message_types_by_name['DisconnectRequest'] +_DISCONNECTRESPONSE = DESCRIPTOR.message_types_by_name['DisconnectResponse'] +_NEWADDRREQUEST = DESCRIPTOR.message_types_by_name['NewAddrRequest'] +_NEWADDRRESPONSE = DESCRIPTOR.message_types_by_name['NewAddrResponse'] +_LISTFUNDSREQUEST = DESCRIPTOR.message_types_by_name['ListFundsRequest'] +_LISTFUNDSOUTPUT = DESCRIPTOR.message_types_by_name['ListFundsOutput'] +_LISTFUNDSCHANNEL = DESCRIPTOR.message_types_by_name['ListFundsChannel'] +_LISTFUNDSRESPONSE = DESCRIPTOR.message_types_by_name['ListFundsResponse'] +_FEERATE = DESCRIPTOR.message_types_by_name['Feerate'] +_CONFIRMATION = DESCRIPTOR.message_types_by_name['Confirmation'] +_WITHDRAWREQUEST = DESCRIPTOR.message_types_by_name['WithdrawRequest'] +_WITHDRAWRESPONSE = DESCRIPTOR.message_types_by_name['WithdrawResponse'] +_FUNDCHANNELREQUEST = DESCRIPTOR.message_types_by_name['FundChannelRequest'] +_OUTPOINT = DESCRIPTOR.message_types_by_name['Outpoint'] +_FUNDCHANNELRESPONSE = DESCRIPTOR.message_types_by_name['FundChannelResponse'] +_TIMEOUT = DESCRIPTOR.message_types_by_name['Timeout'] +_BITCOINADDRESS = DESCRIPTOR.message_types_by_name['BitcoinAddress'] +_CLOSECHANNELREQUEST = DESCRIPTOR.message_types_by_name['CloseChannelRequest'] +_CLOSECHANNELRESPONSE = DESCRIPTOR.message_types_by_name['CloseChannelResponse'] +_AMOUNT = DESCRIPTOR.message_types_by_name['Amount'] +_INVOICEREQUEST = DESCRIPTOR.message_types_by_name['InvoiceRequest'] +_INVOICE = DESCRIPTOR.message_types_by_name['Invoice'] +_PAYREQUEST = DESCRIPTOR.message_types_by_name['PayRequest'] +_PAYMENT = DESCRIPTOR.message_types_by_name['Payment'] +_PAYMENTIDENTIFIER = DESCRIPTOR.message_types_by_name['PaymentIdentifier'] +_LISTPAYMENTSREQUEST = DESCRIPTOR.message_types_by_name['ListPaymentsRequest'] +_LISTPAYMENTSRESPONSE = DESCRIPTOR.message_types_by_name['ListPaymentsResponse'] +_INVOICEIDENTIFIER = DESCRIPTOR.message_types_by_name['InvoiceIdentifier'] +_LISTINVOICESREQUEST = DESCRIPTOR.message_types_by_name['ListInvoicesRequest'] +_STREAMINCOMINGFILTER = DESCRIPTOR.message_types_by_name['StreamIncomingFilter'] +_LISTINVOICESRESPONSE = DESCRIPTOR.message_types_by_name['ListInvoicesResponse'] +_TLVFIELD = DESCRIPTOR.message_types_by_name['TlvField'] +_OFFCHAINPAYMENT = DESCRIPTOR.message_types_by_name['OffChainPayment'] +_INCOMINGPAYMENT = DESCRIPTOR.message_types_by_name['IncomingPayment'] +_ROUTEHINTHOP = DESCRIPTOR.message_types_by_name['RoutehintHop'] +_ROUTEHINT = DESCRIPTOR.message_types_by_name['Routehint'] +_KEYSENDREQUEST = DESCRIPTOR.message_types_by_name['KeysendRequest'] +_STREAMLOGREQUEST = DESCRIPTOR.message_types_by_name['StreamLogRequest'] +_LOGENTRY = DESCRIPTOR.message_types_by_name['LogEntry'] +_SIGNERSTATEENTRY = DESCRIPTOR.message_types_by_name['SignerStateEntry'] +_PENDINGREQUEST = DESCRIPTOR.message_types_by_name['PendingRequest'] +_NODECONFIG = DESCRIPTOR.message_types_by_name['NodeConfig'] +_STARTUPMESSAGE = DESCRIPTOR.message_types_by_name['StartupMessage'] +_STREAMCUSTOMMSGREQUEST = DESCRIPTOR.message_types_by_name['StreamCustommsgRequest'] +_CUSTOMMSG = DESCRIPTOR.message_types_by_name['Custommsg'] +HsmRequestContext = _reflection.GeneratedProtocolMessageType('HsmRequestContext', (_message.Message,), { + 'DESCRIPTOR' : _HSMREQUESTCONTEXT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.HsmRequestContext) + }) +_sym_db.RegisterMessage(HsmRequestContext) + +HsmResponse = _reflection.GeneratedProtocolMessageType('HsmResponse', (_message.Message,), { + 'DESCRIPTOR' : _HSMRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.HsmResponse) + }) +_sym_db.RegisterMessage(HsmResponse) + +HsmRequest = _reflection.GeneratedProtocolMessageType('HsmRequest', (_message.Message,), { + 'DESCRIPTOR' : _HSMREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.HsmRequest) + }) +_sym_db.RegisterMessage(HsmRequest) + +Empty = _reflection.GeneratedProtocolMessageType('Empty', (_message.Message,), { + 'DESCRIPTOR' : _EMPTY, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Empty) + }) +_sym_db.RegisterMessage(Empty) + +Address = _reflection.GeneratedProtocolMessageType('Address', (_message.Message,), { + 'DESCRIPTOR' : _ADDRESS, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Address) + }) +_sym_db.RegisterMessage(Address) + +GetInfoRequest = _reflection.GeneratedProtocolMessageType('GetInfoRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETINFOREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.GetInfoRequest) + }) +_sym_db.RegisterMessage(GetInfoRequest) + +GetInfoResponse = _reflection.GeneratedProtocolMessageType('GetInfoResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETINFORESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.GetInfoResponse) + }) +_sym_db.RegisterMessage(GetInfoResponse) + +StopRequest = _reflection.GeneratedProtocolMessageType('StopRequest', (_message.Message,), { + 'DESCRIPTOR' : _STOPREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.StopRequest) + }) +_sym_db.RegisterMessage(StopRequest) + +StopResponse = _reflection.GeneratedProtocolMessageType('StopResponse', (_message.Message,), { + 'DESCRIPTOR' : _STOPRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.StopResponse) + }) +_sym_db.RegisterMessage(StopResponse) + +ConnectRequest = _reflection.GeneratedProtocolMessageType('ConnectRequest', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ConnectRequest) + }) +_sym_db.RegisterMessage(ConnectRequest) + +ConnectResponse = _reflection.GeneratedProtocolMessageType('ConnectResponse', (_message.Message,), { + 'DESCRIPTOR' : _CONNECTRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ConnectResponse) + }) +_sym_db.RegisterMessage(ConnectResponse) + +ListPeersRequest = _reflection.GeneratedProtocolMessageType('ListPeersRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTPEERSREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListPeersRequest) + }) +_sym_db.RegisterMessage(ListPeersRequest) + +Htlc = _reflection.GeneratedProtocolMessageType('Htlc', (_message.Message,), { + 'DESCRIPTOR' : _HTLC, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Htlc) + }) +_sym_db.RegisterMessage(Htlc) + +Aliases = _reflection.GeneratedProtocolMessageType('Aliases', (_message.Message,), { + 'DESCRIPTOR' : _ALIASES, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Aliases) + }) +_sym_db.RegisterMessage(Aliases) + +Channel = _reflection.GeneratedProtocolMessageType('Channel', (_message.Message,), { + 'DESCRIPTOR' : _CHANNEL, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Channel) + }) +_sym_db.RegisterMessage(Channel) + +Peer = _reflection.GeneratedProtocolMessageType('Peer', (_message.Message,), { + 'DESCRIPTOR' : _PEER, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Peer) + }) +_sym_db.RegisterMessage(Peer) + +ListPeersResponse = _reflection.GeneratedProtocolMessageType('ListPeersResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTPEERSRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListPeersResponse) + }) +_sym_db.RegisterMessage(ListPeersResponse) + +DisconnectRequest = _reflection.GeneratedProtocolMessageType('DisconnectRequest', (_message.Message,), { + 'DESCRIPTOR' : _DISCONNECTREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.DisconnectRequest) + }) +_sym_db.RegisterMessage(DisconnectRequest) + +DisconnectResponse = _reflection.GeneratedProtocolMessageType('DisconnectResponse', (_message.Message,), { + 'DESCRIPTOR' : _DISCONNECTRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.DisconnectResponse) + }) +_sym_db.RegisterMessage(DisconnectResponse) + +NewAddrRequest = _reflection.GeneratedProtocolMessageType('NewAddrRequest', (_message.Message,), { + 'DESCRIPTOR' : _NEWADDRREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.NewAddrRequest) + }) +_sym_db.RegisterMessage(NewAddrRequest) + +NewAddrResponse = _reflection.GeneratedProtocolMessageType('NewAddrResponse', (_message.Message,), { + 'DESCRIPTOR' : _NEWADDRRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.NewAddrResponse) + }) +_sym_db.RegisterMessage(NewAddrResponse) + +ListFundsRequest = _reflection.GeneratedProtocolMessageType('ListFundsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTFUNDSREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListFundsRequest) + }) +_sym_db.RegisterMessage(ListFundsRequest) + +ListFundsOutput = _reflection.GeneratedProtocolMessageType('ListFundsOutput', (_message.Message,), { + 'DESCRIPTOR' : _LISTFUNDSOUTPUT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListFundsOutput) + }) +_sym_db.RegisterMessage(ListFundsOutput) + +ListFundsChannel = _reflection.GeneratedProtocolMessageType('ListFundsChannel', (_message.Message,), { + 'DESCRIPTOR' : _LISTFUNDSCHANNEL, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListFundsChannel) + }) +_sym_db.RegisterMessage(ListFundsChannel) + +ListFundsResponse = _reflection.GeneratedProtocolMessageType('ListFundsResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTFUNDSRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListFundsResponse) + }) +_sym_db.RegisterMessage(ListFundsResponse) + +Feerate = _reflection.GeneratedProtocolMessageType('Feerate', (_message.Message,), { + 'DESCRIPTOR' : _FEERATE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Feerate) + }) +_sym_db.RegisterMessage(Feerate) + +Confirmation = _reflection.GeneratedProtocolMessageType('Confirmation', (_message.Message,), { + 'DESCRIPTOR' : _CONFIRMATION, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Confirmation) + }) +_sym_db.RegisterMessage(Confirmation) + +WithdrawRequest = _reflection.GeneratedProtocolMessageType('WithdrawRequest', (_message.Message,), { + 'DESCRIPTOR' : _WITHDRAWREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.WithdrawRequest) + }) +_sym_db.RegisterMessage(WithdrawRequest) + +WithdrawResponse = _reflection.GeneratedProtocolMessageType('WithdrawResponse', (_message.Message,), { + 'DESCRIPTOR' : _WITHDRAWRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.WithdrawResponse) + }) +_sym_db.RegisterMessage(WithdrawResponse) + +FundChannelRequest = _reflection.GeneratedProtocolMessageType('FundChannelRequest', (_message.Message,), { + 'DESCRIPTOR' : _FUNDCHANNELREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.FundChannelRequest) + }) +_sym_db.RegisterMessage(FundChannelRequest) + +Outpoint = _reflection.GeneratedProtocolMessageType('Outpoint', (_message.Message,), { + 'DESCRIPTOR' : _OUTPOINT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Outpoint) + }) +_sym_db.RegisterMessage(Outpoint) + +FundChannelResponse = _reflection.GeneratedProtocolMessageType('FundChannelResponse', (_message.Message,), { + 'DESCRIPTOR' : _FUNDCHANNELRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.FundChannelResponse) + }) +_sym_db.RegisterMessage(FundChannelResponse) + +Timeout = _reflection.GeneratedProtocolMessageType('Timeout', (_message.Message,), { + 'DESCRIPTOR' : _TIMEOUT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Timeout) + }) +_sym_db.RegisterMessage(Timeout) + +BitcoinAddress = _reflection.GeneratedProtocolMessageType('BitcoinAddress', (_message.Message,), { + 'DESCRIPTOR' : _BITCOINADDRESS, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.BitcoinAddress) + }) +_sym_db.RegisterMessage(BitcoinAddress) + +CloseChannelRequest = _reflection.GeneratedProtocolMessageType('CloseChannelRequest', (_message.Message,), { + 'DESCRIPTOR' : _CLOSECHANNELREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.CloseChannelRequest) + }) +_sym_db.RegisterMessage(CloseChannelRequest) + +CloseChannelResponse = _reflection.GeneratedProtocolMessageType('CloseChannelResponse', (_message.Message,), { + 'DESCRIPTOR' : _CLOSECHANNELRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.CloseChannelResponse) + }) +_sym_db.RegisterMessage(CloseChannelResponse) + +Amount = _reflection.GeneratedProtocolMessageType('Amount', (_message.Message,), { + 'DESCRIPTOR' : _AMOUNT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Amount) + }) +_sym_db.RegisterMessage(Amount) + +InvoiceRequest = _reflection.GeneratedProtocolMessageType('InvoiceRequest', (_message.Message,), { + 'DESCRIPTOR' : _INVOICEREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.InvoiceRequest) + }) +_sym_db.RegisterMessage(InvoiceRequest) + +Invoice = _reflection.GeneratedProtocolMessageType('Invoice', (_message.Message,), { + 'DESCRIPTOR' : _INVOICE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Invoice) + }) +_sym_db.RegisterMessage(Invoice) + +PayRequest = _reflection.GeneratedProtocolMessageType('PayRequest', (_message.Message,), { + 'DESCRIPTOR' : _PAYREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.PayRequest) + }) +_sym_db.RegisterMessage(PayRequest) + +Payment = _reflection.GeneratedProtocolMessageType('Payment', (_message.Message,), { + 'DESCRIPTOR' : _PAYMENT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Payment) + }) +_sym_db.RegisterMessage(Payment) + +PaymentIdentifier = _reflection.GeneratedProtocolMessageType('PaymentIdentifier', (_message.Message,), { + 'DESCRIPTOR' : _PAYMENTIDENTIFIER, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.PaymentIdentifier) + }) +_sym_db.RegisterMessage(PaymentIdentifier) + +ListPaymentsRequest = _reflection.GeneratedProtocolMessageType('ListPaymentsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTPAYMENTSREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListPaymentsRequest) + }) +_sym_db.RegisterMessage(ListPaymentsRequest) + +ListPaymentsResponse = _reflection.GeneratedProtocolMessageType('ListPaymentsResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTPAYMENTSRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListPaymentsResponse) + }) +_sym_db.RegisterMessage(ListPaymentsResponse) + +InvoiceIdentifier = _reflection.GeneratedProtocolMessageType('InvoiceIdentifier', (_message.Message,), { + 'DESCRIPTOR' : _INVOICEIDENTIFIER, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.InvoiceIdentifier) + }) +_sym_db.RegisterMessage(InvoiceIdentifier) + +ListInvoicesRequest = _reflection.GeneratedProtocolMessageType('ListInvoicesRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTINVOICESREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListInvoicesRequest) + }) +_sym_db.RegisterMessage(ListInvoicesRequest) + +StreamIncomingFilter = _reflection.GeneratedProtocolMessageType('StreamIncomingFilter', (_message.Message,), { + 'DESCRIPTOR' : _STREAMINCOMINGFILTER, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.StreamIncomingFilter) + }) +_sym_db.RegisterMessage(StreamIncomingFilter) + +ListInvoicesResponse = _reflection.GeneratedProtocolMessageType('ListInvoicesResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTINVOICESRESPONSE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.ListInvoicesResponse) + }) +_sym_db.RegisterMessage(ListInvoicesResponse) + +TlvField = _reflection.GeneratedProtocolMessageType('TlvField', (_message.Message,), { + 'DESCRIPTOR' : _TLVFIELD, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.TlvField) + }) +_sym_db.RegisterMessage(TlvField) + +OffChainPayment = _reflection.GeneratedProtocolMessageType('OffChainPayment', (_message.Message,), { + 'DESCRIPTOR' : _OFFCHAINPAYMENT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.OffChainPayment) + }) +_sym_db.RegisterMessage(OffChainPayment) + +IncomingPayment = _reflection.GeneratedProtocolMessageType('IncomingPayment', (_message.Message,), { + 'DESCRIPTOR' : _INCOMINGPAYMENT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.IncomingPayment) + }) +_sym_db.RegisterMessage(IncomingPayment) + +RoutehintHop = _reflection.GeneratedProtocolMessageType('RoutehintHop', (_message.Message,), { + 'DESCRIPTOR' : _ROUTEHINTHOP, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.RoutehintHop) + }) +_sym_db.RegisterMessage(RoutehintHop) + +Routehint = _reflection.GeneratedProtocolMessageType('Routehint', (_message.Message,), { + 'DESCRIPTOR' : _ROUTEHINT, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Routehint) + }) +_sym_db.RegisterMessage(Routehint) + +KeysendRequest = _reflection.GeneratedProtocolMessageType('KeysendRequest', (_message.Message,), { + 'DESCRIPTOR' : _KEYSENDREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.KeysendRequest) + }) +_sym_db.RegisterMessage(KeysendRequest) + +StreamLogRequest = _reflection.GeneratedProtocolMessageType('StreamLogRequest', (_message.Message,), { + 'DESCRIPTOR' : _STREAMLOGREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.StreamLogRequest) + }) +_sym_db.RegisterMessage(StreamLogRequest) + +LogEntry = _reflection.GeneratedProtocolMessageType('LogEntry', (_message.Message,), { + 'DESCRIPTOR' : _LOGENTRY, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.LogEntry) + }) +_sym_db.RegisterMessage(LogEntry) + +SignerStateEntry = _reflection.GeneratedProtocolMessageType('SignerStateEntry', (_message.Message,), { + 'DESCRIPTOR' : _SIGNERSTATEENTRY, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.SignerStateEntry) + }) +_sym_db.RegisterMessage(SignerStateEntry) + +PendingRequest = _reflection.GeneratedProtocolMessageType('PendingRequest', (_message.Message,), { + 'DESCRIPTOR' : _PENDINGREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.PendingRequest) + }) +_sym_db.RegisterMessage(PendingRequest) + +NodeConfig = _reflection.GeneratedProtocolMessageType('NodeConfig', (_message.Message,), { + 'DESCRIPTOR' : _NODECONFIG, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.NodeConfig) + }) +_sym_db.RegisterMessage(NodeConfig) + +StartupMessage = _reflection.GeneratedProtocolMessageType('StartupMessage', (_message.Message,), { + 'DESCRIPTOR' : _STARTUPMESSAGE, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.StartupMessage) + }) +_sym_db.RegisterMessage(StartupMessage) + +StreamCustommsgRequest = _reflection.GeneratedProtocolMessageType('StreamCustommsgRequest', (_message.Message,), { + 'DESCRIPTOR' : _STREAMCUSTOMMSGREQUEST, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.StreamCustommsgRequest) + }) +_sym_db.RegisterMessage(StreamCustommsgRequest) + +Custommsg = _reflection.GeneratedProtocolMessageType('Custommsg', (_message.Message,), { + 'DESCRIPTOR' : _CUSTOMMSG, + '__module__' : 'greenlight_pb2' + # @@protoc_insertion_point(class_scope:greenlight.Custommsg) + }) +_sym_db.RegisterMessage(Custommsg) + +_NODE = DESCRIPTOR.services_by_name['Node'] +_HSM = DESCRIPTOR.services_by_name['Hsm'] if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None @@ -47,146 +579,146 @@ _NODE.methods_by_name['Pay']._serialized_options = b'\210\002\001' _NODE.methods_by_name['Keysend']._options = None _NODE.methods_by_name['Keysend']._serialized_options = b'\210\002\001' - _globals['_NETADDRESSTYPE']._serialized_start=5808 - _globals['_NETADDRESSTYPE']._serialized_end=5866 - _globals['_BTCADDRESSTYPE']._serialized_start=5868 - _globals['_BTCADDRESSTYPE']._serialized_end=5913 - _globals['_OUTPUTSTATUS']._serialized_start=5915 - _globals['_OUTPUTSTATUS']._serialized_end=5961 - _globals['_FEERATEPRESET']._serialized_start=5963 - _globals['_FEERATEPRESET']._serialized_end=6012 - _globals['_CLOSECHANNELTYPE']._serialized_start=6014 - _globals['_CLOSECHANNELTYPE']._serialized_end=6060 - _globals['_INVOICESTATUS']._serialized_start=6062 - _globals['_INVOICESTATUS']._serialized_end=6112 - _globals['_PAYSTATUS']._serialized_start=6114 - _globals['_PAYSTATUS']._serialized_end=6164 - _globals['_HSMREQUESTCONTEXT']._serialized_start=32 - _globals['_HSMREQUESTCONTEXT']._serialized_end=104 - _globals['_HSMRESPONSE']._serialized_start=106 - _globals['_HSMRESPONSE']._serialized_end=204 - _globals['_HSMREQUEST']._serialized_start=207 - _globals['_HSMREQUEST']._serialized_end=398 - _globals['_EMPTY']._serialized_start=400 - _globals['_EMPTY']._serialized_end=407 - _globals['_ADDRESS']._serialized_start=409 - _globals['_ADDRESS']._serialized_end=488 - _globals['_GETINFOREQUEST']._serialized_start=490 - _globals['_GETINFOREQUEST']._serialized_end=506 - _globals['_GETINFORESPONSE']._serialized_start=509 - _globals['_GETINFORESPONSE']._serialized_end=687 - _globals['_STOPREQUEST']._serialized_start=689 - _globals['_STOPREQUEST']._serialized_end=702 - _globals['_STOPRESPONSE']._serialized_start=704 - _globals['_STOPRESPONSE']._serialized_end=718 - _globals['_CONNECTREQUEST']._serialized_start=720 - _globals['_CONNECTREQUEST']._serialized_end=767 - _globals['_CONNECTRESPONSE']._serialized_start=769 - _globals['_CONNECTRESPONSE']._serialized_end=821 - _globals['_LISTPEERSREQUEST']._serialized_start=823 - _globals['_LISTPEERSREQUEST']._serialized_end=858 - _globals['_HTLC']._serialized_start=861 - _globals['_HTLC']._serialized_end=990 - _globals['_ALIASES']._serialized_start=992 - _globals['_ALIASES']._serialized_end=1032 - _globals['_CHANNEL']._serialized_start=1035 - _globals['_CHANNEL']._serialized_end=1434 - _globals['_PEER']._serialized_start=1437 - _globals['_PEER']._serialized_end=1571 - _globals['_LISTPEERSRESPONSE']._serialized_start=1573 - _globals['_LISTPEERSRESPONSE']._serialized_end=1625 - _globals['_DISCONNECTREQUEST']._serialized_start=1627 - _globals['_DISCONNECTREQUEST']._serialized_end=1678 - _globals['_DISCONNECTRESPONSE']._serialized_start=1680 - _globals['_DISCONNECTRESPONSE']._serialized_end=1700 - _globals['_NEWADDRREQUEST']._serialized_start=1702 - _globals['_NEWADDRREQUEST']._serialized_end=1768 - _globals['_NEWADDRRESPONSE']._serialized_start=1770 - _globals['_NEWADDRRESPONSE']._serialized_end=1854 - _globals['_LISTFUNDSREQUEST']._serialized_start=1856 - _globals['_LISTFUNDSREQUEST']._serialized_end=1917 - _globals['_LISTFUNDSOUTPUT']._serialized_start=1920 - _globals['_LISTFUNDSOUTPUT']._serialized_end=2115 - _globals['_LISTFUNDSCHANNEL']._serialized_start=2118 - _globals['_LISTFUNDSCHANNEL']._serialized_end=2290 - _globals['_LISTFUNDSRESPONSE']._serialized_start=2292 - _globals['_LISTFUNDSRESPONSE']._serialized_end=2405 - _globals['_FEERATE']._serialized_start=2407 - _globals['_FEERATE']._serialized_end=2504 - _globals['_CONFIRMATION']._serialized_start=2506 - _globals['_CONFIRMATION']._serialized_end=2536 - _globals['_WITHDRAWREQUEST']._serialized_start=2539 - _globals['_WITHDRAWREQUEST']._serialized_end=2731 - _globals['_WITHDRAWRESPONSE']._serialized_start=2733 - _globals['_WITHDRAWRESPONSE']._serialized_end=2777 - _globals['_FUNDCHANNELREQUEST']._serialized_start=2780 - _globals['_FUNDCHANNELREQUEST']._serialized_end=2970 - _globals['_OUTPOINT']._serialized_start=2972 - _globals['_OUTPOINT']._serialized_end=3012 - _globals['_FUNDCHANNELRESPONSE']._serialized_start=3014 - _globals['_FUNDCHANNELRESPONSE']._serialized_end=3125 - _globals['_TIMEOUT']._serialized_start=3127 - _globals['_TIMEOUT']._serialized_end=3153 - _globals['_BITCOINADDRESS']._serialized_start=3155 - _globals['_BITCOINADDRESS']._serialized_end=3188 - _globals['_CLOSECHANNELREQUEST']._serialized_start=3191 - _globals['_CLOSECHANNELREQUEST']._serialized_end=3326 - _globals['_CLOSECHANNELRESPONSE']._serialized_start=3328 - _globals['_CLOSECHANNELRESPONSE']._serialized_end=3426 - _globals['_AMOUNT']._serialized_start=3428 - _globals['_AMOUNT']._serialized_end=3536 - _globals['_INVOICEREQUEST']._serialized_start=3538 - _globals['_INVOICEREQUEST']._serialized_end=3644 - _globals['_INVOICE']._serialized_start=3647 - _globals['_INVOICE']._serialized_end=3916 - _globals['_PAYREQUEST']._serialized_start=3919 - _globals['_PAYREQUEST']._serialized_end=4059 - _globals['_PAYMENT']._serialized_start=4062 - _globals['_PAYMENT']._serialized_end=4314 - _globals['_PAYMENTIDENTIFIER']._serialized_start=4316 - _globals['_PAYMENTIDENTIFIER']._serialized_end=4383 - _globals['_LISTPAYMENTSREQUEST']._serialized_start=4385 - _globals['_LISTPAYMENTSREQUEST']._serialized_end=4457 - _globals['_LISTPAYMENTSRESPONSE']._serialized_start=4459 - _globals['_LISTPAYMENTSRESPONSE']._serialized_end=4520 - _globals['_INVOICEIDENTIFIER']._serialized_start=4522 - _globals['_INVOICEIDENTIFIER']._serialized_end=4609 - _globals['_LISTINVOICESREQUEST']._serialized_start=4611 - _globals['_LISTINVOICESREQUEST']._serialized_end=4683 - _globals['_STREAMINCOMINGFILTER']._serialized_start=4685 - _globals['_STREAMINCOMINGFILTER']._serialized_end=4707 - _globals['_LISTINVOICESRESPONSE']._serialized_start=4709 - _globals['_LISTINVOICESRESPONSE']._serialized_end=4770 - _globals['_TLVFIELD']._serialized_start=4772 - _globals['_TLVFIELD']._serialized_end=4811 - _globals['_OFFCHAINPAYMENT']._serialized_start=4814 - _globals['_OFFCHAINPAYMENT']._serialized_end=4979 - _globals['_INCOMINGPAYMENT']._serialized_start=4981 - _globals['_INCOMINGPAYMENT']._serialized_end=5058 - _globals['_ROUTEHINTHOP']._serialized_start=5060 - _globals['_ROUTEHINTHOP']._serialized_end=5180 - _globals['_ROUTEHINT']._serialized_start=5182 - _globals['_ROUTEHINT']._serialized_end=5233 - _globals['_KEYSENDREQUEST']._serialized_start=5236 - _globals['_KEYSENDREQUEST']._serialized_end=5404 - _globals['_STREAMLOGREQUEST']._serialized_start=5406 - _globals['_STREAMLOGREQUEST']._serialized_end=5424 - _globals['_LOGENTRY']._serialized_start=5426 - _globals['_LOGENTRY']._serialized_end=5450 - _globals['_SIGNERSTATEENTRY']._serialized_start=5452 - _globals['_SIGNERSTATEENTRY']._serialized_end=5515 - _globals['_PENDINGREQUEST']._serialized_start=5517 - _globals['_PENDINGREQUEST']._serialized_end=5617 - _globals['_NODECONFIG']._serialized_start=5619 - _globals['_NODECONFIG']._serialized_end=5680 - _globals['_STARTUPMESSAGE']._serialized_start=5682 - _globals['_STARTUPMESSAGE']._serialized_end=5733 - _globals['_STREAMCUSTOMMSGREQUEST']._serialized_start=5735 - _globals['_STREAMCUSTOMMSGREQUEST']._serialized_end=5759 - _globals['_CUSTOMMSG']._serialized_start=5761 - _globals['_CUSTOMMSG']._serialized_end=5806 - _globals['_NODE']._serialized_start=6167 - _globals['_NODE']._serialized_end=7683 - _globals['_HSM']._serialized_start=7685 - _globals['_HSM']._serialized_end=7800 + _NETADDRESSTYPE._serialized_start=5808 + _NETADDRESSTYPE._serialized_end=5866 + _BTCADDRESSTYPE._serialized_start=5868 + _BTCADDRESSTYPE._serialized_end=5913 + _OUTPUTSTATUS._serialized_start=5915 + _OUTPUTSTATUS._serialized_end=5961 + _FEERATEPRESET._serialized_start=5963 + _FEERATEPRESET._serialized_end=6012 + _CLOSECHANNELTYPE._serialized_start=6014 + _CLOSECHANNELTYPE._serialized_end=6060 + _INVOICESTATUS._serialized_start=6062 + _INVOICESTATUS._serialized_end=6112 + _PAYSTATUS._serialized_start=6114 + _PAYSTATUS._serialized_end=6164 + _HSMREQUESTCONTEXT._serialized_start=32 + _HSMREQUESTCONTEXT._serialized_end=104 + _HSMRESPONSE._serialized_start=106 + _HSMRESPONSE._serialized_end=204 + _HSMREQUEST._serialized_start=207 + _HSMREQUEST._serialized_end=398 + _EMPTY._serialized_start=400 + _EMPTY._serialized_end=407 + _ADDRESS._serialized_start=409 + _ADDRESS._serialized_end=488 + _GETINFOREQUEST._serialized_start=490 + _GETINFOREQUEST._serialized_end=506 + _GETINFORESPONSE._serialized_start=509 + _GETINFORESPONSE._serialized_end=687 + _STOPREQUEST._serialized_start=689 + _STOPREQUEST._serialized_end=702 + _STOPRESPONSE._serialized_start=704 + _STOPRESPONSE._serialized_end=718 + _CONNECTREQUEST._serialized_start=720 + _CONNECTREQUEST._serialized_end=767 + _CONNECTRESPONSE._serialized_start=769 + _CONNECTRESPONSE._serialized_end=821 + _LISTPEERSREQUEST._serialized_start=823 + _LISTPEERSREQUEST._serialized_end=858 + _HTLC._serialized_start=861 + _HTLC._serialized_end=990 + _ALIASES._serialized_start=992 + _ALIASES._serialized_end=1032 + _CHANNEL._serialized_start=1035 + _CHANNEL._serialized_end=1434 + _PEER._serialized_start=1437 + _PEER._serialized_end=1571 + _LISTPEERSRESPONSE._serialized_start=1573 + _LISTPEERSRESPONSE._serialized_end=1625 + _DISCONNECTREQUEST._serialized_start=1627 + _DISCONNECTREQUEST._serialized_end=1678 + _DISCONNECTRESPONSE._serialized_start=1680 + _DISCONNECTRESPONSE._serialized_end=1700 + _NEWADDRREQUEST._serialized_start=1702 + _NEWADDRREQUEST._serialized_end=1768 + _NEWADDRRESPONSE._serialized_start=1770 + _NEWADDRRESPONSE._serialized_end=1854 + _LISTFUNDSREQUEST._serialized_start=1856 + _LISTFUNDSREQUEST._serialized_end=1917 + _LISTFUNDSOUTPUT._serialized_start=1920 + _LISTFUNDSOUTPUT._serialized_end=2115 + _LISTFUNDSCHANNEL._serialized_start=2118 + _LISTFUNDSCHANNEL._serialized_end=2290 + _LISTFUNDSRESPONSE._serialized_start=2292 + _LISTFUNDSRESPONSE._serialized_end=2405 + _FEERATE._serialized_start=2407 + _FEERATE._serialized_end=2504 + _CONFIRMATION._serialized_start=2506 + _CONFIRMATION._serialized_end=2536 + _WITHDRAWREQUEST._serialized_start=2539 + _WITHDRAWREQUEST._serialized_end=2731 + _WITHDRAWRESPONSE._serialized_start=2733 + _WITHDRAWRESPONSE._serialized_end=2777 + _FUNDCHANNELREQUEST._serialized_start=2780 + _FUNDCHANNELREQUEST._serialized_end=2970 + _OUTPOINT._serialized_start=2972 + _OUTPOINT._serialized_end=3012 + _FUNDCHANNELRESPONSE._serialized_start=3014 + _FUNDCHANNELRESPONSE._serialized_end=3125 + _TIMEOUT._serialized_start=3127 + _TIMEOUT._serialized_end=3153 + _BITCOINADDRESS._serialized_start=3155 + _BITCOINADDRESS._serialized_end=3188 + _CLOSECHANNELREQUEST._serialized_start=3191 + _CLOSECHANNELREQUEST._serialized_end=3326 + _CLOSECHANNELRESPONSE._serialized_start=3328 + _CLOSECHANNELRESPONSE._serialized_end=3426 + _AMOUNT._serialized_start=3428 + _AMOUNT._serialized_end=3536 + _INVOICEREQUEST._serialized_start=3538 + _INVOICEREQUEST._serialized_end=3644 + _INVOICE._serialized_start=3647 + _INVOICE._serialized_end=3916 + _PAYREQUEST._serialized_start=3919 + _PAYREQUEST._serialized_end=4059 + _PAYMENT._serialized_start=4062 + _PAYMENT._serialized_end=4314 + _PAYMENTIDENTIFIER._serialized_start=4316 + _PAYMENTIDENTIFIER._serialized_end=4383 + _LISTPAYMENTSREQUEST._serialized_start=4385 + _LISTPAYMENTSREQUEST._serialized_end=4457 + _LISTPAYMENTSRESPONSE._serialized_start=4459 + _LISTPAYMENTSRESPONSE._serialized_end=4520 + _INVOICEIDENTIFIER._serialized_start=4522 + _INVOICEIDENTIFIER._serialized_end=4609 + _LISTINVOICESREQUEST._serialized_start=4611 + _LISTINVOICESREQUEST._serialized_end=4683 + _STREAMINCOMINGFILTER._serialized_start=4685 + _STREAMINCOMINGFILTER._serialized_end=4707 + _LISTINVOICESRESPONSE._serialized_start=4709 + _LISTINVOICESRESPONSE._serialized_end=4770 + _TLVFIELD._serialized_start=4772 + _TLVFIELD._serialized_end=4811 + _OFFCHAINPAYMENT._serialized_start=4814 + _OFFCHAINPAYMENT._serialized_end=4979 + _INCOMINGPAYMENT._serialized_start=4981 + _INCOMINGPAYMENT._serialized_end=5058 + _ROUTEHINTHOP._serialized_start=5060 + _ROUTEHINTHOP._serialized_end=5180 + _ROUTEHINT._serialized_start=5182 + _ROUTEHINT._serialized_end=5233 + _KEYSENDREQUEST._serialized_start=5236 + _KEYSENDREQUEST._serialized_end=5404 + _STREAMLOGREQUEST._serialized_start=5406 + _STREAMLOGREQUEST._serialized_end=5424 + _LOGENTRY._serialized_start=5426 + _LOGENTRY._serialized_end=5450 + _SIGNERSTATEENTRY._serialized_start=5452 + _SIGNERSTATEENTRY._serialized_end=5515 + _PENDINGREQUEST._serialized_start=5517 + _PENDINGREQUEST._serialized_end=5617 + _NODECONFIG._serialized_start=5619 + _NODECONFIG._serialized_end=5680 + _STARTUPMESSAGE._serialized_start=5682 + _STARTUPMESSAGE._serialized_end=5733 + _STREAMCUSTOMMSGREQUEST._serialized_start=5735 + _STREAMCUSTOMMSGREQUEST._serialized_end=5759 + _CUSTOMMSG._serialized_start=5761 + _CUSTOMMSG._serialized_end=5806 + _NODE._serialized_start=6167 + _NODE._serialized_end=7683 + _HSM._serialized_start=7685 + _HSM._serialized_end=7800 # @@protoc_insertion_point(module_scope) diff --git a/libs/gl-client-py/glclient/greenlight_pb2.pyi b/libs/gl-client-py/glclient/greenlight_pb2.pyi index a3d5a3143..544b65801 100644 --- a/libs/gl-client-py/glclient/greenlight_pb2.pyi +++ b/libs/gl-client-py/glclient/greenlight_pb2.pyi @@ -22,7 +22,7 @@ class _NetAddressType: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _NetAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NetAddressType.ValueType], builtins.type): +class _NetAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NetAddressType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Ipv4: _NetAddressType.ValueType # 0 Ipv6: _NetAddressType.ValueType # 1 @@ -41,7 +41,7 @@ class _BtcAddressType: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _BtcAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BtcAddressType.ValueType], builtins.type): +class _BtcAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BtcAddressType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor BECH32: _BtcAddressType.ValueType # 0 """Default""" @@ -58,7 +58,7 @@ class _OutputStatus: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _OutputStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_OutputStatus.ValueType], builtins.type): +class _OutputStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_OutputStatus.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor CONFIRMED: _OutputStatus.ValueType # 0 UNCONFIRMED: _OutputStatus.ValueType # 1 @@ -73,7 +73,7 @@ class _FeeratePreset: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _FeeratePresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FeeratePreset.ValueType], builtins.type): +class _FeeratePresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FeeratePreset.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor NORMAL: _FeeratePreset.ValueType # 0 SLOW: _FeeratePreset.ValueType # 1 @@ -93,7 +93,7 @@ class _CloseChannelType: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _CloseChannelTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_CloseChannelType.ValueType], builtins.type): +class _CloseChannelTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_CloseChannelType.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor MUTUAL: _CloseChannelType.ValueType # 0 UNILATERAL: _CloseChannelType.ValueType # 1 @@ -108,7 +108,7 @@ class _InvoiceStatus: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _InvoiceStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_InvoiceStatus.ValueType], builtins.type): +class _InvoiceStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_InvoiceStatus.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor UNPAID: _InvoiceStatus.ValueType # 0 PAID: _InvoiceStatus.ValueType # 1 @@ -125,7 +125,7 @@ class _PayStatus: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _PayStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PayStatus.ValueType], builtins.type): +class _PayStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PayStatus.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor PENDING: _PayStatus.ValueType # 0 COMPLETE: _PayStatus.ValueType # 1 @@ -138,7 +138,6 @@ COMPLETE: PayStatus.ValueType # 1 FAILED: PayStatus.ValueType # 2 global___PayStatus = PayStatus -@typing_extensions.final class HsmRequestContext(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -159,7 +158,6 @@ class HsmRequestContext(google.protobuf.message.Message): global___HsmRequestContext = HsmRequestContext -@typing_extensions.final class HsmResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -184,7 +182,6 @@ class HsmResponse(google.protobuf.message.Message): global___HsmResponse = HsmResponse -@typing_extensions.final class HsmRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -221,7 +218,6 @@ class HsmRequest(google.protobuf.message.Message): global___HsmRequest = HsmRequest -@typing_extensions.final class Empty(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -231,7 +227,6 @@ class Empty(google.protobuf.message.Message): global___Empty = Empty -@typing_extensions.final class Address(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -252,7 +247,6 @@ class Address(google.protobuf.message.Message): global___Address = Address -@typing_extensions.final class GetInfoRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -262,7 +256,6 @@ class GetInfoRequest(google.protobuf.message.Message): global___GetInfoRequest = GetInfoRequest -@typing_extensions.final class GetInfoResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -299,7 +292,6 @@ class GetInfoResponse(google.protobuf.message.Message): global___GetInfoResponse = GetInfoResponse -@typing_extensions.final class StopRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -309,7 +301,6 @@ class StopRequest(google.protobuf.message.Message): global___StopRequest = StopRequest -@typing_extensions.final class StopResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -319,7 +310,6 @@ class StopResponse(google.protobuf.message.Message): global___StopResponse = StopResponse -@typing_extensions.final class ConnectRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -337,7 +327,6 @@ class ConnectRequest(google.protobuf.message.Message): global___ConnectRequest = ConnectRequest -@typing_extensions.final class ConnectResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -355,7 +344,6 @@ class ConnectResponse(google.protobuf.message.Message): global___ConnectResponse = ConnectResponse -@typing_extensions.final class ListPeersRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -370,7 +358,6 @@ class ListPeersRequest(google.protobuf.message.Message): global___ListPeersRequest = ListPeersRequest -@typing_extensions.final class Htlc(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -403,7 +390,6 @@ class Htlc(google.protobuf.message.Message): global___Htlc = Htlc -@typing_extensions.final class Aliases(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -421,7 +407,6 @@ class Aliases(google.protobuf.message.Message): global___Aliases = Aliases -@typing_extensions.final class Channel(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -491,7 +476,6 @@ class Channel(google.protobuf.message.Message): global___Channel = Channel -@typing_extensions.final class Peer(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -520,7 +504,6 @@ class Peer(google.protobuf.message.Message): global___Peer = Peer -@typing_extensions.final class ListPeersResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -536,7 +519,6 @@ class ListPeersResponse(google.protobuf.message.Message): global___ListPeersResponse = ListPeersResponse -@typing_extensions.final class DisconnectRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -554,7 +536,6 @@ class DisconnectRequest(google.protobuf.message.Message): global___DisconnectRequest = DisconnectRequest -@typing_extensions.final class DisconnectResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -564,7 +545,6 @@ class DisconnectResponse(google.protobuf.message.Message): global___DisconnectResponse = DisconnectResponse -@typing_extensions.final class NewAddrRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -579,7 +559,6 @@ class NewAddrRequest(google.protobuf.message.Message): global___NewAddrRequest = NewAddrRequest -@typing_extensions.final class NewAddrResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -597,7 +576,6 @@ class NewAddrResponse(google.protobuf.message.Message): global___NewAddrResponse = NewAddrResponse -@typing_extensions.final class ListFundsRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -614,7 +592,6 @@ class ListFundsRequest(google.protobuf.message.Message): global___ListFundsRequest = ListFundsRequest -@typing_extensions.final class ListFundsOutput(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -647,7 +624,6 @@ class ListFundsOutput(google.protobuf.message.Message): global___ListFundsOutput = ListFundsOutput -@typing_extensions.final class ListFundsChannel(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -680,7 +656,6 @@ class ListFundsChannel(google.protobuf.message.Message): global___ListFundsChannel = ListFundsChannel -@typing_extensions.final class ListFundsResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -700,7 +675,6 @@ class ListFundsResponse(google.protobuf.message.Message): global___ListFundsResponse = ListFundsResponse -@typing_extensions.final class Feerate(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -723,7 +697,6 @@ class Feerate(google.protobuf.message.Message): global___Feerate = Feerate -@typing_extensions.final class Confirmation(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -738,7 +711,6 @@ class Confirmation(google.protobuf.message.Message): global___Confirmation = Confirmation -@typing_extensions.final class WithdrawRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -770,7 +742,6 @@ class WithdrawRequest(google.protobuf.message.Message): global___WithdrawRequest = WithdrawRequest -@typing_extensions.final class WithdrawResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -788,7 +759,6 @@ class WithdrawResponse(google.protobuf.message.Message): global___WithdrawResponse = WithdrawResponse -@typing_extensions.final class FundChannelRequest(google.protobuf.message.Message): """TODO: Extract AmountOrAll into its own message TODO: Extract Feerate into its own message @@ -827,7 +797,6 @@ class FundChannelRequest(google.protobuf.message.Message): global___FundChannelRequest = FundChannelRequest -@typing_extensions.final class Outpoint(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -845,7 +814,6 @@ class Outpoint(google.protobuf.message.Message): global___Outpoint = Outpoint -@typing_extensions.final class FundChannelResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -871,7 +839,6 @@ class FundChannelResponse(google.protobuf.message.Message): global___FundChannelResponse = FundChannelResponse -@typing_extensions.final class Timeout(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -886,7 +853,6 @@ class Timeout(google.protobuf.message.Message): global___Timeout = Timeout -@typing_extensions.final class BitcoinAddress(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -901,7 +867,6 @@ class BitcoinAddress(google.protobuf.message.Message): global___BitcoinAddress = BitcoinAddress -@typing_extensions.final class CloseChannelRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -925,7 +890,6 @@ class CloseChannelRequest(google.protobuf.message.Message): global___CloseChannelRequest = CloseChannelRequest -@typing_extensions.final class CloseChannelResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -946,7 +910,6 @@ class CloseChannelResponse(google.protobuf.message.Message): global___CloseChannelResponse = CloseChannelResponse -@typing_extensions.final class Amount(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -975,7 +938,6 @@ class Amount(google.protobuf.message.Message): global___Amount = Amount -@typing_extensions.final class InvoiceRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1001,7 +963,6 @@ class InvoiceRequest(google.protobuf.message.Message): global___InvoiceRequest = InvoiceRequest -@typing_extensions.final class Invoice(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1046,7 +1007,6 @@ class Invoice(google.protobuf.message.Message): global___Invoice = Invoice -@typing_extensions.final class PayRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1080,7 +1040,6 @@ class PayRequest(google.protobuf.message.Message): global___PayRequest = PayRequest -@typing_extensions.final class Payment(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1126,7 +1085,6 @@ class Payment(google.protobuf.message.Message): global___Payment = Payment -@typing_extensions.final class PaymentIdentifier(google.protobuf.message.Message): """A payment identifier is a way to reference a unique payment, either by its bolt11 string or just the payment hash. Only one of the two @@ -1152,7 +1110,6 @@ class PaymentIdentifier(google.protobuf.message.Message): global___PaymentIdentifier = PaymentIdentifier -@typing_extensions.final class ListPaymentsRequest(google.protobuf.message.Message): """Request a list of payments that this node has performed. Optionally the query can be narrowed to a single payment by providing an @@ -1174,7 +1131,6 @@ class ListPaymentsRequest(google.protobuf.message.Message): global___ListPaymentsRequest = ListPaymentsRequest -@typing_extensions.final class ListPaymentsResponse(google.protobuf.message.Message): """The response matching `ListPaymentRequest`. It returns a list of PayResponses, i.e., the same format as `Pay` returned its result. @@ -1194,7 +1150,6 @@ class ListPaymentsResponse(google.protobuf.message.Message): global___ListPaymentsResponse = ListPaymentsResponse -@typing_extensions.final class InvoiceIdentifier(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1217,7 +1172,6 @@ class InvoiceIdentifier(google.protobuf.message.Message): global___InvoiceIdentifier = InvoiceIdentifier -@typing_extensions.final class ListInvoicesRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1234,7 +1188,6 @@ class ListInvoicesRequest(google.protobuf.message.Message): global___ListInvoicesRequest = ListInvoicesRequest -@typing_extensions.final class StreamIncomingFilter(google.protobuf.message.Message): """Options to stream_incoming to specify what to stream.""" @@ -1246,7 +1199,6 @@ class StreamIncomingFilter(google.protobuf.message.Message): global___StreamIncomingFilter = StreamIncomingFilter -@typing_extensions.final class ListInvoicesResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1262,7 +1214,6 @@ class ListInvoicesResponse(google.protobuf.message.Message): global___ListInvoicesResponse = ListInvoicesResponse -@typing_extensions.final class TlvField(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1283,7 +1234,6 @@ class TlvField(google.protobuf.message.Message): global___TlvField = TlvField -@typing_extensions.final class OffChainPayment(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1316,7 +1266,6 @@ class OffChainPayment(google.protobuf.message.Message): global___OffChainPayment = OffChainPayment -@typing_extensions.final class IncomingPayment(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1334,7 +1283,6 @@ class IncomingPayment(google.protobuf.message.Message): global___IncomingPayment = IncomingPayment -@typing_extensions.final class RoutehintHop(google.protobuf.message.Message): """A single hop in a Routehint""" @@ -1363,7 +1311,6 @@ class RoutehintHop(google.protobuf.message.Message): global___RoutehintHop = RoutehintHop -@typing_extensions.final class Routehint(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1379,7 +1326,6 @@ class Routehint(google.protobuf.message.Message): global___Routehint = Routehint -@typing_extensions.final class KeysendRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1410,7 +1356,6 @@ class KeysendRequest(google.protobuf.message.Message): global___KeysendRequest = KeysendRequest -@typing_extensions.final class StreamLogRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1420,7 +1365,6 @@ class StreamLogRequest(google.protobuf.message.Message): global___StreamLogRequest = StreamLogRequest -@typing_extensions.final class LogEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1435,7 +1379,6 @@ class LogEntry(google.protobuf.message.Message): global___LogEntry = LogEntry -@typing_extensions.final class SignerStateEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1456,7 +1399,6 @@ class SignerStateEntry(google.protobuf.message.Message): global___SignerStateEntry = SignerStateEntry -@typing_extensions.final class PendingRequest(google.protobuf.message.Message): """This represents a grpc request that is currently pending, along with the pubkey of the client issuing the request and a matching @@ -1490,7 +1432,6 @@ class PendingRequest(google.protobuf.message.Message): global___PendingRequest = PendingRequest -@typing_extensions.final class NodeConfig(google.protobuf.message.Message): """The `NodeConfig` is used to pass startup parameters to the node. The `gl-plugin` will look for a file in its directory to load @@ -1517,7 +1458,6 @@ class NodeConfig(google.protobuf.message.Message): global___NodeConfig = NodeConfig -@typing_extensions.final class StartupMessage(google.protobuf.message.Message): """A message that we know will be requested by `lightningd` at startup, and that we stash a response to on the scheduler. This @@ -1542,7 +1482,6 @@ class StartupMessage(google.protobuf.message.Message): global___StartupMessage = StartupMessage -@typing_extensions.final class StreamCustommsgRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1552,7 +1491,6 @@ class StreamCustommsgRequest(google.protobuf.message.Message): global___StreamCustommsgRequest = StreamCustommsgRequest -@typing_extensions.final class Custommsg(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor diff --git a/libs/gl-client-py/glclient/scheduler_pb2.py b/libs/gl-client-py/glclient/scheduler_pb2.py index 19dd079b4..d1c2e045c 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.py +++ b/libs/gl-client-py/glclient/scheduler_pb2.py @@ -2,63 +2,216 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: scheduler.proto """Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() +from . import greenlight_pb2 as greenlight__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fscheduler.proto\x12\tscheduler\"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\"\"\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\"5\n\x10NodeInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x10\n\x08grpc_uri\x18\x02 \x01(\t\"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\";\n\x10RecoveryResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\"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*+\n\x0e\x43hallengeScope\x12\x0c\n\x08REGISTER\x10\x00\x12\x0b\n\x07RECOVER\x10\x01\x32\xf0\x04\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\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fscheduler.proto\x12\tscheduler\x1a\x10greenlight.proto\"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\"\"\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\"5\n\x10NodeInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x10\n\x08grpc_uri\x18\x02 \x01(\t\"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\";\n\x10RecoveryResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\"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\"G\n\x0fSignerRejection\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.greenlight.HsmRequest*+\n\x0e\x43hallengeScope\x12\x0c\n\x08REGISTER\x10\x00\x12\x0b\n\x07RECOVER\x10\x01\x32\xba\x05\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\x12H\n\x15ReportSignerRejection\x12\x1a.scheduler.SignerRejection\x1a\x11.greenlight.Empty\"\x00\x62\x06proto3') -_globals = globals() -_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'scheduler_pb2', _globals) +_CHALLENGESCOPE = DESCRIPTOR.enum_types_by_name['ChallengeScope'] +ChallengeScope = enum_type_wrapper.EnumTypeWrapper(_CHALLENGESCOPE) +REGISTER = 0 +RECOVER = 1 + + +_CHALLENGEREQUEST = DESCRIPTOR.message_types_by_name['ChallengeRequest'] +_CHALLENGERESPONSE = DESCRIPTOR.message_types_by_name['ChallengeResponse'] +_REGISTRATIONREQUEST = DESCRIPTOR.message_types_by_name['RegistrationRequest'] +_REGISTRATIONRESPONSE = DESCRIPTOR.message_types_by_name['RegistrationResponse'] +_SCHEDULEREQUEST = DESCRIPTOR.message_types_by_name['ScheduleRequest'] +_NODEINFOREQUEST = DESCRIPTOR.message_types_by_name['NodeInfoRequest'] +_NODEINFORESPONSE = DESCRIPTOR.message_types_by_name['NodeInfoResponse'] +_RECOVERYREQUEST = DESCRIPTOR.message_types_by_name['RecoveryRequest'] +_RECOVERYRESPONSE = DESCRIPTOR.message_types_by_name['RecoveryResponse'] +_UPGRADEREQUEST = DESCRIPTOR.message_types_by_name['UpgradeRequest'] +_UPGRADERESPONSE = DESCRIPTOR.message_types_by_name['UpgradeResponse'] +_STARTUPMESSAGE = DESCRIPTOR.message_types_by_name['StartupMessage'] +_LISTINVITECODESREQUEST = DESCRIPTOR.message_types_by_name['ListInviteCodesRequest'] +_LISTINVITECODESRESPONSE = DESCRIPTOR.message_types_by_name['ListInviteCodesResponse'] +_INVITECODE = DESCRIPTOR.message_types_by_name['InviteCode'] +_EXPORTNODEREQUEST = DESCRIPTOR.message_types_by_name['ExportNodeRequest'] +_EXPORTNODERESPONSE = DESCRIPTOR.message_types_by_name['ExportNodeResponse'] +_SIGNERREJECTION = DESCRIPTOR.message_types_by_name['SignerRejection'] +ChallengeRequest = _reflection.GeneratedProtocolMessageType('ChallengeRequest', (_message.Message,), { + 'DESCRIPTOR' : _CHALLENGEREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ChallengeRequest) + }) +_sym_db.RegisterMessage(ChallengeRequest) + +ChallengeResponse = _reflection.GeneratedProtocolMessageType('ChallengeResponse', (_message.Message,), { + 'DESCRIPTOR' : _CHALLENGERESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ChallengeResponse) + }) +_sym_db.RegisterMessage(ChallengeResponse) + +RegistrationRequest = _reflection.GeneratedProtocolMessageType('RegistrationRequest', (_message.Message,), { + 'DESCRIPTOR' : _REGISTRATIONREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.RegistrationRequest) + }) +_sym_db.RegisterMessage(RegistrationRequest) + +RegistrationResponse = _reflection.GeneratedProtocolMessageType('RegistrationResponse', (_message.Message,), { + 'DESCRIPTOR' : _REGISTRATIONRESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.RegistrationResponse) + }) +_sym_db.RegisterMessage(RegistrationResponse) + +ScheduleRequest = _reflection.GeneratedProtocolMessageType('ScheduleRequest', (_message.Message,), { + 'DESCRIPTOR' : _SCHEDULEREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ScheduleRequest) + }) +_sym_db.RegisterMessage(ScheduleRequest) + +NodeInfoRequest = _reflection.GeneratedProtocolMessageType('NodeInfoRequest', (_message.Message,), { + 'DESCRIPTOR' : _NODEINFOREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.NodeInfoRequest) + }) +_sym_db.RegisterMessage(NodeInfoRequest) + +NodeInfoResponse = _reflection.GeneratedProtocolMessageType('NodeInfoResponse', (_message.Message,), { + 'DESCRIPTOR' : _NODEINFORESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.NodeInfoResponse) + }) +_sym_db.RegisterMessage(NodeInfoResponse) + +RecoveryRequest = _reflection.GeneratedProtocolMessageType('RecoveryRequest', (_message.Message,), { + 'DESCRIPTOR' : _RECOVERYREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.RecoveryRequest) + }) +_sym_db.RegisterMessage(RecoveryRequest) + +RecoveryResponse = _reflection.GeneratedProtocolMessageType('RecoveryResponse', (_message.Message,), { + 'DESCRIPTOR' : _RECOVERYRESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.RecoveryResponse) + }) +_sym_db.RegisterMessage(RecoveryResponse) + +UpgradeRequest = _reflection.GeneratedProtocolMessageType('UpgradeRequest', (_message.Message,), { + 'DESCRIPTOR' : _UPGRADEREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.UpgradeRequest) + }) +_sym_db.RegisterMessage(UpgradeRequest) + +UpgradeResponse = _reflection.GeneratedProtocolMessageType('UpgradeResponse', (_message.Message,), { + 'DESCRIPTOR' : _UPGRADERESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.UpgradeResponse) + }) +_sym_db.RegisterMessage(UpgradeResponse) + +StartupMessage = _reflection.GeneratedProtocolMessageType('StartupMessage', (_message.Message,), { + 'DESCRIPTOR' : _STARTUPMESSAGE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.StartupMessage) + }) +_sym_db.RegisterMessage(StartupMessage) + +ListInviteCodesRequest = _reflection.GeneratedProtocolMessageType('ListInviteCodesRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTINVITECODESREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ListInviteCodesRequest) + }) +_sym_db.RegisterMessage(ListInviteCodesRequest) + +ListInviteCodesResponse = _reflection.GeneratedProtocolMessageType('ListInviteCodesResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTINVITECODESRESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ListInviteCodesResponse) + }) +_sym_db.RegisterMessage(ListInviteCodesResponse) + +InviteCode = _reflection.GeneratedProtocolMessageType('InviteCode', (_message.Message,), { + 'DESCRIPTOR' : _INVITECODE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.InviteCode) + }) +_sym_db.RegisterMessage(InviteCode) + +ExportNodeRequest = _reflection.GeneratedProtocolMessageType('ExportNodeRequest', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTNODEREQUEST, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ExportNodeRequest) + }) +_sym_db.RegisterMessage(ExportNodeRequest) + +ExportNodeResponse = _reflection.GeneratedProtocolMessageType('ExportNodeResponse', (_message.Message,), { + 'DESCRIPTOR' : _EXPORTNODERESPONSE, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.ExportNodeResponse) + }) +_sym_db.RegisterMessage(ExportNodeResponse) + +SignerRejection = _reflection.GeneratedProtocolMessageType('SignerRejection', (_message.Message,), { + 'DESCRIPTOR' : _SIGNERREJECTION, + '__module__' : 'scheduler_pb2' + # @@protoc_insertion_point(class_scope:scheduler.SignerRejection) + }) +_sym_db.RegisterMessage(SignerRejection) + +_SCHEDULER = DESCRIPTOR.services_by_name['Scheduler'] if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None _UPGRADEREQUEST.fields_by_name['initmsg']._options = None _UPGRADEREQUEST.fields_by_name['initmsg']._serialized_options = b'\030\001' - _globals['_CHALLENGESCOPE']._serialized_start=1151 - _globals['_CHALLENGESCOPE']._serialized_end=1194 - _globals['_CHALLENGEREQUEST']._serialized_start=30 - _globals['_CHALLENGEREQUEST']._serialized_end=107 - _globals['_CHALLENGERESPONSE']._serialized_start=109 - _globals['_CHALLENGERESPONSE']._serialized_end=147 - _globals['_REGISTRATIONREQUEST']._serialized_start=150 - _globals['_REGISTRATIONREQUEST']._serialized_end=384 - _globals['_REGISTRATIONRESPONSE']._serialized_start=386 - _globals['_REGISTRATIONRESPONSE']._serialized_end=449 - _globals['_SCHEDULEREQUEST']._serialized_start=451 - _globals['_SCHEDULEREQUEST']._serialized_end=485 - _globals['_NODEINFOREQUEST']._serialized_start=487 - _globals['_NODEINFOREQUEST']._serialized_end=535 - _globals['_NODEINFORESPONSE']._serialized_start=537 - _globals['_NODEINFORESPONSE']._serialized_end=590 - _globals['_RECOVERYREQUEST']._serialized_start=592 - _globals['_RECOVERYREQUEST']._serialized_end=677 - _globals['_RECOVERYRESPONSE']._serialized_start=679 - _globals['_RECOVERYRESPONSE']._serialized_end=738 - _globals['_UPGRADEREQUEST']._serialized_start=740 - _globals['_UPGRADEREQUEST']._serialized_end=849 - _globals['_UPGRADERESPONSE']._serialized_start=851 - _globals['_UPGRADERESPONSE']._serialized_end=889 - _globals['_STARTUPMESSAGE']._serialized_start=891 - _globals['_STARTUPMESSAGE']._serialized_end=942 - _globals['_LISTINVITECODESREQUEST']._serialized_start=944 - _globals['_LISTINVITECODESREQUEST']._serialized_end=968 - _globals['_LISTINVITECODESRESPONSE']._serialized_start=970 - _globals['_LISTINVITECODESRESPONSE']._serialized_end=1044 - _globals['_INVITECODE']._serialized_start=1046 - _globals['_INVITECODE']._serialized_end=1093 - _globals['_EXPORTNODEREQUEST']._serialized_start=1095 - _globals['_EXPORTNODEREQUEST']._serialized_end=1114 - _globals['_EXPORTNODERESPONSE']._serialized_start=1116 - _globals['_EXPORTNODERESPONSE']._serialized_end=1149 - _globals['_SCHEDULER']._serialized_start=1197 - _globals['_SCHEDULER']._serialized_end=1821 + _CHALLENGESCOPE._serialized_start=1242 + _CHALLENGESCOPE._serialized_end=1285 + _CHALLENGEREQUEST._serialized_start=48 + _CHALLENGEREQUEST._serialized_end=125 + _CHALLENGERESPONSE._serialized_start=127 + _CHALLENGERESPONSE._serialized_end=165 + _REGISTRATIONREQUEST._serialized_start=168 + _REGISTRATIONREQUEST._serialized_end=402 + _REGISTRATIONRESPONSE._serialized_start=404 + _REGISTRATIONRESPONSE._serialized_end=467 + _SCHEDULEREQUEST._serialized_start=469 + _SCHEDULEREQUEST._serialized_end=503 + _NODEINFOREQUEST._serialized_start=505 + _NODEINFOREQUEST._serialized_end=553 + _NODEINFORESPONSE._serialized_start=555 + _NODEINFORESPONSE._serialized_end=608 + _RECOVERYREQUEST._serialized_start=610 + _RECOVERYREQUEST._serialized_end=695 + _RECOVERYRESPONSE._serialized_start=697 + _RECOVERYRESPONSE._serialized_end=756 + _UPGRADEREQUEST._serialized_start=758 + _UPGRADEREQUEST._serialized_end=867 + _UPGRADERESPONSE._serialized_start=869 + _UPGRADERESPONSE._serialized_end=907 + _STARTUPMESSAGE._serialized_start=909 + _STARTUPMESSAGE._serialized_end=960 + _LISTINVITECODESREQUEST._serialized_start=962 + _LISTINVITECODESREQUEST._serialized_end=986 + _LISTINVITECODESRESPONSE._serialized_start=988 + _LISTINVITECODESRESPONSE._serialized_end=1062 + _INVITECODE._serialized_start=1064 + _INVITECODE._serialized_end=1111 + _EXPORTNODEREQUEST._serialized_start=1113 + _EXPORTNODEREQUEST._serialized_end=1132 + _EXPORTNODERESPONSE._serialized_start=1134 + _EXPORTNODERESPONSE._serialized_end=1167 + _SIGNERREJECTION._serialized_start=1169 + _SIGNERREJECTION._serialized_end=1240 + _SCHEDULER._serialized_start=1288 + _SCHEDULER._serialized_end=1986 # @@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 dac8d13d7..6b218bf88 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.pyi +++ b/libs/gl-client-py/glclient/scheduler_pb2.pyi @@ -8,6 +8,7 @@ import google.protobuf.descriptor import google.protobuf.internal.containers import google.protobuf.internal.enum_type_wrapper import google.protobuf.message +import greenlight_pb2 import sys import typing @@ -22,7 +23,7 @@ class _ChallengeScope: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _ChallengeScopeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ChallengeScope.ValueType], builtins.type): +class _ChallengeScopeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ChallengeScope.ValueType], builtins.type): # noqa: F821 DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor REGISTER: _ChallengeScope.ValueType # 0 RECOVER: _ChallengeScope.ValueType # 1 @@ -34,7 +35,6 @@ REGISTER: ChallengeScope.ValueType # 0 RECOVER: ChallengeScope.ValueType # 1 global___ChallengeScope = ChallengeScope -@typing_extensions.final class ChallengeRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -52,7 +52,6 @@ class ChallengeRequest(google.protobuf.message.Message): global___ChallengeRequest = ChallengeRequest -@typing_extensions.final class ChallengeResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -67,7 +66,6 @@ class ChallengeResponse(google.protobuf.message.Message): global___ChallengeResponse = ChallengeResponse -@typing_extensions.final class RegistrationRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -146,7 +144,6 @@ class RegistrationRequest(google.protobuf.message.Message): global___RegistrationRequest = RegistrationRequest -@typing_extensions.final class RegistrationResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -171,7 +168,6 @@ class RegistrationResponse(google.protobuf.message.Message): global___RegistrationResponse = RegistrationResponse -@typing_extensions.final class ScheduleRequest(google.protobuf.message.Message): """Ask the scheduler to schedule the node to be run on an available nodelet. @@ -193,7 +189,6 @@ class ScheduleRequest(google.protobuf.message.Message): global___ScheduleRequest = ScheduleRequest -@typing_extensions.final class NodeInfoRequest(google.protobuf.message.Message): """Discovery request asking the scheduler if a nodelet is currently assigned the specified node_id, or wait for one to be assigned. If `wait` is set to @@ -217,7 +212,6 @@ class NodeInfoRequest(google.protobuf.message.Message): global___NodeInfoRequest = NodeInfoRequest -@typing_extensions.final class NodeInfoResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -235,7 +229,6 @@ class NodeInfoResponse(google.protobuf.message.Message): global___NodeInfoResponse = NodeInfoResponse -@typing_extensions.final class RecoveryRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -263,7 +256,6 @@ class RecoveryRequest(google.protobuf.message.Message): global___RecoveryRequest = RecoveryRequest -@typing_extensions.final class RecoveryResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -281,7 +273,6 @@ class RecoveryResponse(google.protobuf.message.Message): global___RecoveryResponse = RecoveryResponse -@typing_extensions.final class UpgradeRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -311,7 +302,6 @@ class UpgradeRequest(google.protobuf.message.Message): global___UpgradeRequest = UpgradeRequest -@typing_extensions.final class UpgradeResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -329,7 +319,6 @@ class UpgradeResponse(google.protobuf.message.Message): global___UpgradeResponse = UpgradeResponse -@typing_extensions.final class StartupMessage(google.protobuf.message.Message): """A message that we know will be requested by `lightningd` at startup, and that we stash a response to on the scheduler. This @@ -354,7 +343,6 @@ class StartupMessage(google.protobuf.message.Message): global___StartupMessage = StartupMessage -@typing_extensions.final class ListInviteCodesRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -364,7 +352,6 @@ class ListInviteCodesRequest(google.protobuf.message.Message): global___ListInviteCodesRequest = ListInviteCodesRequest -@typing_extensions.final class ListInviteCodesResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -380,7 +367,6 @@ class ListInviteCodesResponse(google.protobuf.message.Message): global___ListInviteCodesResponse = ListInviteCodesResponse -@typing_extensions.final class InviteCode(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -398,7 +384,6 @@ class InviteCode(google.protobuf.message.Message): global___InviteCode = InviteCode -@typing_extensions.final class ExportNodeRequest(google.protobuf.message.Message): """Empty message for now, node identity is extracted from the mTLS certificate used to authenticate against the Scheduler. @@ -412,7 +397,6 @@ class ExportNodeRequest(google.protobuf.message.Message): global___ExportNodeRequest = ExportNodeRequest -@typing_extensions.final class ExportNodeResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -427,3 +411,23 @@ class ExportNodeResponse(google.protobuf.message.Message): def ClearField(self, field_name: typing_extensions.Literal["url", b"url"]) -> None: ... global___ExportNodeResponse = ExportNodeResponse + +class SignerRejection(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MSG_FIELD_NUMBER: builtins.int + REQUEST_FIELD_NUMBER: builtins.int + msg: builtins.str + """A human-readable description of what went wrong""" + @property + def request(self) -> greenlight_pb2.HsmRequest: ... + def __init__( + self, + *, + msg: builtins.str = ..., + request: greenlight_pb2.HsmRequest | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["request", b"request"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["msg", b"msg", "request", b"request"]) -> None: ... + +global___SignerRejection = SignerRejection diff --git a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py index e4e8bef61..e7f600e50 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py +++ b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py @@ -2,6 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc +import greenlight_pb2 as greenlight__pb2 from . import scheduler_pb2 as scheduler__pb2 @@ -87,6 +88,11 @@ def __init__(self, channel): request_serializer=scheduler__pb2.ExportNodeRequest.SerializeToString, response_deserializer=scheduler__pb2.ExportNodeResponse.FromString, ) + self.ReportSignerRejection = channel.unary_unary( + '/scheduler.Scheduler/ReportSignerRejection', + request_serializer=scheduler__pb2.SignerRejection.SerializeToString, + response_deserializer=greenlight__pb2.Empty.FromString, + ) class SchedulerServicer(object): @@ -269,6 +275,12 @@ def ExportNode(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def ReportSignerRejection(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def add_SchedulerServicer_to_server(servicer, server): rpc_method_handlers = { @@ -312,6 +324,11 @@ def add_SchedulerServicer_to_server(servicer, server): request_deserializer=scheduler__pb2.ExportNodeRequest.FromString, response_serializer=scheduler__pb2.ExportNodeResponse.SerializeToString, ), + 'ReportSignerRejection': grpc.unary_unary_rpc_method_handler( + servicer.ReportSignerRejection, + request_deserializer=scheduler__pb2.SignerRejection.FromString, + response_serializer=greenlight__pb2.Empty.SerializeToString, + ), } generic_handler = grpc.method_handlers_generic_handler( 'scheduler.Scheduler', rpc_method_handlers) @@ -490,3 +507,20 @@ def ExportNode(request, scheduler__pb2.ExportNodeResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ReportSignerRejection(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/ReportSignerRejection', + scheduler__pb2.SignerRejection.SerializeToString, + greenlight__pb2.Empty.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/libs/gl-client-py/pyproject.toml b/libs/gl-client-py/pyproject.toml index e76081025..9ab9f8a14 100644 --- a/libs/gl-client-py/pyproject.toml +++ b/libs/gl-client-py/pyproject.toml @@ -31,6 +31,7 @@ pyln-grpc-proto = "^0.1" # have an issue with TLS (TSI corruption). grpcio-tools = ">=1.56" protobuf = ">=3" +mypy-protobuf = "^3.5.0" [build-system] requires = ["maturin>=0.11,<0.12"] diff --git a/libs/gl-testing/gltesting/fixtures.py b/libs/gl-testing/gltesting/fixtures.py index b1f71ff24..1ccd6584e 100644 --- a/libs/gl-testing/gltesting/fixtures.py +++ b/libs/gl-testing/gltesting/fixtures.py @@ -121,6 +121,15 @@ def mock_estimatesmartfee(r): del os.environ["GL_SCHEDULER_GRPC_URI"] s.stop() + # Check the reporting server to see if there were any failed + # request resolutions or policies. When testing we bail the test + # here. + + if s.debugger.reports != []: + raise ValueError( + f"Some signer reported an error: {s.debugger.reports}" + ) + @pytest.fixture() def clients(directory, scheduler, nobody_id): diff --git a/libs/gl-testing/gltesting/scheduler.py b/libs/gl-testing/gltesting/scheduler.py index 6ac312d48..f07cdfa9b 100644 --- a/libs/gl-testing/gltesting/scheduler.py +++ b/libs/gl-testing/gltesting/scheduler.py @@ -96,6 +96,7 @@ def __init__( self.bitcoind = bitcoind self.invite_codes: List[str] = [] self.received_invite_code = None + self.debugger = DebugServicer() if node_directory is not None: self.node_directory = node_directory @@ -118,6 +119,7 @@ def start(self): port=self.grpc_port, ssl_context=self.identity.to_ssl_context() ) self.server.add_service(self.service) + self.server.add_service(self.debugger.service) threading.Thread(target=anyio.run, args=(self.run,), daemon=True).start() print("Hello") @@ -357,4 +359,15 @@ async def ListInviteCodes(self, req) -> schedpb.ListInviteCodesResponse: return schedpb.ListInviteCodesResponse(invite_code_list=codes) +class DebugServicer(schedgrpc.DebugServicer): + """Collects and analyzes rejected signer requests.""" + + def __init__(self): + self.reports: List[schedpb.SignerRejection] = [] + + async def ReportSignerRejection(self, report): + self.reports.append(report) + return greenlightpb.Empty() + + Scheduler = AsyncScheduler diff --git a/libs/gl-testing/gltesting/scheduler_grpc.py b/libs/gl-testing/gltesting/scheduler_grpc.py index adb5e916a..1e2871d7a 100644 --- a/libs/gl-testing/gltesting/scheduler_grpc.py +++ b/libs/gl-testing/gltesting/scheduler_grpc.py @@ -1,5 +1,6 @@ import purerpc from glclient import scheduler_pb2 as scheduler__pb2 +from glclient import greenlight_pb2 as greenlight__pb2 class SchedulerServicer(purerpc.Servicer): @@ -176,4 +177,41 @@ def __init__(self, channel): scheduler__pb2.ExportNodeRequest, scheduler__pb2.ExportNodeResponse, ) + ) + + +class DebugServicer(purerpc.Servicer): + async def ReportSignerRejection(self, input_message): + raise NotImplementedError() + + @property + def service(self) -> purerpc.Service: + service_obj = purerpc.Service( + "scheduler.Debug" + ) + service_obj.add_method( + "ReportSignerRejection", + self.ReportSignerRejection, + purerpc.RPCSignature( + purerpc.Cardinality.UNARY_UNARY, + scheduler__pb2.SignerRejection, + greenlight__pb2.Empty, + ) + ) + return service_obj + + +class DebugStub: + def __init__(self, channel): + self._client = purerpc.Client( + "scheduler.Debug", + channel + ) + self.ReportSignerRejection = self._client.get_method_stub( + "ReportSignerRejection", + purerpc.RPCSignature( + purerpc.Cardinality.UNARY_UNARY, + scheduler__pb2.SignerRejection, + greenlight__pb2.Empty, + ) ) \ No newline at end of file diff --git a/libs/proto/scheduler.proto b/libs/proto/scheduler.proto index 21009b380..cce18ec77 100644 --- a/libs/proto/scheduler.proto +++ b/libs/proto/scheduler.proto @@ -1,6 +1,8 @@ syntax = "proto3"; package scheduler; +import "greenlight.proto"; + // 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 @@ -148,6 +150,18 @@ service Scheduler { rpc ExportNode(ExportNodeRequest) returns (ExportNodeResponse) {} }; +// A service to collect debugging information from clients. +service Debug { + // The signer is designed to fail closed, i.e., we reject requests + // that do not resolve or that go against one of its policies. This + // comes with some issues, such as false negatives, where we reject + // despite the request being valid. As more apps use the API we need + // to debug these false negatives, hence why we report rejections, + // so we can investigate the validity of the rejection, and to + // fine-tine the signer's ruleset. + rpc ReportSignerRejection(SignerRejection) returns (greenlight.Empty) {} +} + message ChallengeRequest { ChallengeScope scope = 1; bytes node_id = 2; @@ -311,3 +325,10 @@ message ExportNodeResponse { // URL where the encrypted backup can be retrieved from. string url = 1; } + +message SignerRejection { + // A human-readable description of what went wrong + string msg = 1; + greenlight.HsmRequest request = 2; + string git_version = 3; +} From 7528955e80dadecf7d18f5fae046408d69e7fbbc Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 30 Aug 2023 15:25:43 +0200 Subject: [PATCH 06/15] client: Reorganize protobuf includes There is a bit of a structure that is expected by prost for relative imports. This just ensures we get these right. --- libs/gl-client/src/pb.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/gl-client/src/pb.rs b/libs/gl-client/src/pb.rs index ee197edf4..142887678 100644 --- a/libs/gl-client/src/pb.rs +++ b/libs/gl-client/src/pb.rs @@ -1,8 +1,11 @@ -tonic::include_proto!("greenlight"); + +pub mod greenlight { + tonic::include_proto!("greenlight"); +} pub mod scheduler { tonic::include_proto!("scheduler"); } - +pub use greenlight::*; pub use cln_grpc::pb as cln; From e24db3898cfec0fce76d5a6c924a5db6636b26a2 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 31 Aug 2023 13:53:29 +0200 Subject: [PATCH 07/15] make: Fix up the import path on generated scheduler grpc interfaces --- libs/gl-client-py/Makefile | 1 + libs/gl-client-py/glclient/greenlight_pb2.pyi | 76 +++++++++++++++++-- libs/gl-client-py/glclient/scheduler_pb2.py | 7 +- libs/gl-client-py/glclient/scheduler_pb2.pyi | 20 ++++- .../glclient/scheduler_pb2_grpc.py | 74 +++++++++++++----- 5 files changed, 150 insertions(+), 28 deletions(-) diff --git a/libs/gl-client-py/Makefile b/libs/gl-client-py/Makefile index 47ecf020b..063c05f23 100644 --- a/libs/gl-client-py/Makefile +++ b/libs/gl-client-py/Makefile @@ -36,6 +36,7 @@ ${PYPROTOS}: ${PROTOSRC} python -m grpc_tools.protoc ${PYPROTOC_OPTS} scheduler.proto python -m grpc_tools.protoc ${PYPROTOC_OPTS} greenlight.proto sed -i 's/import scheduler_pb2 as scheduler__pb2/from . import scheduler_pb2 as scheduler__pb2/g' ${PYDIR}/glclient/scheduler_pb2_grpc.py + sed -i 's/import greenlight_pb2 as greenlight__pb2/from . import greenlight_pb2 as greenlight__pb2/g' ${PYDIR}/glclient/scheduler_pb2_grpc.py sed -i 's/import greenlight_pb2 as greenlight__pb2/from . import greenlight_pb2 as greenlight__pb2/g' ${PYDIR}/glclient/scheduler_pb2.py sed -i 's/import greenlight_pb2 as greenlight__pb2/from . import greenlight_pb2 as greenlight__pb2/g' ${PYDIR}/glclient/greenlight_pb2_grpc.py diff --git a/libs/gl-client-py/glclient/greenlight_pb2.pyi b/libs/gl-client-py/glclient/greenlight_pb2.pyi index 544b65801..a3d5a3143 100644 --- a/libs/gl-client-py/glclient/greenlight_pb2.pyi +++ b/libs/gl-client-py/glclient/greenlight_pb2.pyi @@ -22,7 +22,7 @@ class _NetAddressType: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _NetAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NetAddressType.ValueType], builtins.type): # noqa: F821 +class _NetAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_NetAddressType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor Ipv4: _NetAddressType.ValueType # 0 Ipv6: _NetAddressType.ValueType # 1 @@ -41,7 +41,7 @@ class _BtcAddressType: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _BtcAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BtcAddressType.ValueType], builtins.type): # noqa: F821 +class _BtcAddressTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_BtcAddressType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor BECH32: _BtcAddressType.ValueType # 0 """Default""" @@ -58,7 +58,7 @@ class _OutputStatus: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _OutputStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_OutputStatus.ValueType], builtins.type): # noqa: F821 +class _OutputStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_OutputStatus.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor CONFIRMED: _OutputStatus.ValueType # 0 UNCONFIRMED: _OutputStatus.ValueType # 1 @@ -73,7 +73,7 @@ class _FeeratePreset: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _FeeratePresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FeeratePreset.ValueType], builtins.type): # noqa: F821 +class _FeeratePresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_FeeratePreset.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor NORMAL: _FeeratePreset.ValueType # 0 SLOW: _FeeratePreset.ValueType # 1 @@ -93,7 +93,7 @@ class _CloseChannelType: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _CloseChannelTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_CloseChannelType.ValueType], builtins.type): # noqa: F821 +class _CloseChannelTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_CloseChannelType.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor MUTUAL: _CloseChannelType.ValueType # 0 UNILATERAL: _CloseChannelType.ValueType # 1 @@ -108,7 +108,7 @@ class _InvoiceStatus: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _InvoiceStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_InvoiceStatus.ValueType], builtins.type): # noqa: F821 +class _InvoiceStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_InvoiceStatus.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor UNPAID: _InvoiceStatus.ValueType # 0 PAID: _InvoiceStatus.ValueType # 1 @@ -125,7 +125,7 @@ class _PayStatus: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _PayStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PayStatus.ValueType], builtins.type): # noqa: F821 +class _PayStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PayStatus.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor PENDING: _PayStatus.ValueType # 0 COMPLETE: _PayStatus.ValueType # 1 @@ -138,6 +138,7 @@ COMPLETE: PayStatus.ValueType # 1 FAILED: PayStatus.ValueType # 2 global___PayStatus = PayStatus +@typing_extensions.final class HsmRequestContext(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -158,6 +159,7 @@ class HsmRequestContext(google.protobuf.message.Message): global___HsmRequestContext = HsmRequestContext +@typing_extensions.final class HsmResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -182,6 +184,7 @@ class HsmResponse(google.protobuf.message.Message): global___HsmResponse = HsmResponse +@typing_extensions.final class HsmRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -218,6 +221,7 @@ class HsmRequest(google.protobuf.message.Message): global___HsmRequest = HsmRequest +@typing_extensions.final class Empty(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -227,6 +231,7 @@ class Empty(google.protobuf.message.Message): global___Empty = Empty +@typing_extensions.final class Address(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -247,6 +252,7 @@ class Address(google.protobuf.message.Message): global___Address = Address +@typing_extensions.final class GetInfoRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -256,6 +262,7 @@ class GetInfoRequest(google.protobuf.message.Message): global___GetInfoRequest = GetInfoRequest +@typing_extensions.final class GetInfoResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -292,6 +299,7 @@ class GetInfoResponse(google.protobuf.message.Message): global___GetInfoResponse = GetInfoResponse +@typing_extensions.final class StopRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -301,6 +309,7 @@ class StopRequest(google.protobuf.message.Message): global___StopRequest = StopRequest +@typing_extensions.final class StopResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -310,6 +319,7 @@ class StopResponse(google.protobuf.message.Message): global___StopResponse = StopResponse +@typing_extensions.final class ConnectRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -327,6 +337,7 @@ class ConnectRequest(google.protobuf.message.Message): global___ConnectRequest = ConnectRequest +@typing_extensions.final class ConnectResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -344,6 +355,7 @@ class ConnectResponse(google.protobuf.message.Message): global___ConnectResponse = ConnectResponse +@typing_extensions.final class ListPeersRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -358,6 +370,7 @@ class ListPeersRequest(google.protobuf.message.Message): global___ListPeersRequest = ListPeersRequest +@typing_extensions.final class Htlc(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -390,6 +403,7 @@ class Htlc(google.protobuf.message.Message): global___Htlc = Htlc +@typing_extensions.final class Aliases(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -407,6 +421,7 @@ class Aliases(google.protobuf.message.Message): global___Aliases = Aliases +@typing_extensions.final class Channel(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -476,6 +491,7 @@ class Channel(google.protobuf.message.Message): global___Channel = Channel +@typing_extensions.final class Peer(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -504,6 +520,7 @@ class Peer(google.protobuf.message.Message): global___Peer = Peer +@typing_extensions.final class ListPeersResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -519,6 +536,7 @@ class ListPeersResponse(google.protobuf.message.Message): global___ListPeersResponse = ListPeersResponse +@typing_extensions.final class DisconnectRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -536,6 +554,7 @@ class DisconnectRequest(google.protobuf.message.Message): global___DisconnectRequest = DisconnectRequest +@typing_extensions.final class DisconnectResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -545,6 +564,7 @@ class DisconnectResponse(google.protobuf.message.Message): global___DisconnectResponse = DisconnectResponse +@typing_extensions.final class NewAddrRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -559,6 +579,7 @@ class NewAddrRequest(google.protobuf.message.Message): global___NewAddrRequest = NewAddrRequest +@typing_extensions.final class NewAddrResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -576,6 +597,7 @@ class NewAddrResponse(google.protobuf.message.Message): global___NewAddrResponse = NewAddrResponse +@typing_extensions.final class ListFundsRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -592,6 +614,7 @@ class ListFundsRequest(google.protobuf.message.Message): global___ListFundsRequest = ListFundsRequest +@typing_extensions.final class ListFundsOutput(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -624,6 +647,7 @@ class ListFundsOutput(google.protobuf.message.Message): global___ListFundsOutput = ListFundsOutput +@typing_extensions.final class ListFundsChannel(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -656,6 +680,7 @@ class ListFundsChannel(google.protobuf.message.Message): global___ListFundsChannel = ListFundsChannel +@typing_extensions.final class ListFundsResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -675,6 +700,7 @@ class ListFundsResponse(google.protobuf.message.Message): global___ListFundsResponse = ListFundsResponse +@typing_extensions.final class Feerate(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -697,6 +723,7 @@ class Feerate(google.protobuf.message.Message): global___Feerate = Feerate +@typing_extensions.final class Confirmation(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -711,6 +738,7 @@ class Confirmation(google.protobuf.message.Message): global___Confirmation = Confirmation +@typing_extensions.final class WithdrawRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -742,6 +770,7 @@ class WithdrawRequest(google.protobuf.message.Message): global___WithdrawRequest = WithdrawRequest +@typing_extensions.final class WithdrawResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -759,6 +788,7 @@ class WithdrawResponse(google.protobuf.message.Message): global___WithdrawResponse = WithdrawResponse +@typing_extensions.final class FundChannelRequest(google.protobuf.message.Message): """TODO: Extract AmountOrAll into its own message TODO: Extract Feerate into its own message @@ -797,6 +827,7 @@ class FundChannelRequest(google.protobuf.message.Message): global___FundChannelRequest = FundChannelRequest +@typing_extensions.final class Outpoint(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -814,6 +845,7 @@ class Outpoint(google.protobuf.message.Message): global___Outpoint = Outpoint +@typing_extensions.final class FundChannelResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -839,6 +871,7 @@ class FundChannelResponse(google.protobuf.message.Message): global___FundChannelResponse = FundChannelResponse +@typing_extensions.final class Timeout(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -853,6 +886,7 @@ class Timeout(google.protobuf.message.Message): global___Timeout = Timeout +@typing_extensions.final class BitcoinAddress(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -867,6 +901,7 @@ class BitcoinAddress(google.protobuf.message.Message): global___BitcoinAddress = BitcoinAddress +@typing_extensions.final class CloseChannelRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -890,6 +925,7 @@ class CloseChannelRequest(google.protobuf.message.Message): global___CloseChannelRequest = CloseChannelRequest +@typing_extensions.final class CloseChannelResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -910,6 +946,7 @@ class CloseChannelResponse(google.protobuf.message.Message): global___CloseChannelResponse = CloseChannelResponse +@typing_extensions.final class Amount(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -938,6 +975,7 @@ class Amount(google.protobuf.message.Message): global___Amount = Amount +@typing_extensions.final class InvoiceRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -963,6 +1001,7 @@ class InvoiceRequest(google.protobuf.message.Message): global___InvoiceRequest = InvoiceRequest +@typing_extensions.final class Invoice(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1007,6 +1046,7 @@ class Invoice(google.protobuf.message.Message): global___Invoice = Invoice +@typing_extensions.final class PayRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1040,6 +1080,7 @@ class PayRequest(google.protobuf.message.Message): global___PayRequest = PayRequest +@typing_extensions.final class Payment(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1085,6 +1126,7 @@ class Payment(google.protobuf.message.Message): global___Payment = Payment +@typing_extensions.final class PaymentIdentifier(google.protobuf.message.Message): """A payment identifier is a way to reference a unique payment, either by its bolt11 string or just the payment hash. Only one of the two @@ -1110,6 +1152,7 @@ class PaymentIdentifier(google.protobuf.message.Message): global___PaymentIdentifier = PaymentIdentifier +@typing_extensions.final class ListPaymentsRequest(google.protobuf.message.Message): """Request a list of payments that this node has performed. Optionally the query can be narrowed to a single payment by providing an @@ -1131,6 +1174,7 @@ class ListPaymentsRequest(google.protobuf.message.Message): global___ListPaymentsRequest = ListPaymentsRequest +@typing_extensions.final class ListPaymentsResponse(google.protobuf.message.Message): """The response matching `ListPaymentRequest`. It returns a list of PayResponses, i.e., the same format as `Pay` returned its result. @@ -1150,6 +1194,7 @@ class ListPaymentsResponse(google.protobuf.message.Message): global___ListPaymentsResponse = ListPaymentsResponse +@typing_extensions.final class InvoiceIdentifier(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1172,6 +1217,7 @@ class InvoiceIdentifier(google.protobuf.message.Message): global___InvoiceIdentifier = InvoiceIdentifier +@typing_extensions.final class ListInvoicesRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1188,6 +1234,7 @@ class ListInvoicesRequest(google.protobuf.message.Message): global___ListInvoicesRequest = ListInvoicesRequest +@typing_extensions.final class StreamIncomingFilter(google.protobuf.message.Message): """Options to stream_incoming to specify what to stream.""" @@ -1199,6 +1246,7 @@ class StreamIncomingFilter(google.protobuf.message.Message): global___StreamIncomingFilter = StreamIncomingFilter +@typing_extensions.final class ListInvoicesResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1214,6 +1262,7 @@ class ListInvoicesResponse(google.protobuf.message.Message): global___ListInvoicesResponse = ListInvoicesResponse +@typing_extensions.final class TlvField(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1234,6 +1283,7 @@ class TlvField(google.protobuf.message.Message): global___TlvField = TlvField +@typing_extensions.final class OffChainPayment(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1266,6 +1316,7 @@ class OffChainPayment(google.protobuf.message.Message): global___OffChainPayment = OffChainPayment +@typing_extensions.final class IncomingPayment(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1283,6 +1334,7 @@ class IncomingPayment(google.protobuf.message.Message): global___IncomingPayment = IncomingPayment +@typing_extensions.final class RoutehintHop(google.protobuf.message.Message): """A single hop in a Routehint""" @@ -1311,6 +1363,7 @@ class RoutehintHop(google.protobuf.message.Message): global___RoutehintHop = RoutehintHop +@typing_extensions.final class Routehint(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1326,6 +1379,7 @@ class Routehint(google.protobuf.message.Message): global___Routehint = Routehint +@typing_extensions.final class KeysendRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1356,6 +1410,7 @@ class KeysendRequest(google.protobuf.message.Message): global___KeysendRequest = KeysendRequest +@typing_extensions.final class StreamLogRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1365,6 +1420,7 @@ class StreamLogRequest(google.protobuf.message.Message): global___StreamLogRequest = StreamLogRequest +@typing_extensions.final class LogEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1379,6 +1435,7 @@ class LogEntry(google.protobuf.message.Message): global___LogEntry = LogEntry +@typing_extensions.final class SignerStateEntry(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1399,6 +1456,7 @@ class SignerStateEntry(google.protobuf.message.Message): global___SignerStateEntry = SignerStateEntry +@typing_extensions.final class PendingRequest(google.protobuf.message.Message): """This represents a grpc request that is currently pending, along with the pubkey of the client issuing the request and a matching @@ -1432,6 +1490,7 @@ class PendingRequest(google.protobuf.message.Message): global___PendingRequest = PendingRequest +@typing_extensions.final class NodeConfig(google.protobuf.message.Message): """The `NodeConfig` is used to pass startup parameters to the node. The `gl-plugin` will look for a file in its directory to load @@ -1458,6 +1517,7 @@ class NodeConfig(google.protobuf.message.Message): global___NodeConfig = NodeConfig +@typing_extensions.final class StartupMessage(google.protobuf.message.Message): """A message that we know will be requested by `lightningd` at startup, and that we stash a response to on the scheduler. This @@ -1482,6 +1542,7 @@ class StartupMessage(google.protobuf.message.Message): global___StartupMessage = StartupMessage +@typing_extensions.final class StreamCustommsgRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -1491,6 +1552,7 @@ class StreamCustommsgRequest(google.protobuf.message.Message): global___StreamCustommsgRequest = StreamCustommsgRequest +@typing_extensions.final class Custommsg(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor diff --git a/libs/gl-client-py/glclient/scheduler_pb2.py b/libs/gl-client-py/glclient/scheduler_pb2.py index d1c2e045c..d53949e3d 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.py +++ b/libs/gl-client-py/glclient/scheduler_pb2.py @@ -16,7 +16,7 @@ from . import greenlight_pb2 as greenlight__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fscheduler.proto\x12\tscheduler\x1a\x10greenlight.proto\"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\"\"\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\"5\n\x10NodeInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x10\n\x08grpc_uri\x18\x02 \x01(\t\"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\";\n\x10RecoveryResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\"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\"G\n\x0fSignerRejection\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.greenlight.HsmRequest*+\n\x0e\x43hallengeScope\x12\x0c\n\x08REGISTER\x10\x00\x12\x0b\n\x07RECOVER\x10\x01\x32\xba\x05\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\x12H\n\x15ReportSignerRejection\x12\x1a.scheduler.SignerRejection\x1a\x11.greenlight.Empty\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0fscheduler.proto\x12\tscheduler\x1a\x10greenlight.proto\"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\"\"\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\"5\n\x10NodeInfoResponse\x12\x0f\n\x07node_id\x18\x01 \x01(\x0c\x12\x10\n\x08grpc_uri\x18\x02 \x01(\t\"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\";\n\x10RecoveryResponse\x12\x13\n\x0b\x64\x65vice_cert\x18\x01 \x01(\t\x12\x12\n\ndevice_key\x18\x02 \x01(\t\"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\"G\n\x0fSignerRejection\x12\x0b\n\x03msg\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.greenlight.HsmRequest*+\n\x0e\x43hallengeScope\x12\x0c\n\x08REGISTER\x10\x00\x12\x0b\n\x07RECOVER\x10\x01\x32\xf0\x04\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\x32Q\n\x05\x44\x65\x62ug\x12H\n\x15ReportSignerRejection\x12\x1a.scheduler.SignerRejection\x1a\x11.greenlight.Empty\"\x00\x62\x06proto3') _CHALLENGESCOPE = DESCRIPTOR.enum_types_by_name['ChallengeScope'] ChallengeScope = enum_type_wrapper.EnumTypeWrapper(_CHALLENGESCOPE) @@ -169,6 +169,7 @@ _sym_db.RegisterMessage(SignerRejection) _SCHEDULER = DESCRIPTOR.services_by_name['Scheduler'] +_DEBUG = DESCRIPTOR.services_by_name['Debug'] if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None @@ -213,5 +214,7 @@ _SIGNERREJECTION._serialized_start=1169 _SIGNERREJECTION._serialized_end=1240 _SCHEDULER._serialized_start=1288 - _SCHEDULER._serialized_end=1986 + _SCHEDULER._serialized_end=1912 + _DEBUG._serialized_start=1914 + _DEBUG._serialized_end=1995 # @@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 6b218bf88..4b7a61fa8 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2.pyi +++ b/libs/gl-client-py/glclient/scheduler_pb2.pyi @@ -23,7 +23,7 @@ class _ChallengeScope: ValueType = typing.NewType("ValueType", builtins.int) V: typing_extensions.TypeAlias = ValueType -class _ChallengeScopeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ChallengeScope.ValueType], builtins.type): # noqa: F821 +class _ChallengeScopeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ChallengeScope.ValueType], builtins.type): DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor REGISTER: _ChallengeScope.ValueType # 0 RECOVER: _ChallengeScope.ValueType # 1 @@ -35,6 +35,7 @@ REGISTER: ChallengeScope.ValueType # 0 RECOVER: ChallengeScope.ValueType # 1 global___ChallengeScope = ChallengeScope +@typing_extensions.final class ChallengeRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -52,6 +53,7 @@ class ChallengeRequest(google.protobuf.message.Message): global___ChallengeRequest = ChallengeRequest +@typing_extensions.final class ChallengeResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -66,6 +68,7 @@ class ChallengeResponse(google.protobuf.message.Message): global___ChallengeResponse = ChallengeResponse +@typing_extensions.final class RegistrationRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -144,6 +147,7 @@ class RegistrationRequest(google.protobuf.message.Message): global___RegistrationRequest = RegistrationRequest +@typing_extensions.final class RegistrationResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -168,6 +172,7 @@ class RegistrationResponse(google.protobuf.message.Message): global___RegistrationResponse = RegistrationResponse +@typing_extensions.final class ScheduleRequest(google.protobuf.message.Message): """Ask the scheduler to schedule the node to be run on an available nodelet. @@ -189,6 +194,7 @@ class ScheduleRequest(google.protobuf.message.Message): global___ScheduleRequest = ScheduleRequest +@typing_extensions.final class NodeInfoRequest(google.protobuf.message.Message): """Discovery request asking the scheduler if a nodelet is currently assigned the specified node_id, or wait for one to be assigned. If `wait` is set to @@ -212,6 +218,7 @@ class NodeInfoRequest(google.protobuf.message.Message): global___NodeInfoRequest = NodeInfoRequest +@typing_extensions.final class NodeInfoResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -229,6 +236,7 @@ class NodeInfoResponse(google.protobuf.message.Message): global___NodeInfoResponse = NodeInfoResponse +@typing_extensions.final class RecoveryRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -256,6 +264,7 @@ class RecoveryRequest(google.protobuf.message.Message): global___RecoveryRequest = RecoveryRequest +@typing_extensions.final class RecoveryResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -273,6 +282,7 @@ class RecoveryResponse(google.protobuf.message.Message): global___RecoveryResponse = RecoveryResponse +@typing_extensions.final class UpgradeRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -302,6 +312,7 @@ class UpgradeRequest(google.protobuf.message.Message): global___UpgradeRequest = UpgradeRequest +@typing_extensions.final class UpgradeResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -319,6 +330,7 @@ class UpgradeResponse(google.protobuf.message.Message): global___UpgradeResponse = UpgradeResponse +@typing_extensions.final class StartupMessage(google.protobuf.message.Message): """A message that we know will be requested by `lightningd` at startup, and that we stash a response to on the scheduler. This @@ -343,6 +355,7 @@ class StartupMessage(google.protobuf.message.Message): global___StartupMessage = StartupMessage +@typing_extensions.final class ListInviteCodesRequest(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -352,6 +365,7 @@ class ListInviteCodesRequest(google.protobuf.message.Message): global___ListInviteCodesRequest = ListInviteCodesRequest +@typing_extensions.final class ListInviteCodesResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -367,6 +381,7 @@ class ListInviteCodesResponse(google.protobuf.message.Message): global___ListInviteCodesResponse = ListInviteCodesResponse +@typing_extensions.final class InviteCode(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -384,6 +399,7 @@ class InviteCode(google.protobuf.message.Message): global___InviteCode = InviteCode +@typing_extensions.final class ExportNodeRequest(google.protobuf.message.Message): """Empty message for now, node identity is extracted from the mTLS certificate used to authenticate against the Scheduler. @@ -397,6 +413,7 @@ class ExportNodeRequest(google.protobuf.message.Message): global___ExportNodeRequest = ExportNodeRequest +@typing_extensions.final class ExportNodeResponse(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor @@ -412,6 +429,7 @@ class ExportNodeResponse(google.protobuf.message.Message): global___ExportNodeResponse = ExportNodeResponse +@typing_extensions.final class SignerRejection(google.protobuf.message.Message): DESCRIPTOR: google.protobuf.descriptor.Descriptor diff --git a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py index e7f600e50..6f9332c6e 100644 --- a/libs/gl-client-py/glclient/scheduler_pb2_grpc.py +++ b/libs/gl-client-py/glclient/scheduler_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -import greenlight_pb2 as greenlight__pb2 +from . import greenlight_pb2 as greenlight__pb2 from . import scheduler_pb2 as scheduler__pb2 @@ -88,11 +88,6 @@ def __init__(self, channel): request_serializer=scheduler__pb2.ExportNodeRequest.SerializeToString, response_deserializer=scheduler__pb2.ExportNodeResponse.FromString, ) - self.ReportSignerRejection = channel.unary_unary( - '/scheduler.Scheduler/ReportSignerRejection', - request_serializer=scheduler__pb2.SignerRejection.SerializeToString, - response_deserializer=greenlight__pb2.Empty.FromString, - ) class SchedulerServicer(object): @@ -275,12 +270,6 @@ def ExportNode(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') - def ReportSignerRejection(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - def add_SchedulerServicer_to_server(servicer, server): rpc_method_handlers = { @@ -324,11 +313,6 @@ def add_SchedulerServicer_to_server(servicer, server): request_deserializer=scheduler__pb2.ExportNodeRequest.FromString, response_serializer=scheduler__pb2.ExportNodeResponse.SerializeToString, ), - 'ReportSignerRejection': grpc.unary_unary_rpc_method_handler( - servicer.ReportSignerRejection, - request_deserializer=scheduler__pb2.SignerRejection.FromString, - response_serializer=greenlight__pb2.Empty.SerializeToString, - ), } generic_handler = grpc.method_handlers_generic_handler( 'scheduler.Scheduler', rpc_method_handlers) @@ -508,6 +492,60 @@ def ExportNode(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + +class DebugStub(object): + """A service to collect debugging information from clients. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ReportSignerRejection = channel.unary_unary( + '/scheduler.Debug/ReportSignerRejection', + request_serializer=scheduler__pb2.SignerRejection.SerializeToString, + response_deserializer=greenlight__pb2.Empty.FromString, + ) + + +class DebugServicer(object): + """A service to collect debugging information from clients. + """ + + def ReportSignerRejection(self, request, context): + """The signer is designed to fail closed, i.e., we reject requests + that do not resolve or that go against one of its policies. This + comes with some issues, such as false negatives, where we reject + despite the request being valid. As more apps use the API we need + to debug these false negatives, hence why we report rejections, + so we can investigate the validity of the rejection, and to + fine-tine the signer's ruleset. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_DebugServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ReportSignerRejection': grpc.unary_unary_rpc_method_handler( + servicer.ReportSignerRejection, + request_deserializer=scheduler__pb2.SignerRejection.FromString, + response_serializer=greenlight__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'scheduler.Debug', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Debug(object): + """A service to collect debugging information from clients. + """ + @staticmethod def ReportSignerRejection(request, target, @@ -519,7 +557,7 @@ def ReportSignerRejection(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/scheduler.Scheduler/ReportSignerRejection', + return grpc.experimental.unary_unary(request, target, '/scheduler.Debug/ReportSignerRejection', scheduler__pb2.SignerRejection.SerializeToString, greenlight__pb2.Empty.FromString, options, channel_credentials, From 8aebaed92d0070057226073a44851a3ba4ca4e75 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 31 Aug 2023 13:53:53 +0200 Subject: [PATCH 08/15] docker: Re-install the gl-testing package for build-self I was running into issues because the package wasn't being updated and I couldn't test my changes. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ef34fec00..0f5760809 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ gen: ${GENALL} build-self: ensure-docker (cd libs; cargo build --all) (cd libs/gl-client-py && python3 -m maturin develop) + pip install -e libs/gl-testing check-all: check-self check-self-gl-client check-py From 8430f50d00d765aa5e3edd53b752a369b502a32b Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 31 Aug 2023 15:25:07 +0200 Subject: [PATCH 09/15] py: Allow building the gl-client-py package in enforcing mode By selecting `--default-features=false` we can switch over to the enforcing mode. --- libs/gl-client-py/Cargo.toml | 9 ++++++-- libs/gl-client/src/signer/mod.rs | 2 ++ libs/gl-client/src/signer/report.rs | 35 +++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 libs/gl-client/src/signer/report.rs diff --git a/libs/gl-client-py/Cargo.toml b/libs/gl-client-py/Cargo.toml index 3f0021da1..e82e8b2c4 100644 --- a/libs/gl-client-py/Cargo.toml +++ b/libs/gl-client-py/Cargo.toml @@ -12,7 +12,8 @@ crate-type = ["cdylib"] anyhow = { workspace = true } bytes = "1.4" env_logger = { workspace = true } -gl-client = { path = "../gl-client", features = ["permissive"] } + +gl-client = { path = "../gl-client", default-features = false, features = [ "export" ] } hex = "*" log = "*" once_cell = "*" @@ -20,4 +21,8 @@ prost = "0.11" pyo3 = {version = "0.18", features = ["extension-module", "serde", "abi3-py37"]} tokio = { version = "1", features = ["full"] } tonic = { version = "^0.8", features = ["tls", "transport"] } -serde_json = "^1.0" \ No newline at end of file +serde_json = "^1.0" + +[features] +default = ["permissive"] +permissive = ["gl-client/permissive"] \ No newline at end of file diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index 79340da55..d356d4c1a 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -12,6 +12,7 @@ use http::uri::InvalidUri; use lightning_signer::bitcoin::hashes::Hash; use lightning_signer::bitcoin::Network; use lightning_signer::node::NodeServices; +use lightning_signer::policy::filter::FilterRule; use log::{debug, info, trace, warn}; use std::convert::TryInto; use std::sync::Arc; @@ -29,6 +30,7 @@ use vls_protocol_signer::handler::Handler; mod approver; mod auth; pub mod model; +mod report; mod resolve; const VERSION: &str = "v23.08"; diff --git a/libs/gl-client/src/signer/report.rs b/libs/gl-client/src/signer/report.rs new file mode 100644 index 000000000..bc8f50654 --- /dev/null +++ b/libs/gl-client/src/signer/report.rs @@ -0,0 +1,35 @@ +//! Signer reporting facility to debug issues +//! +//! The resolver and policies implemented in the signer may produce +//! false negatives, i.e., they may reject an otherwise valid request +//! based on a missing approval or failing to match up the request +//! with the signed context requests in the resolver. +//! +//! Since issues involving these are hard to debug, given that they +//! run on user devices, we'd like to report any failure to the +//! servers where they are logged and used to fine-tune policies and +//! the resolver. The information in these reports is already known by +//! the server and we are attaching most of it just for easier +//! collation by capturing the full context. + +use crate::pb; +pub struct Reporter {} + +impl Reporter { + pub async fn report(r: pb::scheduler::SignerRejection) { + log::warn!("Delivering report {:?}", r); + let tls = crate::tls::TlsConfig::new().expect("could not load TlsConfig"); + let uri = crate::utils::scheduler_uri(); + let channel = tonic::transport::Endpoint::from_shared(uri) + .expect("could not configure client") + .tls_config(tls.inner.clone()) + .expect("error configuring client with tls config") + .connect_lazy(); + + let mut client = pb::scheduler::debug_client::DebugClient::new(channel); + match client.report_signer_rejection(r).await { + Ok(_) => log::info!("rejection reported"), + Err(e) => log::error!("could not report rejection: {}", e), + } + } +} From 827714278ac9b24a0f2a082e065590d06b9170a2 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 31 Aug 2023 15:26:03 +0200 Subject: [PATCH 10/15] signer: Add resolution and error reporting to the signer --- libs/gl-client/src/signer/mod.rs | 83 ++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index d356d4c1a..995254bb1 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -100,18 +100,11 @@ impl Signer { let persister = Arc::new(crate::persist::MemoryPersister::new()); let mut policy = lightning_signer::policy::simple_validator::make_simple_policy(network); - #[cfg(feature = "permissive")] - { - policy.filter = PolicyFilter::new_permissive(); - } - #[cfg(not(feature = "permissive"))] - { - policy.filter = PolicyFilter::default(); - policy.filter.merge(PolicyFilter { - // TODO: Remove once we have fully switched over to zero-fee anchors - rules: vec![FilterRule::new_warn("policy-channel-safe-type-anchors")], - }); - } + policy.filter = PolicyFilter::default(); + policy.filter.merge(PolicyFilter { + // TODO: Remove once we have fully switched over to zero-fee anchors + rules: vec![FilterRule::new_warn("policy-channel-safe-type-anchors")], + }); let validator_factory = Arc::new(SimpleValidatorFactory::new_with_policy(policy)); let starting_time_factory = ClockStartingTimeFactory::new(); @@ -306,33 +299,18 @@ impl Signer { fn authenticate_request( &self, msg: &vls_protocol::msgs::Message, - req: &HsmRequest, - ) -> Result, Error> { - let ctxrequests: Vec = self - .check_request_auth(req.requests.clone()) - .into_iter() - .filter_map(|r| r.ok()) - .map(|r| decode_request(r)) - .filter_map(|r| match r { - Ok(r) => Some(r), - Err(e) => { - log::error!("Unable to decode request in context: {}", e); - None - } - }) - .collect::>(); - + reqs: &Vec, + ) -> Result<(), Error> { log::trace!( "Resolving signature request against pending grpc commands: {:?}", - req.requests + reqs ); - Resolver::try_resolve(msg, &ctxrequests)?; - use auth::Authorizer; - let auth = auth::GreenlightAuthorizer {}; - let approvals = auth.authorize(ctxrequests).map_err(|e| Error::Auth(e))?; - debug!("Current approvals: {:?}", approvals); - Ok(approvals) + // Quick path out of here: we can't find a resolution for a + // request, then abort! + Resolver::try_resolve(msg, &reqs)?; + + Ok(()) } async fn process_request(&self, req: HsmRequest) -> Result { @@ -362,14 +340,45 @@ impl Signer { _ => {} } + let ctxrequests: Vec = self + .check_request_auth(req.requests.clone()) + .into_iter() + .filter_map(|r| r.ok()) + .map(|r| decode_request(r)) + .filter_map(|r| match r { + Ok(r) => Some(r), + Err(e) => { + log::error!("Unable to decode request in context: {}", e); + None + } + }) + .collect::>(); + let msg = vls_protocol::msgs::from_vec(req.raw.clone()).map_err(|e| Error::Protocol(e))?; log::debug!("Handling message {:?}", msg); log::trace!("Signer state {}", serde_json::to_string(&prestate).unwrap()); - let approvals = self.authenticate_request(&msg, &req)?; + if let Err(e) = self.authenticate_request(&msg, &ctxrequests) { + report::Reporter::report(crate::pb::scheduler::SignerRejection { + msg: e.to_string(), + request: Some(req.clone()), + git_version: GITHASH.to_string(), + }) + .await; + #[cfg(not(feature = "permissive"))] + return Err(Error::Resolver(req.raw, ctxrequests)); + }; + + use auth::Authorizer; + let auth = auth::GreenlightAuthorizer {}; + let approvals = auth.authorize(ctxrequests).map_err(|e| Error::Auth(e))?; + debug!("Current approvals: {:?}", approvals); let approver = Arc::new(MemoApprover::new(approver::ReportingApprover::new( - PositiveApprover(), + #[cfg(feature = "permissive")] + vls_protocol_signer::approver::PositiveApprover(), + #[cfg(not(feature = "permissive"))] + vls_protocol_signer::approver::NegativeApprover(), ))); approver.approve(approvals); let root_handler = self.handler_with_approver(approver)?; From 04fbabf9774fd6273efe5481a17d023f95c6f006 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Thu, 31 Aug 2023 15:27:30 +0200 Subject: [PATCH 11/15] make: No need to run in force-flaky anymore We fixed the grpc issues in python a while ago. --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 0f5760809..414c187de 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,6 @@ check-self: ensure-docker PYTHONPATH=/repo/libs/gl-testing \ pytest -vvv \ /repo/libs/gl-testing \ - --force-flaky \ ${PYTEST_OPTS} ensure-docker: From 3bb4f6366b78dc013e89b415de40fe7addc73c49 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 18 Sep 2023 12:19:54 +0200 Subject: [PATCH 12/15] signer: Upgrade to VLS v0.10.0 --- libs/gl-client/src/signer/approver.rs | 2 +- libs/gl-client/src/signer/mod.rs | 2 +- libs/gl-client/src/signer/resolve.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/gl-client/src/signer/approver.rs b/libs/gl-client/src/signer/approver.rs index 57113d069..daecef3df 100644 --- a/libs/gl-client/src/signer/approver.rs +++ b/libs/gl-client/src/signer/approver.rs @@ -33,7 +33,7 @@ impl Approve for ReportingApprover { fn approve_onchain( &self, tx: &lightning_signer::bitcoin::Transaction, - values_sat: &[u64], + values_sat: &[lightning_signer::bitcoin::TxOut], unknown_indices: &[usize], ) -> bool { log::warn!( diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index 995254bb1..d3cb0537b 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -23,7 +23,7 @@ use tonic::transport::{Endpoint, Uri}; use tonic::Request; use vls_protocol::msgs::{DeBolt, HsmdInitReplyV4}; use vls_protocol::serde_bolt::Octets; -use vls_protocol_signer::approver::{Approval, Approve, MemoApprover, PositiveApprover}; +use vls_protocol_signer::approver::{Approve, MemoApprover}; use vls_protocol_signer::handler; use vls_protocol_signer::handler::Handler; diff --git a/libs/gl-client/src/signer/resolve.rs b/libs/gl-client/src/signer/resolve.rs index a127343c0..d44385f5e 100644 --- a/libs/gl-client/src/signer/resolve.rs +++ b/libs/gl-client/src/signer/resolve.rs @@ -99,7 +99,7 @@ impl Resolver { } } - let ser = vls_protocol::serde_bolt::to_vec(req).unwrap(); + let ser = req.inner().as_vec(); Err(Error::Resolver(ser, reqctx.to_vec())) } } From 7e6f8a84338b073cc37b80c9901b8b361fa1ea31 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 18 Sep 2023 18:18:55 +0200 Subject: [PATCH 13/15] test: Test against the v23.08 version of CLN and try to reprotest --- libs/gl-testing/Dockerfile | 2 +- libs/gl-testing/tests/test_node.py | 35 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/libs/gl-testing/Dockerfile b/libs/gl-testing/Dockerfile index abb80b7b4..0cb153f14 100644 --- a/libs/gl-testing/Dockerfile +++ b/libs/gl-testing/Dockerfile @@ -145,7 +145,7 @@ RUN cd /tmp/ && \ rm -rf bitcoin.tar.gz /tmp/bitcoin-$BITCOIN_VERSION COPY --from=builder /repo/cln-versions/ /opt/cln -RUN ln -s /opt/cln/v23.05gl1 /opt/cln-latest +RUN ln -s /opt/cln/v23.08gl1 /opt/cln-latest RUN mkdir /tmp/protoc && \ cd /tmp/protoc && \ diff --git a/libs/gl-testing/tests/test_node.py b/libs/gl-testing/tests/test_node.py index 892a548b5..0b014417b 100644 --- a/libs/gl-testing/tests/test_node.py +++ b/libs/gl-testing/tests/test_node.py @@ -401,3 +401,38 @@ def test_node_reconnect(clients, scheduler, node_factory, bitcoind): peer = rpc.listpeers()['peers'][0] assert peer['connected'] assert peer['id'] == l1.info['id'] + + +def test_vls_crash_repro( + clients: Clients, + scheduler: Scheduler, + node_factory, + bitcoind) -> None: + """Reproduce an overflow panic in VLS v0.10.0. """ + l1, = node_factory.line_graph(1, opts={'experimental-anchors': None}) + assert(l1.rpc.getinfo()['version'] == 'v23.08gl1') + + c = clients.new() + c.register(configure=True) + s = c.signer().run_in_thread() + gl1 = c.node() + + gl1.connect_peer(l1.info['id'], f'127.0.0.1:{l1.daemon.port}') + + l1.fundwallet(10**7) + l1.rpc.fundchannel(c.node_id.hex(), 'all') + bitcoind.generate_block(1, wait_for_mempool=1) + + wait_for(lambda: l1.rpc.listpeerchannels()['channels'][0]['state'] == 'CHANNELD_NORMAL') + + # Roei reports that the issue can be triggered by sending n from + # l1 to n1 and then (n-1)msat back to l1 + + inv = gl1.invoice( + amount_msat=clnpb.AmountOrAny(amount=clnpb.Amount(msat=2500000)), + description="desc", + label="lbl" + ).bolt11 + + l1.rpc.pay(inv) + inv = l1.rpc.invoice(amount_msat=2499000, label="lbl", description="desc") From eb6a623834b9a420ce56f616c67edbcf9c6c592d Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 25 Sep 2023 12:27:50 +0200 Subject: [PATCH 14/15] client: Remove oververbose state printing --- libs/gl-plugin/src/node/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gl-plugin/src/node/mod.rs b/libs/gl-plugin/src/node/mod.rs index 5612fec4b..0fd2892b4 100644 --- a/libs/gl-plugin/src/node/mod.rs +++ b/libs/gl-plugin/src/node/mod.rs @@ -486,7 +486,7 @@ impl Node for PluginNodeServer { }) .collect(); - req.request.signer_state = dbg!(state.into()); + req.request.signer_state = state.into(); req.request.requests = ctx.snapshot().await.into_iter().map(|r| r.into()).collect(); debug!( "Sending signer requests with {} requests and {} state entries", From 03adfa85c3f2a2ae59681d312fdfc4c376639883 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 26 Sep 2023 12:36:12 +0200 Subject: [PATCH 15/15] client: Fix an error string mismatch --- libs/gl-client/src/signer/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index d3cb0537b..9340b7d80 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -762,7 +762,7 @@ mod tests { .await .unwrap_err() .to_string(), - *"signer refused a request: ShortRead" + *"protocol error: ShortRead" ) }