-
Couldn't load subscription status.
- Fork 70
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
base: master
Are you sure you want to change the base?
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 |
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
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
|
We have @tnull as a crate owner on crates.io now. And if my private conversation with @stevenroose is correct then @elsirion has been invited to be a crate owner also. I assume both of you were also given merge perms here so this PR should be able to make some progress now please. |
|
I don't have merge perms or an crates.io invite yet as far as I can tell. Happy to take on the responsibility, but also respect if @stevenroose doesn't want too many people as maintainers. |
| - `bitcoin_hashes v0.13`: MSRV v1.48.0 | ||
| - `bitcoin_hashes v0.14`: MSRV v1.56.1 | ||
|
|
||
| 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.
Why is this no longer true, i.e., why don't we have to pin back the other dependencies below?
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.
Possibly a faulty rebase conflict resolution? I made changes to these lines in #86 and this PR was open forever. @tcharding
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 just clobbered them because over the last year (since edition 2018 came into rust-bitcoin) I've barely ever had to pin anymore. Admittedly not the best reason for the change, I've put it back how it was.
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 think it depends which MSRV you are targeting, a lot of the bip39 deps seem to have bumped their MSRV in minor version releases. I only had to pin for the old rust version tests back then.
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.
In rust-bitcoin and related crates we've avoided pinning by using fixed lockfiles, which we basically never update even though we should. That's why you haven't had to deal with this crap @tcharding.
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.
Yeah, eventually we might want to discuss doing a conservative MSRV bump here (1.41 seems very old by now, for every standard), potentially just aligning it with the rust-bitcoin policy.
But, for now, that's out-of-scope of this PR. And if we already have the checks in place, there probably is no rush to do so.
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.
Nice
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.
Would like to clarify if the README.md changes were intentional before merging, I have a strong suspicion that they weren't and the described pinning isn't sufficient.
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
1357566 to
e30b544
Compare
@apoelstra can you add @elsirion and @tnull as a maintainers please. @stevenroose has confirmed this by signal message with me. He has added them both as owners on crates.io already. @tnull said he would message you directly on signal also about this. For anyone reading @stevenroose does not check GitHub notifications so will likely not read this message any time soon. You'll just have to believe me that I talked with him. |
This via signal from @tnull to me. |
Docs were fixed, still need to test MSRV though, so no full ACK yet.
There are multiple MSRVs in this crate because of the `bitcoin_hashes` dependency and also the `zeroize` feature. Add MSRV test jobs for the three MSRVs effected by `bitcoin_hashes` and also one for the `zeroize` feature.
Good eye, thanks. I've added 4 MSRV jobs which is pretty ugly but should get the coverage we want. |
Can confirm I was added 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.
Mostly looks good, one nit, one comment.
|
|
||
| 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.
nit: Spurious whitespace here.
| fi | ||
|
|
||
| # Pin dependencies as required if we are using MSRV toolchain. | ||
| if cargo --version | grep "1\.48"; then |
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.
No super strong opinion, but in LDK we use such a pattern (just an example, see https://github.com/lightningdevkit/rust-lightning/blob/0.2/ci/ci-tests.sh):
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
# The backtrace v0.3.75 crate relies on rustc 1.82
[ "$RUSTC_MINOR_VERSION" -lt 82 ] && cargo update -p backtrace --precise "0.3.74" --verboseSeems this could be a bit cleaner/less error prone if we start handling even more different rust versions.
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 just hope that once we hit rust version 1.480 in 45 years we won't be testing 1.48 anymore 😆

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.