Commit Graph

1008 Commits

Author SHA1 Message Date
Jane Lusby 2abf4b93a8 consolidate test init functions into zebra-test (#541)
* consolidate test init logic into one place

* rustfmt

Co-authored-by: Jane Lusby <jane@zfnd.org>
2020-06-24 11:47:18 -07:00
Henry de Valence 87a8d328d5 Rewrite zebra-state tests to use transcripts.
This makes adding more tests easier.
2020-06-24 11:47:18 -07:00
Henry de Valence e8d42264e8 Add a check method to the Transcript. 2020-06-24 11:47:18 -07:00
Henry de Valence 5c9cd52baf Add a Transcript Service for testing. 2020-06-24 11:47:18 -07:00
teor a9efb8715e chain: Update the note about time truncation 2020-06-24 18:22:36 +10:00
teor f40bfff7c0 consensus: Simplify error handling in a test
Part of #477.
2020-06-24 18:22:36 +10:00
teor f1ce4dcf14 consensus: Inline node_time_check() into callers
node_time_check() is a small function, so we inline it into its callers.
(And then rename node_time_check_helper() to node_time_check().)

Part of #477.
2020-06-24 18:22:36 +10:00
teor 59bc8d7167 consensus: Make BlockVerifier only call AddBlock on success
We don't want to call the state's AddBlock until we know the block is
valid. This avoids subtle bugs if the state is modified in call().

(in_memory currently modifies the state in call(), on_disk modifies the
state in the async block.)

Part of #477.
2020-06-24 18:22:36 +10:00
teor 8fde8c1a6b consensus: Add tests for block node time checks
Part of #477.
2020-06-24 18:22:36 +10:00
teor a41f4f68cf consensus: move verify::block to its own file
Part of #477.
2020-06-24 18:22:36 +10:00
teor d97c769869 consensus: Refactor the node time check for testing
Part of #477.
2020-06-24 18:22:36 +10:00
teor 3f5e2695e3 chain: Tweak the version and time test bounds
Use MAX constants for the block header version and time arbitrary test
ranges. Reduces the block header time arbitrary test range from 2**32 to
2**32-1 (u32::MAX). (2**32 is an invalid time value, which gets
truncated to 0 during serialization.)

Also add some comments about DateTime conversions.

Part of #477.
2020-06-24 18:22:36 +10:00
teor 3c27c11012 consensus: Check block times against the local clock
Part of #477.
2020-06-24 18:22:36 +10:00
teor f10bfd5806 consensus: Add a block time check function
Add a function that checks the block header miner times against the
node's local clock.

(We'll use this function in the next commit.)

Part of #477.
2020-06-24 18:22:36 +10:00
teor 719aa75581 chain: Add a comment about transaction sizes
We don't need to check transaction sizes yet, because we aren't
parsing or generating transactions outside of blocks.

Part of #483.
2020-06-24 18:22:36 +10:00
Alfredo Garcia 67718898c5
add usage help to generated config (#527) 2020-06-23 11:56:00 -07:00
Henry de Valence a453edd91c Put type definitions back at the bottom of the file. 2020-06-23 10:16:27 -07:00
Henry de Valence 18eb212d8e Set the new tips to be the last, not first, hash. 2020-06-23 10:16:27 -07:00
Henry de Valence 70241d3cad Fix broken git dependencies.
Pinning hashes means these won't break again in the future; they can always be updated.
2020-06-22 20:23:02 -07:00
Henry de Valence e8561d8f9e rename zebra-test-vectors to zebra-test 2020-06-22 20:23:02 -07:00
Jane Lusby 1c42b66a4f
Implement sync component for start subcommand (#506) 2020-06-22 19:24:53 -07:00
teor 03b8453b8a
Checkpoint Verifier Tests (#517)
* Add basic checkpoint verifier tests
* Refactor a checkpoint verifier condition
* Remove some outdated comments
2020-06-23 12:15:37 +10:00
Jane Lusby 246e7cd2a9
Start testing out new version of `eyre` and `color-eyre` in zebra (#526)
* port to new version of eyre without generics

* correctly setup color_eyre hooks

Co-authored-by: Jane Lusby <jane@zfnd.org>
2020-06-22 15:36:23 -07:00
dependabot[bot] f301de41fa Bump tracing-subscriber from 0.2.5 to 0.2.6
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.5 to 0.2.6.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber/-0.2.5...tracing-subscriber-0.2.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-22 12:01:47 -04:00
dependabot[bot] e3ad9737e7 Bump sled from 0.31.0 to 0.32.0
Bumps [sled](https://github.com/spacejam/sled) from 0.31.0 to 0.32.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.31...v0.32)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-22 12:00:54 -04:00
dependabot[bot] bf779ea1d6 Bump serde from 1.0.112 to 1.0.114
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.112 to 1.0.114.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.112...v1.0.114)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-22 11:58:09 -04:00
dependabot[bot] 5c0df915f1 Bump w9jds/firebase-action from v1.3.1 to v1.5.0
Bumps [w9jds/firebase-action](https://github.com/w9jds/firebase-action) from v1.3.1 to v1.5.0.
- [Release notes](https://github.com/w9jds/firebase-action/releases)
- [Commits](https://github.com/w9jds/firebase-action/compare/v1.3.1...6d1a577caffa15dfad8cc3d95e8ea2ac7ff51f7f)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-22 11:55:43 -04:00
teor d8b48f885b
consensus: Add a checkpoint verifier stub (#502)
consensus: Add a checkpoint verifier stub

This stub only verifies blocks whose hashes are in the checkpoint
list.

It doesn't have tests, chain child verifies to their ancestors, or
support checkpoint maximum height queries.

Part of #429.
2020-06-22 08:51:43 +10:00
Deirdre Connolly 2bdd07c1bc
Create instance group if it doesn't exist, update it if it does (#513)
* Deploy instance group if it doesn't exist, update it if it does

* Rename push.yml to cd.yml

* Rename some CD steps
2020-06-21 04:39:47 -04:00
dependabot[bot] 6324ad8828 Bump bytes from 0.5.4 to 0.5.5
Bumps [bytes](https://github.com/tokio-rs/bytes) from 0.5.4 to 0.5.5.
- [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.4...v0.5.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-19 12:56:38 -04:00
Deirdre Connolly 2f87a9a9f6 Update existing managed instance groups on deploy 2020-06-19 03:46:09 -04:00
Deirdre Connolly 509f0763ad Scope deploys to main, gcloud branches; shorten initial delay 2020-06-19 03:46:09 -04:00
Deirdre Connolly c901b42c75 Shorten health check delay from 3 minutes to 1 2020-06-19 03:46:09 -04:00
Deirdre Connolly 05316dee21 Listen on 0.0.0.0, not 127.0.0.1
Turns out when your node faces the internet directly, it has to listen
to those addresses directly.
2020-06-19 03:46:09 -04:00
Deirdre Connolly e6d986a057 Put all ports EXPOSE'd on the same line 2020-06-19 03:46:09 -04:00
Deirdre Connolly c85acde18f Add 'zebrad' tags to instance templates
And add 'one time' commands commented out for managing firewall rules.
2020-06-19 03:46:09 -04:00
Deirdre Connolly f95e7d5595 Add health check 2020-06-19 03:46:09 -04:00
Deirdre Connolly 4aabadc67d Remove zone param 2020-06-19 03:46:09 -04:00
Deirdre Connolly 621a14abe9 Managed group of size 1 seems to reliably work 🙃 2020-06-19 03:46:09 -04:00
Deirdre Connolly c7046eb6f5 Create instance group in one specified zone 2020-06-19 03:46:09 -04:00
Deirdre Connolly 20e0e4bef0 Go back to project default machine type for now 2020-06-19 03:46:09 -04:00
Deirdre Connolly cae9df9169 Remove --base-instance-name, redundant 2020-06-19 03:46:09 -04:00
Deirdre Connolly c50e9a5bee Add region 2020-06-19 03:46:09 -04:00
Deirdre Connolly e2c30e7bd2 Type n1-highmem-8 2020-06-19 03:46:09 -04:00
Deirdre Connolly 14a62bf9bb Remove region; highmem is constrainted 2020-06-19 03:46:09 -04:00
Deirdre Connolly 7742bb4dbd Bump memory on instance template 2020-06-19 03:46:09 -04:00
Deirdre Connolly 30f01c6ff0 Use updated 'zebrad seed' command, move binary to root, no workdir 2020-06-19 03:46:09 -04:00
Deirdre Connolly 29117f7c73 Explicit WORKDIR for runner stage 2020-06-19 03:46:09 -04:00
Deirdre Connolly 84c34b2e48 Use ENTRYPOINT plus CMD for command 2020-06-19 03:46:09 -04:00
Deirdre Connolly e86bbf372b Run 'zebrad seed' instead of 'connect' for now 2020-06-19 03:46:09 -04:00