Upgrade libsecp256k1 from 0.3.5 ➔ 0.7.0#967
Conversation
Codecov Report
@@ Coverage Diff @@
## master #967 +/- ##
===========================================
+ Coverage 62.62% 76.01% +13.39%
===========================================
Files 244 244
Lines 9147 9149 +2
===========================================
+ Hits 5728 6955 +1227
+ Misses 3419 2194 -1225
Continue to review full report at Codecov.
|
libsecp256k1 from 0.3.5 ➔ 0.7.0libsecp256k1 to secp256k1
| @@ -1,4 +1,5 @@ | |||
| [workspace] | |||
| resolver = "2" | |||
There was a problem hiding this comment.
Why is the new cargo feature resolver required for this change?
There was a problem hiding this comment.
Ok, so the issue is that cargo's old resolver does not handle features in dependencies correctly. In our case we have the libsecp256k1 crate as (1) a dependency for non-std and (2) as a dep for the off-chain engines. Both cases require a different feature set, of which some features are not compatible to non-std.
The old feature resolver doesn't handle this properly and merges the features, thus resulting in errors a la error: duplicate lang item in crate std (which secp256k1 depends on): panic_impl.
But since we'll migrate to the 2021 edition soon this will be obsolete anyway (because resolver = "2" is the default there).
There was a problem hiding this comment.
Shouldn't this be unnecessary since we are using edition 2021 now?
There was a problem hiding this comment.
Shouldn't this be unnecessary since we are using edition 2021 now?
Absolutely my assumption as well, but unfortunately not true: rust-lang/cargo#9956.
If you are using a [virtual workspace], you will still need to explicitly set the [
resolverfield] in the[workspace]definition if you want to opt-in to the new resolver.
libsecp256k1 to secp256k1libsecp256k1 from 0.3.5 ➔ 0.7.0
|
What is the reason for using |
I've switched back to |
Robbepop
left a comment
There was a problem hiding this comment.
LGTM
Please fix CI and we can merge.
|
Did you try to build a contract that uses the |
| blank_lines_upper_bound = 1 | ||
| blank_lines_lower_bound = 0 | ||
| edition = "2018" # changed | ||
| edition = "2021" # changed |
| @@ -1,4 +1,5 @@ | |||
| [workspace] | |||
| resolver = "2" | |||
There was a problem hiding this comment.
Shouldn't this be unnecessary since we are using edition 2021 now?
@xgreenx Yes, I tested it. Ideally we would also have an example contract that uses these eth compatibility functions, so if you have any idea feel free to say :-). The issue that you ran into is detected in our CI with this stage: I had this to, specifically it was these errors: What I found is that
We've fixed this by migrating to edition 2021, which has |
This is required to fix the failing
cargo-contractCI (specifically the Windows run).We are currently using a way outdated version of
libsecp256k1, upgrading it turned out harder than just switching to the otherno_stdcompatible crate.