-
Notifications
You must be signed in to change notification settings - Fork 312
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 bitcoin/miniscript dependencies #1177
Upgrade bitcoin/miniscript dependencies #1177
Conversation
e67c6e8
to
52d19be
Compare
Thanks for the headsup and trial patch. Any rough ETA for 0.31 ? Since this would be a breaking change we need to figure out if it could make it in to our 1.0-beta (this year 🤞) or safer to target for a 2.0 release next year. |
There isn't anything massive in this one, I wouldn't stress about getting it into 1.0-beta. You could even skip this one and jump straight to the next one if your 2.0 comes out after March/April. |
ETA for v0.31.0 would be in the next couple weeks I'd say. |
Closes #1191. |
|
@tcharding I see that rust-miniscript 11.0 was released with rust-bitcoin/rust-miniscript#618, if the changes aren't too big can we get this into our 1.0-alpha.4 milestone? |
Deleted message, first notification of the morning and I totally misunderstood the comment. I'll fix this PR up. |
The upgrade is currently stuck on the I think I have all the other crate upgrades queued up. I can check them over and take of draft soon as |
I'm moving this to up to the 1.0.0-alpha.4 release since rust-bitcoin 0.31.0 and rust-miniscript 11.0.0 are released. @tcharding has also created PRs to upgrade the other crates we depend on, we just need to get them merged and released. |
52d19be
to
6d4ea1c
Compare
CI is expected to be red because I have paths sections in the manifest, to test locally you'll need to either use git wortkrees or update the paths. |
6d4ea1c
to
6233210
Compare
I rescind my claim :) Has one test failure:
|
bdk/crates/bdk/tests/wallet.rs Lines 2058 to 2064 in c01983d
It appears the point of this test is to check that when bumping fee, a new input is added and one output is taken away when compared with the original tx. We know what the expected fee is from the value of the ins/outs (50k + 25k - 45K), so why not just set the bumpfee using let mut builder = wallet.build_fee_bump(txid).unwrap();
// We set a fee high enough that during rbf we are forced to add
// a new input and also that we have to remove the change
// that we had previously
// inputs: 50k + 25k
// outputs: 45K
let fee = 50_000 + 25_000 - 45_000;
builder.fee_absolute(fee);
let psbt = builder.finish().unwrap(); |
crates/esplora/Cargo.toml
Outdated
@@ -13,16 +13,16 @@ readme = "README.md" | |||
|
|||
[dependencies] | |||
bdk_chain = { path = "../chain", version = "0.9.0", default-features = false } | |||
esplora-client = { version = "0.6.0", default-features = false } | |||
esplora-client = { version = "0.7.0", default-features = false, path = "../../../../rust-esplora-client/02-07-upgrade-bitcoin-0.31" } |
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 rust-esplora-client
0.7.0 is now published on crates.io so this can be fixed.
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.
Thanks @notmandatory, will do.
a9199e4
to
1efe247
Compare
Upgrade: - bitcoin to v0.31.0 - miniscript to v11.0.0 Note: The bitcoin upgrade includes improvements to the `Transaction::weight()` function, it appears those guys did good, we no longer need to add the 2 additional weight units "just in case".
1efe247
to
984c758
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 984c758
)?, | ||
sighash, | ||
)) | ||
Ok((sighash, sighash_type)) |
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 looks better, thank you.
The only thing I'm confused about (on my end) is why I see this when trying to build locally error[E0277]: the trait bound `bitcoin::bitcoin_hashes::sha256d::Hash: ThirtyTwoByteHash` is not satisfied
--> crates/bdk/src/wallet/signer.rs:537:13
|
533 | sign_psbt_ecdsa(
| --------------- required by a bound introduced by this call
...
537 | hash,
| ^^^^ the trait `ThirtyTwoByteHash` is not implemented for `bitcoin::bitcoin_hashes::sha256d::Hash`
|
= help: the following other types implement trait `ThirtyTwoByteHash`:
bitcoin::secp256k1::bitcoin_hashes::sha256t::Hash<T>
bitcoin::secp256k1::bitcoin_hashes::sha256::Hash
bitcoin::secp256k1::bitcoin_hashes::sha256d::Hash
bitcoin::LegacySighash
bitcoin::SegwitV0Sighash
bitcoin::TapSighash
note: required by a bound in `sign_psbt_ecdsa` |
Same patch is fine, thanks! |
@ValuedMammal two things:
|
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 984c758
Thanks for doing the update, this was a lot of work!
@apoelstra Thanks for adding the extra context. BDK has a trait bdk/crates/bdk/src/wallet/signer.rs Lines 521 to 542 in 53791eb
Instead of being fancy, I think if we just call match self.ctx {
SignerContext::Segwitv0 => {
let (hash, hash_ty) = Segwitv0::sighash(psbt, input_index, ())?;
sign_psbt_ecdsa(
&self.inner,
pubkey,
&mut psbt.inputs[input_index],
hash,
hash_ty,
secp,
sign_options.allow_grinding,
);
}
SignerContext::Legacy => {
let (hash, hash_ty) = Legacy::sighash(psbt, input_index, ())?;
sign_psbt_ecdsa(
&self.inner,
pubkey,
&mut psbt.inputs[input_index],
hash,
hash_ty,
secp,
sign_options.allow_grinding,
);
}
_ => return Ok(()), // handled above
}; |
Gotcha! Yep, this makes sense -- and I suspect that in future we may try to split out the two |
Note @apoelstra this is the 0.31 upgrade not the 0.32 upgrade (using secp 0.28 so |
@tcharding ah, then I suspect the cause of the error is actually rust-bitcoin/rust-secp256k1#673 ... which is why we are removing |
The
Can you check your lock file and see what version of Thanks |
Just for the record, this PR does not attempt to use any of the improvements in the new |
I'm glad you brought this up. While troubleshooting I did a Before resetting Cargo.lock
After
|
Sweet, everything works then. 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.
ACK 984c758
Closes #1381 |
Unfortunately this does not compile when rebased on top of
|
The corresponding LDK issue is lightningdevkit/rust-lightning#2745. |
I just did a test-rebase (https://github.com/bitcoindevkit/bdk/pull/1405/checks) and CI builds fine for me. Maybe when you tried it you didn't do a |
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 984c758
5f238d8 Bump bdk version to 1.0.0-alpha.9 (Steve Myers) Pull request description: ### Description Bump bdk version to 1.0.0-alpha.9 bdk_chain to 0.12.0 bdk_bitcoind_rpc to 0.8.0 bdk_electrum to 0.11.0 bdk_esplora to 0.11.0 bdk_file_store to 0.9.0 bdk_testenv to 0.2.0 fixes #1399 ### Notes to the reviewers I also removed unneeded version for bdk_testenv in dev-dependencies, see #1177 (comment). ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: evanlinjin: ACK 5f238d8 Tree-SHA512: 7ede94a6476a6b8c49a16b0aad147030eab23e26b9c4cadb1dd319fb8562ae325640f506f2d6dab0e85b0ee7f6955ac298ec1f70264704dc7f9a9492f8794f38
Upgrade:
Fix: #1196