-
Notifications
You must be signed in to change notification settings - Fork 441
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 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.0
libsecp256k1
to secp256k1
@@ -1,4 +1,5 @@ | |||
[workspace] | |||
resolver = "2" |
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.
Why is the new cargo
feature resolver required for this change?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be unnecessary since we are using edition 2021 now?
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.
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 [
resolver
field] in the[workspace]
definition if you want to opt-in to the new resolver.
libsecp256k1
to secp256k1
libsecp256k1
from 0.3.5 ➔ 0.7.0
What is the reason for using |
I've switched back to |
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.
LGTM
Please fix CI and we can merge.
Did you try to build a contract that uses the |
edition = "2018" # changed | ||
edition = "2021" # changed |
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.
good catch!
@@ -1,4 +1,5 @@ | |||
[workspace] | |||
resolver = "2" |
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.
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-contract
CI (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_std
compatible crate.