Commit Graph

129 Commits

Author SHA1 Message Date
Conrado Gouvea 9688811e35
Update multiple crates to ensure bitvec 0.22.3 is being used (#2351)
* Update multiple crates to ensure bitvec 0.22.3 is being used and avoid package conflicts

* Add documentation to zebra-chain::sapling to indicate that ZIP-216 rules are enforced by jubjub

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2021-06-23 13:16:22 +10:00
dependabot[bot] b3849695a4 build(deps): bump secp256k1 from 0.20.2 to 0.20.3
Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from 0.20.2 to 0.20.3.
- [Release notes](https://github.com/rust-bitcoin/rust-secp256k1/releases)
- [Changelog](https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-bitcoin/rust-secp256k1/compare/secp256k1-0.20.2...secp256k1-0.20.3)

---
updated-dependencies:
- dependency-name: secp256k1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 15:45:48 -04:00
dependabot[bot] 17d9b898ea build(deps): bump bech32 from 0.8.0 to 0.8.1
Bumps [bech32](https://github.com/rust-bitcoin/rust-bech32) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/rust-bitcoin/rust-bech32/releases)
- [Commits](https://github.com/rust-bitcoin/rust-bech32/compare/v0.8.0...v0.8.1)

---
updated-dependencies:
- dependency-name: bech32
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 15:43:29 -04:00
Conrado Gouvea c9e93a75f7
Replace primitives_types with uint (#2350) 2021-06-18 15:35:05 -03:00
Pili Guerra 6396ac27d8
Update versions for zebra v1.0.0-alpha.11 release (#2334)
* Update versions for zebra v1.0.0-alpha.11 release

* Update Cargo.lock
2021-06-18 10:37:58 +01:00
teor ff7c1c4523
Depend on a specific git commit for zcash_history (#2345) 2021-06-18 09:32:21 +00:00
Conrado Gouvea 5c0880810b
ZIP-221: integrate MMR tree from librustcash (without Orchard) (#2227)
* add zcash_history.rs with librustzcash Tree wrapper

* Apply suggestions from code review

Co-authored-by: teor <teor@riseup.net>

* Apply changes from code review

* Update zebra-chain/src/primitives/zcash_history.rs

Co-authored-by: teor <teor@riseup.net>

* Apply changes from code review

* Add Entry struct; return Result where needed; add test

* Apply suggestions from code review

Co-authored-by: teor <teor@riseup.net>

* zcash_history: improve naming style with `inner`

* zcash_history: check if block has the correct network upgrade when adding to tree

* zcash_history: test improvements

* zcash_history: split Tree::new into new_from_block and new_from_cache

* zcash_history: move tests to their own file

* remove unneeded empty line in Cargo.toml

Co-authored-by: teor <teor@riseup.net>
2021-06-11 11:25:48 -03:00
dependabot[bot] fc0edb5c44
build(deps): bump itertools from 0.10.0 to 0.10.1 (#2279)
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/rust-itertools/itertools/releases)
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.0...v0.10.1)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-11 12:26:46 +10:00
Pili Guerra 9aafa79fa3
Update versions for zebra v1.0.0-alpha.10 release (#2245)
* Update versions for zebra v1.0.0-alpha.10 release

* Update Cargo.lock
2021-06-09 12:56:36 +02:00
Pili Guerra e3d2ae0a8a
Update versions for zebra v1.0.0-alpha.9 release (#2196)
* Update versions for zebra v1.0.0-alpha.9 release

* Update Cargo.lock
2021-05-26 13:01:39 +02:00
Deirdre Connolly ad7a29517c
Fix clippy::cmp_owned for (sapling, orchard)::keys with `ConstantTimeEq` (#2184)
* Impl subtle::ConstantTimeEq for orchard SpendingKey, use that in Eq/PartialEq

* Use constant time comparisons for secret key data where applicable

This also makes Clippy happier so that we aren't creating types just to compare.

* Fix clippy::cmp_owned for orchard::keys Eq/PartialEq

By impl'ing ConstantTimeEq for those types where leaks of the value
would compromise access or privacy.

* Make clippy::cmp_owned happy for some sapling::keys
2021-05-22 09:40:49 -03:00
dependabot[bot] b8fe6617b8
build(deps): bump sha2 from 0.9.4 to 0.9.5 (#2147)
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.9.4 to 0.9.5.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.9.4...sha2-v0.9.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-13 07:58:48 +10:00
Pili Guerra 500dc2e511
Update version strings for Zebra v1.0.0-alpha.8 release (#2136)
* Update versions for zebra v1.0.0-alpha.8 release

* Update tower-batch and tower-fallback version strings

* Update Cargo.lock
2021-05-12 14:27:36 +02:00
Deirdre Connolly 3901dc9adc
Merge pull request #2099 from ZcashFoundation/redpallas-sig-stub
Flesh out redpallas, direct port of redjubjub
2021-05-06 10:56:00 -04:00
dependabot[bot] c2706f448a build(deps): bump sha2 from 0.9.3 to 0.9.4
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.9.3...sha2-v0.9.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 08:58:07 -04:00
dependabot[bot] 84aca7e78b build(deps): bump tracing from 0.1.25 to 0.1.26
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.25 to 0.1.26.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.25...tracing-0.1.26)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 17:05:49 -04:00
dependabot[bot] 72547cafff build(deps): bump secp256k1 from 0.20.1 to 0.20.2
Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from 0.20.1 to 0.20.2.
- [Release notes](https://github.com/rust-bitcoin/rust-secp256k1/releases)
- [Changelog](https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-bitcoin/rust-secp256k1/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-30 11:22:35 -04:00
Deirdre Connolly 566a10151c Rebase tidies 2021-04-30 00:48:23 -04:00
Deirdre Connolly 6d4ecff24b Pin halo2 commit and update usage of pasta_curves accordingly 2021-04-30 00:48:23 -04:00
Deirdre Connolly 9b6339bb9c Add link to funty pin removal issue 2021-04-30 00:48:23 -04:00
Deirdre Connolly 638ff8d7f8 Bump redjubjub 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 40383b2741 Partway done with typing out Orchard chain types 2021-04-30 00:48:23 -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
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
Kirill Fomichev b636cf8ac1
Benchmark Block struct serialization code (#2018)
* Benchmark Block struct serialization code

* benchmark generated block

* add deserialize benchmark

* Fix block/tests.rs conditional module imports

* add large_single_transaction_block

* Fix name for deserialise benchmark

Co-authored-by: teor <teor@riseup.net>
2021-04-19 12:15:02 +00:00
Kirill Fomichev 5f36be7223
build(deps): bump ripemd160 from 0.8.0 to 0.9.1 (#2027) 2021-04-19 20:43:38 +10:00
teor b9ac221ad4
Implement Sapling serialization in Transaction V5 (#2020)
* serialize/deserialize spaling shielded data in v5 transaction

* fix serialize/deserialize fields order according to spec

* remove extra clone calls

* more serialize fixes

* clippy: fix empty array

* tidy comments

* Add v4 and v5 transaction tests

Also make sure that serialized bytes match if structs match.

* Test fake v5 blocks made out of pre-NU5 block test vectors

* Add outputs-only tests for v5 shared anchor serialization

* Refactor sapling::ShieldedData V5 serialization into its own impl

* Fix spec name typos

* Simplify sapling shielded data parsing

* Delete redundant V5 transaction wrappers in tests

And split out sapling ShieldedData serialization.

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2021-04-19 08:09:57 +10:00
dependabot[bot] 7d36a5e2c3 build(deps): bump color-eyre from 0.5.10 to 0.5.11
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/v0.5.11/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/compare/v0.5.10...v0.5.11)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-14 09:22:27 -04:00
Alfredo Garcia 5ec05e91e1 update version strings for v1.0.0-alpha.6 2021-04-08 18:48:34 -04:00
teor db87a8410e Update tower-batch tests to rand 0.8
And move the ed25519-zebra patch to the workspace Cargo.toml.

This fix helps avoid Cargo.lock instability.
2021-04-07 01:46:22 -04:00
Deirdre Connolly 6bb5220b13
Bump redjubjub to 0.4.0 (#1975) 2021-04-03 11:09:14 -04:00
Deirdre Connolly 0ffab6d589
Ed25519 async batch verification for JoinSplit signatures (#1952)
* Ed25519 async batch verification for JoinSplit signatures

We've been verifying JoinSplitSigs one-by-one pre-ZIP-215. Now as we're post-ZIP-215,
we can take advantage of the batch math to validate this signatures.

I would have pumped all the joinsplits in our MAINNET_BLOCKS test vectors but these
signatures are over the sighash, which needs the NU code to compute, and once we're
doing all that set up, we're basically doing transaction validation, so.

Resolves #1944

* Repoint to latest ed25519-zebra commit with note to point at 3.0 when released

Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: teor <teor@riseup.net>
2021-03-31 09:08:19 +10:00
dependabot[bot] 562c141ee1
build(deps): bump displaydoc from 0.2.0 to 0.2.1 (#1959)
Bumps [displaydoc](https://github.com/yaahc/displaydoc) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/yaahc/displaydoc/releases)
- [Changelog](https://github.com/yaahc/displaydoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/displaydoc/compare/v0.2.0...v0.2.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 09:27:00 +10:00
Deirdre Connolly 7efc700aca
Merge pull request #1713 from ZcashFoundation/use-groth16-batch-math
Use batch optimizations, load params in groth16::Verifier, verify Spend & Output descriptions in transaction verifier
2021-03-24 12:28:25 -04:00
Deirdre Connolly ca1d2de87d
Bump versions for v1.0.0-alpha.5 (#1932)
Zebra's latest alpha checkpoints on Canopy activation, continues our work on NU5, and fixes a security issue.

Some notable changes include:

## Added
- Log address book metrics when PeerSet or CandidateSet don't have many peers (#1906)
- Document test coverage workflow (#1919)
- Add a final job to CI, so we can easily require all the CI jobs to pass (#1927)

## Changed
- Zebra has moved its mandatory checkpoint from Sapling to Canopy (#1898, #1926)
  - This is a breaking change for users that depend on the exact height of the mandatory checkpoint.

## Fixed
- tower-batch: wake waiting workers on close to avoid hangs (#1908)
- Assert that pre-Canopy blocks use checkpointing (#1909)
- Fix CI disk space usage by disabling incremental compilation in coverage builds (#1923)

## Security
- Stop relying on unchecked length fields when preallocating vectors (#1925)
2021-03-22 22:05:01 -04:00
dependabot[bot] 97cae4b2da build(deps): bump displaydoc from 0.1.7 to 0.2.0
Bumps [displaydoc](https://github.com/yaahc/displaydoc) from 0.1.7 to 0.2.0.
- [Release notes](https://github.com/yaahc/displaydoc/releases)
- [Changelog](https://github.com/yaahc/displaydoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/displaydoc/commits/v0.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-17 15:50:40 -04:00
Alfredo Garcia d49eaab68e
Bump versions for zebrad 1.0.0-alpha.4 (#1913)
* Bump versions for zebrad 1.0.0-alpha.4

* add Cargo.lock
2021-03-16 21:12:37 -03:00
dependabot[bot] 7f9d66a4af build(deps): bump serde-big-array from 0.3.1 to 0.3.2
Bumps [serde-big-array](https://github.com/est31/serde-big-array) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/est31/serde-big-array/releases)
- [Commits](https://github.com/est31/serde-big-array/commits/v0.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-13 05:50:01 -05:00
Alfredo Garcia ca44fbd7b8
upgrade ed25519-zebra to v2 (#1811)
This implements ZIP-215
2021-03-02 17:45:55 +10:00
dependabot[bot] bf1e2bd3b8
build(deps): bump tracing from 0.1.24 to 0.1.25 (#1815)
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.24 to 0.1.25.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.24...tracing-0.1.25)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 09:28:26 +10:00
teor 7558f74c78 Bump versions for zebrad 1.0.0-alpha.3 2021-02-23 10:39:13 -05:00
dependabot[bot] b578d1ff2e build(deps): bump proptest-derive from 0.2.0 to 0.3.0
Bumps [proptest-derive](https://github.com/AltSysrq/proptest) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/AltSysrq/proptest/releases)
- [Changelog](https://github.com/AltSysrq/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/AltSysrq/proptest/compare/proptest-derive-0.2.0...proptest-derive-0.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 01:33:54 -05:00
dependabot[bot] dd940f7dbf build(deps): bump bech32 from 0.7.2 to 0.8.0
Bumps [bech32](https://github.com/rust-bitcoin/rust-bech32) from 0.7.2 to 0.8.0.
- [Release notes](https://github.com/rust-bitcoin/rust-bech32/releases)
- [Commits](https://github.com/rust-bitcoin/rust-bech32/compare/v0.7.2...v0.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-21 20:51:43 -05:00
dependabot[bot] f19ef44493 build(deps): bump tracing from 0.1.23 to 0.1.24
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.23 to 0.1.24.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.23...tracing-0.1.24)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-18 22:21:49 -05:00
Deirdre Connolly 0c5daa8410 Bump versions for zebrad 1.0.0-alpha.2
Including tower-batch bump to 0.2.0, tower-fallback to 0.2.0, zebra-script to 1.0.0-alpha.3
2021-02-09 16:14:29 -05:00
dependabot[bot] b3a3b8f7c7 build(deps): bump tracing from 0.1.22 to 0.1.23
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.22 to 0.1.23.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.22...tracing-0.1.23)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-05 12:26:52 -05:00
dependabot[bot] 25b6491929 build(deps): bump sha2 from 0.9.2 to 0.9.3
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.9.2 to 0.9.3.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.9.2...sha2-v0.9.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-01 19:14:15 -05:00
dependabot[bot] c52310ef91 build(deps): bump jubjub from 0.5.1 to 0.6.0
Bumps [jubjub](https://github.com/zkcrypto/jubjub) from 0.5.1 to 0.6.0.
- [Release notes](https://github.com/zkcrypto/jubjub/releases)
- [Changelog](https://github.com/zkcrypto/jubjub/blob/main/RELEASES.md)
- [Commits](https://github.com/zkcrypto/jubjub/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-30 01:54:06 -05:00