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

chore: bitcoin crate upgrade #3080

Open
wants to merge 58 commits into
base: master
Choose a base branch
from

Conversation

mihailjianu1
Copy link
Contributor

@mihailjianu1 mihailjianu1 commented Dec 10, 2024

Upgrade the bitcoin crate almost everywhere.

Some test targets in the crypto crate have not been upgraded yet. The main issue there is that we can't have the secp256k1 dependency (transitive) on different versions from different dependencies with bazel. See more on why here: #1150.

The latest bitcoin dependency depends on secp256k1 0.29, however the latest bip32 dependency has not upgraded to 0.29 yet. The best course of action would be to separate these crates, however to unblock the testnet4 support, that can be done at a later date.

The ckBTC minter canister has also not been upgraded

@github-actions github-actions bot added the fix label Dec 13, 2024
@mihailjianu1 mihailjianu1 changed the title fix: bitcoin crate upgrade chore: bitcoin crate upgrade Dec 16, 2024
@github-actions github-actions bot added chore and removed fix labels Dec 16, 2024
Copy link
Member

@rumenov rumenov left a comment

Choose a reason for hiding this comment

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

Nice! Thanks

@ninegua
Copy link
Member

ninegua commented Dec 20, 2024

@randombit wrote:

I can look into upgrading bitcoin in the crypto tests after this merges.

Just FYI, I tried to upgrade ckbtc minter to bitcion from bitcoin_0_28 but failed. Explanation is here #3275 (comment). Likely it will also fail for crypto.

@mihailjianu1 mihailjianu1 requested a review from a team as a code owner January 14, 2025 09:24
@@ -64,6 +64,7 @@ pub(crate) fn address_limits(network: Network) -> (usize, usize) {
Network::Testnet => (100, 1000),
Network::Signet => (1, 1),
Network::Regtest => (1, 1),
other => unreachable!("Unsupported network: {:?}", other),
Copy link
Member

@DSharifi DSharifi Jan 22, 2025

Choose a reason for hiding this comment

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

We should avoid panics. I would also avoid the catch-all pattern as it would make us blind to changes to this enum in a future upgrade. Edit: nvm this. I see that the type is non exhaustive.

I would either go with returning an Error and let the caller handle the error, or fall back to the safest return value.

CC: @rumenov

Copy link
Member

Choose a reason for hiding this comment

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

Another options is to create our own type SupportedNetworks with the variants we support in the adapter. That way you can avoid having this unreachable! panic everywhere we match on Network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants