teor
b648375bbe
fix: Hard-code the genesis previous block hash
2020-07-16 10:06:29 -07:00
teor
39e67c8748
feature: Check the genesis hash in checkpoint lists
...
And use the consensus parameters to get the genesis previous block hash.
2020-07-16 10:06:29 -07:00
teor
648d8daf12
feature: Initial consensus parameter module
2020-07-16 10:06:29 -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
teor
1915634d2b
Check for bad heights or hashes in checkpoint lists ( #639 )
...
* Add MIN and MAX for BlockHeight and LockTime
* Remove duplicate test cases
* fix a comment about the minimum lock time
The minimum LockTime::Time is 5 November 1985 00:53:20 UTC, so the first
day that only contains valid times is 6 November 1985 (in all timezones).
Similarly, the maximum LockTime::Time is 7 February 2106 06::28::15 UTC,
so the last day that only contains valid times in all time zones is
5 February 2106.
* fix: Reject checkpoint lists with bad hashes or heights
Reject the all-zeroes hash, because it is the parent hash of the genesis
block, and should never appear in a checkpoint list.
Reject checkpoint heights that are greater than the maximum block
height.
2020-07-16 15:09:22 +10:00
teor
851afad01f
fix: Resist CheckpointVerifier memory DoS attacks ( #635 )
...
* fix: Resist CheckpointVerifier memory DoS attacks
Allow a maximum of 2 queued blocks at each height, as a tradeoff between
efficient bad block rejection, and memory usage.
Closes #628 .
* fix: Make max queued blocks at height equal to fanout
* fix: Just allocate all the capacity upfront
* fix: Use with_capacity(1) and reserve_exact(1)
2020-07-15 13:27:10 -07:00
teor
ab6d1f5ec8
fix: Use the default Zcash port in version messages ( #661 )
...
We don't provide our address yet, so the port should be ignored.
But let's use the correct port, to avoid carrying this bug forward into
working code.
2020-07-15 11:43:28 -07: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
teor
a19fdd9f25
fix: Rename to is_time_valid_at
2020-07-15 09:16:54 -07:00
teor
b2bb872df0
Use Unicode for section reference
...
Co-authored-by: Henry de Valence <hdevalence@hdevalence.ca>
2020-07-15 09:16:54 -07:00
teor
c2e4f7b0a5
refactor: Move the local clock check to a BlockHeader method
2020-07-15 09:16:54 -07:00
teor
5548dffd3b
refactor: Move the coinbase first check to a Block method
2020-07-15 09:16:54 -07:00
teor
47bc02ea44
partial revert: Use &Block, not Arc<Block>
2020-07-15 09:16:54 -07:00
Jane Lusby
72ec79dd5e
Update zebra-consensus/src/checkpoint/list.rs
...
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2020-07-15 09:16:54 -07:00
teor
6f064e0154
refactor: Use Arc<Block> in BlockVerifier
...
Arc is a bit more flexible when using futures.
And improve the documentation for coinbase_is_first_check.
Closes #627 .
2020-07-15 09:16:54 -07:00
teor
30effa6a46
doc: Improve checkpoint test comments
...
Closes #626 .
2020-07-15 09:16:54 -07:00
teor
e58c913897
refactor: Make max_height call max_height_in_range
...
Closes #630 .
2020-07-15 09:16:54 -07:00
teor
78459afe97
fix: Stop revhex on EOF
2020-07-15 19:19:02 +10:00
Alfredo Garcia
d8834b149a
Limit protocol messages size ( #645 )
...
* change body msg limit and test case
* accept body at the exact limit len
* test the edges of the limit value
2020-07-15 19:15:52 +10:00
teor
12b9fa8ae2
Let zebrad revhex read from stdin ( #648 )
...
* Log at warn level for commands that use stdout
* Let zebrad revhex read from stdin
Most unix tools support reading from stdin, so they can be used in
pipelines.
Part of #564 .
2020-07-15 16:16:07 +10:00
teor
e452ba1c13
fix: Use matches!() based on a new nightly clippy lint
2020-07-15 12:50:11 +10:00
Jane Lusby
dd0cd17b3a
reorder workspace crates ( #651 )
2020-07-14 13:23:43 -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
teor
e1bb95603c
Put zebrad/Cargo.toml in a nicer order ( #650 )
2020-07-14 10:17:05 -07:00
Alfredo Garcia
04b2eeedd0
Longer checkpoint gap test case ( #643 )
...
* create longer checkpoint test
* use futures unordered to syncronize background futures
Co-authored-by: Jane Lusby <jane@zfnd.org>
2020-07-13 09:29:21 -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
teor
870a0be928
fix: Make sure checkpoint heights and hashes are unique
...
Previously, CheckpointList would silently ignore duplicate heights or
hashes.
Closes #632 .
2020-07-10 10:53:32 -07:00
Jane Lusby
06fff62561
remove git dependency on equihash crate
2020-07-10 07:52:52 -04:00
Deirdre Connolly
56361654c6
Fix CD workflow using cloudbuild.yaml ( #637 )
...
* Fix variable substitutions in CD workflow and gcloud build config
* Docker needs everything lowercase
* Store container image in GCR
* Don't use GITHUB_REPOSITORY
2020-07-10 07:37:54 -04:00
teor
8b5ec155f0
Consensus refactor ( #629 )
...
* Flatten consensus::verify::* to consensus::*
* Move consensus::*::tests into their own files
* Move CheckpointList into its own file
* Move Progress and Target into a types module
QueuedBlock and QueuedBlockList can stay in checkpoint.rs, because
they are tightly coupled to CheckpointVerifier.
2020-07-10 16:51:01 +10:00
Alfredo Garcia
5d6a5ca329
Add consensus coinbase checks ( #593 )
...
* add coinbase check and test case
Co-authored-by: Jane Lusby <jane@zfnd.org>
2020-07-10 09:13:44 +10: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
Jane Lusby
0474a79669
Add cool helpers for using zcash_serialize / zcash_deserialize ( #586 )
...
Co-authored-by: Dimitris Apostolou <dimitris.apostolou@icloud.com>
2020-07-09 15:29:31 -04:00
Henry de Valence
8b72781fe1
deps: Update redjubjub to 0.2
...
Closes #606 .
2020-07-09 15:20:23 -04:00
Deirdre Connolly
e0a71c229d
Trigger Google Cloud Builds via GitHub App integration ( #614 )
...
Use cloudbuild.yaml for all invocations including via gcloud cli and github build triggers
2020-07-09 14:22:56 -04:00
Henry de Valence
fcd2f43f39
network: add warning to connection handling code.
2020-07-09 11:15:06 -07:00
Henry de Valence
217c25ef07
network: propagate tracing Spans through peer connection
2020-07-09 11:15:06 -07:00
Henry de Valence
ff4e722cd7
sync: touch up tracing output.
2020-07-09 11:15:06 -07: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
Deirdre Connolly
83f0747490
Remove straggler install_tracing()
...
This was removed in the PR but the actual squashed commit still had it. 🤔
2020-07-08 16:55:56 -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
Alfredo Garcia
c8cbb08ae3
check equihash solution covers the block header ( #607 )
2020-07-08 20:58:20 +10:00
Jane Lusby
959f029457
make clippy warnings errors in CI ( #605 )
...
* make clippy warnings errors in CI
* Apply fixes from cargo clippy --all-features --all-targets -- -D warnings
* Resolve merge conflicts
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-07-07 16:26:22 -07:00
Alfredo Garcia
f14e577ea9
apply clippy code suggestions
2020-07-07 18:33:14 -04:00