Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to LDK 0.0.116 #105

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

tnull
Copy link
Collaborator

@tnull tnull commented May 22, 2023

This is a draft PR which will be regularly rebased on upstream HEAD to incorporate and test the made changes.

@tnull tnull added this to the 0.2 milestone May 22, 2023
src/wallet.rs Outdated Show resolved Hide resolved
@tnull tnull marked this pull request as draft May 22, 2023 10:50
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch 5 times, most recently from d94eca4 to b37a146 Compare May 22, 2023 12:25
@tnull tnull mentioned this pull request May 22, 2023
9 tasks
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from b37a146 to a224937 Compare May 23, 2023 18:05
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from a224937 to d268794 Compare June 24, 2023 21:02
@tnull
Copy link
Collaborator Author

tnull commented Jun 24, 2023

Rebased on current main and updated to use LDK 0.0.116-alpha1.

@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch 4 times, most recently from bcf2f91 to 1a9297d Compare June 30, 2023 14:28
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from 1a9297d to eaf2b96 Compare July 6, 2023 11:37
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from eaf2b96 to 03dd0e1 Compare July 24, 2023 07:48
@tnull tnull changed the title WIP: Upgrade to LDK 0.0.116 Upgrade to LDK 0.0.116 Jul 24, 2023
@tnull tnull marked this pull request as ready for review July 24, 2023 07:48
@tnull tnull requested a review from wpaulino July 24, 2023 07:48
@tnull tnull mentioned this pull request Jul 24, 2023
@tnull
Copy link
Collaborator Author

tnull commented Jul 24, 2023

Switched to 0.0.116 after release and split out anchor support to a dedicated follow-up PR #141.

src/wallet.rs Outdated Show resolved Hide resolved
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch 4 times, most recently from e264025 to 22bfd14 Compare July 24, 2023 13:00
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from 22bfd14 to eca9943 Compare August 2, 2023 07:45
src/wallet.rs Outdated Show resolved Hide resolved
src/event.rs Show resolved Hide resolved
bindings/ldk_node.udl Outdated Show resolved Hide resolved
bindings/ldk_node.udl Outdated Show resolved Hide resolved
src/types.rs Outdated Show resolved Hide resolved
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from eca9943 to 3f06e26 Compare August 8, 2023 09:33
@tnull
Copy link
Collaborator Author

tnull commented Aug 8, 2023

Rebased on main to fix CI builds.

@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from 3f06e26 to 9c5eea6 Compare August 8, 2023 09:47
@tnull tnull mentioned this pull request Aug 8, 2023
@tnull tnull requested a review from wpaulino August 10, 2023 07:51
Copy link

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but needs a rebase

@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from 9c5eea6 to 7ef7d92 Compare August 11, 2023 08:21
@tnull tnull force-pushed the 2023-05-upgrade-to-LDK-0.0.116 branch from 7ef7d92 to 972afcb Compare August 11, 2023 08:31
@tnull
Copy link
Collaborator Author

tnull commented Aug 11, 2023

LGTM but needs a rebase

Rebased on main and took the liberty of squashing fixups including minimal changes:

> git range-diff 2023-05-upgrade-to-LDK-0.0.116-backup~1..2023-05-upgrade-to-LDK-0.0.116-backup 2023-05-upgrade-to-LDK-0.0.116~1..2023-05-upgrade-to-LDK-0.0.116

1:  12c5086 ! 1:  972afcb Update to LDK 0.0.116
    @@ bindings/ldk_node.udl: interface LDKNode {
        [Throws=NodeError]
        PaymentHash send_spontaneous_payment(u64 amount_msat, PublicKey node_id);
        [Throws=NodeError]
    +-  void send_payment_probe([ByRef]Invoice invoice);
    ++  void send_payment_probe([ByRef]Bolt11Invoice invoice);
    +   [Throws=NodeError]
    +   void send_spontaneous_payment_probe(u64 amount_msat, PublicKey node_id);
    +   [Throws=NodeError]
     -  Invoice receive_payment(u64 amount_msat, [ByRef]string description, u32 expiry_secs);
     +  Bolt11Invoice receive_payment(u64 amount_msat, [ByRef]string description, u32 expiry_secs);
        [Throws=NodeError]
    @@ src/lib.rs: pub use error::Error as NodeError;
      pub use io::utils::generate_entropy_mnemonic;
     @@ src/lib.rs: use wallet::Wallet;

    - use logger::{log_error, log_info, log_trace, FilesystemLogger, Logger};
    + use logger::{log_debug, log_error, log_info, log_trace, FilesystemLogger, Logger};

     -use lightning::chain::keysinterface::EntropySource;
      use lightning::chain::Confirm;
    @@ src/lib.rs: use wallet::Wallet;
     @@ src/lib.rs: use lightning_background_processor::process_events_async;
      use lightning_transaction_sync::EsploraSyncClient;

    - use lightning::routing::router::{PaymentParameters, RouteParameters};
    + use lightning::routing::router::{PaymentParameters, RouteParameters, Router as LdkRouter};
     -use lightning_invoice::{payment, Currency, Invoice};
     +use lightning_invoice::{payment, Bolt11Invoice, Currency};

    @@ src/lib.rs: impl<K: KVStore + Sync + Send + 'static> Node<K> {
                        .map_err(|_| Error::ChannelConfigUpdateFailed)
        }

    -   /// Send a payement given an invoice.
    +   /// Send a payment given an invoice.
     -  pub fn send_payment(&self, invoice: &Invoice) -> Result<PaymentHash, Error> {
     +  pub fn send_payment(&self, invoice: &Bolt11Invoice) -> Result<PaymentHash, Error> {
                let rt_lock = self.runtime.read().unwrap();
    @@ src/lib.rs: impl<K: KVStore + Sync + Send + 'static> Node<K> {
                }
                let route_params = RouteParameters { payment_params, final_value_msat: amount_msat };

    +@@ src/lib.rs: impl<K: KVStore + Sync + Send + 'static> Node<K> {
    +   /// the actual payment. Note this is only useful if there likely is sufficient time for the
    +   /// probe to settle before sending out the actual payment, e.g., when waiting for user
    +   /// confirmation in a wallet UI.
    +-  pub fn send_payment_probe(&self, invoice: &Invoice) -> Result<(), Error> {
    ++  pub fn send_payment_probe(&self, invoice: &Bolt11Invoice) -> Result<(), Error> {
    +           let rt_lock = self.runtime.read().unwrap();
    +           if rt_lock.is_none() {
    +                   return Err(Error::NotRunning);
    +@@ src/lib.rs: impl<K: KVStore + Sync + Send + 'static> Node<K> {
    +                   invoice.min_final_cltv_expiry_delta() as u32,
    +           )
    +           .with_expiry_time(expiry_time.as_secs())
    +-          .with_route_hints(invoice.route_hints());
    ++          .with_route_hints(invoice.route_hints())
    ++          .map_err(|_| Error::InvalidInvoice)?;
    +           if let Some(features) = invoice.features() {
    +-                  payment_params = payment_params.with_features(features.clone());
    ++                  payment_params = payment_params
    ++                          .with_bolt11_features(features.clone())
    ++                          .map_err(|_| Error::InvalidInvoice)?;
    +           }
    +           let route_params = RouteParameters { payment_params, final_value_msat: amount_msat };
    +
    +@@ src/lib.rs: impl<K: KVStore + Sync + Send + 'static> Node<K> {
    +                           &payer,
    +                           &route_params,
    +                           Some(&first_hops.iter().collect::<Vec<_>>()),
    +-                          &inflight_htlcs,
    ++                          inflight_htlcs,
    +                   )
    +                   .map_err(|e| {
    +                           log_error!(self.logger, "Failed to find path for payment probe: {:?}", e);
     @@ src/lib.rs: impl<K: KVStore + Sync + Send + 'static> Node<K> {
        /// given.
        pub fn receive_payment(

@tnull tnull merged commit ed6c529 into lightningdevkit:main Aug 11, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants