From 27d9feda58cdbaa1494419bbb4f773c97a5054b3 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 17 Jun 2021 15:41:16 +0000 Subject: [PATCH 1/4] Only check docs on rustc 1.52 as rustc stable now crashes --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d24b2be7a45..716d4b0b751 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,7 +165,9 @@ jobs: check_commits: runs-on: ubuntu-latest env: - TOOLCHAIN: stable + # rustc 1.53 regressed and panics when building our (perfectly fine) docs. + # See https://github.com/rust-lang/rust/issues/84738 + TOOLCHAIN: 1.52.1 steps: - name: Checkout source code uses: actions/checkout@v2 From e7974dac843773546249ed2fa517208f52688a1b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 17 Jun 2021 15:48:20 +0000 Subject: [PATCH 2/4] Expose doc-linked constants in lightning-invoice These constants are generally useful, and are linked from documentation, so should be exposed in any case. --- lightning-invoice/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index fa6a8eedb0f..f3a1f40bb0a 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -60,12 +60,12 @@ const MAX_EXPIRY_TIME: u64 = 60 * 60 * 24 * 356; /// Default expiry time as defined by [BOLT 11]. /// /// [BOLT 11]: https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md -const DEFAULT_EXPIRY_TIME: u64 = 3600; +pub const DEFAULT_EXPIRY_TIME: u64 = 3600; /// Default minimum final CLTV expiry as defined by [BOLT 11]. /// /// [BOLT 11]: https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md -const DEFAULT_MIN_FINAL_CLTV_EXPIRY: u64 = 18; +pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY: u64 = 18; /// This function is used as a static assert for the size of `SystemTime`. If the crate fails to /// compile due to it this indicates that your system uses unexpected bounds for `SystemTime`. You From 84ac66e80f96186166b14a46e80f1cbf5b06576d Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 17 Jun 2021 15:49:17 +0000 Subject: [PATCH 3/4] Make links in message signing docs rustdoc links Latest rustc warns that "this URL is not a hyperlink" and notes that "bare URLs are not automatically turned into clickable links". This resolves those warnings. Thanks to Joshua Nelson for pointing out the correct syntax for this. --- lightning/src/util/message_signing.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lightning/src/util/message_signing.rs b/lightning/src/util/message_signing.rs index c39da1d533e..69c802e7a0a 100644 --- a/lightning/src/util/message_signing.rs +++ b/lightning/src/util/message_signing.rs @@ -12,13 +12,13 @@ //! Note this is not part of the specs, but follows lnd's signing and verifying protocol, which can is defined as follows: //! //! signature = zbase32(SigRec(sha256d(("Lightning Signed Message:" + msg))) -//! zbase32 from https://philzimmermann.com/docs/human-oriented-base-32-encoding.txt +//! zbase32 from //! SigRec has first byte 31 + recovery id, followed by 64 byte sig. //! //! This implementation is compatible with both lnd's and c-lightning's //! -//! https://lightning.readthedocs.io/lightning-signmessage.7.html -//! https://api.lightning.community/#signmessage +//! +//! use prelude::*; use crate::util::zbase32; From f87557931132fbca98fe21d30c17ebc0e601f0cf Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 17 Jun 2021 20:15:39 +0000 Subject: [PATCH 4/4] Clarify invoice comment noting the relevant final-cltv-expiry vals --- lightning-invoice/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index f3a1f40bb0a..2ce58f296f9 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -64,7 +64,11 @@ pub const DEFAULT_EXPIRY_TIME: u64 = 3600; /// Default minimum final CLTV expiry as defined by [BOLT 11]. /// +/// Note that this is *not* the same value as rust-lightning's minimum CLTV expiry, which is +/// provided in [`MIN_FINAL_CLTV_EXPIRY`]. +/// /// [BOLT 11]: https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md +/// [`MIN_FINAL_CLTV_EXPIRY`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY pub const DEFAULT_MIN_FINAL_CLTV_EXPIRY: u64 = 18; /// This function is used as a static assert for the size of `SystemTime`. If the crate fails to