Commit Graph

417 Commits

Author SHA1 Message Date
dependabot[bot] 2dd0fa0e07 build(deps): bump tokio from 0.3.4 to 0.3.5
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.3.4 to 0.3.5.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.3.4...tokio-0.3.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 10:39:39 -05:00
dependabot[bot] 61d0f02c57 build(deps): bump inferno from 0.10.1 to 0.10.2
Bumps [inferno](https://github.com/jonhoo/inferno) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/jonhoo/inferno/releases)
- [Changelog](https://github.com/jonhoo/inferno/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jonhoo/inferno/compare/v0.10.1...v0.10.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 10:35:14 -05:00
dependabot[bot] 1a77122acb build(deps): bump structopt from 0.3.20 to 0.3.21
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.20 to 0.3.21.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.20...v0.3.21)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 10:34:12 -05:00
teor 939c2b97a6 Implement AdjustedDifficulty creation
Also:
* call the difficulty check from `block_is_contextually_valid`
* add a stub `difficulty_threshold_is_valid` function
2020-12-01 07:27:30 +10:00
dependabot[bot] e832f70c2c build(deps): bump tracing from 0.1.21 to 0.1.22
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.21 to 0.1.22.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.21...tracing-0.1.22)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-24 10:55:53 -05:00
dependabot[bot] a4af90c2b0 build(deps): bump color-eyre from 0.5.7 to 0.5.8
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.7 to 0.5.8.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/compare/v0.5.7...v0.5.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-24 09:59:22 -05:00
Henry de Valence 342eb166ff state: track UTXO provenance
This commit changes the state system and database format to track the
provenance of UTXOs, in addition to the outputs themselves.
Specifically, it tracks the following additional metadata:

- the height at which the UTXO was created;
- whether or not the UTXO was created from a coinbase transaction or
  not.

This metadata will allow us to:

- check the coinbase maturity consensus rule;
- check the coinbase inputs => no transparent outputs rule;
- implement lookup of transactions by utxo (using the height to find the
  block and then scanning the block) for a future RPC mechanism.

Closes #1342
2020-11-23 22:18:43 -08:00
Henry de Valence a2a70e1fc1 consensus: fix same-block utxo lookups
The UTXO query system assumes that a transaction will only request
information about UTXOs created in prior blocks.  But transactions are
allowed to spend UTXOs created by prior transactions in the same block.

This doesn't fit with the existing query model, so instead of trying to
change it, allow the script verifier to take an additional set of known
UTXOs, and propagate this set from the block.
2020-11-23 14:16:39 +10:00
Henry de Valence ba3c19142c deps: update hyper, metrics to tokio 0.3
The metrics code becomes much simpler because the current version of the
metrics crate builds its own single-threaded runtime on a dedicated worker
thread, so no dependency on the main Zebra Tokio runtime is required.
2020-11-20 10:08:16 -08:00
Henry de Valence add94c1c45 deps: move to tokio 0.3, tower 0.4
This change is mostly mechanical, with the exception of the changes to the
`tower-batch` middleware.  This middleware was adapted from `tower::buffer`,
and the `tower::buffer` code was changed to implement its own bounded queue,
because Tokio 0.3 removed the `mpsc::Sender::poll_send` method.  See

ddc64e8d4d

for more context on the Tower changes.  To match Tower as closely as possible
in order to be able to upstream `tower-batch`, those changes are copied from
`tower::Buffer` to `tower-batch`.
2020-11-20 10:08:16 -08:00
Jane Lusby 4c9bb87df2
zebra-state: replace sled with rocksdb (#1325)
## Motivation

Prior to this PR we've been using `sled` as our database for storing persistent chain data on the disk between boots. We picked sled over rocksdb to minimize our c++ dependencies despite it being a less mature codebase. The theory was if it worked well enough we'd prefer to have a pure rust codebase, but if we ever ran into problems we knew we could easily swap it out with rocksdb.

Well, we ran into problems. Sled's memory usage was particularly high, and it seemed to be leaking memory. On top of all that, the performance for writes was pretty poor, causing us to become bottle-necked on sled instead of the network.

## Solution

This PR replaces `sled` with `rocksdb`. We've seen a 10x improvement in memory usage out of the box, no more leaking, and much better write performance. With this change writing chain data to disk is no longer a limiting factor in how quickly we can sync the chain.

The code in this pull request has:
  - [x] Documentation Comments
  - [x] Unit Tests and Property Tests

## Review

@hdevalence
2020-11-18 18:05:06 -08:00
Jane Lusby 65a605520f remove references to sled from service.rs 2020-11-18 15:09:43 -05:00
Henry de Valence 608b3953af deps: cargo update 2020-11-17 14:56:27 -08:00
dependabot[bot] 18eb4d1c31 build(deps): bump primitive-types from 0.7.2 to 0.7.3
Bumps [primitive-types](https://github.com/paritytech/parity-common) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/paritytech/parity-common/releases)
- [Commits](https://github.com/paritytech/parity-common/compare/primitive-types-v0.7.2...primitive-types-v0.7.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-13 15:59:04 -05:00
dependabot[bot] 8c5f6d0177 build(deps): bump once_cell from 1.5.1 to 1.5.2
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.5.1...v1.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-13 14:48:11 -05:00
Jane Lusby 1bc833dbcc Move work conversion helpers to test code 2020-11-12 09:14:52 -05:00
teor 18bd5e5fbd Update Cargo.lock
We need spandoc 0.2.1 to avoid a panic on empty blocks.
2020-11-12 12:30:54 +10:00
dependabot[bot] a7ad73feac build(deps): bump sled from 0.34.4 to 0.34.5
Bumps [sled](https://github.com/spacejam/sled) from 0.34.4 to 0.34.5.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.34.4...v0.34.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-10 11:01:06 -05:00
dependabot[bot] e40c7b57c3 build(deps): bump bs58 from 0.3.1 to 0.4.0
Bumps [bs58](https://github.com/mycorrhiza/bs58-rs) from 0.3.1 to 0.4.0.
- [Release notes](https://github.com/mycorrhiza/bs58-rs/releases)
- [Commits](https://github.com/mycorrhiza/bs58-rs/compare/0.3.1...0.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-09 09:35:19 -05:00
dependabot[bot] a58299a0f0 build(deps): bump color-eyre from 0.5.6 to 0.5.7
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/compare/v0.5.6...v0.5.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-09 08:40:55 -05:00
dependabot[bot] 1e3cf6dc5c build(deps): bump tracing-subscriber from 0.2.14 to 0.2.15
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.14 to 0.2.15.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.14...tracing-subscriber-0.2.15)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 20:37:40 -05:00
dependabot[bot] 785fc30481 build(deps): bump hyper from 0.13.8 to 0.13.9
Bumps [hyper](https://github.com/hyperium/hyper) from 0.13.8 to 0.13.9.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.13.8...v0.13.9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 20:07:18 -05:00
dependabot[bot] e87340594a build(deps): bump thiserror from 1.0.21 to 1.0.22
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.21 to 1.0.22.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.21...1.0.22)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 19:28:42 -05:00
dependabot[bot] b99ecbd2d7 build(deps): bump blake2b_simd from 0.5.10 to 0.5.11
Bumps [blake2b_simd](https://github.com/oconnor663/blake2_simd) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/oconnor663/blake2_simd/releases)
- [Commits](https://github.com/oconnor663/blake2_simd/compare/0.5.10...0.5.11)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 19:28:24 -05:00
dependabot[bot] dd7e1bb3f1 build(deps): bump blake2s_simd from 0.5.10 to 0.5.11
Bumps [blake2s_simd](https://github.com/oconnor663/blake2_simd) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/oconnor663/blake2_simd/releases)
- [Commits](https://github.com/oconnor663/blake2_simd/compare/0.5.10...0.5.11)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 18:54:13 -05:00
dependabot[bot] 578a3ca5ab build(deps): bump sha2 from 0.9.1 to 0.9.2
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.9.1 to 0.9.2.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.9.1...streebog-v0.9.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 18:53:49 -05:00
dependabot[bot] 2442cf162f build(deps): bump regex from 1.4.1 to 1.4.2
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.1 to 1.4.2.
- [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.1...1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-02 17:01:21 -05:00
dependabot[bot] 83c844abb5 build(deps): bump futures from 0.3.6 to 0.3.7
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.6...0.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-27 02:28:48 -04:00
Henry de Valence 12d25159c6 zebrad: use hedged requests in sync
The hedge middleware implements hedged requests, as described in _The
Tail At Scale_. The idea is that we auto-tune our retry logic according
to the actual network conditions, pre-emptively retrying requests that
exceed some latency percentile. This would hopefully solve the problem
where our timeouts are too long on mainnet and too slow on testnet.
2020-10-26 12:05:35 -07:00
Henry de Valence b90581a3d7 zebrad: create a Downloads Stream for syncing.
This makes two changes relative to the existing download code:

1.  It uses a oneshot to attempt to cancel the download task after it
    has started;

2.  It encapsulates the download creation and cancellation logic into a
    Downloads struct.
2020-10-26 12:05:35 -07:00
teor 672b39a847 Use MAX_BLOCK_REORG_HEIGHT in zebra-checkpoints
MAX_BLOCK_REORG_HEIGHT is 1 less than the constant it replaces. The new
calculation is correct: the 100th block is finalized.
2020-10-26 20:59:40 +10:00
dependabot[bot] ff51c2e0c0 build(deps): bump tracing-subscriber from 0.2.13 to 0.2.14
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.13 to 0.2.14.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.13...tracing-subscriber-0.2.14)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-23 15:02:02 -04:00
Henry de Valence 9dc8d76d68 consensus: add stub groth16::Verifier
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-10-20 11:16:22 -04:00
dependabot[bot] 2358091a37 build(deps): bump serde from 1.0.116 to 1.0.117
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.116 to 1.0.117.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.116...v1.0.117)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-16 15:26:00 -04:00
teor 32bbc19c6b Fix a timeout bug in zebra_test::command
And add tests for the command functionality.

Also document some remaining bugs (see #1140).
2020-10-15 19:54:00 -04:00
Jane Lusby e05103323e
Implement Async Script Verification RFC (#961)
This commit begins the process of integrating `zcash_script` with the rest of the system for verifying scripts while syncing the block chain. It does so by adding the necessary support for looking up UTXOs from the state service and implements the first parts of the `script::Verifier` for looking up the necessary UTXOs in the state and then generating the necessary call to `zcash_script` to verify the script itself.

Co-authored-by: teor <teor@riseup.net>
2020-10-14 14:06:32 -07:00
dependabot[bot] 49042c5f78
build(deps): bump regex from 1.4.0 to 1.4.1 (#1159)
Bumps [regex](https://github.com/rust-lang/regex) from 1.4.0 to 1.4.1.
- [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.0...1.4.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-14 12:10:48 -07:00
dependabot[bot] 15d0e127fd build(deps): bump structopt from 0.3.19 to 0.3.20
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.19 to 0.3.20.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.19...v0.3.20)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 12:00:27 -04:00
dependabot[bot] f2d9d4fb87 build(deps): bump serde_json from 1.0.58 to 1.0.59
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.58 to 1.0.59.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.58...v1.0.59)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-13 12:00:03 -04:00
dependabot[bot] 766baea9d8
build(deps): bump regex from 1.3.9 to 1.4.0 (#1150)
Bumps [regex](https://github.com/rust-lang/regex) from 1.3.9 to 1.4.0.
- [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.3.9...1.4.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 13:27:26 -07:00
dependabot[bot] 2d0d8eb2fd
build(deps): bump pin-project from 0.4.26 to 0.4.27 (#1149)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 0.4.26 to 0.4.27.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.26...v0.4.27)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 12:36:21 -07:00
dependabot[bot] 3d309447ed
build(deps): bump toml from 0.5.6 to 0.5.7 (#1148)
Bumps [toml](https://github.com/alexcrichton/toml-rs) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/alexcrichton/toml-rs/releases)
- [Commits](https://github.com/alexcrichton/toml-rs/compare/0.5.6...0.5.7)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 12:36:00 -07:00
dependabot[bot] 5e58955212
build(deps): bump zcash_script from 0.1.2 to 0.1.3 (#1147)
Bumps [zcash_script](https://github.com/ZcashFoundation/zcash_script) from 0.1.2 to 0.1.3.
- [Release notes](https://github.com/ZcashFoundation/zcash_script/releases)
- [Changelog](https://github.com/ZcashFoundation/zcash_script/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ZcashFoundation/zcash_script/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-12 12:35:37 -07:00
dependabot[bot] 256c0fce27
build(deps): bump structopt from 0.3.18 to 0.3.19 (#1139)
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.18 to 0.3.19.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.18...v0.3.19)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-09 13:07:10 -07:00
dependabot[bot] 76e7e3d714 build(deps): bump tracing-subscriber from 0.2.12 to 0.2.13
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.12 to 0.2.13.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.12...tracing-subscriber-0.2.13)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-08 15:09:32 -04:00
Jane Lusby 855f9b5bcb
Implement MVP of NonFinalizedState and integrate it with the state service (#1101)
* implement most of the chain functions
* implement fork
* fix outpoint handling in Chain struct
* update expect for work
* split utxo into two sets
* update the Chain definition
* remove allow attribute in zebra-state/lib.rs
* merge ChainSet type into MemoryState
* Add error messages to asserts
* export proptest impls for use in downstream crates
* add testjob for disabled feature in zebra-chain
* try to fix github actions syntax
* add module doc comment
* update RFC for utxos
* add missing header
* working proptest for Chain
* propagate back results over channel
* Start updating RFC to match changes
* implement queued block pruning
* and now it syncs wooo!
* remove empty modules
* setup config for proptests
* re-enable missing_docs lint
* update RFC to match changes in impl
* add documentation
* use more explicit variable names
2020-10-08 13:07:32 +10:00
dependabot[bot] 1b7bf61f96 build(deps): bump thiserror from 1.0.20 to 1.0.21
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.20 to 1.0.21.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.20...1.0.21)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-07 18:25:33 -04:00
dependabot[bot] 08f363e1cb build(deps): bump futures from 0.3.5 to 0.3.6
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.5...0.3.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-06 16:54:08 -04:00
dependabot[bot] 1d742d0658 build(deps): bump futures-util from 0.3.5 to 0.3.6
Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.5...0.3.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-06 05:32:21 -04:00
dependabot[bot] 23a62a2d87 build(deps): bump inferno from 0.10.0 to 0.10.1
Bumps [inferno](https://github.com/jonhoo/inferno) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/jonhoo/inferno/releases)
- [Changelog](https://github.com/jonhoo/inferno/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jonhoo/inferno/compare/v0.10.0...v0.10.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-06 05:31:01 -04:00
dependabot[bot] 51746892ff build(deps): bump futures-core from 0.3.5 to 0.3.6
Bumps [futures-core](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.5...0.3.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-06 05:29:51 -04:00
dependabot[bot] b473476a4a build(deps): bump pin-project from 0.4.25 to 0.4.26
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 0.4.25 to 0.4.26.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.25...v0.4.26)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-05 11:27:06 -04:00
dependabot[bot] d769f62a73 build(deps): bump color-eyre from 0.5.5 to 0.5.6
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/compare/v0.5.5...v0.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-05 11:26:23 -04:00
Jane Lusby 86ed13060f
Add tests for `Chain` implementation (#1093)
* Begin work on RFC5 implementation

* I think this is necessary

* holy shit supertrait implemented via subtrait

* implement most of the chain functions

* change to slightly better name

* implement fork

* fix outpoint handling in Chain struct

* update expect for work

* resolve review comment

* split utxo into two sets

* update the Chain definition

* just a little more

* update comment

* Apply suggestions from code review

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

* apply changes from code review

* remove allow attribute in zebra-state/lib.rs

* Update zebra-state/src/memory_state.rs

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

* merge ChainSet type into MemoryState

* rename state impl types

* Add error messages to asserts

* checkpoint so I can split off arbitrary changes into a PR

* export proptest impls for use in downstream crates

* add testjob for disabled feature in zebra-chain

* run rustfmt

* try to fix github actions syntax

* differentiate name

* prove that github action tests zebra-chain build without features

* revert change from last commit now that test is running

* remove accidentally introduced newline

* checkpoint

* add module doc comment

* update RFC for utxos

* add missing header

* working proptest for Chain

* apply change from chain impl PR

* setup config for proptests

* Update zebra-chain/src/block/arbitrary.rs

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

* run rustfmt

Co-authored-by: teor <teor@riseup.net>
2020-10-02 15:51:51 -07:00
dependabot[bot] 1b528404cd build(deps): bump pin-project from 0.4.24 to 0.4.25
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 0.4.24 to 0.4.25.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.24...v0.4.25)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-02 11:18:13 -04:00
dependabot[bot] ae362d260e build(deps): bump serde_json from 1.0.57 to 1.0.58
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.57 to 1.0.58.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.57...v1.0.58)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-01 16:56:11 -04:00
dependabot[bot] b5ecafa7bc build(deps): bump chrono from 0.4.18 to 0.4.19
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.18 to 0.4.19.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.18...v0.4.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-01 15:09:10 -04:00
dependabot[bot] 15c5365ca7 build(deps): bump tracing from 0.1.19 to 0.1.21
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.19 to 0.1.21.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.19...tracing-0.1.21)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-29 11:01:34 -04:00
dependabot[bot] 2230e353df
Merge pull request #1103 from ZcashFoundation/dependabot/cargo/pin-project-0.4.24
build(deps): bump pin-project from 0.4.23 to 0.4.24
2020-09-28 11:13:11 -07:00
dependabot[bot] bf4ddc1074 build(deps): bump chrono from 0.4.15 to 0.4.18
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.15 to 0.4.18.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.15...v0.4.18)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 11:13:05 -07:00
dependabot[bot] d5ce5eeee2 build(deps): bump structopt from 0.3.17 to 0.3.18
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.17...v0.3.18)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-24 18:25:54 -04:00
Jane Lusby 0b4e974c9e
export proptest impls for use in downstream crates (#1092)
* export proptest impls for use in downstream crates

* add testjob for disabled feature in zebra-chain

* run rustfmt

* try to fix github actions syntax

* differentiate name

* prove that github action tests zebra-chain build without features

* revert change from last commit now that test is running

* remove accidentally introduced newline

* Update .github/workflows/ci.yml

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-09-23 18:52:52 -07:00
Jane Lusby 40e22808c7
disable reporting url for timeout errors (#1087)
* disable reporting url for timeout errors

* revert newline removal

* switch to released color-eyre version
2020-09-21 16:15:09 -07:00
Henry de Valence 6dd7318d3b deps: use Tower 0.4 from git instead of 0.3.1.
This addresses at least three pain points:

- we were affected by bugs that were already fixed in git, but not in
  the released crate;
- we can use service combinators to transform requests and responses;
- we can use the hedge middleware.

The version in git is still marked as 0.3.1 but these changes will be
part of tower 0.4: https://github.com/tower-rs/tower/issues/431
2020-09-21 14:16:56 -07:00
Alfredo Garcia c616c7ffd2
Move consensus verification errors (#1070)
* refactor block and tx validation errors

* rename errors module to error

* move NoTransactions to BlockError

* clarify some errors, use dbg format for hash in error

* mnake is_coinbase_first return BlockError

* add new error types for each consensus Service

Co-authored-by: Jane Lusby <jane@zfnd.org>
2020-09-21 11:54:06 -07:00
dependabot[bot] 85241a49d6 build(deps): bump hyper from 0.13.7 to 0.13.8
Bumps [hyper](https://github.com/hyperium/hyper) from 0.13.7 to 0.13.8.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.13.7...v0.13.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-21 11:58:31 -04:00
Jane Lusby ca648ff27c
Enable issue-url feature in color-eyre (#1072)
* Enable issue-url feature in color-eyre

* get version automatically

* and the url!
2020-09-17 15:09:18 -07:00
Jane Lusby bd861fd25e
update panic hook for zebra-test to supress confusing output (#1065)
* update panic hook for zebra-test to supress confusing output

* remove outdated comment
2020-09-17 13:20:30 -07:00
dependabot[bot] a7d5a80517 build(deps): bump zcash_script from 0.1.0 to 0.1.1
Bumps [zcash_script](https://github.com/ZcashFoundation/zcash_script) from 0.1.0 to 0.1.1.
- [Release notes](https://github.com/ZcashFoundation/zcash_script/releases)
- [Changelog](https://github.com/ZcashFoundation/zcash_script/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ZcashFoundation/zcash_script/compare/v0.1.0...v0.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-16 12:24:34 -04:00
dependabot[bot] b441e2cfa5 build(deps): bump color-eyre from 0.5.2 to 0.5.3
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/compare/v0.5.2...v0.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-15 08:04:06 -04:00
dependabot[bot] b86023ad0f
build(deps): bump serde from 1.0.115 to 1.0.116 (#1060)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.115 to 1.0.116.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.115...v1.0.116)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-14 13:49:27 -07:00
dependabot[bot] ba32d27f6e
build(deps): bump tracing-subscriber from 0.2.11 to 0.2.12 (#1059)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.11 to 0.2.12.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.11...tracing-subscriber-0.2.12)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-14 13:49:07 -07:00
Jane Lusby a7b418bfe5
Add test for first checkpoint verification (#1018)
* add test for first checkpoint sync

Prior this this change we've not had any tests that verify our sync /
network logic is well behaved. This PR cleans up the test helper code to
make error reports more consistent and uses this cleaned up API to
implement a checkpoint sync test which runs zebrad until it reads the
first checkpoint event from stdout.

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

* move include out of unix cfg

Co-authored-by: teor <teor@riseup.net>
2020-09-11 13:39:39 -07:00
dependabot[bot] 69032e1007 build(deps): bump sled from 0.34.3 to 0.34.4
Bumps [sled](https://github.com/spacejam/sled) from 0.34.3 to 0.34.4.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.34.3...v0.34.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-11 13:08:16 -04:00
dependabot[bot] b881eafe47 build(deps): bump jubjub from 0.5.0 to 0.5.1
Bumps [jubjub](https://github.com/zkcrypto/jubjub) from 0.5.0 to 0.5.1.
- [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>
2020-09-10 09:45:37 -07:00
dependabot[bot] a3984729be build(deps): bump jubjub from 0.4.0 to 0.5.0
Bumps [jubjub](https://github.com/zkcrypto/jubjub) from 0.4.0 to 0.5.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>
2020-09-09 10:31:24 -04:00
dependabot[bot] 142226ad57 build(deps): bump indexmap from 1.5.2 to 1.6.0
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.5.2 to 1.6.0.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.5.2...1.6.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 07:56:39 -04:00
Jane Lusby 6744f415d2
Implement sighash (#870)
* Implement sighash

* move sighash logic to a separate module

* start filling in more of the alg

* start setting up a test case

* make the test useful

* Iter transaction inputs

* better error message for expect

* add support for zip243 sighash

* ohey first testvector is passing, yayyy

* pass the second testvector

* add last testvector

* move a use statement

* use common deserialization code for amount everywhere

* cleanup attributes

* bring in fixed preimage

* fix discrepancy with spec

* always deserialize as a signed value

* Update zebra-chain/src/transaction/sighash.rs

* update unreachable statements

* add serialization impls for nonnegative amounts

* Apply suggestions from code review

* document sighash fn

* tweek docs

* fix mistake in translation for zip243

* consistent error messages

* reorder because i like it more that way

* document more panics

* Update zebra-chain/src/amount.rs

* Add comment regarding the serialization of spend descriptions in sighash

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-09-05 19:31:11 -04:00
teor d3b6a73f7b Improve zebra-state logging and metrics 2020-09-02 12:09:50 -04:00
dependabot[bot] 753b93d8a3 build(deps): bump indexmap from 1.5.1 to 1.5.2
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.5.1...1.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-02 12:07:01 -04:00
dependabot[bot] 656a84fa55 build(deps): bump color-eyre from 0.5.1 to 0.5.2
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.1 to 0.5.2.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Changelog](https://github.com/yaahc/color-eyre/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/color-eyre/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-01 11:39:43 -04:00
Henry de Valence 3ed967bcf8 deps: use x25519-dalek's new PartialEq, Eq methods 2020-08-31 13:30:14 -07:00
dependabot[bot] f7fe7b9053 build(deps): bump secp256k1 from 0.17.2 to 0.19.0
Bumps [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) from 0.17.2 to 0.19.0.
- [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.17.2...secp256k1-0.19.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-28 17:09:39 -04:00
dependabot[bot] 005ec6c57c
build(deps): bump structopt from 0.3.16 to 0.3.17 (#953)
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.16 to 0.3.17.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.16...v0.3.17)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-26 11:59:04 -07:00
dependabot[bot] 8e9019a847 build(deps): bump jubjub from 0.3.0 to 0.4.0
Bumps [jubjub](https://github.com/zkcrypto/jubjub) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/zkcrypto/jubjub/releases)
- [Changelog](https://github.com/zkcrypto/jubjub/blob/master/RELEASES.md)
- [Commits](https://github.com/zkcrypto/jubjub/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-25 17:35:54 -04:00
dependabot[bot] 619c499ba6 build(deps): bump sled from 0.34.2 to 0.34.3
Bumps [sled](https://github.com/spacejam/sled) from 0.34.2 to 0.34.3.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-24 12:49:10 -04:00
teor 06f4a59664 feature: Add a checkpoint_sync config option
(The option doesn't do anything yet.)
2020-08-24 15:34:46 +10:00
Ramana Venkata 991c70723a zebrad: Create zebrad.toml in acceptance tests from ZebradConfig
Fixes #929
2020-08-23 21:24:19 -04:00
Ramana Venkata e90137e79b
Update sha2@0.9.1 (#938)
* Update sha2@0.9.1

Fixes #915

* Update zebra-chain/src/sprout/keys.rs

Co-authored-by: Jane Lusby <jlusby42@gmail.com>

* Update zebra-chain/src/sprout/note/nullifiers.rs

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-08-21 16:26:14 -07:00
teor 5afa24588a fix: Remove unused dependencies 2020-08-20 14:49:17 -04:00
Jane Lusby 1d6183ef84
Make zebra-script wrap the C++ script implementation in zcashconsensus (#708)
* attempt to use zcashconsensus crate in zebra-script

* boop

* update verify fn to use zebra types

* a bit more cleanup

* cleanup

* more

* beep boop

* fix renamed member

* cleaning

* get a real branch id

* remove as of yet unneeded api

* Update zebra-chain/src/transaction.rs

* Update zebra-chain/src/transaction.rs

* more cleanup

* oops wrong dep section

* use a tuple to communicate arg association

* update to use published version of zcash_script

* fix new compiler error

* install llvm on windows

* fix bindgen bug????

* try to get docker file to win

* okay try everything

* fix windows build maybe

* always download choco

* fix paths for moved types

* try a different error message

* try convenience script

* try installing just llvm

* add back one more

* try installing some headers

* try a diff package

* try everything

* remove the minimum

* try newer docker builder image

* cleanup docker image

* cleanup extra ci step
2020-08-18 11:08:53 -07:00
Henry de Valence d63562994d deps: Update x25519-dalek, ed25519-zebra 2020-08-17 20:47:48 -07:00
dependabot[bot] 982f59b30d
build(deps): bump proptest from 0.10.0 to 0.10.1 (#913)
Bumps [proptest](https://github.com/altsysrq/proptest) from 0.10.0 to 0.10.1.
- [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/0.10.0...v0.10.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-17 14:19:34 -07:00
Henry de Valence 0d1f56ad2f chain: remove utils module
A catch-all utils module can really easily slip into being a place to stash
miscellaneous functions that don't really belong anywhere in particular.
2020-08-17 11:46:34 -07:00
Deirdre Connolly 616d82faaf Use the jubjub::AffinePoint in the canonical, encoded little-endian byte form in
Pedersen tests

Keeps the librustzcash test vectors with their big-endian byte order
as comments, for greppability.
2020-08-14 02:04:12 -04:00
Deirdre Connolly 8f15ed8140 Cargo.lock 2020-08-14 02:04:12 -04:00
Deirdre Connolly 579f1ed134 Flesh out windowed_pedersen_commitment_r 2020-08-14 02:04:12 -04:00
Deirdre Connolly 9d87f30d18 Start of, but currently unfinished, Sapling note commitment / Windowed Pedersen Commitment 2020-08-14 02:04:12 -04:00
dependabot[bot] 945b019739
build(deps): bump tracing-subscriber from 0.2.10 to 0.2.11 (#873)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.10 to 0.2.11.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.10...tracing-subscriber-0.2.11)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-11 10:30:50 -07:00
dependabot[bot] 69ab12a4bb
build(deps): bump serde from 1.0.114 to 1.0.115 (#874)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.114 to 1.0.115.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.114...v1.0.115)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-11 10:20:02 -07:00
dependabot[bot] 5cb61136c9
build(deps): bump tracing from 0.1.18 to 0.1.19 (#872)
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.18 to 0.1.19.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.18...tracing-0.1.19)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-11 10:18:54 -07:00
dependabot[bot] 4ec011f32d build(deps): bump indexmap from 1.5.0 to 1.5.1
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.5.0...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-10 06:06:00 -04:00
dependabot[bot] 3de99bd360
build(deps): bump color-eyre from 0.5.0 to 0.5.1 (#855)
Bumps [color-eyre](https://github.com/yaahc/color-eyre) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/yaahc/color-eyre/releases)
- [Commits](https://github.com/yaahc/color-eyre/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-07 10:12:50 -07:00
Henry de Valence a77328ad7c
Refactor tracing components (#834)
* Split tracing component code into modules.

* Repatriate Tracing and simplify config handling.

We upstreamed our Tracing component, expecting not to have to exert fine
control over the tracing settings.  But this turned out not to be the case, and
now that we want to do other things (flamegraphs, journalctl, opentelemetry,
etc), we end up with really awkward code (as in the current flamegraph
handling).

This also makes use of the changes to `init()` to load the config early to pass
configuration data into the components, which avoids the need for the
refactoring in #775.

Finally, we restore support for the `-v` flag when the filter is unset.  Closes #831.

* Disable tracing and metrics endpoints by default.

Closes #660.

* Switch back to upstream Abscissa.

* Integrate flamegraph support into the new Tracing component.

* Pass -v in acceptance tests to get info-level output.

* Clean up acceptance test code.
2020-08-06 10:29:31 -07:00
dependabot[bot] c0caba401c build(deps): bump structopt from 0.3.15 to 0.3.16
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.15 to 0.3.16.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-06 06:22:55 -04:00
Henry de Valence 2efb4eb262 consensus: add a static redjubjub::VERIFIER with fallback 2020-08-05 21:28:55 -07:00
Jane Lusby 867dd0b475
Setup tracing-flame for use profiling zebrad (#436)
* Setup tracing-flame for use profiling zebrad

* start work on conditional flamegraph generation

* review time!

* update comments

* Update Cargo.toml

* disable default features for inferno

* reorganize

* missing one trait

* Apply suggestions from code review

* graceful shutdown!

* remove special case handling on ctrlc for cleanup

* rename signal fn to better represent its responsibility

* remove unused global hook for flushing flamegraph

* move tracing logic to the right file

* just copy linkerd's signal handling logic

* update book

* make zebrad app drop on shutdown normally

* Update zebrad/src/components/tokio.rs

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

* Update zebrad/src/application.rs

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

* Apply suggestions from code review

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

* cleanup a little

* ooh yea there's an API for that

* setup env-filter for backup subscriber

* document env filter

* document return codes

* forgot to save

* Update book/src/applications/zebrad.md

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

Co-authored-by: teor <teor@riseup.net>
2020-08-05 16:35:56 -07:00
Alfredo Garcia ded273413a
Use transcripts in block verify tests (#675)
* change consensus block tests to transcripts

* fix lints

Co-authored-by: Jane Lusby <jlusby42@gmail.com>

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-08-05 14:41:41 -07:00
teor b7fac7b3bc feature: Make ExpandedDifficulty use U256 internally
Adds a dependency on the primitive-types crate.

Also adds custom hex debug formatting for compact and expanded
difficulties.
2020-08-04 12:29:07 +10:00
dependabot[bot] 8e268150a7 build(deps): bump tracing-subscriber from 0.2.9 to 0.2.10
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.9 to 0.2.10.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.9...tracing-subscriber-0.2.10)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-03 21:11:50 -04:00
dependabot[bot] f3b65f9609 build(deps): bump tracing from 0.1.17 to 0.1.18
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.17 to 0.1.18.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.17...tracing-0.1.18)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-03 15:49:30 -04:00
teor 195948e5b1 feature: Add an ExpandedDifficulty type and conversion
Also add tests.
2020-08-03 10:28:31 +10:00
Alfredo Garcia f2d7bb3177
Command execution tests (#690)
* add zebrad acceptance tests
* add custom command test helpers that work with kill
* add and use info event for start and seed commands
* combine conflicting tests into one test case

Co-authored-by: Jane Lusby <jane@zfnd.org>
2020-08-01 16:15:26 +10:00
Jane Lusby e6b849568f
Add support for errors in zebra_test::Transcript (#678)
* Add support for errors in zebra_test::Transcript

* test transcript with an error checker

* switch to option instead of MockError

* update docs

* dont use verifier against ready_and

* cleanup exports and add docs

* handle todos

* fix doctest

* temp: use cleaner error handling example

* add ability to test only for presence of error
2020-07-31 11:54:18 -07:00
Jane Lusby 1015db25a8
remap the state storage to only store blocks once (#741) 2020-07-31 09:21:54 +10:00
dependabot[bot] ce7f3e6c01 build(deps): bump sled from 0.34.0 to 0.34.2
Bumps [sled](https://github.com/spacejam/sled) from 0.34.0 to 0.34.2.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.34...v0.34.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-29 12:27:39 -04:00
dependabot[bot] 9a8fe2109f build(deps): bump pin-project from 0.4.22 to 0.4.23
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 0.4.22 to 0.4.23.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/master/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v0.4.22...v0.4.23)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 17:27:25 -04:00
Henry de Valence 7d0a3debb6 chain: ensure impl Deserialize for Amount validates data.
This uses serde's try_from attribute to run deserialized values through the
TryFrom impl.  Also adds a test to make sure that validation actually does
happen.
2020-07-28 12:20:40 -07:00
Henry de Valence 04044be6d1 tower-batch: test fallback verification example. 2020-07-27 14:52:06 -07:00
dependabot[bot] 842c69c60c build(deps): bump serde_json from 1.0.56 to 1.0.57
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.56 to 1.0.57.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.56...v1.0.57)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-27 13:48:15 -04:00
Alfredo Garcia 5b3c6e4c6c
Port bash checkpoint scripts to zebra-checkpoints single rust binary (#740)
* make zebra-checkpoints
* fix LOOKAHEAD_LIMIT scope
* add a default cli path
* change doc usage text
* add tracing
* move MAX_CHECKPOINT_HEIGHT_GAP to zebra-consensus
* do byte_reverse_hex in a map
2020-07-25 17:53:00 +10:00
dependabot[bot] f7c59c99b5 build(deps): bump tracing-subscriber from 0.2.8 to 0.2.9
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.8 to 0.2.9.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.8...tracing-subscriber-0.2.9)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-24 14:31:44 -04:00
dependabot[bot] e99e9653eb
build(deps): bump sled from 0.33.0 to 0.34.0 (#735)
Bumps [sled](https://github.com/spacejam/sled) from 0.33.0 to 0.34.0.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.33...v0.34)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-23 10:55:34 -07:00
dependabot[bot] 909b74a613
build(deps): bump tracing from 0.1.16 to 0.1.17 (#734)
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.16 to 0.1.17.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.16...tracing-0.1.17)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-23 10:54:56 -07:00
Jane Lusby c1a1493159
use dirs crate for default location of state and config (#714)
* use dirs crate for default location of state and config
* panic if a path isn't specified for zebra-state
2020-07-23 21:12:20 +10:00
Henry de Valence 4a98b8fa0d Add basic metrics to the syncer. 2020-07-22 21:59:00 -07:00
Jane Lusby a722cf33f7 enable new tracing instrumentation in tokio 2020-07-22 14:39:54 -04:00
Henry de Valence 0586da7167 Revert #500 (generic errors in tower-batch).
Unfortunately, since the Batch wrapper was changed to have a generic error
type, when wrapping it in another Service, nothing constrains the error type,
so we have to specify it explicitly to avoid an inference hole.  This is pretty
unergonomic -- from the compiler error message it's very unintuitive that the
right fix is to change `Batch::new` to `Batch::<_, _, SomeError>::new`.

The options are:

1. roll back the changes that make the error type generic, so that the error
   type is a concrete type;

2. keep the error type generic but hardcode the error in the default
   constructor and add an additional code path that allows overriding the
   error.

However, there's a further issue with generic errors: the error type must be
Clone.  This problem comes from the fact that there can be multiple Batch
handles that have to share access to errors generated by the inner Batch
worker, so there's not a way to work around this.  However, almost all error
types aren't Clone, so there are fairly few error types that we would be
swapping in.

This suggests that in case (2) we would be maintaining extra code to allow
generic errors, but with restrictive enough generic bounds to make it
impractical to use generic error types.  For this reason I think that (1) is a
better option.
2020-07-22 14:29:55 -04:00
dependabot[bot] 7067ac6e0d build(deps): bump tokio from 0.2.21 to 0.2.22
Bumps [tokio](https://github.com/tokio-rs/tokio) from 0.2.21 to 0.2.22.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.2.21...tokio-0.2.22)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-22 12:43:38 -04:00
Henry de Valence 1047d2f690 sync: add backpressure to syncer
Closes #617.
Closes #698.

The remaining work on the syncer is alluded to in a new comment:

1. Correctly constructing a block locator object
2. Detecting when we've stopped making progress syncing and restarting obtain_tips.
2020-07-21 20:16:23 -07:00
teor b0cd920fad feature: Use the Heartwood protocol version in zebra-network 2020-07-21 10:46:07 -07:00
dependabot[bot] c8fe4b43d8 build(deps): bump indexmap from 1.4.0 to 1.5.0
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.4.0...1.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-21 12:19:01 -04:00
dependabot[bot] 2208a6a22d build(deps): bump tracing-subscriber from 0.2.7 to 0.2.8
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.7 to 0.2.8.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.7...tracing-subscriber-0.2.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-21 12:01:40 -04:00
dependabot[bot] 599afb7fbb build(deps): bump metrics-runtime from 0.13.0 to 0.13.1
Bumps [metrics-runtime](https://github.com/metrics-rs/metrics) from 0.13.0 to 0.13.1.
- [Release notes](https://github.com/metrics-rs/metrics/releases)
- [Commits](https://github.com/metrics-rs/metrics/compare/metrics-runtime-v0.13.0...metrics-runtime-v0.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-21 12:00:42 -04:00
dependabot[bot] 474de52e5c
build(deps): bump displaydoc from 0.1.6 to 0.1.7 (#689)
Bumps [displaydoc](https://github.com/yaahc/displaydoc) from 0.1.6 to 0.1.7.
- [Release notes](https://github.com/yaahc/displaydoc/releases)
- [Commits](https://github.com/yaahc/displaydoc/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-20 11:00:15 -07:00
dependabot[bot] 2d8e518499 build(deps): bump redjubjub from 0.2.1 to 0.2.2
Bumps [redjubjub](https://github.com/ZcashFoundation/redjubjub) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/ZcashFoundation/redjubjub/releases)
- [Changelog](https://github.com/ZcashFoundation/redjubjub/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ZcashFoundation/redjubjub/compare/0.2.1...0.2.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-16 09:42:44 -04:00
dependabot[bot] f70f3b324c Bump sled from 0.32.1 to 0.33.0
Bumps [sled](https://github.com/spacejam/sled) from 0.32.1 to 0.33.0.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.32.1...v0.33)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-15 10:21:59 -07:00
Henry de Valence e58de06cb0 tower-fallback: add docs
Thanks to @seanmonstar for pointing to the article on the downsides of fallback.
2020-07-15 10:09:37 -07:00
Henry de Valence ecda5445d5 tower-fallback: switch to Box<dyn Error + Send + Sync + 'static>
Previously the code used Either for error handling, but a boxed std Error is
smaller in the happy path and more useful.
2020-07-15 10:09:37 -07:00
Henry de Valence 4be0a8edc3 tower-fallback: add implementation. 2020-07-15 10:09:37 -07:00
dependabot[bot] c3fcac8a5c Bump hyper from 0.13.6 to 0.13.7
Bumps [hyper](https://github.com/hyperium/hyper) from 0.13.6 to 0.13.7.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.13.6...v0.13.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-14 10:40:53 -07:00
dependabot[bot] d945ec3620 Bump bytes from 0.5.5 to 0.5.6
Bumps [bytes](https://github.com/tokio-rs/bytes) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v0.5.5...v0.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-14 10:39:42 -07:00
dependabot[bot] ebcf6b0385 Bump sled from 0.32.0 to 0.32.1
Bumps [sled](https://github.com/spacejam/sled) from 0.32.0 to 0.32.1.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.32...v0.32.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-13 11:51:35 -04:00
Jane Lusby 2b48008129
setup skeleton zebra-utils crate for independent binaries (#638)
* setup skeleton zebra-utils crate for independent binaries

* resolve review comments
2020-07-10 12:31:01 -07:00
Jane Lusby 06fff62561 remove git dependency on equihash crate 2020-07-10 07:52:52 -04:00
Jane Lusby 765e1e61e7
fix spandoc instrumentation for await expressions (#618)
* fix spandoc instrumentation for await expressions

* depend on released version of spandoc
2020-07-09 17:43:44 -04:00
Henry de Valence 8b72781fe1 deps: Update redjubjub to 0.2
Closes #606.
2020-07-09 15:20:23 -04:00
dependabot[bot] d627889104 Bump tracing from 0.1.15 to 0.1.16
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.15 to 0.1.16.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.15...tracing-0.1.16)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-09 10:22:27 -07:00
Deirdre Connolly 2cd58c8325
Add RedJubjub signature verifier service (#460)
Using tower-batch-based async pattern.

Now the Verifier is agnostic of redjubjub SigTypes.  Updated tests to
generate sigs of both types and batch verifies the whole batch.

Resolves #407
2020-07-08 17:23:00 -04:00
teor f2052b398b
feature: Implement CheckpointVerifier (#524)
* Return Poll::Ready(Err(_)) when verification has finished
* Turn checkpoint::init() into CheckpointVerifier::new()
* Accept IntoIterator<...> for CheckpointVerifier::new()
* Add a CheckpointList type

* Replace the state service with oneshot channels.
* Reject redundant checkpoint blocks
* impl Drop for CheckpointVerifier

* Add fields for caching blocks, and managing verify chains.
* Add current checkpoint functions
* Use a checkpoint range
* Get full backtraces with Err::Try
* Add enums for verification progress and target block heights.

* Replace install_tracing() with zebra_test::init()
* Add a test that mixes good and bad blocks
* Add timeouts to the checkpoint test futures
2020-07-08 21:22:36 +10:00