-
Notifications
You must be signed in to change notification settings - Fork 99
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
Remove libsnark, libgmp, mini-gmp #613
Conversation
TODO: solve memory leak in RewardsCalc (seems in few places we totally forgot about call `mpz_clear` to clear the memory allocated for each used variable).
If tests in other translation units leave pblocktree and pcoinsTip in an initialized state, free the memory and set it to nullptr.
Unlike ZCash, we still have libsnark included in both the build and dependency systems. Therefore, this commit should remove all the libsnark-related components from both systems. zcash@26a8f68
removal of missed locations that reference libnark
We aren't automatically deleting them yet.
It is in an anonymous namespace, so it needs to be above all code in the file that uses it.
Since nDefaultPort is always equal to ASSETCHAINS_P2PPORT and DNS records do not contain any information about the port number, the condition to check the correct port will always be true. Therefore, it can be removed.
Should this also be removed? https://github.com/KomodoPlatform/komodo/blob/patch-remove-libsnark/libsnark.mk.patch I notice there are no updates to readme, so I assume listed deps are valid, if not I'll PR changes as required. |
All of those patches from 2017 should be dumped |
zcutil/fetch-params.bat
Outdated
@REM IF NOT EXIST "%APPDATA%"\ZcashParams\sprout-verifying.key ( | ||
@REM ECHO Downloading Zcash trusted setup sprout-verifying.key, this may take a while ... | ||
@REM .\wget64.exe --progress=dot:giga --continue --retry-connrefused --waitretry=3 --timeout=30 https://z.cash/downloads/sprout-verifying.key -O "%APPDATA%"\ZcashParams\sprout-verifying.key | ||
@REM ) | ||
IF NOT EXIST "%APPDATA%"\ZcashParams\sapling-spend.params ( | ||
ECHO Downloading Zcash trusted setup sprout-proving.key, this may take a while ... |
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.
I guess not sprout-proving but sapling-spend should be here in echo msg?
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.
I guess not sprout-proving but sapling-spend should be here in echo msg?
Yes, true. Echo messages fixed.
Yes, not only this file, but also all |
@dimxy Also, I propose removing all dynamic (time-based) sapling activation mechanisms from our codebase due to the complications they introduce, such as the |
I am okay with this idea. I think it is also good to create vUpgrades arrays for asset chains, like make a dedicated vUpgrades array for each old known chain and a default array for new chains with special upgrades. |
Changes
mini-gmp
C-library has been removed, and the functionsbitcoin_base58{en,de}code
have been replaced with internal{En,De}codeBase58
from the Bitcoin codebase.rewards CC
; the same results can be achieved more efficiently using the internalarith_uint256
type.payments CC
; refactoring has been done to work with large numbers in calculations usingarith_uint256
.Dilithium
andmusig
have been removed from the CC in preparation for the upcoming update to thesecp256k1
codebase.komodod
will no longer verify old Sprout proofs and will assume they are valid. This change is safe forKMD
and ACs, as transactions involving Sprout afterKOMODO_SAPLING_DEADLINE
(February 15, 2019) were prohibited at the consensus level.libnsnark
andlibgmp
have been removed from dependencies and build systems.These changes will result in faster Initial Block Download (IBD) due to saving CPU time on verifying old Sprout transactions and disabling scripts and other resource-intensive checks during IBD. Additionally, with the removal of old pre-sapling Sprout, the need for
sprout-proving.key
andsprout-verifying.key
files in.zcash-params
(~910 Mb) is eliminated.Sources
Todo for review
I have already completed all the tasks on the TODO list by myself, but it would be beneficial to have them reviewed by someone else (please regard this list as key points or guidelines for what needs to be checked):
KomodoOcean
and originalkomodod
sources related to this pull request file by file to ensure that we have all the necessary changes in both codebases and have not missed or forgotten anything.KMD
itself from the beginning. If feasible, compare the synchronization time before and after the changes made in this pull request.-ac_sapling=1
parameter to support private transactions from the beginning. Otherwise, these chains will not be able to send shielded transactions until sapling activation, as old Sprout proofs are no longer supported and additionally, all Sprout transactions have been prohibited since February 15, 2019 by consensus rules.sprout-proving.key
andsprout-verifying.key
files in the Zcash parameters.