@@ -14,7 +14,6 @@ use crate::fee_estimator::OnchainFeeEstimator;
14
14
use crate :: gossip:: GossipSource ;
15
15
use crate :: io:: sqlite_store:: SqliteStore ;
16
16
use crate :: io:: utils:: { read_node_metrics, write_node_metrics} ;
17
- #[ cfg( any( vss, vss_test) ) ]
18
17
use crate :: io:: vss_store:: VssStore ;
19
18
use crate :: liquidity:: LiquiditySource ;
20
19
use crate :: logger:: { log_error, log_info, FilesystemLogger , Logger } ;
@@ -30,7 +29,6 @@ use crate::wallet::persist::KVStoreWalletPersister;
30
29
use crate :: wallet:: Wallet ;
31
30
use crate :: { io, NodeMetrics } ;
32
31
use crate :: { LogLevel , Node } ;
33
- #[ cfg( any( vss, vss_test) ) ]
34
32
use std:: collections:: HashMap ;
35
33
36
34
use lightning:: chain:: { chainmonitor, BestBlock , Watch } ;
@@ -66,7 +64,6 @@ use bip39::Mnemonic;
66
64
use bitcoin:: secp256k1:: PublicKey ;
67
65
use bitcoin:: { BlockHash , Network } ;
68
66
69
- #[ cfg( any( vss, vss_test) ) ]
70
67
use bitcoin:: bip32:: { ChildNumber , Xpriv } ;
71
68
use std:: convert:: TryInto ;
72
69
use std:: default:: Default ;
@@ -76,7 +73,6 @@ use std::path::PathBuf;
76
73
use std:: sync:: atomic:: AtomicBool ;
77
74
use std:: sync:: { Arc , Mutex , RwLock } ;
78
75
use std:: time:: SystemTime ;
79
- #[ cfg( any( vss, vss_test) ) ]
80
76
use vss_client:: headers:: { FixedHeaders , LnurlAuthToJwtProvider , VssHeaderProvider } ;
81
77
82
78
#[ derive( Debug , Clone ) ]
@@ -361,9 +357,14 @@ impl NodeBuilder {
361
357
self . build_with_store ( kv_store)
362
358
}
363
359
364
- /// Builds a [`Node`] instance with a [`VssStore` ] backend and according to the options
360
+ /// Builds a [`Node`] instance with a [VSS ] backend and according to the options
365
361
/// previously configured. Uses LnurlAuth as default method for authentication/authorization.
366
- #[ cfg( any( vss, vss_test) ) ]
362
+ ///
363
+ /// **Caution**: [VSS] support is in **alpha**. Using [VSS] (or any remote persistence) may
364
+ /// cause LDK to panic if persistence failures are unrecoverable, i.e., if they remain unresolved
365
+ /// after internal retries are exhausted.
366
+ ///
367
+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
367
368
pub fn build_with_vss_store (
368
369
& self , vss_url : String , store_id : String , lnurl_auth_server_url : String ,
369
370
fixed_headers : HashMap < String , String > ,
@@ -401,9 +402,14 @@ impl NodeBuilder {
401
402
self . build_with_vss_store_and_header_provider ( vss_url, store_id, header_provider)
402
403
}
403
404
404
- /// Builds a [`Node`] instance with a [`VssStore` ] backend and according to the options
405
+ /// Builds a [`Node`] instance with a [VSS ] backend and according to the options
405
406
/// previously configured. Uses only FixedHeaders as default method for authentication/authorization.
406
- #[ cfg( any( vss, vss_test) ) ]
407
+ ///
408
+ /// **Caution**: [VSS] support is in **alpha**. Using [VSS] (or any remote persistence) may
409
+ /// cause LDK to panic if persistence failures are unrecoverable, i.e., if they remain unresolved
410
+ /// after internal retries are exhausted.
411
+ ///
412
+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
407
413
pub fn build_with_vss_store_with_fixed_headers (
408
414
& self , vss_url : String , store_id : String , fixed_headers : HashMap < String , String > ,
409
415
) -> Result < Node , BuildError > {
@@ -412,10 +418,16 @@ impl NodeBuilder {
412
418
self . build_with_vss_store_and_header_provider ( vss_url, store_id, header_provider)
413
419
}
414
420
415
- /// Builds a [`Node`] instance with a [`VssStore`] backend and according to the options
416
- /// previously configured. Give `header_provider` is used to attach headers to every request made
417
- /// to [VSS](https://github.com/lightningdevkit/vss-server/blob/main/README.md) backend.
418
- #[ cfg( any( vss, vss_test) ) ]
421
+ /// Builds a [`Node`] instance with a [VSS] backend and according to the options
422
+ /// previously configured. Given `header_provider` is used to attach headers to every request made
423
+ /// to the [VSS] backend.
424
+ ///
425
+ /// **Caution**: [VSS] support
426
+ /// is in **alpha**. Using [VSS] (or any remote persistence) may cause LDK to panic if persistence
427
+ /// failures are unrecoverable, i.e., if they remain unresolved after internal retries are
428
+ /// exhausted.
429
+ ///
430
+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
419
431
pub fn build_with_vss_store_and_header_provider (
420
432
& self , vss_url : String , store_id : String , header_provider : Arc < dyn VssHeaderProvider > ,
421
433
) -> Result < Node , BuildError > {
@@ -445,7 +457,6 @@ impl NodeBuilder {
445
457
)
446
458
}
447
459
448
- #[ cfg( any( vss, vss_test) ) ]
449
460
fn derive_vss_xprv (
450
461
& self , config : & Arc < Config > , seed_bytes : & [ u8 ; 64 ] , logger : & Arc < FilesystemLogger > ,
451
462
) -> Result < Xpriv , BuildError > {
@@ -618,9 +629,14 @@ impl ArcedNodeBuilder {
618
629
self . inner . read ( ) . unwrap ( ) . build_with_fs_store ( ) . map ( Arc :: new)
619
630
}
620
631
621
- /// Builds a [`Node`] instance with a [`VssStore` ] backend and according to the options
632
+ /// Builds a [`Node`] instance with a [VSS ] backend and according to the options
622
633
/// previously configured. Uses LnurlAuth as default method for authentication/authorization.
623
- #[ cfg( any( vss, vss_test) ) ]
634
+ ///
635
+ /// **Caution**: [VSS] support is in **alpha**. Using [VSS] (or any remote persistence) may
636
+ /// cause LDK to panic if persistence failures are unrecoverable, i.e., if they remain unresolved
637
+ /// after internal retries are exhausted.
638
+ ///
639
+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
624
640
pub fn build_with_vss_store (
625
641
& self , vss_url : String , store_id : String , lnurl_auth_server_url : String ,
626
642
fixed_headers : HashMap < String , String > ,
@@ -632,9 +648,14 @@ impl ArcedNodeBuilder {
632
648
. map ( Arc :: new)
633
649
}
634
650
635
- /// Builds a [`Node`] instance with a [`VssStore` ] backend and according to the options
651
+ /// Builds a [`Node`] instance with a [VSS ] backend and according to the options
636
652
/// previously configured. Uses only FixedHeaders as default method for authentication/authorization.
637
- #[ cfg( any( vss, vss_test) ) ]
653
+ ///
654
+ /// **Caution**: [VSS] support is in **alpha**. Using [VSS] (or any remote persistence) may
655
+ /// cause LDK to panic if persistence failures are unrecoverable, i.e., if they remain unresolved
656
+ /// after internal retries are exhausted.
657
+ ///
658
+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
638
659
pub fn build_with_vss_store_with_fixed_headers (
639
660
& self , vss_url : String , store_id : String , fixed_headers : HashMap < String , String > ,
640
661
) -> Result < Arc < Node > , BuildError > {
@@ -645,10 +666,15 @@ impl ArcedNodeBuilder {
645
666
. map ( Arc :: new)
646
667
}
647
668
648
- /// Builds a [`Node`] instance with a [`VssStore` ] backend and according to the options
669
+ /// Builds a [`Node`] instance with a [VSS ] backend and according to the options
649
670
/// previously configured. Give `header_provider` is used to attach headers to every request made
650
671
/// to [VSS](https://github.com/lightningdevkit/vss-server/blob/main/README.md) backend.
651
- #[ cfg( any( vss, vss_test) ) ]
672
+ ///
673
+ /// **Caution**: [VSS] support is in **alpha**. Using [VSS] (or any remote persistence) may
674
+ /// cause LDK to panic if persistence failures are unrecoverable, i.e., if they remain unresolved
675
+ /// after internal retries are exhausted.
676
+ ///
677
+ /// [VSS]: https://github.com/lightningdevkit/vss-server/blob/main/README.md
652
678
pub fn build_with_vss_store_and_header_provider (
653
679
& self , vss_url : String , store_id : String , header_provider : Arc < dyn VssHeaderProvider > ,
654
680
) -> Result < Arc < Node > , BuildError > {
0 commit comments