-
Notifications
You must be signed in to change notification settings - Fork 73
Enable bitcoin_hashes v0.14.0
#76
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
Conversation
|
cc @afilini |
|
ACK, that would be helpful for me, all the other libs like rust-bitcoin and bdk have already upgraded to hashes 0.14 |
Kixunil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be nice for me even just for cleanness sake.
Cargo.toml
Outdated
| # Enabling the "rand" feature by default to run the benches | ||
| bip39 = { path = ".", features = ["rand"] } | ||
| bitcoin_hashes = ">=0.12,<0.14" # enable default features for test | ||
| bitcoin_hashes = ">=0.12,<=0.14" # enable default features for test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be >= 0.12, <0.15, otherwise 0.14.1 will be unusable even though it'd be compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wow, TIL. Will fix, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to go right ahead and 'trust don't verify'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The verification is easy, just evaluate 0 < 1 expression in your head. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I thought we were talking about 0.14 working for 0.14.0 but not for 0.14.1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.14 implies 0.14.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I have no idea what you were talking about in your original comment then. <= 14 is equivalent to < 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not. 0.14 == 0.14.0
0.14.1 > 0.14.0
0.14.1 < 0.15.0
And the above implies 0.14.1 > 0.14 which is a negation of 0.14.1 <= 0.14
So for <= 14 to be equivalent to < 15 we require all x to satisfy x <= 0.14 <-> x <0.15 and we have a counter example for x = 0.14.1. QED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it now. Seems the confusion started when I wrote "I'm going to go right ahead and 'trust don't verify'." and I have no clue what I was thinking then. Your original review comment is actually perfectly clean.
Just call me retarded :)
Cargo.toml
Outdated
|
|
||
| # Unexported dependnecies | ||
| bitcoin_hashes = { version = ">=0.12, <=0.13", default-features = false } | ||
| bitcoin_hashes = { version = ">=0.12, <=0.14", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs to be <0.15, it was already broken.
46ef0ed to
2b47d40
Compare
Kixunil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2b47d40
|
Oh this PR is no good anyway, |
|
Raised #79 to discuss the MSRV bump. Converting to draft until that resolves. |
|
Is this a MSRV bump? Anyone who wants an older MSRV can use an older version of As someone who currently has two copies of |
|
@kayabaNerve that line wouldn't be great, better jut use |
|
Precise updates get overriden upon the next call to update. A line in the toml, next to the line adding this very crate as a dependency, would pin it. That's why I said what I said. It's irrelevant to the larger point I don't believe this is a MSRV break and should be able to move forward regardless though. |
MSRV doesn't get bumped on update if you use recent cargo. But yes, this is not MSRV break in the sense that it'd justify major version. |
|
Could you take this PR out of draft and merge and release please? 😄 Seems like a simple change and I need it for the reason @tcharding outlined. |
I second this. The simplest fix is resting on the shelf for more than a year now. Maintainer, please do the v2.2.1 release. |
|
Ping @tcharding @stevenroose, please let's merge, it's a simple change and very much needed. Thanks |
|
I'm not a maintainer here sorry mate. If you have a direct link to Steven you could hassle him. |
|
@tcharding I guess the first step would be for you to rebase it (there are conflicts) and take it out of draft. |
1ca2e1b to
26683c2
Compare
|
No sweat, done. |
|
Oh this cannot be undrafted because of the MSRV bump. At the risk of being rude, and @stevenroose you can slap me in person when you see me next, I'd suggest one of the following:
I'm not the don of the rust-bitcoin org but I do feel in someway responsible that we have crates in the org that are not maintained. I don't know the solution to that problem. No one is required to do anything round here, so props to Steven for writing the crate, and all due respect. |
5994a4c to
1357566
Compare
bitcoin_hashes v0.14.0
b3f9c4d to
a20b9fa
Compare
|
Used new syntax as suggested and fixed up the github action job names. |
1a83c40 to
ec024a8
Compare
|
And used valid Rust versions, will fix pinning ... |
ec024a8 to
649c990
Compare
tnull
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems CI is still broken due to dependency/pinning foo.
|
Is any one waiting on this that wants to work it out? I f**king hate pinning. |
Hmm, honestly not so much the actual changes, but having the additional CI coverage would be nice. But no huge rush rn. |
e3144d2 to
d80f73a
Compare
|
Instead of pinning I found a lock file that works for 1.41 and 1.48 and committed those, then used the 1.48 lock file for all the MSRV versions tested. |
ead6f20 to
56f25a7
Compare
tnull
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of pinning I found a lock file that works for 1.41 and 1.48 and committed those, then used the 1.48 lock file for all the MSRV versions tested.
Hmm, not quite sure if I prefer that approach, especially given that we point users to test.sh for pinning instructions to make this work under a specific MSRV. And now, we don't pin there. If you prefer not to deal with the the pinning part, we can just land this (maybe only the first commit)? And I can take it from there.
| - `bitcoin_hashes v0.13`: MSRV `v1.48.0` | ||
| - `bitcoin_hashes v0.14`: MSRV `v1.56.0` | ||
|
|
||
| When using older version of Rust, you might have to pin the versions of several crates, for an up-to-date list refer to [`contrib/test.sh`](contrib/test.sh): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We refer here to test.sh for pinning instructions, and now there aren't any anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh dear, good eye. Thanks man, will fix.
20a77f1 to
14b4f8c
Compare
Great, I have zero interest in pinning or in this crate at all so I"d really appreciate not having to touch this PR anymore. Thanks for the offer. I've remove the second patch. |
tnull
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, LGTM mod one comment regarding the added pins.sh.
Can revisit extending MSRV test coverage in CI as a follow-up sometime.
pins.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this file isn't used anywhere? Can we drop it for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bother, that was just supposed to be use while I was messing with the pinning. My bad. Removed.
14b4f8c to
2c573a2
Compare
README.md
Outdated
|
|
||
| When using older version of Rust, you might have to pin the versions of several crates, for an up-to-date list refer to [`contrib/test.sh`](contrib/test.sh): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whitespace could still be dropped, but shouldn't block this PR :>
Hardware devices like the smallest binary possible, currently if one builds with `rust-bitcoin v0.32` and `rust-bip39` they get two versions of `bitcoin_hashes` in the dependency graph because we don't support `bitcoin_hashes v0.14`. Note that using `bitcoin_hashes 0.14` bumps the MSRV to Rust v1.56.1
2c573a2 to
d567f87
Compare
|
My bad, done. |
|
I actually checked by diff this time ... |
|
|
||
| - `bitcoin_hashes v0.12`: MSRV v1.41.1 | ||
| - `bitcoin_hashes v0.13`: MSRV v1.48.0 | ||
| - `bitcoin_hashes v0.14`: MSRV v1.56.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't verified this claim given that we decided to forgo CI checks for now and manually figuring out the necessary pinning is a pita. It seems benign enough and a reasonable assumption that the MSRV will be dictated by bitcoin_hashes and there aren't any further interactions in the code base.
Per https://github.com/michalkucharczyk/rust-bip39/tree/mku-2.0.1-release, `parity-bip39` was a fork to publish a release of `bip39` with two specific PRs merged. Not only have those PRs been merged, yet `bip39` now accepts `bitcoin_hashes 0.14` (rust-bitcoin/rust-bip39#76), making this a great time to reconcile (even though it does technically add a git dependency until the new release is cut...).
Per https://github.com/michalkucharczyk/rust-bip39/tree/mku-2.0.1-release, `parity-bip39` was a fork to publish a release of `bip39` with two specific PRs merged. Not only have those PRs been merged, yet `bip39` now accepts `bitcoin_hashes 0.14` (rust-bitcoin/rust-bip39#76), making this a great time to reconcile (even though it does technically add a git dependency until the new release is cut...).

Hardware devices like the smallest binary possible, currently if one builds with latest
rust-bitcoinandrust-bip39they get two versions ofbitcoin_hashesin the dependency graph because we don't support the latestbitcoin_hashes.Note using the latest version causes the MSRV to increase to
Rust v0.56.1.