Skip to content

Upstream bindings changes for 0.0.123 #3035

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

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

No description provided.

`onion::message::messenger::PeeledOnion` is a public enum which
included the private enum `NextHop`, which is not acceptable. Thus,
we here expose `NextHop` but rename it `NextMessageHop` to make
clear that it is specific to messages.
We don't actually intend these to be public as they're just for
docs but the bindings don't currently parse `#[doc(hidden)]` as
"no-export" so we add manual no-export tags as well.
@TheBlueMatt TheBlueMatt added this to the 0.0.123 milestone May 1, 2024
@TheBlueMatt TheBlueMatt force-pushed the 2024-04-upstream-123-bindings branch from 4dab520 to d5bc9a1 Compare May 1, 2024 18:19
G8XSU
G8XSU previously approved these changes May 1, 2024
Copy link
Contributor

@G8XSU G8XSU left a comment

Choose a reason for hiding this comment

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

Lgtm!
Waiting for CI.

@codecov-commenter
Copy link

codecov-commenter commented May 1, 2024

Codecov Report

Attention: Patch coverage is 77.14286% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 89.15%. Comparing base (b403411) to head (376df87).

Files Patch % Lines
lightning/src/ln/types.rs 82.60% 3 Missing and 1 partial ⚠️
lightning/src/blinded_path/message.rs 60.00% 2 Missing ⚠️
lightning/src/onion_message/messenger.rs 75.00% 1 Missing ⚠️
lightning/src/onion_message/packet.rs 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3035      +/-   ##
==========================================
- Coverage   89.16%   89.15%   -0.01%     
==========================================
  Files         118      117       -1     
  Lines       97850    97850              
  Branches    97850    97850              
==========================================
- Hits        87244    87235       -9     
- Misses       8361     8369       +8     
- Partials     2245     2246       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheBlueMatt TheBlueMatt force-pushed the 2024-04-upstream-123-bindings branch from d5bc9a1 to dad26ad Compare May 1, 2024 18:58
@TheBlueMatt
Copy link
Collaborator Author

Ugh rustfmt complained:

$ git diff-tree -U1 d5bc9a10 dad26adbdiff --git a/lightning/src/ln/interactivetxs.rs b/lightning/src/ln/interactivetxs.rs
index e3b354ff8..603416208 100644
--- a/lightning/src/ln/interactivetxs.rs
+++ b/lightning/src/ln/interactivetxs.rs
@@ -24,4 +24,4 @@ use crate::events::bump_transaction::{BASE_INPUT_WEIGHT, EMPTY_SCRIPT_SIG_WEIGHT
 use crate::ln::channel::TOTAL_BITCOIN_SUPPLY_SATOSHIS;
-use crate::ln::msgs::SerialId;
 use crate::ln::msgs;
+use crate::ln::msgs::SerialId;
 use crate::ln::types::ChannelId;

G8XSU
G8XSU previously approved these changes May 1, 2024
The `PaymentHash`, `PaymentSecret`, `PaymentPreimage`, and
`ChannelId` types are all small wrappers around `[u8; 32]` and are
used throughout the codebase but were defined in the top-level
`ln/mod.rs` file and the relatively sparsely-populated
`ln/channel_id.rs` file.

Here we move them to a common `types` module and go ahead and
update all our in-crate `use` statements to refer to the new
module for bindings. We do, however, leave a `pub use` alias for
the old paths to avoid upgrade hassle for users.
@TheBlueMatt TheBlueMatt force-pushed the 2024-04-upstream-123-bindings branch from dad26ad to 376df87 Compare May 1, 2024 19:01
@TheBlueMatt
Copy link
Collaborator Author

Hah, sorry, I should have run the script again rather than assuming it'll print all errors at once...

$ git diff-tree -U1 dad26adb 376df8770
diff --git a/lightning/src/ln/onion_utils.rs b/lightning/src/ln/onion_utils.rs
index 02af88fcb..0abcb7de2 100644
--- a/lightning/src/ln/onion_utils.rs
+++ b/lightning/src/ln/onion_utils.rs
@@ -13,4 +13,4 @@ use crate::ln::channelmanager::{HTLCSource, RecipientOnionFields};
 use crate::ln::msgs;
-use crate::ln::wire::Encode;
 use crate::ln::types::{PaymentHash, PaymentPreimage};
+use crate::ln::wire::Encode;
 use crate::routing::gossip::NetworkUpdate;
diff --git a/lightning/src/sign/mod.rs b/lightning/src/sign/mod.rs
index 50c0d2bc0..79edf0aed 100644
--- a/lightning/src/sign/mod.rs
+++ b/lightning/src/sign/mod.rs
@@ -41,2 +41,3 @@ use crate::chain::transaction::OutPoint;
 use crate::crypto::utils::{hkdf_extract_expand_twice, sign, sign_with_aux_rand};
+use crate::ln::chan_utils;
 use crate::ln::chan_utils::{
@@ -55,3 +56,2 @@ use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
 use crate::ln::script::ShutdownScript;
-use crate::ln::chan_utils;
 use crate::ln::types::PaymentPreimage;
diff --git a/rustfmt_excluded_files b/rustfmt_excluded_files
index 51731c40d..29f075c0a 100644
--- a/rustfmt_excluded_files
+++ b/rustfmt_excluded_files
@@ -212,2 +212,3 @@
 ./lightning/src/ln/shutdown_tests.rs
+./lightning/src/ln/types.rs
 ./lightning/src/ln/wire.rs

@TheBlueMatt TheBlueMatt merged commit 37c431a into lightningdevkit:main May 4, 2024
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants