Commit Graph

472 Commits

Author SHA1 Message Date
dependabot[bot] 6c073a9017
build(deps): bump google-github-actions/auth from 0.7.0 to 0.7.1 (#4188)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-25 21:47:13 +00:00
dependabot[bot] e90c22917d
build(deps): bump reviewdog/action-actionlint from 1.23.0 to 1.24.0 (#4161)
Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: reviewdog/action-actionlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 12:03:27 +00:00
dependabot[bot] 83636f7c27
build(deps): bump codecov/codecov-action from 2.1.0 to 3.1.0 (#4162)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.1.0 to 3.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.1.0...v3.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 03:00:08 +00:00
dependabot[bot] a613fb1682
build(deps): bump actions/checkout from 3.0.1 to 3.0.2 (#4163)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-22 03:00:02 +00:00
teor 5575b7a40e
fix(ci): share GitHub runner caches between branches (#4149)
* Use shared caches for the CI job

* Fix shared lint Rust caches
2022-04-21 00:33:08 +00:00
teor 32556b8b6b
fix(ci): increase the Zcash parameter fetch timeout (#4148)
* fix(ci): increase the Zcash parameter fetch timeout

* Also increase the coverage workflow timeout
2022-04-20 00:58:55 +00:00
dependabot[bot] 90a8401308
build(deps): bump actions/checkout from 3.0.0 to 3.0.1 (#4126)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v3.0.1)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-16 02:01:20 +00:00
dependabot[bot] 01e7382809 build(deps): bump reviewdog/action-actionlint from 1.22.0 to 1.23.0
Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.22.0 to 1.23.0.
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.22.0...v1.23.0)

---
updated-dependencies:
- dependency-name: reviewdog/action-actionlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-15 19:08:29 -04:00
Gustavo Valverde 4823df346d
fix(ci): give enough time to zebra before reading logs (#4123)
* fix(ci): give enough time to zebra before reading logs

* imp(ci): add sleep comment reason
2022-04-14 19:39:26 +00:00
teor 2041d69312
ci(Mergify): Fix invalid mergify config on main branch (#4120)
Signed-off-by: teor <teor@riseup.net>
2022-04-14 17:15:57 +10:00
Gustavo Valverde 04d52bfa3b
feat(ci): run cached state rebuilds in main branch (#4107)
* feat(ci): run cached state rebuilds in main branch

* fix(ci): allow the PR/branch name in the disk name

Move the hight information to the disk description, to reduce the name length

* fix(ci): add missing SHA

* fix(ci): regenerate chekpoint cached state on main

This will automatically regenerate the disk when a merge is completed on main

* tmp(ci): do not duplicate sync test at/after merge

This temporarily ensure the test just runs in the main branch, ensuring we can track it easier
2022-04-13 21:44:39 -04:00
Gustavo Valverde 970f06d332
refactor(queue)!: improve mergify merge throughput (#4094)
* refactor(ci)!: rename queues and reassign labels

* imp(ci:) allow a bigger throughput for merge trains

* imp(ci): allow mergify to interrupt queues that are not a hotfix

* imp(ci): add a bigger timeout before creating speculative checks

* Update .github/mergify.yml

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

* Update .github/mergify.yml

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

* Apply suggestions from code review

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

Co-authored-by: teor <teor@riseup.net>
2022-04-14 10:17:16 +10:00
teor 9055f0f3a1
ci(Mergify): configuration update (#4105)
Signed-off-by: teor <teor@riseup.net>
2022-04-13 10:28:03 +10:00
Gustavo Valverde 90c6980630
imp(ci): use GitHub Branch Protection checks instead of Mergify (#4103) 2022-04-13 09:43:58 +10:00
dependabot[bot] 8aa1908049
build(deps): bump reviewdog/action-actionlint from 1.21.0 to 1.22.0 (#4099)
Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.21.0 to 1.22.0.
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.21.0...v1.22.0)

---
updated-dependencies:
- dependency-name: reviewdog/action-actionlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-12 17:53:31 +00:00
Gustavo Valverde 47c1c01fcf
refactor(ci): use distinctive names for cached state disks (#4073)
* fix(ci): correctly use lowered network caps

In the Test workflow we were using a different approach than the one being used in the Full sync test.

Also, in the Full sync test the variable was LOWER_NET_NAME, but NETWORK was being used in the disk name, with caps.

* imp(ci): get state version from local constants.rs

* imp(ci): use the same get name approach

* fix(ci): use the correct name for state version variable

* imp(ci)!: use different disk names for cached states

Disk states synced to canopy and synced to the chain tip should have different names to reference correctly on actual and coming tests the needed disk.

* imp(ci): test-stateful-sync no longer depends on regenerate-stateful-disks

* Apply suggestions from code review

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* fix(ci): use a better name for network string conversion

* Revert "Apply suggestions from code review"

This reverts commit cbbfaf4e9c.

* fix: do not get log information if sync was skipped

* fix(ci): do not lower the variable name

* fix(ci): use the same lowering case for network everywhere

* test: more .dockerignore conditions

* fix: use the right approach to lower caps

* remove extra .dockerignore

* trigger a change for stateful disk regeneration

* imp(ci): use `checkpoint` as the disk reference

* revert wrong delete

* fix(ci): add INSTANCE_ID and correct logging message

* imp(ci): add `v` prefix to state version number

* fix(ci): remove typo from logging message to get the height

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-04-12 05:34:15 +00:00
Gustavo Valverde 831a2009bd
style(ci): lint and standardize the actions structure (#3940)
* style(ci): comply with https://json.schemastore.org/github-workflow.json

Some substituions were harder to make as files were not standardized

* fix(mergify): use correct name for macos

* style(actions): revert to single quotes

* style: lint dependabot and mergify conf files

* style: remove conditions with missing context

* imp(lint): automate GH Actions linting

* fix(lint): some actions need to be triggered by PR event

* fix(lint): consider all workflow YAMLs

* Use the same paths in the patch file

* revert: keep condition as is

* add TODO

* fix: add missing checkpoint_sync input

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-12 15:06:37 +10:00
dependabot[bot] 73aea46458
build(deps): bump tj-actions/changed-files from 18.6 to 18.7 (#4065)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 18.6 to 18.7.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v18.6...v18.7)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-09 19:55:07 +00:00
Gustavo Valverde 23e8a432f6
fix(ci): use correct machine names for exit codes (#4069) 2022-04-09 14:27:53 -04:00
teor 7e8194c63f
3. change(db): Store UTXOs by transaction location rather than transaction hash (#3978)
* Change OutputLocation to contain a TransactionLocation

* Change OutputLocation reads from the database

* Update some doc comments

* Update some TODOs

* Change deleting spent UTXOs and updating spent balances

* Change adding new UTXOs and adding their values to balances

* Disable dead code warnings

* Update snapshot test code

* Update round-trip tests for OutputLocations

* Update snapshot test data

* Increment the database format version

* Remove a redundant try_into()

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>

* Refactor redundant code

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>

* ci: attempt at fixing 'Regenerate stateful disks'

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2022-04-08 22:42:05 +00:00
Gustavo Valverde 44cb35c320
fix(ci): validate tests exit code after reading the container logs (#3968)
* fix(ci): validate exit code

* fix(ci): use a single step

* fix: run from gcp command

* fix: remove variable substitution

* fix: escaping characters

* fix: handle bash issues with variable expansion

* fix: seggregate execution into multiple steps

* fix: the command is a string

* fix: move docker ignore to use caching

* revert panic

* fix: add panic and fix exit code command

* revert: remove panic

* fix: apply the exit code to all gcp tests

* imp(ci): use single line exit

* Clean up the CODEOWNERS file

We moved the dockerignore file into the docker directory,
so it doesn't need a separate entry any more.

Co-authored-by: teor <teor@riseup.net>
2022-04-07 23:16:40 +00:00
Deirdre Connolly 1a4f8f6573
feat(ci): create disk image after a successful full sync test (#3986)
* Create disk image after a successful full sync test

* Extract full sync height and name zebrad cached state with it

* Read 500 lines to extract sync height

* Restrict log query to just the container output and fix regex syntax for ubuntu

* Explicitly search logs in descending time

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
2022-04-06 16:57:45 -04:00
dependabot[bot] b0304c5882
build(deps): bump docker/metadata-action from 3.6.2 to 3.7.0 (#4049)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 3.6.2 to 3.7.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v3.6.2...v3.7.0)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 20:51:01 +00:00
dependabot[bot] 47c77f57d1
build(deps): bump google-github-actions/auth from 0.6.0 to 0.7.0 (#4050)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 19:28:39 +00:00
teor 13c216cd3c
1.0.0-beta.7 Release (#4039)
* Update changelog for v1.0.0-beta.7

* Increment all crate versions

* Remove redundant release test that is now covered by CI

* Remove completed NU5 README check task from the release template

* Add Merge Freeze tool to the release checklist

* Simplify release checklist by removing unused steps
2022-04-05 18:06:46 +00:00
dependabot[bot] fa8d1a7074
build(deps): bump tj-actions/changed-files from 18.4 to 18.6 (#4002)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 18.4 to 18.6.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v18.4...v18.6)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 20:44:19 +00:00
teor eeff71d0bd
Increase test coverage of state rebuild (#4020)
Only run the state rebuild job if the database format version has (likely) changed.

If we have accidentally changed the format, but not changed the version,
we want to run with the old cached state, so this job fails.

If we change the state path without changing the version,
this job will take a few hours, because it will do a full rebuild.
2022-04-01 16:02:55 +00:00
Gustavo Valverde 75ae05b257
imp(ci): do not invalidate cache between PRs (#3996)
When a PR is created and an image is built in a branch, the cache is also pushed to a `buildcache` tag.

As all PRs are using the same tag, sometimes the cache for a specific branch gets invalidated and makes it take longer on further pushes.

This fix might make the first commit take longer, but further ones will be faster if no changes in the code are applied.
2022-03-31 01:34:12 +00:00
Deirdre Connolly 3552eafbb8
Add a job to ci.yml that does `cargo install --locked --path ./zebrad/ zebrad` (#3998)
* Add a job to ci.yml that does cargo install --locked --path . zebrad

* Update .github/workflows/ci.yml

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

* Update .github/workflows/ci.patch.yml

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

* Update .github/workflows/ci.yml

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>

* Update .github/workflows/ci.patch.yml

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-30 21:53:57 +00:00
Deirdre Connolly dcade546c0
Update test.patch.yml with lightwalletd job (#3970)
* Update test.patch.yml with lightwalletd job

* Remove a workflow condition that will always be false

In general, patch workflows need the
opposite conditions to the original workflow.

But in this case, we know the result of the
condition will always be true, so we can just delete it.

Co-authored-by: teor <teor@riseup.net>
2022-03-27 22:40:53 +00:00
Conrado Gouvea ed5e85f8ae
fix syntax in some yml workflows (#3957) 2022-03-24 22:39:16 +00:00
dependabot[bot] 5d7f986183
build(deps): bump tj-actions/changed-files from 18.3 to 18.4 (#3917)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 18.3 to 18.4.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v18.3...v18.4)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-23 11:57:55 -04:00
dependabot[bot] de59fc6aa0
build(deps): bump actions/cache from 2 to 3 (#3918)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-21 23:08:25 +00:00
Gustavo Valverde 39765534f1
fix(actions): use a specific shortening length for SHAs (#3929)
* fix(actions): use a specific shortening length for SHAs

The rlespinasse/github-slug-action now works without checking out the code, reduce time and improving security with following actions.

This requires to specify the GITHUB_SHA_SHORT variable length, as git uses 8 by default, but docker uses 7 by default.

* fix(actions): target correct rlespinasse/github-slug-action version

* fix(actions): just use major version

* fix(actions): github-slug-action is not being correctly referenced
2022-03-21 23:07:01 +00:00
Gustavo Valverde e1eb916b6d
refactor(ci): use improved OIDC for gcloud authentication (#3885)
* refactor(ci): use improved OIDC authentication

* fix(ci): standardize OIDC on all required jobs

* fix: wrong indentation

* fix(ci): remove non existing depency in clean job
2022-03-18 21:25:35 +00:00
dependabot[bot] 84ee78dee4
build(deps): bump tj-actions/changed-files from 18.1 to 18.3 (#3895)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 18.1 to 18.3.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v18.1...v18.3)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-18 10:09:56 +00:00
Janito Vaqueiro Ferreira Filho 57dba9fd17
Add `--nocapture` to lightwalletd integration test (#3859)
Print lightwalletd's output in CI.
2022-03-18 04:31:29 +00:00
teor 413f7fbb1d
fix(ci): remove coverage from mergify because nightly fails (#3886) 2022-03-16 00:07:04 -04:00
dependabot[bot] bf1f7aa973
build(deps): bump tj-actions/changed-files from 17.3 to 18.1 (#3876)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 17.3 to 18.1.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v17.3...v18.1)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-16 03:18:33 +00:00
dependabot[bot] c66d6bfa38
build(deps): bump docker/build-push-action from 2.9.0 to 2.10.0 (#3878)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.9.0 to 2.10.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.9.0...v2.10.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-15 22:35:18 +00:00
teor 5950083006
fix(ci): path format for cached state rebuild (#3873) 2022-03-15 09:13:31 +00:00
Deirdre Connolly fcfdc5493e
s/pd-extreme/pd-ssd/ to avoid quotas (#3823) 2022-03-10 22:10:59 +00:00
dependabot[bot] 6f3885d126
build(deps): bump tj-actions/changed-files from 17.2 to 17.3 (#3796)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 17.2 to 17.3.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v17.2...v17.3)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-10 04:01:31 +00:00
dependabot[bot] b0a4e7d487
build(deps): bump google-github-actions/setup-gcloud from 0.5.1 to 0.6.0 (#3814)
Bumps [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) from 0.5.1 to 0.6.0.
- [Release notes](https://github.com/google-github-actions/setup-gcloud/releases)
- [Changelog](https://github.com/google-github-actions/setup-gcloud/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/setup-gcloud/compare/v0.5.1...v0.6.0)

---
updated-dependencies:
- dependency-name: google-github-actions/setup-gcloud
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-10 04:01:20 +00:00
Gustavo Valverde d8d3f6407c
build(cache): do not use GHA cache for images (#3794)
GitHub's GHA cache gets invalidated at 10Gb, which is very easy to hit when we're building multiple times a day with several commits.

Instead use the registry, which won't get invalidated until a change is identified in the build process.
2022-03-10 01:12:34 +00:00
Conrado Gouvea bbef390944
change(ci): remove Windows support (#3819)
* ci: remove Windows support

* address comments
2022-03-10 10:50:12 +10:00
Gustavo Valverde 03d123b428
refactor(test): cleanup GCP instances on a single PR (#3766)
* refactor(test): reuse same GCP instance on a single PR

This also ensures the deployments are faster, and we only delete the instance when merging or closing the PR, instead of doing it on each push to the PR

* fix(deploy): add zone to updates

* fix: typo

* fix(ci): improve conditions for updates

* fix(deploy): delete old deployments instead of reusing it

* fix(deploy): keep delete command after run

* fix(deploy): always create an instance

* fix(deploy): delete disks on every delete command.

* imp(ci): use better id name

* Update .github/workflows/test.yml

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* imp: handle errors correctly on deletion

* fix: do not hide valid errors

* fix: edge case where the container is not ready yet

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-03-09 17:10:05 -04:00
teor e4e6275983
fix(ci): test full sync syntax 2022-03-09 18:03:25 +10:00
teor ba5c641c85
fix(ci): re-enable manual dispatch for test full sync (#3812) 2022-03-09 18:00:58 +10:00
Conrado Gouvea 0d2c7154ea
build(deps): bump actions/checkout from 2.4.0 to 3.0.0 (#3806) 2022-03-09 03:38:38 +00:00
Gustavo Valverde ce0727e306
build(docker): revert supporting arm64 (#3791)
Building crates it's taking too much time and timing out on GitHub's Action.
2022-03-08 15:22:03 +00:00
Gustavo Valverde 3923c3de9e
imp(test): turn on full backtraces and disable frame filtering (#3763)
* imp(test): turn on full backtraces and disable frame filtering

* imp(verbosity): add RUST_LIB_BACKTRACE

We also need `RUST_LIB_BACKTRACE` as stated in:
https://docs.rs/color-eyre/latest/color_eyre/#multiple-report-format-verbosity-levels
https://doc.rust-lang.org/std/backtrace/index.html#environment-variables

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

* fix(verbosity): add missing instances for RUST_BACKTRACE, RUST_LIB_BACKTRACE and COLORBT_SHOW_HIDDEN

Co-authored-by: teor <teor@riseup.net>
2022-03-08 15:09:41 +00:00
dependabot[bot] cee770fe2c
build(deps): bump docker/login-action from 1.13.0 to 1.14.1 (#3761)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.13.0 to 1.14.1.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.13.0...v1.14.1)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-08 09:14:10 +00:00
teor f1123e0386
2. refactor(db): split the raw disk serialzation format into modules (#3717)
* doc(db): fix some comments

* refactor(db): split disk serialization types into their own module

* refactor(db): split the disk format into modules

* doc(db/test): explain the RON serialization format
2022-03-08 07:59:41 +00:00
Gustavo Valverde 4a5f0c25ce
refactor: use gcloud to search for cached disk state (#3775) 2022-03-07 22:19:04 -05:00
teor c724c354d7
fix(ci): only run the full sync test on mergify queue PRs (#3773)
* fix(ci): only run the full sync test on mergify queue PRs

* fix inconsistent indenting and syntax

* Update .github/workflows/test-full-sync.yml

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
2022-03-08 02:46:12 +00:00
teor d86896b841
fix(ci): revert a test job name change (#3774) 2022-03-07 22:16:48 -04:00
teor 699c0625f3
fix(test/full-sync): ignore snapshot test file changes (#3756) 2022-03-06 21:22:46 -04:00
dependabot[bot] 26d6ef9aa0
build(deps): bump docker/login-action from 1.12.0 to 1.13.0 (#3570)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.12.0...v1.13.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-05 17:34:54 +00:00
Conrado Gouvea 2f6a48bed8
fix(tests): use TEST_FAKE_ACTIVATION_HEIGHTS at runtime and fix tests (#3749)
* fix: check TEST_FAKE_ACTIVATION_HEIGHTS at runtime

* fix(tests): add TEST_FAKE_ACTIVATION_HEIGHTS variable

This variable ensures the test is activated in the `test-fake-activation-heights` step

* fix(docker): do not run specific tests by default in entrypoint.sh

* fix(test): remove extra TEST_FULL_SYNC argument

* imp(timeout): wait for an average build time

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
2022-03-05 13:32:46 -04:00
Deirdre Connolly 3238ddffa7 Extra $ 2022-03-04 16:40:19 -05:00
Deirdre Connolly f875742766 Fix CD 'Deploy mainnet nodes' job conditional 2022-03-04 16:40:19 -05:00
teor 4cb0f36ae5
doc(ci): explain the different ways .txt files are used (#3743) 2022-03-04 15:55:49 -04:00
Gustavo Valverde d9a0f9d657
fix(build, deployment): missing job key and timeout bump for build (#3744)
* fix: add missing job key

* fix(arm64): bump timeout to build without cache

* fix(deployment): apply changes made in 5004c4d3a1

* fix: remove uneeded condition

* refactor(tests):  make vm names refer the test name

This also adds a build step for full sync, as there won't be a reference image when using workflow_dispatch

* fix(deployment): testing depends on the built image
2022-03-04 15:55:32 -04:00
Gustavo Valverde 15949c8c37
refactor(test): decouple full sync from other tests (#3735)
* refactor(test): decouple full sync from other tests

As the full sync requires to be run just once and isolated, we're running this test in a separate workflow, after a PR has been approved.

* fix: revert to previous conditions in job regenerate-stateful-disks

* fix(condition): get disk sha if regeneration is not executed

* fix: typo

* Update .github/workflows/test-full-sync.yml

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>

* fix(build): bump build time for arm64

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-03-04 08:12:22 +00:00
Gustavo Valverde c822f0ab0c
fix(build): arm64 add extra time when building from scratch (#3738) 2022-03-04 07:27:36 +00:00
Gustavo Valverde 5004c4d3a1
refactor(build): use OCI Image Format Specification for labels (#3728)
* refactor(build): use OCI Image Format Specification for labels

This should also fix when an image gets built multiple times using the cache, as each image differs in labels

* refactor(tags): use PR context sha and ref

Remove the needed of PR Head SHA and Ref, as those can cause conflict depending on how the branch name has been established
2022-03-04 02:33:29 -04:00
teor e7af51db3a
fix(deps): remove an outdated dependabot ignore rule (#3719)
We can use dependabot commands instead.
2022-03-03 13:04:25 +00:00
teor 9ce3a9a62f
fix(ci): check for adityapk00/lightwalletd behaviour in test harness (#3705)
* fix(ci): remove an unused trigger path

* doc(ci): explain lightwalletd trigger paths

* fix(test): check for adityapk00/lightwalletd behaviour in test harness

* fix(ci): work around buildx command error

* fix(ci): revert the workaround
2022-03-03 13:03:06 +00:00
teor 5cc7f46200
fix(codeowners): avoid multiple reviewer assignments (#3718)
Assign more code to the largest review team, to avoid multiple reviewer assignments.
2022-03-03 12:50:10 +00:00
Gustavo Valverde c176e2a423
feat(build): add arm64 support with cross-compilation (#3678)
* add(actions): lightwalletd continous integrations

* refactor(actions): build lightwalletd and reuse it in zebra

- Download lightwalletd source code
- Create a new Dockerfile for lightwalletd
- Use lightwalletd binary in Zebra's image
- Create a specific step to build/update lightwalletd
- Add lightwalletd integration test to the test suite
- Remove lightwalletd.yml, as it was harder to control

* refactor(docker): organize Dockerfiles and remove unused

Fixes: #3344

* feat(build): add arrm64 support

* fix(build): do not install google-compute-engine in arm64

This package is not available for this platform

* fix(build): do not build arm64 for tests

* fix(condition): indent for better visibility

* fix(condition): wrong use of operators
2022-03-03 00:39:41 +00:00
teor 30b5468f2f
fix(review): only assign one reviewer to general Rust reviews (#3708)
If we assign two teams, GitHub assigns two reviewers.
2022-03-02 23:07:20 +00:00
Gustavo Valverde dcbf8ba545
fix(build): use the right multistage target (#3700) 2022-03-02 16:53:12 +00:00
teor 6b31f5b454
fix(ci): update CI job path triggers (#3692)
* ci(test): re-run tests when snapshot data changes

* fix(ci): rebuild state when disk format changes

* fix(ci): rebuild rust docs when code or dependencies change

* doc(ci): explain why we run jobs when files change

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
2022-03-02 14:23:05 +00:00
Gustavo Valverde db966f27fa
feat(actions)!: add full sync test (#3582)
* add(tests): full sync test

* fix(test): add build

* fix(deploy): escape double dashes '--' correctly

* fix(test): remove unexpected --no-capture arg

error: Found argument '--nocapture' which wasn't expected, or isn't valid in this context

* refactor(docker): use default executable as entrypoint

* refactor(startup): add a custom entrypoint

* fix(test): add missing TEST_FULL_SYNC variable

* test(timeout): use the biggest machine

* fix

* fix(deploy): use latest successful image

* typo

* refactor(docker): generate config file at startup

* revert(build): changes were made to docker

* fix(docker): send variables correctly to the entrypoint

* test different conf file approach

* fix(env): add RUN_TEST env variable

* ref: use previous approach

* fix(color): use environment variable

* fix(resources): use our normal machine size

* fix(ci): double CPU and RAM for full sync test

* fix(test): check for zebrad test output in the correct order

The mempool is only activated once, so we must check for that log first.
After mempool activation, the stop regex is logged at least once.
(It might be logged before as well, but we can't rely on that.)

When checking that the mempool didn't activate,
wait for the `zebrad` command to exit,
then check the entire log.

* fix(ci): run full sync test with full compiler optimisations

* fix(tests): reintroduce tests and run full sync on approval

* fix(tests): reduce the changelog

Co-authored-by: teor <teor@riseup.net>
2022-03-02 14:15:24 +00:00
Gustavo Valverde a0c451223f
feat(lightwalletd): add build and CI pipeline (#3657)
* add(actions): lightwalletd continous integrations

* refactor(actions): build lightwalletd and reuse it in zebra

- Download lightwalletd source code
- Create a new Dockerfile for lightwalletd
- Use lightwalletd binary in Zebra's image
- Create a specific step to build/update lightwalletd
- Add lightwalletd integration test to the test suite
- Remove lightwalletd.yml, as it was harder to control

* fix(build): remove extra port being exposed

* fix(lightwalletd): test should be after `--` in cargo test

* revert(lint): do not lint external code as it can be confusing

* fix(test): lightwalletd_integration test is not ignored

* docs(docker): clarify the addition of unused args

* refactor(docker): organize Dockerfiles and remove unused

Fixes: #3344

* fix(actions): activate workflows on correct path changes

* test

* revert previous commit

* feat(build): add arm64 support with cross-compilation (#3659)

* feat(build): add arrm64 support

* fix(build): do not install google-compute-engine in arm64

This package is not available for this platform

* fix(build): do not build arm64 for tests

* fix(changes): reduce changelog

* Revert "feat(build): add arm64 support with cross-compilation (#3659)"

This reverts commit 291e00c405.
2022-03-02 09:00:55 +00:00
Gustavo Valverde 061d7da67c
feat(codeowners): add code reviewers to the repository (#3677)
* feat(codeowners): add code owners in repository

* fix(path): recently split out crate

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

* fix(teams): use reviewers instead of owners name

* fix(teams): wrong team name

* docs: use correct default explanation

* fix(path): add extra paths to devops team

Co-authored-by: teor <teor@riseup.net>
2022-03-01 14:50:18 +00:00
dependabot[bot] a8a52125d0
build(deps): bump tj-actions/changed-files from 14.4 to 17.2 (#3667)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 14.4 to 17.2.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](https://github.com/tj-actions/changed-files/compare/v14.4...v17.2)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-28 21:38:30 -04:00
Conrado Gouvea e75fe2c42f
include listing not-mentioned PRs and not-bumped crates in the release checklist (#3621) 2022-02-23 18:18:30 +00:00
teor 22b8a6003c
3. refactor(state): move database reads and writes to a new zebra_db module (#3579)
* refactor(state): move disk_db reads to a new zebra_db module

* refactor(state): make finalized value pool method names consistent

* refactor(state): split database writes into the zebra_db module

* refactor(state): move the block batch method to DiskWriteBatch

* refactor(state): actually add the zebra_db module

Unfortunately, I've lost the interim changes to this file,
so this commit might be the only one that compiles.

* refactor(state): add a newly created file to the cached state CI job
2022-02-23 00:43:41 +00:00
Deirdre Connolly 35f9b17710
fix(actions): run coverage collection when pushing to main (#3561)
* Run Coverage collection on main

Resolves #3533

* fix(coverage): just run coverage on specific file changes to main

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
2022-02-22 09:48:00 +00:00
teor 1896943f62
fix(ci): also check for duplicate dependencies with optional features off (#3592)
* fix(dependencies): update an unused duplicate dependency exception

This duplicate was removed by PR #3572, but other duplicates still exist.

* feat(ci): check for duplicate dependencies with optional features off
2022-02-21 17:41:31 +00:00
Gustavo Valverde 6fafd1af57
refactor(mergify): better test requirements and merge conditions (#3580)
* fix(mergify, actions): use better names and require tests

* feat(queue): do not update the actual PR, create a draft

Do not allow to update/rebase the original pull request to check its mergeability. Create a draft pull request instead.

This doesn't add Mergify as a co-author

* feat(queue): do not interrupt already running queues

Our queues might take more than 5 hours even if the priority is low.

Do not allow interrupting the ongoing speculative checks when a pull request with higher priority enters in the queue.

* fix(mergify): move 'allow' attributes to queue_rules

* fix(mergify): attributes are not conditions
2022-02-18 17:53:27 -05:00
teor e182c33273
fix(ci): make the purpose of each sync test clearer (#3574) 2022-02-17 21:42:26 +00:00
teor 92b561dc8a
refactor(state): split the database module (#3568)
* refactor(state): split the disk_format module

* refactor(ci): add the new disk_db file to the state CI list

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-17 19:08:49 +00:00
dependabot[bot] 61d3243da5
build(deps): bump google-github-actions/setup-gcloud from 0.5.0 to 0.5.1 (#3560)
Bumps [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/google-github-actions/setup-gcloud/releases)
- [Changelog](https://github.com/google-github-actions/setup-gcloud/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/setup-gcloud/compare/v0.5.0...v0.5.1)

---
updated-dependencies:
- dependency-name: google-github-actions/setup-gcloud
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-16 22:21:15 +00:00
teor d593347a3e
fix(ci): delete a redundant "test all" job (#3552)
* fix(ci): clarify ignored test name

`--include-ignored` runs all tests, including tests
that would normally be ignored.

`-Zunstable-options` enables all unstable options,
but it doesn't do anything by itself.

There is a lot of overlap with "test-all" in this job,
which we might want to fix in a future PR.

* fix(ci): remove unused -Zunstable-options

`--include-ignored` is now stable, so `unstable-options` is not needed.

* fix(test): delete a redundant test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-16 20:53:37 +00:00
Gustavo Valverde 52ba1f0edd fix(test): create a new disk with the commit being tested 2022-02-16 15:52:12 -04:00
Gustavo Valverde 2e61998182
fix(test): evaluate "if" conditions correctly and use last disk SHA (#3556)
* fix(test): use the short SHA from actual run if valid

* fix(test): if condition must evaluate to a single false

* fix(test): do not run logs and upload if not needed

* imp(test): allow test stateful sync after disk regeneration

This takes is fast enough, so it shouldn't do any harm if run just after a ~3 hours test

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-16 15:56:09 +00:00
Gustavo Valverde 8c07d3906d
fix(actions): allow branches with dots in the name (#3557)
Dependabot creates branches with versions using a dot notation, and some tests fails because of this

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-16 15:47:02 +00:00
Gustavo Valverde 943a38a0d6
fix(clippy): allow unprivileged runs of clippy (#3558) 2022-02-16 15:15:19 +00:00
Gustavo Valverde 8023ab15cf
fix(test): create disk from image before mounting (#3550) 2022-02-16 02:43:29 +00:00
Gustavo Valverde fe2edca1ba
refactor(test): dockerize tests and run sync in detached mode (#3459)
* refactor (cd): overall pipeline improvement

- Use a more ENV configurable Dockerfile
- Remove cloudbuild dependency
- Use compute optimized machine types
- Use SSD instead of normal hard drives
- Move Sentry endpoint to secrets
- Use a single yml for auto & manual deploy
- Migrate to Google Artifact Registry

* refactor (cd): overall pipeline improvement

- Use a more ENV configurable Dockerfile
- Remove cloudbuild dependency
- Use compute optimized machine types
- Use SSD instead of normal hard drives
- Move Sentry endpoint to secrets
- Use a single yml for auto & manual deploy
- Migrate to Google Artifact Registry

* refactor (cd): use newer google auth action

* fix (cd): use newer secret as gcp credential

* fix (docker): do not create extra directories

* fix (docker): ignore .github for caching purposes

* fix (docker): use latest rust

* fix (cd): bump build timeout

* fix: use a better name for manual deployment

* refactor (docker): use standard directories for executable

* fix (cd): most systems expect a "latest" tag

Caching from the latest image is one of the main reasons to add this extra tag. Before this commit, the inline cache was not being used.

* fix (cd): push the build image and the cache separately

The inline cache exporter only supports `min` cache mode. To enable `max` cache mode, push the image and the cache separately by using the registry cache exporter.

This also allows for smaller release images.

* fix (cd): remove unused GHA cache

We're leveraging the registry to cache the actions, instead of using the 10GB limits from Github Actions cache storage

* refactor (cd): use cargo-chef for caching rust deps

* fix: move build system deps before cargo cheg cook

* fix (release): use newer debian to reduce vulnerabilities

* fix (cd): use same zone, region and service accounts

* fix (cd): use same disk size and type for all deployments

* refactor (cd): activate interactive shells

Use interactive shells for manual and test deployments. This allow greater flexibility if troubleshooting is needed inside the machines

* refactor (test): use docker artifact from registry

Instead of using a VM to SSH into in to build and test. Build in GHA (to have the logs available), run the workspace tests in GHA, and just run the sync tests in GCP

Use a cintainer VM with zebra's image directly on it, and pass the needed parameters to run the Sync past mandatory checkpoint.

* tmp (cd): bump timeout for building from scratch

* tmp (test): bump build time

* fix (cd, test): bump build time-out to 210 minutes

* fix (docker): do not build with different settings

Compiling might be slow because different steps are compiling the same code 2-4 times because of the variations

* revert (docker): do not fix the rust version

* fix (docker): build on the root directory

* refactor(docker): Use base image commands and tools

* fix (cd): use correct variables & values, add build concurrency

* fix(cd): use Mainnet instead of mainnet

* imp: remove checkout as Buildkit uses the git context

* fix (docker): just Buildkit uses a .dockerignore in a path

* imp (cd): just use needed variables in the right place

* imp (cd): do not checkout if not needed

* test: run on push

* refactor(docker): reduce build changes

* fix(cd): not checking out was limiting some variables

* refactor(test): add an multistage exclusive for testing

* fix(cd): remove tests as a runtime dependency

* fix(cd): use default service account with cloud-platform scope

* fix(cd): revert checkout actions

* fix: use GA c2 instead of Preview c2d machine types

* fix(actions): remove workflow_dispatch from patched actions

This causes GitHub confusion as it can't determined which of the actions using workflow_dispatch is the right one

* fix(actions): remove patches from push actions

* test: validate changes on each push

* fix(test): wrong file syntax on test job

* fix(test): add missing env parameters

* fix(docker): Do not rebuild to download params and run tests

* fix(test): setup gcloud and loginto artifact just when needed

Try not to rebuild the tests

* fix(test): use GCP container to sync past mandatory checkpoint

* fix(test): missing separators

* test

* fix(test): mount the available disk

* push

* refactor(test): merge disk regeneration into test.yml

* fix(cd): minor typo fixes

* fix(docker): rebuild on .github changes

* fix(cd): keep compatibility with gcr.io

To prevent conflicts between registries, and migrate when the time is right, we'll keep pushing to both registries and use github actions cache to prevent conflicts between artifacts.

* fix(cd): typo and scope

* fix(cd): typos everywhere

* refactor(test): use smarter docker wait and keep old registry

* fix(cd): do not constraint the CPUs for bigger machines

* revert(cd): reduce PR diff as there's a separate one for tests

* fix(docker): add .github as it has no impact on caching

* fix(test): run command correctly

* fix(test): wiat and create image if previous step succeded

* force rebuild

* fix(test): do not restrict interdependant steps based on event

* force push

* feat(docker): add google OS Config agent

Use a separate step to have better flexibility in case a better approach is available

* fix(test): remove all hardoced values and increase disks

* fix(test): use correct commands on deploy

* fix(test): use args as required by google

* fix(docker): try not to invalidate zebrad download cache

* fix(test): minor typo

* refactor(test): decouple jobs for better modularity

This also allows faster tests as testing Zunstable won't be a dependency and it can't stop already started jobs if it fails.

* fix(test): Do not try to execute ss and commands in one line

* fix(test): do not show undeeded information in the terminal

* fix(test): sleep befor/after machine creation/deletion

* fix(docker): do not download zcash params twice

* feat(docker): add google OS Config agent

Use a separate step to have better flexibility in case a better approach is available

* merge: docker-actions-refactor into docker-test-refactor

* test docker wait scenarios

* fix(docker): $HOME variables is not being expanded

* fix(test): allow docker wait to work correctly

* fix(docker): do not use variables while using COPY

* fix(docker): allow to use zebrad as a command

* fix(cd): use test .yml from main

* fix(cd): Do not duplicate network values

The Dockerfile has an ARG with a default value of 'Mainnet', if this value is changed it will be done manually on a workflow_dispatch, making the ENV option a uneeded duplicate in this workflow

* fix(test): use bigger machine type for compute intensive tasks

* refactor(test): add tests in CI file

* fix(test): remove duplicated tests

* fix(test): typo

* test: build on .github changes temporarily

* fix(test): bigger machines have no effect on sync times

* feat: add an image to inherit from with zcash params

* fix(cd): use the right image name and allow push to test

* fix(cd): use the right docker target and remove extra builds

* refactor(docker): use cached zcash params from previous build

* fix(cd): finalize for merging

* imp(cd): add double safety measure for production

* fix(cd): use specific SHA for containers

* fix(cd): use latest gcloud action version

* fix(test): use the network as Mainnet and remove the uppercase from tests

* fix(test): run disk regeneration on specific file change

Just run this regeneration when changing the following files:

https://github.com/ZcashFoundation/zebra/blob/main/zebra-state/src/service/finalized_state/disk_format.rs
https://github.com/ZcashFoundation/zebra/blob/main/zebra-state/src/service/finalized_state.rs
https://github.com/ZcashFoundation/zebra/blob/main/zebra-state/src/constants.rs

* refactor(test): seggregate disks regeneration from tests

Allow to regenerate disks without running tests, and to run tests from previous disk regeneration.

Disk will be regenerated just if specific files were changed, or triggered manually.

Tests will run just if a disk regeneration was not manually triggered.

* fix(test): gcp disks require lower case conventions

* fix(test): validate logs being emmited by docker

GHA is transforming is somehow transforwing the variable to lowercase also, so we're changint it to adapt to it

* test

* fix(test): force tty terminal

* fix(test): use a one line command to test terminal output

* fix(test): always delete test instance

* fix(test): use short SHA from the PR head

Using the SHA from the base, creates confusion and it's not accurate with the SHA being shown and used on GitHub.

We have to keep both as manual runs with `workflow_dispatch` does not have a PR SHA

* fix(ci): do not trigger CI on docker changes

There's no impact in this workflow when a change is done in the dockerfile

* Instead of runing cargo test when the instance gets created, run this commands afterwards in a different step.

As GHA TTY is not working as expected, and workarounds does not play nicely with `gcloud compute ssh` actions/runner#241 (comment) we decided to get the container name from the logs, log directly to the container and run the cargo command from there.

* doc(test): document reasoning for new steps

* fix(test): increase machine type and ssh timeout

* fix(test): run tests on creation and follow container logs

This allows to follow logs in Github Actions terminal, while the GCP container is still running.

Just delete the instance when following the logs ends successfully or fails

* finalize(test): do not rebuild image when changing actions

* fix(test): run tests on creation and follow container logs

This allows to follow logs in Github Actions terminal, while the GCP container is still running.

Just delete the instance when following the logs ends successfully or fails

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-16 00:54:16 +00:00
dependabot[bot] 2cae880e3e
Bump google-github-actions/auth from 0.5.0 to 0.6.0 (#3496)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/auth/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-13 12:39:18 +00:00
dependabot[bot] a471e9e3ee
Bump docker/build-push-action from 2.8.0 to 2.9.0 (#3497)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.8.0...v2.9.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-13 12:37:06 +00:00
Gustavo Valverde fd8c727c31
fix(actions): typo on paths filtering (#3516)
The keyword is `paths` and the actions were using `path`

That's the reason why most actions have been running, and there's been no impact in time savings
2022-02-11 14:05:19 +00:00
Gustavo Valverde d2e58dfa37 fix(mergify): do not wait for depecrated Cloud Build
Cloud Build was recently removed, and Mergify is expecting a result from a non-existing action.
2022-02-10 18:44:10 -05:00
Gustavo Valverde 284aeb7106
fix: temporarily allow forked repos to run PR workflows (#3503)
* fix(zcash-params): Do not update parameters image on PR

We should not update a direct dependency of our Docker image to be writeable by a PR from anywhere, a local branch or a fork branch, before that change has been approved by a human and merged to #main

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
2022-02-10 07:31:33 -04:00
Gustavo Valverde a872f1727a
refactor(cd): improve Docker and gcloud usage without Cloud Build (#3431)
* refactor (cd): overall pipeline improvement

- Use a more ENV configurable Dockerfile
- Remove cloudbuild dependency
- Use compute optimized machine types
- Use SSD instead of normal hard drives
- Move Sentry endpoint to secrets
- Use a single yml for auto & manual deploy
- Migrate to Google Artifact Registry

* refactor (cd): overall pipeline improvement

- Use a more ENV configurable Dockerfile
- Remove cloudbuild dependency
- Use compute optimized machine types
- Use SSD instead of normal hard drives
- Move Sentry endpoint to secrets
- Use a single yml for auto & manual deploy
- Migrate to Google Artifact Registry

* refactor (cd): use newer google auth action

* fix (cd): use newer secret as gcp credential

* fix (docker): do not create extra directories

* fix (docker): ignore .github for caching purposes

* fix (docker): use latest rust

* fix: use a better name for manual deployment

* refactor (docker): use standard directories for executable

* fix (cd): most systems expect a "latest" tag

Caching from the latest image is one of the main reasons to add this extra tag. Before this commit, the inline cache was not being used.

* fix (cd): push the build image and the cache separately

The inline cache exporter only supports `min` cache mode. To enable `max` cache mode, push the image and the cache separately by using the registry cache exporter.

This also allows for smaller release images.

* fix (cd): remove unused GHA cache

We're leveraging the registry to cache the actions, instead of using the 10GB limits from Github Actions cache storage

* refactor (cd): use cargo-chef for caching rust deps

* fix (release): use newer debian to reduce vulnerabilities

* fix (cd): use same zone, region and service accounts

* fix (cd): use same disk size and type for all deployments

* refactor (cd): activate interactive shells

Use interactive shells for manual and test deployments. This allow greater flexibility if troubleshooting is needed inside the machines

* fix (docker): do not build with different settings

Compiling might be slow because different steps are compiling the same code 2-4 times because of the variations

* fix(cd): use Mainnet instead of mainnet

* fix(docker): remove tests as a runtime dependency

* fix(cd): use default service account with cloud-platform scope

* fix(cd): keep compatibility with gcr.io

To prevent conflicts between registries, and migrate when the time is right, we'll keep pushing to both registries and use github actions cache to prevent conflicts between artifacts.

* fix(docker): do not download zcash params twice

* feat(docker): add google OS Config agent

Use a separate step to have better flexibility in case a better approach is available

* fix(docker): allow to use zebrad as a command

* feat: add an image to inherit from with zcash params

* refactor(docker): use cached zcash params from previous build

* imp(cd): add double safety measure for production
2022-02-08 20:50:13 -04:00
dependabot[bot] 35222fb30f
Bump google-github-actions/setup-gcloud from 0.4.0 to 0.5.0 (#3471)
Bumps [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/google-github-actions/setup-gcloud/releases)
- [Changelog](https://github.com/google-github-actions/setup-gcloud/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google-github-actions/setup-gcloud/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: google-github-actions/setup-gcloud
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-08 10:37:26 +00:00
teor 6ddbe7972d
fix(mergify): put PRs with no priority label in the low priority queue (#3454)
This also lets us handle dependabot PRs using the low queue rule.
2022-02-02 02:07:33 +00:00
Gustavo Valverde 4d32f9c765
fix(mergify): restrict merges if there are unresolved reviews (#3453) 2022-02-02 00:28:59 +00:00
Deirdre Connolly 07f120a21a
Restore coverage to use latest nightly (#3450)
Fixes #3367

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-01 01:10:28 +00:00
Gustavo Valverde 5fa40216df
refactor (actions): make better use of variables, secrets and versions (#3393)
* style: use global variables and don't double print

Remove repeated instances of global environment variables. Do not print ENV variables on the terminal as GitHub Actions already shows it.

* fix (actions): Use fixed major versions for actions

As actions get recurrent fixes, using a specific version causes more maintance on the pipelines.

On the other hand, using @master versions could make some action unreliable, as breaking changes might be included without further notice, and even change behavior on a daily basis.

* refactor: make better use of ENV variables

A whole step with refex was being used to extract different variables from GitHub's environment. This gets depecrated in favor of using `rlespinasse/github-slug-action@v4` which has slug URL variables.

A SLUG on a variable will:
- put the variable content in lower case
- replace any character by - except 0-9, a-z, ., and _
- remove leading and trailing - character
- limit the string size to 63 characters

This changes also takes care of using the Head or Base branch for deployments. This will allow us tomerge of workflows, as most steps on this deployment actions are very similar, with little variations between workflows.

* fix (actions): use secrets for sensitive information

* revert: use specific versions for dependabot

Reverting commit 8c93409902
2022-01-26 21:46:18 -04:00
Deirdre Connolly 39fc0e27d8
Bump cd workflow timeout to 60 mins (#3412) 2022-01-26 18:45:08 +00:00
teor aef75ee9ff
fix(mergify): use low-priority queue for the correct jobs (#3406)
This fixes an inverted match condition.
2022-01-26 07:45:14 -04:00
Gustavo Valverde 15eca05370
fix (actions): add duplicated workflows with path-ignore (#3405)
GitHub does not support skipped but required checks by default, this an official workaround to allow this feature; which requires to duplicate the same workflow using path-ignore and just executing a step that will always pass, for each job.

Reference: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
2022-01-26 03:19:43 +00:00
Gustavo Valverde 6373a95405
Improve GitHub Actions checks based on files & folders (#3377)
* Segregate linting jobs from CI workflow

Lint on push to all branches, except for main, as this action will be required to merge.

Just run the lint action when a Rust file is changed, as it won't make sense to run it on other scenarios.

DRY with uneeded jobs

* Make actions dependable on changed files or folders

* Fix & add missing paths

* Revert changes removing cargo.lock and deny.toml checks

Also refactor this to use a more redable and change prone cargo-deny-action. And move this actions out of the clippy-deps job, as this are more related to CI than linting.

* Fix wrong indentation

* Add new configuration file from #3386

* Do not fail on licenses as this configuration is missing

* Do not add advisories features

Add advisories checks in a different PR

* Allow tests and coverage on PR series

If we only run CI on branches that are going to merge to main, then PR series become a lot harder to test. (Because each PR is based on the previous PR, not main.)
2022-01-25 07:58:11 -04:00
Conrado Gouvea 4aeabd0b52
Fix interstitial sprout anchors check (#3283)
* Fix interstitial Sprout anchors check

* Update state docs; add sprout_trees_by_anchor to comparisons

* Update book/src/dev/rfcs/0005-state-updates.md

Co-authored-by: Marek <mail@marek.onl>

* Rename `interstitial_roots` to `interstitial_trees`

* Document consensus rules

* Refactor the docs

* Improve the docs for consensus rules

* Update reference to cached state

* Update zebra-state/src/service/check/anchors.rs

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

* Fix formatting

Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-18 20:18:49 +00:00
Conrado Gouvea 9b9e49953e
Use 2022-01-14 nightly to workaround coverage issue https://github.com/taiki-e/cargo-llvm-cov/issues/128 (#3366) 2022-01-18 19:31:09 +00:00
Gustavo Valverde ee9f081dd5
Do not update PRs to the latest tip automatically (#3351)
This causes the Mergify bot to commit to each PR, being also included in the squashed merge as an author.

As the queue merges the head branch (main) to latest tip before testing with the CI, having all those feature branches constantly updating with Mergify is not needed
2022-01-14 11:26:55 -05:00
Gustavo Valverde dc4533d368
Use the correct conditions and merge method in Mergify (#3341)
* fix: Use the correct conditions and merge method

Mergifys Status Checks conditions are based on the job name, not the worflow name. As our worflows have dynamic names, each variant must be considered.

Squash merges are the default being used in the Zebra repo, so mergify must comply with this configuration.

Use condition operators for labels in each pull request rule; previously it was expecting both labels to be set. And update names accordingly.

* fix: Allow mergify to merge dependabot PRs

Also adapt dependabot's configuration to use the recently adapted labels

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-01-13 23:34:09 +00:00
Gustavo Valverde fc1a1cdac1
Add mergify merging queues (#3324)
* Add mergify merging queues

* Fix Mergify invalid configuration

* Improve adaptability to the actual workflow

Do not merge if the pull-request test is not green. Do not move draft PRs to the queue. And update keep all open PRs updated.

* Fix a typo on check-success condition
2022-01-07 19:11:01 -05:00
Conrado Gouvea 1cbc06aa64
Add install.md to checklist, update to use a single PR (#3282)
* Add updating install.md to checklist

* Change to use a single PR for version increment and changelog
2021-12-23 10:16:15 -03:00
Janito Vaqueiro Ferreira Filho b71833292d
Use `MockedClientHandle` in other tests (#3241)
* Move `MockedClientHandle` to `peer` module

It's more closely related to a `Client` than the `PeerSet`, and this
prepares it to be used by other tests.

* Rename `MockedClientHandle` to `ClientTestHarness`

Reduce confusion, and clarify that the client is not mocked.

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

* Add clarification to `mock_peers` documentation

Explicitly say how the generated data is returned.

* Rename method to `wants_connection_heartbeats`

The `Client` service only represents one direction of a connection, so
`is_connected` is not the exact term.

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

* Mock `Client` instead of `LoadTrackedClient`

Move where the conversion from mocked `Client` to mocked
`LoadTrackedClient` in order to make the test helper more easily used by
other tests.

* Use `ClientTestHarness` in `initialize` tests

Replace the boilerplate code to create a fake `Client` instance with
usages of the `ClientTestHarness` constructor.

* Allow receiving requests from `Client` instance

Create a helper type to wrap the result, to make it easier to assert on
specific events after trying to receive a request.

* Allow inspecting the current error in the slot

Share the `ErrorSlot` between the `Client` and the handle, so that the
handle can be used to inspect the contents of the `ErrorSlot`.

* Allow placing an error into the `ErrorSlot`

Assuming it is initially empty. If it already has an error, the code
will panic.

* Allow gracefully closing the request receiver

Close the endpoint with the appropriate call to the `close()` method.

* Allow dropping the request receiver endpoint

Forcefully closes the endpoint.

* Rename field to `client_request_receiver`

Also rename the related methods to include
`outbound_client_request_receiver` to make it more precise.

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

* Allow dropping the heartbeat shutdown receiver

Allows the `Client` to detect that the channel has been closed.

* Rename fn. to `drop_heartbeat_shutdown_receiver`

Make it clear that it affects the heartbeat task.

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

* Move `NowOrLater` into a new `now-or-later` crate

Make it easily accessible to other crates.

* Add `IsReady` extension trait for `Service`

Simplifies checking if a service is immediately ready to be called.

* Add extension method to check for readiness error

Checks if the `Service` isn't immediately ready because a call to
`ready` immediately returns an error.

* Rename method to `is_failed`

Avoid negated method names.

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

* Add a `IsReady::is_pending` extension method

Checks if a `Service` is not ready to be called.

* Use `ClientTestHarness` in `Client` test vectors

Reduce repeated code and try to improve readability.

* Create a new `ClientTestHarnessBuilder` type

A builder to create test `Client` instances using mock data which can be
tracked and manipulated through a `ClientTestHarness`.

* Allow configuring the `Client`'s mocked version

Add a `with_version` builder method.

* Use `ClientTestHarnessBuilder` in `PeerVersions`

Use the builder to set the peer version, so that the `version` parameter
can be removed from the constructor later.

* Use a default mock version where possible

Reduce noise when setting up the harness for tests that don't really
care about the remote peer version.

* Remove `Version` parameter from the `build` method

The `with_version` builder method should be used instead.

* Fix some typos and outdated info in the release checklist

* Add extra client tests for zero and multiple readiness checks (#3273)

And document existing tests.

* Replace `NowOrLater` with `futures::poll!` (#3272)

* Replace NowOrLater with the futures::poll! macro in zebrad

* Replace NowOrLater with the futures::poll! macro in zebra-test

* Remove the now-or-later crate

* remove unused imports

* rustfmt

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2021-12-22 06:13:26 +10:00
dependabot[bot] 5543b9b6bc
Bump EmbarkStudios/cargo-deny-action from 1.2.6 to 1.2.9 (#3163)
Bumps [EmbarkStudios/cargo-deny-action](https://github.com/EmbarkStudios/cargo-deny-action) from 1.2.6 to 1.2.9.
- [Release notes](https://github.com/EmbarkStudios/cargo-deny-action/releases)
- [Commits](https://github.com/EmbarkStudios/cargo-deny-action/compare/v1.2.6...v1.2.9)

---
updated-dependencies:
- dependency-name: EmbarkStudios/cargo-deny-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-07 11:08:51 +10:00
teor 022808d028
Release Zebra v1.0.0-beta.2 (#3132)
Zebra's latest beta continues implementing zero-knowledge proof and note commitment tree validation. In this release, we have finished implementing transaction header, transaction amount, and Zebra-specific NU5 validation. (NU5 mainnet validation is waiting on an `orchard` crate update, and some consensus parameter updates.)

We also fix a number of security issues that could pose a local denial of service risk, or make it easier for an attacker to make a node follow a false chain.

As of this release, Zebra will automatically download and cache the Sprout and Sapling Groth16 circuit parameters. The cache uses around 1 GB of disk space. These cached parameters are shared across all Zebra and `zcashd` instances run by the same user.

See CHANGELOG.md for the full list of changes in this release.
2021-12-03 06:54:14 +10:00
Marek 3c9ad89018
Add Sprout anchors to `zebra-state` (#3100)
* Add Sprout anchors to the state

* Update zebra-state/src/service/non_finalized_state/chain.rs

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

* Return new types of note commitments from Sprout transactions

* Refactor the tests

* Refactor some comments

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

* Increment `DATABASE_FORMAT_VERSION`

* Update `test.yml` with the new image name

* Refactor the `version = 5` transaction description

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

* Update comment

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
Co-authored-by: teor <teor@riseup.net>
2021-11-30 11:05:58 +01:00
teor 0ef4629232
Automatically download and load sprout parameters (#3085)
* Download and load Sprout parameters using zcash_proofs

Also update some librustzcash dependencies, to avoid duplicate dependencies.

* Update upstream orchard to avoid a compilation error

* Skip librustzcash batch refactor for now, to avoid compilation errors

* Change the cache ID, so we actually cache Sprout

* Move existing file checks into zcash_proofs

* Add a 1 hour timeout to parameter file downloads

* Give other tasks priority, before spawning the download task

* Update to the latest version of our modified librustzcash fork

* Change the cache key for Sprout

* Add 40 minutes to CI timeouts for occasional sprout downloads

* Update to zcash_proofs with split downloads

* Check file sizes to help debug parameter load failures in zcash_proofs

* Start the second download once the first has finished in zcash_proofs

* Document the parameter download task

* Stop hashing existing files twice
2021-11-25 13:26:32 -03:00
teor e054d57622
Speed up CI, and split unrelated and conflicting CI jobs (#3077)
* Move dependency checks to the clippy job

* Split the fake activation heights into their own job

* Fix expected types

* Minimise proptest cases on Windows, macOS, and coverage

We don't expect proptests to fail on different platforms.
2021-11-22 14:26:07 -03:00
teor f7202bfbc0
Download Zcash Sapling parameters and load them from cached files (#3057)
* Replace Zcash parameters crates with pre-downloaded local parameter files

* Download Zcash parameters using the `zcashd` script in CI and Docker

* Add a zcash_proofs dependency to zebra-consensus

* Download Sapling parameters using zcash_proofs, rather than fetch-params.sh

* Add a new `zebrad download` subcommand

This command isn't required for nomrmal usage.
But it's useful when testing, or launching multiple Zebra instances.

* Use `zebrad download` in CI to pre-download parameters

* Log a helpful hint if downloading fails

* Allow some duplicate dependencies currently hidden by orchard

* Spawn a separate task to download Groth16 parameters

* Run the parameter download with code coverage

This avoids re-compining Zebra with and without coverage.

* Update Cargo.lock after rebase

* Try to pass `download` as an argument to `zebrad` in coverage CI

* Fix copy and paste comment typos

* Add path and download examples, like zcash_proofs

* Download params in CI just like zcash_proofs does

* Delete a redundant build step

* Implement graceful shutdown for zebrad start

* Send coverage summary to /dev/null when getting the params path

* Use the correct parameters path and download commands in CI

* Explain pre-downloads

* Avoid calling params_folder twice

* Rename parameter types and methods for consistency

```sh
fastmod SaplingParams SaplingParameters zebra*
fastmod Groth16Params Groth16Parameters zebra*
fastmod PARAMS GROTH16_PARAMETERS zebra*
fastmod params_folder directory zebra*
```

And a manual variable name tweak.

* rustfmt

* Remove a redundant coverage step

Co-authored-by: Janito Vaqueiro Ferreira Filho <janito.vff@gmail.com>
2021-11-19 23:02:56 +00:00
dependabot[bot] bdf5f70557
Bump actions/checkout from 2.3.5 to 2.4.0 (#3009)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.5 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.5...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: teor <teor@riseup.net>
2021-11-05 15:08:39 +10:00
Janito Vaqueiro Ferreira Filho 0960e4fb0b
Update to Tokio 1.13.0 (#2994)
* Update `tower` to version `0.4.9`

Update to latest version to add support for Tokio version 1.

* Replace usage of `ServiceExt::ready_and`

It was deprecated in favor of `ServiceExt::ready`.

* Update Tokio dependency to version `1.13.0`

This will break the build because the code isn't ready for the update,
but future commits will fix the issues.

* Replace import of `tokio::stream::StreamExt`

Use `futures::stream::StreamExt` instead, because newer versions of
Tokio don't have the `stream` feature.

* Use `IntervalStream` in `zebra-network`

In newer versions of Tokio `Interval` doesn't implement `Stream`, so the
wrapper types from `tokio-stream` have to be used instead.

* Use `IntervalStream` in `inventory_registry`

In newer versions of Tokio the `Interval` type doesn't implement
`Stream`, so `tokio_stream::wrappers::IntervalStream` has to be used
instead.

* Use `BroadcastStream` in `inventory_registry`

In newer versions of Tokio `broadcast::Receiver` doesn't implement
`Stream`, so `tokio_stream::wrappers::BroadcastStream` instead. This
also requires changing the error type that is used.

* Handle `Semaphore::acquire` error in `tower-batch`

Newer versions of Tokio can return an error if the semaphore is closed.
This shouldn't happen in `tower-batch` because the semaphore is never
closed.

* Handle `Semaphore::acquire` error in `zebrad` test

On newer versions of Tokio `Semaphore::acquire` can return an error if
the semaphore is closed. This shouldn't happen in the test because the
semaphore is never closed.

* Update some `zebra-network` dependencies

Use versions compatible with Tokio version 1.

* Upgrade Hyper to version 0.14

Use a version that supports Tokio version 1.

* Update `metrics` dependency to version 0.17

And also update the `metrics-exporter-prometheus` to version 0.6.1.
These updates are to make sure Tokio 1 is supported.

* Use `f64` as the histogram data type

`u64` isn't supported as the histogram data type in newer versions of
`metrics`.

* Update the initialization of the metrics component

Make it compatible with the new version of `metrics`.

* Simplify build version counter

Remove all constants and use the new `metrics::incement_counter!` macro.

* Change metrics output line to match on

The snapshot string isn't included in the newer version of
`metrics-exporter-prometheus`.

* Update `sentry` to version 0.23.0

Use a version compatible with Tokio version 1.

* Remove usage of `TracingIntegration`

This seems to not be available from `sentry-tracing` anymore, so it
needs to be replaced.

* Add sentry layer to tracing initialization

This seems like the replacement for `TracingIntegration`.

* Remove unnecessary conversion

Suggested by a Clippy lint.

* Update Cargo lock file

Apply all of the updates to dependencies.

* Ban duplicate tokio dependencies

Also ban git sources for tokio dependencies.

* Stop allowing sentry-tracing git repository in `deny.toml`

* Allow remaining duplicates after the tokio upgrade

* Use C: drive for CI build output on Windows

GitHub Actions uses a Windows image with two disk drives, and the
default D: drive is smaller than the C: drive. Zebra currently uses a
lot of space to build, so it has to use the C: drive to avoid CI build
failures because of insufficient space.

Co-authored-by: teor <teor@riseup.net>
2021-11-02 18:46:57 +00:00
Pili Guerra 989ba51cb9
Update release-checklist.md (#3001)
Include potential changes to the README in the release checklist

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2021-11-02 15:36:47 +00:00
teor 9963471b7c
Check for duplicate crate dependencies in CI (#2986)
* Add default deny.toml for "cargo deny check bans"

`cargo deny init`

* Delete unused "cargo deny" config entries

Also cleanup trailing whitespace.

* Deny duplicate crates and unexpected crate sources

Allow the current set of duplicates and sources,
with references to the tickets that will fix them.

* Check for duplicate dependencies in CI

Also check for:
- unexpected crate sources
- outdated Cargo.lock
  (required for accurate duplicate and source checks)

* Revert CI name changes so required statuses pass

* Fix ticket for sentry-tracing
2021-11-01 21:19:22 +00:00
Deirdre Connolly 0381c2347b
ZIP-401: weighted random mempool eviction (#2889)
* ZIP-401 weighted random mempool eviction

* rename zcash.mempool.total_cost.bytes to zcash.mempool.cost.bytes

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

* Remove duplicated lines

* Add cost() method to UnminedTx

Update serialization failure messages

* More docs quoting ZIP-401 rules

* Change mempool::Storage::new() to handle Copy-less HashMap, HashSet

* mempool: tidy cost types and evict_one()

* More consensus rule docs

* Refactor calculating mempool costs for Unmined transactions

* Add a note on asympotic performance of calculating weights of txs in mempool

* Bump test mempool / storage config to avoid weighted random cost limits

* Use mempool tx_cost_limit = u64::MAX for some tests

* Remove failing tests for now

* Allow(clippy::field-reassign-with-default) because of a move on a type that doesn't impl Copy

* Fix mistaken doctest formatting

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

* Increase test timeout for Windows builds

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2021-10-27 00:21:19 +00:00
Deirdre Connolly 52357f7522
Remove dconnolly as default assignee and reviewer on dependabot PRs, and make them low priority (#2951)
* Remove dconnolly as default assignee and reviewer on dependabot PRs

* Assign dependabot PRs low priority by default

Co-authored-by: teor <teor@riseup.net>
2021-10-26 00:22:51 +00:00
teor 35290db052
Only run fake activation heights tests on zebra-state (#2929)
Also only run the zebrad acceptance tests on macOS.

Re-running the compiler and test binaries for unused crates is slow in CI.

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2021-10-21 23:51:20 +00:00
Marek ffa6fed7b3
Improve the template for release versioning (#2906)
* Specify the location of the user agent string

* Specify the `cargo install` command

* Fix a typo

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2021-10-20 18:02:07 +00:00
dependabot[bot] 0b25257bef
Bump actions/checkout from 2.3.4 to 2.3.5 (#2898)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.3.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: teor <teor@riseup.net>
2021-10-19 04:03:10 +00:00
dependabot[bot] d307d43e19 Bump codecov/codecov-action from 2.0.3 to 2.1.0
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2.0.3 to 2.1.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2.0.3...v2.1.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 15:14:19 -04:00
Deirdre Connolly 0e60936ad3
Restore coverage (#2684)
* Update coverage workflow

* Remove cache layer, up timeout to 60 minutes anyway
2021-08-27 11:03:40 -04:00
Alfredo Garcia ac76d35cbb
Make some small changes to release-checklist.md (#2671)
* Update release-checklist.md

* give all alternatives to check what changed

Co-authored-by: teor <teor@riseup.net>
2021-08-26 22:45:19 +00:00
Conrado Gouvea bc4194fcb9
ZIP-221/244 auth data commitment validation in checkpoint verifier (#2633)
* Add validation of ZIP-221 and ZIP-244 commitments

* Apply suggestions from code review

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

* Add auth commitment check in the finalized state

* Reset the verifier when comitting to state fails

* Add explanation comment

* Add test with fake activation heights

* Add generate_valid_commitments flag

* Enable fake activation heights using env var instead of feature

* Also update initial_tip_hash; refactor into progress_from_tip()

* Improve comments

* Add fake activation heights test to CI

* Fix bug that caused commitment trees to not match when generating partial arbitrary chains

* Add ChainHistoryBlockTxAuthCommitmentHash::from_commitments to organize and deduplicate code

* Remove stale comment, improve readability

* Allow overriding with PROPTEST_CASES

* partial_chain_strategy(): don't update note commitment trees when not needed; add comment

Co-authored-by: teor <teor@riseup.net>
2021-08-23 14:17:33 +00:00
Conrado Gouvea f6416ff8ee
Update to cache v10 (#2644) 2021-08-19 17:33:22 +00:00
Conrado Gouvea 4014e0fec8
Attempt to fix test.yml (#2635)
* Only use -t flag to docker run, set SSH keep alive

* Remove SSH flag for now

* Add ssh flag back to test.yml gcloud compute ssh command

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2021-08-16 19:02:39 -04:00
Conrado Gouvea 32e1237df8
Update cache to v9 (#2598)
* Update cache to v9

* Update state disk image

* Rename

* Remove ending semicolon for remote commands

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2021-08-11 17:11:59 -04:00
Deirdre Connolly 21d71a651e
Merge pull request #2601 from ZcashFoundation/dconnolly-patch-1
Sync to, not past, activation for regenerate-stateful-test-disks.yml
2021-08-11 12:15:22 -04:00
teor e2a3a38047
Disable Rust beta tests in CI, due to a rust bug (#2542) 2021-07-29 13:02:12 +10:00
teor 5684667a31
Update to google-github-actions/setup-gcloud in workflows (#2533)
* Update to google-github-actions/setup-gcloud in workflows

See https://github.com/google-github-actions/setup-gcloud#use-google-github-actionssetup-gcloud

* Also update the Google Cloud test workflow

* Also update regenerate stateful test disks

* Also update Manual Deploy

* Also update zcashd deploy
2021-07-27 12:13:04 -04:00
teor c8305fba1f
Stop using the wrong name for the coverage action (#2453)
Previously the action was called "CI", which could be confusing.
2021-07-07 11:36:54 -03:00
Pili Guerra 515dc4bf5c
Update versions for Zebra v1.0.0 alpha.12 release (#2415)
* Update versions for zebra v1.0.0-alpha.12 release

* Update Cargo.lock

* Update release checklist with latest version changes to help keep track for future releases

* Remove reference to the fact that tower-fallback was not updated
2021-07-01 08:59:32 +01:00
teor 4c321f6fa1 Skip IPv6 network tests in google cloud workflows
Also consistently use the zebra-test:latest docker image.
2021-06-28 23:34:57 -04:00
teor efb2ffbf33 Stop ignoring failed cached state tests
Previously, Zebra's cached state workflows would run all of Zebra's
tests, but they would ignore the results for most tests. They would only
fail if the mainnet cached state test failed.

After this fix, the tests fail if any test or build step fails.
2021-06-28 23:34:57 -04:00
teor 17e94bd241
Stop skipping the cached sync tests in CI (#2402)
This is a bugfix on PR #2314, which changed the name of the test
function in the code, but didn't change the CI workflow.
2021-06-29 12:49:42 +10:00
teor 22f2f06bad
Remove "solution" from the ticket template (#2385)
We want developers to do detailed designs and solutions in
RFCs and code comments, rather than tickets.
2021-06-24 10:43:27 +01:00
Pili Guerra e87933e167
Add CHANGELOG.md file to the zebra git repo (#2346)
* Add new CHANGELOG.md file to zebra git repo

* Update Release Checklist to add updates to CHANGELOG.md

* Add some explanation about the CHANGELOG.md file

* Fix headings to make them consistent with Keep a changelog format

* Small fix for clarity

* Add release dates to changelog

* Change order of steps to update the changelog
2021-06-22 14:31:30 +01:00
Alfredo Garcia 544d182d25
Add and use a function for mandatory checkpoint (#2314)
* add `mandatory_checkpoint_height()` function

* use mandatory checkpoint instead of canopy in acceptance tests
2021-06-18 10:05:28 +10:00
Deirdre Connolly ea15ad1131
Use Swatinem/rust-cache@v1 (#2291) 2021-06-15 11:36:33 +10:00
Deirdre Connolly 28c3a23f14
Replace bespoke source-based coverage config with cargo-llvm-cov (#2286)
* Replace bespoke source-based coverage config with cargo-llvm-cov

* Keep incremental builds disabled

* Use cargo-llvm-cov ^0.1.0-alpha.4

Co-authored-by: teor <teor@riseup.net>
2021-06-15 11:35:26 +10:00