Skip to content

Remove explicit dependency on hex-conservative #3210

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
merged 2 commits into from
Aug 12, 2024

Conversation

tcharding
Copy link
Contributor

The hex crate is re-exported by rust-bitcoin so we can get it from there instead of explicitly depending on it. Doing so reduces the maintenance burden and helps reduce the likelyhood of getting two versions in the dependency graph.

Note however that there is still a single explicit dev dependency that may want to be kept in sync.

@tcharding
Copy link
Contributor Author

tcharding commented Jul 31, 2024

Ugh, this makes the code non-uniform because it grabs hex from bitcoin instead of from bitcoin::hashes. I was going to patch that next but then remembered that I don't know how to use rustfmt in this repo to re-order the import statements. So we could either:

  1. Re-do this PR use bitcoin::hashes::hex
  2. Teach Tobin how to run the formatter

(If we do (2) I can revive #3146.)

@tcharding tcharding mentioned this pull request Jul 31, 2024
@TheBlueMatt
Copy link
Collaborator

Teach Tobin how to run the formatter

Yea, sorry, we weren't really good about that. Fixing in #3226

@tcharding tcharding force-pushed the 07-31-rm-hex-dep branch 3 times, most recently from 3161563 to 4bf5489 Compare August 8, 2024 06:12
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.84%. Comparing base (fd8f4ac) to head (eac1b87).
Report is 8 commits behind head on main.

Files Patch % Lines
lightning/src/routing/gossip.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3210      +/-   ##
==========================================
+ Coverage   89.74%   89.84%   +0.10%     
==========================================
  Files         122      122              
  Lines      101875   102846     +971     
  Branches   101875   102846     +971     
==========================================
+ Hits        91423    92407     +984     
- Misses       7767     7776       +9     
+ Partials     2685     2663      -22     

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

tnull
tnull previously approved these changes Aug 8, 2024
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

LGTM

TheBlueMatt
TheBlueMatt previously approved these changes Aug 8, 2024
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheBlueMatt
Copy link
Collaborator

Oops, this doesn't build because of the extern crate hex; line in fuzz/src/lib.rs. Also, the remaining dependency on hex in lightning-invoice can just be removed as its not used directly anywhere:

diff --git a/lightning-invoice/Cargo.toml b/lightning-invoice/Cargo.toml
index d89f8d08e..94b307167 100644
--- a/lightning-invoice/Cargo.toml
+++ b/lightning-invoice/Cargo.toml
@@ -28,7 +28,6 @@ bitcoin = { version = "0.31.2", default-features = false }

 [dev-dependencies]
 lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false, features = ["_test_utils"] }
-hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
 serde_json = { version = "1"}
 hashbrown = { version = "0.13", default-features = false }

@tcharding tcharding dismissed stale reviews from TheBlueMatt and tnull via 64af3fc August 8, 2024 22:19
The `hex` crate is re-exported by `rust-bitcoin` so we can get it from
there instead of explicitly depending on it. Doing so reduces the
maintenance burden and helps reduce the likelyhood of getting two
versions in the dependency graph.
Use the `hex-conservative` crate directly from `bitcoin` instead of from
`hashes`. Although it makes no real difference it is slightly more clear
and more terse.
@tcharding
Copy link
Contributor Author

I don't know what to make of the failing CI jobs, there is a ! but no output as to why they failed?

@tnull
Copy link
Contributor

tnull commented Aug 9, 2024

I don't know what to make of the failing CI jobs, there is a ! but no output as to why they failed?

Yeah, unfortunately they started failing a few days ago without yielding any error output, and so far nobody has found the time to dig in what makes github fail them..

@tcharding
Copy link
Contributor Author

Bizzarre, can you tag me please if it turns out to be something github related that we might run into in rust-bitcoin also.

@TheBlueMatt TheBlueMatt merged commit bc1c026 into lightningdevkit:main Aug 12, 2024
16 of 19 checks passed
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.

3 participants