Skip to content

Update to a dev version latest bitcoin master 0e2e55971275da64ceb62e8991a0a5fa962cb8b1 #289

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
Jan 12, 2022

Conversation

sanket1729
Copy link
Member

Update to a version of dev rust-bitcoin so that we can prepare for rust-miniscript release. The integration tests are updated to point a personal fork of rust-bitcoincore-rpc to have rust semver type issues.

After we have this, we can make progress on tapscript while we await finalized rust-bitcoin release. After which, we can remove the git dependencies and have crates.io dependencies instead.

@sanket1729 sanket1729 changed the title update to latest bitcoin master Update to a dev version latest bitcoin master Jan 11, 2022
@@ -83,11 +83,11 @@ fn main() {
0xa9, 0x14, 0x92, 0x09, 0xa8, 0xf9, 0x0c, 0x58, 0x4b, 0xb5, 0x97, 0x4d, 0x58, 0x68, 0x72,
0x49, 0xe5, 0x32, 0xde, 0x59, 0xf4, 0xbc, 0x87,
]);

let wit = transaction.input[0].witness.to_vec();
let mut interpreter = miniscript::Interpreter::from_txdata(
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think to change the parameter type in from_txdata (and in inner::from_txdata) to &Witness avoiding the step of converting to vec?

If I am looking correctly it's used only for iteration and we have Witness::iter which doesn't allocate

Copy link
Member Author

@sanket1729 sanket1729 Jan 11, 2022

Choose a reason for hiding this comment

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

Yes, this is an already planned change in a follow-up PR that changes the interpreter API for taproot support. Wanted to keep things simple here (as in just resolving compile errors).

Copy link
Member Author

Choose a reason for hiding this comment

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

Does it make sense for psbt FINAL_SCRIPT_WITNESS to be Witness type instead of Vec<Vec<u8>>

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a follow up commit and discovered that rust-miniscript needs rust-bitcoin/rust-bitcoin#774 for a cleaner non-allocating API.

@sanket1729 sanket1729 changed the title Update to a dev version latest bitcoin master Update to a dev version latest bitcoin master 0e2e55971275da64ceb62e8991a0a5fa962cb8b1 Jan 11, 2022
@sanket1729
Copy link
Member Author

@apoelstra, this can help move things forward on rust-miniscript

@@ -7,7 +7,7 @@ description = "Miniscript: a subset of Bitcoin Script designed for analysis"
license = "CC0-1.0"

[features]
fuzztarget = ["bitcoin/fuzztarget"]
fuzztarget = []
Copy link
Member

Choose a reason for hiding this comment

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

In f3c38b8:

We should drop fuzztarget entirely.

})?;
let target = input.sighash_type.unwrap_or(bitcoin::EcdsaSigHashType::All);
for (key, ecdsa_sig) in &input.partial_sigs {
let flag = bitcoin::EcdsaSigHashType::from_u32_standard(ecdsa_sig.hash_ty as u32)
Copy link
Member

Choose a reason for hiding this comment

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

In f3c38b8:

lol, is this conversion just to check standardness? We should add a method to rust-bitcoin so we can call `ecdsa_sig.hash_tx.is_standard()'.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, this line is not needed. ecdsa_sig.hash_ty is guaranteed to follow standardness rules.

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 aa36494

@sanket1729 sanket1729 merged commit 87c9849 into rust-bitcoin:master Jan 12, 2022
@sanket1729
Copy link
Member Author

Resolving the comments in follow up PR

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