-
Notifications
You must be signed in to change notification settings - Fork 328
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
base: master
Are you sure you want to change the base?
Conversation
…om/dfinity/ic into mihailjianu1/bitcoin-crate-upgrade
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! Thanks
@randombit wrote:
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. |
@@ -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), |
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.
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
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.
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
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 thesecp256k1
dependency (transitive) on different versions from different dependencies with bazel. See more on why here: #1150.The latest
bitcoin
dependency depends onsecp256k1 0.29
, however the latestbip32
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