Skip to content

Commit abf6564

Browse files
authored
Merge pull request #1532 from ariard/2022-06-scaleup-far-away
Scale up CLTV_FAR_FAR_AWAY to 2 weeks of blocks
2 parents d2a7ee2 + c989ce1 commit abf6564

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lightning/src/ln/channelmanager.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,13 @@ pub(crate) const MAX_LOCAL_BREAKDOWN_TIMEOUT: u16 = 2 * 6 * 24 * 7;
870870
// the HTLC via a full update_fail_htlc/commitment_signed dance before we hit the
871871
// CLTV_CLAIM_BUFFER point (we static assert that it's at least 3 blocks more).
872872
pub const MIN_CLTV_EXPIRY_DELTA: u16 = 6*7;
873-
pub(super) const CLTV_FAR_FAR_AWAY: u32 = 6 * 24 * 7; //TODO?
873+
// This should be long enough to allow a payment path drawn across multiple routing hops with substantial
874+
// `cltv_expiry_delta`. Indeed, the length of those values is the reaction delay offered to a routing node
875+
// in case of HTLC on-chain settlement. While appearing less competitive, a node operator could decide to
876+
// scale them up to suit its security policy. At the network-level, we shouldn't constrain them too much,
877+
// while avoiding to introduce a DoS vector. Further, a low CTLV_FAR_FAR_AWAY could be a source of
878+
// routing failure for any HTLC sender picking up an LDK node among the first hops.
879+
pub(super) const CLTV_FAR_FAR_AWAY: u32 = 14 * 24 * 6;
874880

875881
/// Minimum CLTV difference between the current block height and received inbound payments.
876882
/// Invoices generated for payment to us must set their `min_final_cltv_expiry` field to at least

0 commit comments

Comments
 (0)