Commit Graph

1517 Commits

Author SHA1 Message Date
therealyingtong 4f22077cf6
Remove const activation heights from consensus.rs 2020-08-06 12:30:48 +08:00
therealyingtong 9970a8aefd
Hard-code NetworkUpgrade::Canopy in generate_random_rseed 2020-08-06 12:27:20 +08:00
therealyingtong b05e257f79
Fix database queries in scan.rs and transact.rs 2020-08-06 12:00:49 +08:00
therealyingtong 44f46e50ce
Add <P: consensus::Parameters> type parameter to Builder struct 2020-08-06 11:43:07 +08:00
therealyingtong 88072d64ec
Remove network cfg from zcash_client_backend and zcash_primitives 2020-08-06 11:35:05 +08:00
Henry de Valence 139fc09f10
bellman: add VerificationError (#254)
* bellman: add VerificationError

This adds a distinct VerificationError type to the crate and changes
`verify_proof` to return `Result<(), VerificationError>` rather than
`Result<bool, SynthesisError>`.  This is significantly safer, because it avoids
the need to mix pattern-matching logic with boolean logic (the cause of
RUSTSEC-2019-0004).

* Rename VerificationError variants per review comments.

* Add missing Clone impl to VerificationError.
2020-08-05 22:26:31 +12:00
therealyingtong d6deaddc0a
Only query last_height when needed in decrypt_and_store_transaction() 2020-08-05 16:09:41 +08:00
therealyingtong c8fcdeb50b
Minor changes in note_encryption.rs 2020-08-05 15:45:18 +08:00
therealyingtong 2ed9b6f881
Refactor contextual random rseed generation into util method in zcash_primitives 2020-08-05 15:21:42 +08:00
therealyingtong a3ae1b273d
Switch plaintext version on height for dummy outputs in Builder 2020-08-05 14:27:36 +08:00
therealyingtong d5f80618ef
Switch plaintext version on height in commit_to_address() in zcash_client_sqlite 2020-08-05 14:26:57 +08:00
therealyingtong a25348dfba
Revert passing Parameters to methods 2020-08-05 12:47:29 +08:00
therealyingtong 74b2f0a79e
Pass height to decrypt_transaction() 2020-08-04 21:05:29 +08:00
therealyingtong 0a47a9dbea
Pass rseed to Prover 2020-08-04 16:40:53 +08:00
str4d a224d826fa
Merge pull request #251 from str4d/bundled-prover
zcash_proofs: Add LocalProver::bundled
2020-08-04 05:35:07 +12:00
therealyingtong b34e8b903c
Add invalid version byte tests for ZIP212 2020-08-03 13:51:45 +08:00
therealyingtong eba542c95f
Add activation heights as consts in consensus::Parameters 2020-08-03 13:40:39 +08:00
therealyingtong b1ddd556af
Check derived esk against claimed epk when decrypting note 2020-07-31 22:40:52 +08:00
therealyingtong 895e251793
Fix tests 2020-07-31 22:40:48 +08:00
therealyingtong 6904c8f933
Implement plaintext_version_is_valid() 2020-07-31 22:28:51 +08:00
therealyingtong eda00ec7ad
Pass esk to SaplingNoteEncryption::new and add generate_or_derive_esk() 2020-07-31 22:28:50 +08:00
therealyingtong 65504d9ca7
Add enum Rseed<E::Fs> to Note struct 2020-07-31 22:28:40 +08:00
therealyingtong b537f0f712
Pass height to methods which encrypt or decrypt Sapling outputs 2020-07-31 12:39:39 +08:00
str4d 2cca23c6d2
Merge pull request #257 from therealyingtong/canopy-activation-heights
Set activation heights for Canopy
2020-07-31 12:16:18 +12:00
therealyingtong 71d31abad6
Set activation heights for Canopy 2020-07-30 12:52:02 +08:00
Jack Grigg c921cfcf97 zcash_proofs: Add LocalProver::bundled
Requires the bundled-prover feature, which enables the
wagyu-zcash-parameters crate and adds around 50 MiB to the overall
binary size. That crate bundles the same Sapling parameter files we
normally obtain from disk, so we constrain them to match the same
hard-coded hashes.
2020-07-10 22:15:23 +12:00
Jack Grigg 20bb9a6c0f equihash: Test vectors for expand_array and indices_from_minimal
Migrated from src/gtest/test_equihash.cpp
2020-07-10 21:12:39 +12:00
Jack Grigg c89d1c8470 equihash: Test that all bits of the solution matter
Migrated from src/test/equihash_tests.cpp
2020-07-10 20:52:47 +12:00
Jack Grigg 30fe588cca equihash: Valid and invalid test vectors
Includes existing test vectors from src/test/equihash_tests.cpp, and
additional test vectors from https://github.com/zcash/zcash/pull/1487.
2020-07-10 20:35:23 +12:00
str4d f55f094ef6
Merge pull request #248 from str4d/equihash-crate
Move Equihash verifier into equihash crate
2020-07-10 11:57:11 +12:00
Jack Grigg b5bd52e7a1 equihash 0.1.0 2020-07-10 10:25:52 +12:00
str4d d380a8c8d2
Merge pull request #246 from str4d/zcash_client_sqlite
zcash_client_sqlite crate
2020-07-10 10:22:37 +12:00
Jack Grigg 8c250ca3de zcash_sqlite: Add an unreliability warning to query::get_balance docs 2020-07-10 09:50:43 +12:00
Jack Grigg 8188fae779 zcash_client_sqlite: Implement outgoing viewing key policies
This enables an SQLite light client to specify whether recipient history
can be recovered from the block chain (and by what outgoing viewing key)
with per-transaction granularity.
2020-07-09 23:48:09 +12:00
Jack Grigg 1b059d4ae0 equihash: Remove unnecessary log dependency 2020-07-09 20:53:50 +12:00
Jack Grigg 72fbd2071d equihash: Clarify order of operations in indices_from_minimal 2020-07-09 20:51:52 +12:00
Jack Grigg 7740658084 equihash: Add additional constraints on Params
These are requirements of the general Equihash implementation, that are
satisfied by the Zcash parameters.
2020-07-09 20:50:58 +12:00
Jack Grigg 092ffc7373 equihash: Crate documentation 2020-07-08 17:34:52 +12:00
Jack Grigg bcd687cffb equihash: Remove iterative and recursive APIs
The canonical verification API from Heartwood activation is the
recursive API exposed through is_valid_solution. We retain
is_valid_solution_iterative internally for testing.
2020-07-08 15:22:38 +12:00
Jack Grigg 8759684fad equihash: Add parameter validity checks 2020-07-07 22:09:24 +12:00
Jane Lusby 997657f256
Move `error!` logs into proper error type (#14)
hey kid, want some error handling?
2020-07-07 21:00:53 +12:00
str4d 9768c7141d
Merge pull request #240 from therealyingtong/canopy-nu-parameters
Placeholders for Canopy network upgrade
2020-06-27 01:41:17 +12:00
Jack Grigg bbc3ec54c7 CI: Fetch and cache Sapling parameters for tests 2020-06-27 00:46:05 +12:00
Jack Grigg 9012672164 zcash_proofs: Add API for downloading the Sapling parameters
Includes an example that exposes the API as a binary.
2020-06-27 00:45:12 +12:00
Jack Grigg e910788e8e zcash_proofs: Extract default params folder logic 2020-06-27 00:45:12 +12:00
Jack Grigg 0a61db0317 Upgrade to rusqlite 0.23
Requires bumping the MSRV to 1.40.0 because libsqlite3-sys uses features
introduced in that version. remove_dir_all can similarly be unpinned.
2020-06-27 00:45:12 +12:00
Jack Grigg 5b2c71e112 Move Equihash verification APIs into equihash crate 2020-06-26 13:01:04 +12:00
Jack Grigg d71a599191 Empty equihash crate 2020-06-26 12:53:07 +12:00
Jack Grigg 131e00e25d zcash_client_sqlite::scan::decrypt_and_store_transaction 2020-06-25 18:54:41 +12:00
Jack Grigg b1a2e8172d zcash_client_backend: Add account to DecryptedOutput 2020-06-25 18:54:41 +12:00