Commit Graph

1008 Commits

Author SHA1 Message Date
teor c04d1b7b8f doc: Consensus-critical difficulty encodings 2020-08-04 12:29:07 +10:00
teor 06157a7c8e
Update the BlockHeader fields for Heartwood (#767)
The Heartwood upgrade changes the meaning of the hashFinalSaplingRoot to
hashLightClientRoot. Since we don't know the network upgrade heights in
zebra-chain, we just use [u8; 32] for now.
2020-08-04 12:15:28 +10:00
teor 59eb23772d feature: Use the Canopy testnet network protocol version
Canopy will activate on testnet within the next 24 hours. To continue to
use testnet, we need to upgrade the Zebra network protocol version.
2020-08-04 12:13:58 +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
Alfredo Garcia deba84b96e rustfmt 2020-08-03 15:50:48 -04:00
Alfredo Garcia 5f23970377 move env variable creation to test_cmd 2020-08-03 15:50:48 -04:00
Alfredo Garcia 2dacd0a62b change default state path 2020-08-03 15:50:48 -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
teor c4dec3fb36 feature: Make a CompactDifficulty wrapper
Wrap the compact difficulty "bits" field in a CompactDifficulty struct,
and rename the header field for clarity.
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
teor d4d1edad5a
fix: Use types to avoid ChainVerifier inconsistencies (#797) 2020-07-31 10:21:20 +10:00
Jane Lusby 1015db25a8
remap the state storage to only store blocks once (#741) 2020-07-31 09:21:54 +10:00
Alfredo Garcia 917a4fbdbe
Add last_checkpoint argument to zebra-checkpoints (#793) 2020-07-31 08:33:00 +10:00
teor e74ff18708 refactor: Move the checkpoint list tests to their own file 2020-07-31 07:21:43 +10:00
teor 5b9703f95a fix: Avoid creating a CheckpointVerifier if it is not needed
Also:
* make sure the checkpoints cover all pre-Sapling blocks
* do some minor refactoring to reduce duplicate code
2020-07-30 13:30:18 +10:00
teor fbeae99328 fix: Only warn on unexpected high blocks
High blocks are expected when we restart with most of the chain in our
state.

Also downgrade the message from warn to info.
2020-07-30 13:30:18 +10:00
Alfredo Garcia 89ef08793b delete file 2020-07-29 19:44:21 -07:00
Alfredo Garcia 617f1d80ef move docs to zebra book 2020-07-29 19:44:21 -07:00
Alfredo Garcia 6297a7cd19 document zebrad enviroment variables 2020-07-29 19:44:21 -07:00
Henry de Valence ef0b200b82 restore Zebras to part of the name, not a comment 2020-07-29 18:46:47 -07:00
Jack Grigg d1e0e1abf5 fix: Broadcast a valid BIP 14 user agent
Closes ZcashFoundation/zebra#791.
2020-07-29 15:49:14 -04: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
teor 050c46388f fix: Open the endpoints after the config is loaded
We get the injected TokioComponent dependency before the config is
loaded, so we can't use it to open the endpoints.

And we can't define after_config, because we use derive(Component).

So we work around these issues by opening the endpoints manually,
from the application's after_config.
2020-07-29 16:03:52 +10:00
teor 6be0f8ed2f fix: Warn if the listener port is for the wrong network
We'll fix the underlying defaults in #660, with the rest of the
listeners.
2020-07-29 16:03:52 +10:00
teor e7437cc551 feature: Get endpoint addresses from config 2020-07-29 16:03:52 +10:00
teor 11090dbf91 feature: Separate Mainnet and Testnet state 2020-07-29 01:45:19 -04:00
teor be054906ef fix: Stop calling zcash-cli twice in zebra-checkpoints
Also:
* stop capturing zcash-cli stderr
* check subprocess exit status
* require valid UTF-8 from zcash-cli
* refactor out some repeated code
2020-07-28 22:34:08 -04:00
teor cf4840c74a doc: Add docs to zebra-utils
And `deny(missing_docs)`.
2020-07-28 22:34:08 -04:00
teor cf0fd043d4 feature: Update mainnet and testnet checkpoints 2020-07-28 22:27:49 -04:00
teor 536668f993 fix: allow(dead_code) on some protocol version functions 2020-07-28 22:10:20 -04:00
teor 0ef8e38266 fix: Tweak the RFC template
* replace references to "(Rust) language" with Zebra, Zcash or project as appropriate
* talk about impacts on the broader ecosystem
2020-07-29 11:32:24 +10: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 238dec51dd network: do not export Builder
This is used to construct the Codec, which is an internal type.  The
export was added in 4dc307f2.
2020-07-28 11:10:15 -07:00
teor 396d209638 feature: Add the MinimumDifficulty consensus parameter 2020-07-28 10:34:41 +10:00
Henry de Valence 04044be6d1 tower-batch: test fallback verification example. 2020-07-27 14:52:06 -07:00
teor 1e787aecb9 feature: Check the previous block height in BlockVerifier
This is a temporary busy-waiting fix.
2020-07-27 14:14:44 -04:00
teor 2b1e7162b1 feature: Set the testnet Canopy upgrade height
See ZIP 251 and zcash/zips#385 for details.

Closes #756.
2020-07-27 14:03:14 -04:00
teor 993532b604 feature: Add a "Genesis" network upgrade
We can use this network upgrade to implement different consensus rules
and chain context handling for genesis blocks.

Part of the chain state design in #682.
2020-07-27 14:03:14 -04:00
teor 5ece62f0a5 fix: Update comments for Heartwood's hashChainHistoryRoot 2020-07-27 14:00:56 -04:00
teor 12cbe410f2 fix: Hide warn-level logs in the zebra-consensus tests
Unless RUST_LOG is set.
2020-07-27 13:51:33 -04:00
teor a60299d86c fix: Change the default test log level to warn 2020-07-27 13:51:33 -04:00
teor 2d3926e800 fix: Replace a return with unreachable! 2020-07-27 13:49:11 -04: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
Henry de Valence b59cfc49b7 sync: create requests sequentially to respect backpressure.
This seems like a better design on principle but also appears to give a much
nicer sawtooth pattern of queued blocks in the checkpointer and a much smoother
pattern of block requests.
2020-07-24 18:36:00 -04:00
Deirdre Connolly 0cd8b7e7bd Rename pr.yml to ci.yml 2020-07-24 18:18:46 -04:00
Deirdre Connolly e24cd5755b Add a nicer human name to coverage job 2020-07-24 18:18:46 -04:00