Commit Graph

1452 Commits

Author SHA1 Message Date
Deirdre Connolly 686071e023 Default all GitHub Actions jobs to timeout at 30 minutes
Resolves #1142
2020-10-12 18:39:33 -04:00
teor 40c745e540 Keep check.rs functions in alphabetical order 2020-10-13 08:11:11 +10:00
teor 4e952a3930 Swap subsidy_is_valid argument order
This change makes the function consistent with the other check::*
functions.
2020-10-13 08:11:11 +10:00
teor 3fad3cf3af Rename functions to subsidy_is_valid*
To match the other check::* functions.

Automated commit, created using the script:

sed -i 's/subsidy_is_correct/subsidy_is_valid/' \
    $(grep -r subsidy_is_correct zebra* | cut -d: -f1 | sort -u)
2020-10-13 08:11:11 +10:00
teor 407962b864 Rename any remaining is_time_valid_at instances
Automated search and replace, using the script:

sed -i 's/is_time_valid_at/time_is_valid_at/' \
    $(grep -r is_time_valid_at zebra* | cut -d: -f1 | sort -u)
2020-10-13 08:11:11 +10:00
teor d504232720 Apply error and span suggestions
Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-10-13 08:11:11 +10:00
teor 244066f6d9 Add a hash debug-level span for block verification 2020-10-13 08:11:11 +10:00
teor c4630cd1f5 Improve error messages for header.time validation 2020-10-13 08:11:11 +10:00
teor 4953282005 Move difficulty threshold checks into their own function 2020-10-13 08:11:11 +10:00
teor 77e227dfe4 Fix some function docs and parameter names 2020-10-13 08:11:11 +10:00
Alfredo Garcia c0a14ecc8c
move genesis parameters to zebra-chain (#1151) 2020-10-12 14:08:23 -07:00
Alfredo Garcia c93f0b3a2e
Block Subsidy and Founders Reward Amounts (#1051)
* add general and founders reward subsidy modules
* validate founders reward
* Use funding streams after Canopy on testnet
ZIP-1014 only applies to mainnet, where Canopy is at the first halving.
On testnet, Canopy is before the first halving, and the dev fund rules
apply from Canopy. (See ZIP-214.)
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Jane Lusby <jlusby42@gmail.com>

* pass all test vectors through current subsidy validation
* Add testnet and halving subsidy tests
* add subsidy validation error tests

* rename block validation methods
* add network to block verifier

* add amount operators
* Implement Ord, Eq, and Hash for Amount
* Implement Add<Height> for Height
And make the existing Height operators do range checks.
* Apply operator suggestions
Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-10-13 06:54:48 +10: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
teor 691ad12cc9
Add modules and test plans to the RFC template (#1145) 2020-10-12 12:46:52 -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
teor 1e97691fc8 Fix some "needless lifetime" clippy lints
These lints seem to be new in clippy nightly.
2020-10-12 08:54:23 +10:00
teor fd0fac3a61
State RFC: Handle duplicate block edge cases (#1136)
Handle the following duplicate block edge cases:
* duplicate in finalized state
* duplicate in queue

* Handle the broadcast channel correctly
2020-10-10 11:50:12 +10:00
teor e2d67fc9e7
Add metrics for the sled state (#1062) 2020-10-10 11:49:44 +10: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
Jane Lusby eaf5473efc
Add verification and state tracing events and spans (#1131) 2020-10-09 19:05:09 +10:00
Jane Lusby b3634fa3e7
Make the state service use broadcast channels (#1137)
And refactor error handling
2020-10-09 18:37:24 +10: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
Deirdre Connolly b6bca380fa Format 'under construction' better in markdown 2020-10-07 11:35:39 -04:00
Henry de Valence b2c3ba9d94
docs: update readme (#1118)
* docs: update readme

Fill in the README with:

- setting expectations about Zebra goals;
- explanation of the work we've done so far;
- suggestions from review comments;
- under construction sign.


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


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


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


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

Co-authored-by: Jane Lusby <jlusby42@gmail.com>
Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-10-06 23:53:22 -07:00
Deirdre Connolly 8b8ef6dc4d Remove extra Sum impl 2020-10-07 01:29:08 -04:00
Deirdre Connolly cc44711204 Impl<'a> Sub<&'a ValueCommitment> for ValueCommitment 2020-10-07 01:29:08 -04:00
Deirdre Connolly de6994ad52 Dupe the multiple Add impls
Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-10-07 01:29:08 -04:00
Deirdre Connolly 62ad554d84 Remove redundant non_snake_case 2020-10-07 01:29:08 -04:00
Deirdre Connolly b5b2d6a359 Impl more Add, Sum for references and Sum test 2020-10-07 01:29:08 -04:00
Deirdre Connolly 7cd730c552 Add tests for impl (Add|Sub)(Assign) for ValueCommitment 2020-10-07 01:29:08 -04:00
Deirdre Connolly d4da79af86 Impl (Add|Sub)(Assign) for ValueCommitment 2020-10-07 01:29:08 -04:00
teor 3820eddef7
Shielded coinbase test blocks (#1116)
* Add shielded coinbase block test vectors

* Add a large block test vector in binary format
2020-10-06 16:35:41 -07: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
Deirdre Connolly f7095ae9a2 Add some more human-readable language to the doc comment on merkle_crh_sprout 2020-10-05 23:44:25 -04:00
Deirdre Connolly 0cf24be8e0 Use VecDeque in places
The unwrap()'s are all after checks to make sure the value should never be None.
2020-10-05 23:44:25 -04:00
Deirdre Connolly d6cac9ea0a Allow dead code for now 2020-10-05 23:44:25 -04:00
Deirdre Connolly ee8ac1fd38 Remove LittleEndian import 2020-10-05 23:44:25 -04:00
Deirdre Connolly b85fcdfce9 Hex-encode empty root test vectors to height 29 2020-10-05 23:44:25 -04:00
Deirdre Connolly 8ab0f92d45 Persist the byte-reversed commitments 2020-10-05 23:44:25 -04:00
Deirdre Connolly ebbb494fb3 It woooooorks 2020-10-05 23:44:25 -04:00
Deirdre Connolly 30491c2c55 Fix merkle_crh_sprout 2020-10-05 23:44:25 -04:00
Deirdre Connolly 064021b7bf Update test vectors 2020-10-05 23:44:25 -04:00
Deirdre Connolly 24fa507e41 Tidy tests 2020-10-05 23:44:25 -04:00