Skip to content

Commit 5ceb625

Browse files
authored
Merge pull request #3959 from TheBlueMatt/2025-07-3246-followups
Trivial #3246 followups.
2 parents 55baa15 + 86c186a commit 5ceb625

File tree

3 files changed

+21
-36
lines changed

3 files changed

+21
-36
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,19 +2964,6 @@ const MAX_PEER_STORAGE_SIZE: usize = 1024;
29642964
/// many peers we reject new (inbound) connections.
29652965
const MAX_NO_CHANNEL_PEERS: usize = 250;
29662966

2967-
/// The maximum expiration from the current time where an [`Offer`] or [`Refund`] is considered
2968-
/// short-lived, while anything with a greater expiration is considered long-lived.
2969-
///
2970-
/// Using [`ChannelManager::create_offer_builder`] or [`ChannelManager::create_refund_builder`],
2971-
/// will include a [`BlindedMessagePath`] created using [`MessageRouter::create_blinded_paths`].
2972-
///
2973-
/// Using compact [`BlindedMessagePath`]s may provide better privacy as the [`MessageRouter`] could select
2974-
/// more hops. However, since they use short channel ids instead of pubkeys, they are more likely to
2975-
/// become invalid over time as channels are closed. Thus, they are only suitable for short-term use.
2976-
///
2977-
/// [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
2978-
pub const MAX_SHORT_LIVED_RELATIVE_EXPIRY: Duration = Duration::from_secs(60 * 60 * 24);
2979-
29802967
/// Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
29812968
/// These include payments that have yet to find a successful path, or have unresolved HTLCs.
29822969
#[derive(Debug, PartialEq)]
@@ -11567,8 +11554,9 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
1156711554
///
1156811555
/// # Privacy
1156911556
///
11570-
/// Uses the [`MessageRouter`] provided to the [`ChannelManager`] at construction to build a
11571-
/// [`BlindedMessagePath`] for the offer. See those docs for privacy implications.
11557+
/// Uses [`MessageRouter`] provided at construction to construct a [`BlindedMessagePath`] for
11558+
/// the offer. See the documentation of the selected [`MessageRouter`] for details on how it
11559+
/// selects blinded paths including privacy implications and reliability tradeoffs.
1157211560
///
1157311561
/// Also, uses a derived signing pubkey in the offer for recipient privacy.
1157411562
///
@@ -11597,7 +11585,7 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
1159711585
/// This gives users full control over how the [`BlindedMessagePath`] is constructed,
1159811586
/// including the option to omit it entirely.
1159911587
///
11600-
/// See [`Self::create_offer_builder`] for details on offer construction, privacy, and limitations.
11588+
/// See [`Self::create_offer_builder`] for more details on usage.
1160111589
///
1160211590
/// [`BlindedMessagePath`]: crate::blinded_path::message::BlindedMessagePath
1160311591
/// [`Offer`]: crate::offers::offer::Offer
@@ -11640,9 +11628,9 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1164011628
///
1164111629
/// # Privacy
1164211630
///
11643-
/// Uses [`MessageRouter`] to construct a [`BlindedMessagePath`] for the refund based on the given
11644-
/// `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
11645-
/// privacy implications.
11631+
/// Uses [`MessageRouter`] provided at construction to construct a [`BlindedMessagePath`] for
11632+
/// the refund. See the documentation of the selected [`MessageRouter`] for details on how it
11633+
/// selects blinded paths including privacy implications and reliability tradeoffs.
1164611634
///
1164711635
/// Also, uses a derived payer id in the refund for payer privacy.
1164811636
///
@@ -11689,12 +11677,7 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
1168911677
/// refund, including the option to omit it entirely. This is useful for testing or when
1169011678
/// alternative privacy strategies are needed.
1169111679
///
11692-
/// See [`Self::create_refund_builder`] for:
11693-
/// - refund recognition by [`ChannelManager`] via [`Bolt12Invoice`] handling,
11694-
/// - `payment_id` rules and expiration behavior,
11695-
/// - invoice revocation and refund failure handling,
11696-
/// - defaulting behavior for `max_total_routing_fee_msat`,
11697-
/// - and detailed payment and privacy semantics.
11680+
/// See [`Self::create_refund_builder`] for more details on usage.
1169811681
///
1169911682
/// # Errors
1170011683
///

lightning/src/ln/offers_tests.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use crate::blinded_path::message::BlindedMessagePath;
5050
use crate::blinded_path::payment::{Bolt12OfferContext, Bolt12RefundContext, PaymentContext};
5151
use crate::blinded_path::message::OffersContext;
5252
use crate::events::{ClosureReason, Event, HTLCHandlingFailureType, PaidBolt12Invoice, PaymentFailureReason, PaymentPurpose};
53-
use crate::ln::channelmanager::{Bolt12PaymentError, MAX_SHORT_LIVED_RELATIVE_EXPIRY, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry, self};
53+
use crate::ln::channelmanager::{Bolt12PaymentError, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry, self};
5454
use crate::types::features::Bolt12InvoiceFeatures;
5555
use crate::ln::functional_test_utils::*;
5656
use crate::ln::msgs::{BaseMessageHandler, ChannelMessageHandler, Init, NodeAnnouncement, OnionMessage, OnionMessageHandler, RoutingMessageHandler, SocketAddress, UnsignedGossipMessage, UnsignedNodeAnnouncement};
@@ -67,6 +67,10 @@ use crate::routing::router::{PaymentParameters, RouteParameters, RouteParameters
6767
use crate::sign::{NodeSigner, Recipient};
6868
use crate::util::ser::Writeable;
6969

70+
/// This used to determine whether we built a compact path or not, but now its just a random
71+
/// constant we apply to blinded path expiry in these tests.
72+
const MAX_SHORT_LIVED_RELATIVE_EXPIRY: Duration = Duration::from_secs(60 * 60 * 24);
73+
7074
use crate::prelude::*;
7175

7276
macro_rules! expect_recent_payment {

lightning/src/offers/flow.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,9 @@ where
562562
///
563563
/// # Privacy
564564
///
565-
/// Uses the [`OffersMessageFlow`]'s [`MessageRouter`] to construct a [`BlindedMessagePath`]
566-
/// for the offer. See those docs for privacy implications.
565+
/// Uses [`MessageRouter`] provided at construction to construct a [`BlindedMessagePath`] for
566+
/// the offer. See the documentation of the selected [`MessageRouter`] for details on how it
567+
/// selects blinded paths including privacy implications and reliability tradeoffs.
567568
///
568569
/// Also uses a derived signing pubkey in the offer for recipient privacy.
569570
///
@@ -598,7 +599,7 @@ where
598599
/// This gives users full control over how the [`BlindedMessagePath`] is constructed,
599600
/// including the option to omit it entirely.
600601
///
601-
/// See [`Self::create_offer_builder`] for details on offer construction, privacy, and limitations.
602+
/// See [`Self::create_offer_builder`] for more details on usage.
602603
pub fn create_offer_builder_using_router<ME: Deref, ES: Deref>(
603604
&self, router: ME, entropy_source: ES, peers: Vec<MessageForwardNode>,
604605
) -> Result<OfferBuilder<DerivedMetadata, secp256k1::All>, Bolt12SemanticError>
@@ -682,8 +683,9 @@ where
682683
///
683684
/// # Privacy
684685
///
685-
/// Uses the [`OffersMessageFlow`]'s [`MessageRouter`] to construct a [`BlindedMessagePath`]
686-
/// for the offer. See those docs for privacy implications.
686+
/// Uses [`MessageRouter`] provided at construction to construct a [`BlindedMessagePath`] for
687+
/// the refund. See the documentation of the selected [`MessageRouter`] for details on how it
688+
/// selects blinded paths including privacy implications and reliability tradeoffs.
687689
///
688690
/// The builder will have the provided expiration set. Any changes to the expiration on the
689691
/// returned builder will not be honored by [`OffersMessageFlow`]. For non-`std`, the highest seen
@@ -734,11 +736,7 @@ where
734736
/// This gives users full control over how the [`BlindedMessagePath`] is constructed,
735737
/// including the option to omit it entirely.
736738
///
737-
/// See [`Self::create_refund_builder`] for:
738-
/// - how the resulting [`Refund`] is recognized by [`OffersMessageFlow`] and verified via [`Self::verify_bolt12_invoice`],
739-
/// - refund expiration handling,
740-
/// - rules around revocation and [`Event::PaymentFailed`] behavior,
741-
/// - and defaulting logic for `max_total_routing_fee_msat`.
739+
/// See [`Self::create_refund_builder`] for more details on usage.
742740
///
743741
/// # Errors
744742
///

0 commit comments

Comments
 (0)