replace old libsecp256k1 fork with upstream & remove GMP dependency #128
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace the old libsecp256k1 fork with upstream. The initial motivation for this change was performance: upstream libsecp256k1 can make use of now expired patented optimizations that significantly reduce the amount of time to perform key recovery.
There are two other significant benefits though. The previous fork in use was many many years old and some users have voiced concern about usage of such stale forks (EOSIO/eos#8984). It's certainly desirable to get back on track with the upstream repository. Plus, this latest version of libsecp256k1 no longer needs GMP to perform at optimal speed -- they've even completely removed that code path from the library. GMP is an LGPL library and removing it as a dependency opens up the possibility for future positive changes to binary releases. Besides, removing dependencies always make me smile these days. 😉
My measurements of the performance improvement for K1 key recovery:
(exact performance numbers will vary based on hardware and many other factors; these numbers we gathered with only a single core loaded)
Much of the changes are over in eosnetworkfoundation/mandel-fc#19
Yes, this PR isn't touching the cicd or build scripts. I'm going to continue to ignore those with the hope something good can come along before 3.1 release 😈
This ports over EOSIO/eos#9885 (and EOSIO/fc#180) but then adds on top of it: an even newer version of libsecp256k1 is used vs that late 2020 change which both slightly boosts performance more and allows removal of GMP. I've also wired in libsecp256k1's unit tests.