Skip to content
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 to bitcoin v0.32.0 #679

Merged
merged 1 commit into from
May 17, 2024

Conversation

tcharding
Copy link
Member

@tcharding tcharding commented May 1, 2024

We just released a new version of bitcoin, lets use it.

Includes upgrading the version of:

  • bitcoind to v0.36.0
  • secp256k1 to 0.29.0

@tcharding tcharding changed the title Upgrade bitcoin v0.32.0 Upgrade to bitcoin v0.32.0 May 1, 2024
@tcharding
Copy link
Member Author

CI is fixed in #678

Copy link

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

ACK 7c90cad

Copy link
Contributor

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

I have some suggestions

@@ -374,15 +374,23 @@ impl<Pk: MiniscriptKey> Wpkh<Pk> {
impl<Pk: MiniscriptKey + ToPublicKey> Wpkh<Pk> {
/// Obtains the corresponding script pubkey for this descriptor.
pub fn script_pubkey(&self) -> ScriptBuf {
let addr = Address::p2wpkh(&self.pk.to_public_key(), Network::Bitcoin)
use core::convert::TryFrom;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we move this up to the imports? It also repeated down a little bit in L388.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, definitely. I must have thrown this up just roughly hacked together, I tend to put use statements in functions when I'm doing quick and dirty work. I see from the PR description that I did not indicate that was the case at all, so apologies for stealing your review time.

});
let mut sigser = sig.serialize_der().to_vec();
let mut sigser = signature.serialize_der().to_vec();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we do serialize trick here to avoid one heap allocation?
Also aren't we intending to deprecate to_vec anyways?

Copy link
Member

Choose a reason for hiding this comment

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

I only see one allocation.

And yes, we are going to deprecate to_vec, but today it is not deprecated and there is no replacement :)

Copy link
Contributor

Choose a reason for hiding this comment

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

#687.

sig: schnorr_sig,
hash_ty: bitcoin::sighash::TapSighashType::Default,
signature: schnorr_sig,
sighash_type: bitcoin::sighash::TapSighashType::Default,
};
ser_schnorr_sigs.push(schnorr_sig.to_vec());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we do serialize trick here to avoid one heap allocation?
Also aren't we intending to deprecate to_vec anyways?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yep, this serialization is unnecessary (though it's unrelated to this PR I think and can be done separately).

Copy link
Contributor

Choose a reason for hiding this comment

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

let addr = bitcoin::Address::p2wpkh(&pk, bitcoin::Network::Bitcoin)
.expect("Address corresponding to valid pubkey");
*script_pubkey == addr.script_pubkey()
use core::convert::TryFrom;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we move this up to the imports? It also repeated down a little bit in L252.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

);
*redeem_script == addr.script_pubkey()
}
Err(_) => false,
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this acceptable? I may mask some deeper problem by indicating that the key wasn't found and not indicating that there was a key but it was uncompressed?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also don't have good feelings about this.
What if you've matched on a specific Error?

@tcharding
Copy link
Member Author

Cleanup up, just needs @RCasatta to cut the new bitcoind release and we are off to the races. I'll do the release tracking PR separately in case anything else needs to go in before release.

@RCasatta
Copy link
Contributor

Bitcoind released

We just released a new version of `bitcoin`, lets use it.

Includes upgrading the version of:

- `bitcoind` to `v0.36.0`
- `secp256k1` to `0.29.0`
@tcharding tcharding marked this pull request as ready for review May 16, 2024 21:59
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK cf8c1c8

@apoelstra apoelstra merged commit 6895a06 into rust-bitcoin:master May 17, 2024
7 checks passed
@tcharding tcharding deleted the 05-01-release-12.0.0 branch May 17, 2024 23:32
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.

5 participants