Skip to content
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 #70

Merged
merged 46 commits into from
Jun 13, 2024

Conversation

DeckerSU
Copy link
Owner

@DeckerSU DeckerSU commented Feb 19, 2024

  • The old mini-gmp C-library has been removed, and the functions bitcoin_base58{en,de}code have been replaced with internal {En,De}codeBase58 from the Bitcoin codebase.
  • GMP functions are no longer used in rewards CC; the same results can be achieved more efficiently using the internal arith_uint256 type.
  • GMP functions are no longer used in payments CC; refactoring has been done to work with large numbers in calculations using arith_uint256.
  • Dilithium and musig have been removed from the CC in preparation for the upcoming update to the secp256k1 codebase.
  • Old pre-sapling Sprout (PHGRProof) proofs validation has been removed. komodod will no longer verify old Sprout proofs and will assume they are valid. This change is safe for KMD and ACs, as transactions involving Sprout after KOMODO_SAPLING_DEADLINE (February 15, 2019) were prohibited at the consensus level.
  • libnsnark and libgmp have been removed from dependencies and build systems.
  • KMD and dPoW-protected AC checkpoints have been updated.

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 and sprout-verifying.key files in .zcash-params (~910 Mb) is eliminated.

DeckerSU and others added 30 commits February 1, 2024 22:06
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.
This reverts commit daad2c273657233735a100e5011fcc2fd1a88b75.
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/zcash@26a8f68
@DeckerSU DeckerSU merged commit f7ab5f6 into static-experimental Jun 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants