Commit Graph

2595 Commits

Author SHA1 Message Date
Deirdre Connolly d3f0b226e6 Orchard: tidy nullifiers 2021-04-30 00:48:23 -04:00
Deirdre Connolly b93a71c779 Orchard: borrow local.bytes for pallas::Affine serde helper 2021-04-30 00:48:23 -04:00
Deirdre Connolly 009e1dd37e Orchard: some Action (de)serialization fixes 2021-04-30 00:48:23 -04:00
Deirdre Connolly f3cf6966a5 Orchard: tidy commitments etc 2021-04-30 00:48:23 -04:00
Deirdre Connolly cb9d6956d7 Orchard: Fix trait imports and Arbitrary for Action 2021-04-30 00:48:23 -04:00
Deirdre Connolly 981080f049 Orchard: Tidy Debug impl's for keys, cast a pallas::Base into a pallas::Scalar 2021-04-30 00:48:23 -04:00
Deirdre Connolly 6e51671c93 Tidy prf's 2021-04-30 00:48:23 -04:00
Deirdre Connolly 120b065a94 Action should use VerificationKeyBytes 2021-04-30 00:48:23 -04:00
Deirdre Connolly 570ad6e914 Add redpallas::signing_key::SigningKey stub 2021-04-30 00:48:23 -04:00
Deirdre Connolly 01fed3e0f3 Tidy impl From<SpendingKey> for IvkCommitRandomness 2021-04-30 00:48:23 -04:00
Deirdre Connolly bd4e5e1f38 Cleanup 2021-04-30 00:48:23 -04:00
Deirdre Connolly df1ecc72b1 Most things are filled in, including a guess at Pallas-based Mixing Pedersen Hash 2021-04-30 00:48:23 -04:00
Deirdre Connolly 23e391894b Tidy 2021-04-30 00:48:23 -04:00
Deirdre Connolly de051c727c orchard: DiversifierKey is a newtype refinement of 32 bytes 2021-04-30 00:48:23 -04:00
Deirdre Connolly fd29708ecc orchard: derive IncomingViewingKey from FullViewingKey
Includes sinsemilla commit and short commit
2021-04-30 00:48:23 -04:00
Deirdre Connolly 6e1d2f1fb1 orchard: impl From<SpendingKey> for NullifierDerivingKey 2021-04-30 00:48:23 -04:00
Deirdre Connolly f50d8697d4 impl orchard SpendingKey::new() 2021-04-30 00:48:23 -04:00
Deirdre Connolly 20abeda04b Add sapling prf_ock and generate_trapdoor 2021-04-30 00:48:23 -04:00
Deirdre Connolly c3e40d73cf Bunch more work implementing orchard, porting from sapling where applicable 2021-04-30 00:48:23 -04:00
Deirdre Connolly 40383b2741 Partway done with typing out Orchard chain types 2021-04-30 00:48:23 -04:00
Alfredo Garcia a63c2e8c40 Update book/src/dev/proptests.md
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
2021-04-29 18:29:53 -04:00
teor 661a8d57dc Explain how to derive arbitrary impls 2021-04-29 18:29:53 -04:00
teor f33db69267 Remove broken ci-success check
Previously, Zebra made ci-success a required check for merges to main. And then we made ci-success depend on a bunch of other CI checks.

But this doesn't work as expected, because if the dependent checks fail, ci-success is skipped, and the branch protection rules allow the branch to be merged to main.
2021-04-29 18:28:47 -04:00
teor 7e395298f1 Just run builds on ubuntu stable
But keep the tests across ubuntu, macOS, Windows x Rust stable, beta
2021-04-30 07:35:46 +10:00
teor d0e6597fec Use minimal cargo components in docs workflow 2021-04-30 07:35:46 +10:00
teor ea4d3b23f9 Use minimal cargo components in CI 2021-04-30 07:35:46 +10:00
teor b52fbae30f
Fix a bad merge in #2075 (#2085)
Also tweak a constant name, an import, and a comment.
2021-04-29 17:47:10 +10:00
Alfredo Garcia 9fc2388fbc
Parse ConsensusBranchId into NetworkUpgrade for transaction v5 (#2075)
* add consensus_branch_id field to transaction v5

* clippy

* rustfmt

* replace consensus_branch_id with network_upgrade

* remove unintended test files

* change method name

* some clanups

* add network_upgrade as a constant in tests

* use std in created function

* add comment to manual arbitrary impl

* create custom strategy to deal with NetworkUpgrade

* Add a missing TODO comment

Co-authored-by: teor <teor@riseup.net>
2021-04-29 01:55:29 +00:00
teor b70b74c93a
Revert "build(deps): bump vergen from 5.1.2 to 5.1.5" (#2078)
This reverts commit 555805171c.
2021-04-28 09:38:10 -04:00
Alfredo Garcia 75d29aca24
Add V5 transparent and sapling to transaction::check, add missing coinbase PrevOut check (#2070)
* validate sapling v5 tx

* Make itertools dependency optional

We only need itertools when the `proptest-impl` feature is enabled.

* Check if V4 and V5 coinbase transactions contain PrevOut transparent inputs

This is a bugfix on V4 transaction validation. The PrevOut consensus
rule was not explicitly stated in the Zcash spec until April 2021.
(But it was implied by Bitcoin, and partially implemented by Zebra.)

Also do the shielded sapling input check for V5 transactions.

* Add spec and orchard TODOs to has_inputs_and_outputs

Also make the variable names match the spec.

* Sort transaction functions to match v5 data order

* Simplify transaction input and output checks

Move counts or iterators into `Transaction` methods, so we can remove
duplicate code, and make the consensus rule logic clearer.

* Update sapling_balances_match for Transaction v5

- Quote from the spec
- Explain why the function is redunant for v5
- Rename the function so it's clear that it is sapling-specific

Co-authored-by: teor <teor@riseup.net>
2021-04-28 10:43:00 +10:00
dependabot[bot] 555805171c build(deps): bump vergen from 5.1.2 to 5.1.5
Bumps [vergen](https://github.com/rustyhorde/vergen) from 5.1.2 to 5.1.5.
- [Release notes](https://github.com/rustyhorde/vergen/releases)
- [Commits](https://github.com/rustyhorde/vergen/compare/5.1.2...5.1.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-27 10:26:26 -04:00
teor 247620320e
Rename shielded_data to sapling_shielded_data as needed (#2072)
This change help avoid bugs that confuse sapling with orchard (or sprout).

```sh
fastmod shielded_data sapling_shielded_data
```
2021-04-27 10:37:53 -03:00
teor 1f40498fcf
Clippy nightly: disable owned cmp, stop comparing bool using assert_eq (#2073)
* Disable clippy warnings about comparing a newly created struct

In Sapling, we compare canonical JubJub bytes with a supplied byte array.

Since we need to perform calculations to get it into canonical form, we
need to create a newly owned object.

* Clippy: use assert rather than assert_eq on a bool
2021-04-27 09:57:45 -03:00
teor 4b948e67a7
Add extra crate dependencies to the proptest docs (#2071) 2021-04-27 09:42:22 -03:00
teor 3377a486c6 Document how Zebra does cross-crate proptests 2021-04-26 14:07:04 -04:00
dependabot[bot] 9ac0319602 build(deps): bump dirs from 3.0.1 to 3.0.2
Bumps [dirs](https://github.com/soc/dirs-rs) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/soc/dirs-rs/releases)
- [Commits](https://github.com/soc/dirs-rs/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 14:04:31 -04:00
Alfredo Garcia a49b9d44f6
Enable more Transaction v5 tests (#2063)
* Use NU5 and Transaction v5 in most proptests

* Stop skipping post-Canopy blocks in the block subsidy tests

Co-authored-by: teor <teor@riseup.net>
2021-04-26 08:32:21 +10:00
dependabot[bot] 1be56166b6 build(deps): bump regex from 1.4.5 to 1.4.6
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.4.5...1.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-23 09:38:51 -04:00
teor 04cfc2274b Move zebra-state tests into their own files 2021-04-23 09:34:13 -04:00
teor 0d8ffc367e Move LedgerState into the block module 2021-04-23 09:34:13 -04:00
teor 9b3d56db0c
Update network_upgrade.rs (#2058) 2021-04-23 10:23:43 -03:00
Pili Guerra ea1446ee92
Update version strings for Zebra v1.0.0-alpha.7 release (#2056)
* Update version strings for Zebra v1.0.0-alpha.7 release
2021-04-23 12:56:25 +00:00
Alfredo Garcia e730e84a09
remove the `rest` field of v5 transaction (#2057) 2021-04-23 16:25:44 +10:00
teor 7e2c3a2fc7 Clarify a duplicate log message 2021-04-21 23:59:29 -04:00
teor 7b13d5573a Make String Zcash serialization consistent with deserialization
After recent changes, serialization was `write_string`, but
deserialization was `zcash_deserialize`.
2021-04-21 23:58:48 -04:00
Kirill Fomichev 5b2f1cdfd5
Add journald support through tracing-journald (#2034)
* Add journald support through tracing-journald

* change journald to use_journald

* more fixes
2021-04-22 09:31:06 +10:00
Kirill Fomichev afac2c2846
Use the default port for configured listen addresses with no port (#2043)
* Allow use listen address in config without port

* update comments

* remove not used alias

* use Network::default_port

* Move tests and use toml instead json

* change error message

* Make match more readable

Co-authored-by: teor <teor@riseup.net>
2021-04-21 23:14:29 +00:00
teor 96b3c94dbc
Add the new commit count and git hash to the version (#2038)
* Use the git version + new commit count + hash for the app version

This helps diagnose bugs in versions of Zebra built from git branches,
rather than git version tags.

* Fill in assert

* Also log semver string

* Fix syntax

* Handle vergen using the cargo package version or raw git tag

* s/Semver/SemVer/

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2021-04-21 22:14:36 +00:00
teor 0203d1475a Refactor and document correctness for std::sync::Mutex<AddressBook> 2021-04-21 17:14:47 -04:00
teor 905b90d6a1 Refactor and document correctness for std::sync::Mutex in ErrorSlot 2021-04-21 16:39:06 -04:00