Commit Graph

4253 Commits

Author SHA1 Message Date
Alfredo Garcia 9b1d26538a
Release v1.0.0-rc.4 (#6045)
* bump v1.0.0-rc.4

* Add new mainnet and testnet checkpoints generated using zcashd

* make changes to changelog from review

* move item to new section

* change section name

---------

Co-authored-by: teor <teor@riseup.net>
2023-01-31 04:53:27 +00:00
teor e20cf957e3
fix(consensus): Verify the lock times of mempool transactions (#6027)
* Implement the BestChainNextMedianTimePast state request

* Verify the lock times of mempool transactions

* Document that the mempool already handles lock time rejections correctly

* Fix existing tests

* Add new mempool lock time success and failure tests
2023-01-27 21:46:51 +00:00
dependabot[bot] 7b2f135eca
build(deps): bump actions/github-script from 6.3.3 to 6.4.0 (#6042)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.3.3 to 6.4.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6.3.3...v6.4.0)

---
updated-dependencies:
- dependency-name: actions/github-script
  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>
2023-01-27 16:35:49 +00:00
dependabot[bot] 7acd72b5ec
build(deps): bump toml from 0.5.11 to 0.6.0: changes `zebrad generate` to use double quoted strings, old configs still work (#6029)
* build(deps): bump toml from 0.5.11 to 0.6.0

Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.6.0.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.6.0)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Add production config in toml 0.6.0 format

* Add getblocktemplate feature config in toml 0.6.0 format

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>
2023-01-27 01:01:08 +00:00
dependabot[bot] cda28797d0
build(deps): bump sentry from 0.29.1 to 0.29.2 (#6033)
Bumps [sentry](https://github.com/getsentry/sentry-rust) from 0.29.1 to 0.29.2.
- [Release notes](https://github.com/getsentry/sentry-rust/releases)
- [Changelog](https://github.com/getsentry/sentry-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-rust/compare/0.29.1...0.29.2)

---
updated-dependencies:
- dependency-name: sentry
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-26 19:43:13 +00:00
dependabot[bot] 00e7418372
build(deps): bump sentry-tracing from 0.29.1 to 0.29.2 (#6034)
Bumps [sentry-tracing](https://github.com/getsentry/sentry-rust) from 0.29.1 to 0.29.2.
- [Release notes](https://github.com/getsentry/sentry-rust/releases)
- [Changelog](https://github.com/getsentry/sentry-rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-rust/compare/0.29.1...0.29.2)

---
updated-dependencies:
- dependency-name: sentry-tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-25 20:47:27 +00:00
teor dd90f79b48
fix(clippy): Silence future-incompat warnings until we upgrade Abscissa (#6024)
* Silence future-incompat warnings until we upgrade Abscissa

* Add missing cargo and clippy configs to workflow triggers
2023-01-24 16:27:56 +00:00
Pili Guerra c92f7b0150
feat(actions): add a workflow to automatically add new Zebra issues to projects (#6008)
* Add job to automatically add new Zebra issues to projects

* Apply suggestions from code review

Co-authored-by: Arya <aryasolhi@gmail.com>

* fix(actions): move to the workflows folder and add TODO

* chore: lint

Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-24 01:05:21 +00:00
dependabot[bot] 69a64b6db6
build(deps): bump inferno from 0.11.13 to 0.11.14 (#6022)
Bumps [inferno](https://github.com/jonhoo/inferno) from 0.11.13 to 0.11.14.
- [Release notes](https://github.com/jonhoo/inferno/releases)
- [Changelog](https://github.com/jonhoo/inferno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jonhoo/inferno/compare/v0.11.13...v0.11.14)

---
updated-dependencies:
- dependency-name: inferno
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 23:31:47 +00:00
dependabot[bot] 992807f7dc
build(deps): bump reviewdog/action-actionlint from 1.35.0 to 1.36.0 (#6021)
Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.35.0 to 1.36.0.
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/v1.35.0...v1.36.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 23:31:26 +00:00
Gustavo Valverde 85bcbbdf16
ci: add a test to check that the Docker image config works (#5968)
* ci: add a test to validate Zebra's config file and path

* fix: use `ZEBRA_CONF_PATH` as single variable locating the conf

* fix: do not remove the containers

* fix: use extended regex

* fix: use different steps to validate the conf tests

* fix: do not specify a default CMD for running Docker in test builds

* fix: use actual starting commands for entrypoint

* fix: do not add cargo twice if cargo is in $1

* fix: allow to run `zebrad` in the `tests` stage of Dockerfile

* fix: new entrypoint does not allow an empty CMD

* fix: do not duplicate the `zebrad` command

* fix: segregate configuration jobs

* refactor(entrypoint): handle better parameters conditions

* fix: make `zebrad` an executable command in `tests` stage

* Show the commands that are being executed in the new docker test

* Show full logs without tee or grep

* Apply suggestions from code review

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

* fix: use the actual path inside docker

* fix: use `grep` with exit code

If the container is logging to stderr, piping works only for stdout, so we're adding `2>&1`

* fix: use `grep -q` to get an exit code

* fix: fail if any error is detected

* fix: fail if this test takes more than 5 minutes

* fix: update patch workflows

* feat: test Dockerfile `runtime` config

* fix: depend on the configuration test to continue

Co-authored-by: teor <teor@riseup.net>
2023-01-23 06:41:59 +00:00
Alfredo Garcia d72211fbbe
feat(zebra-checkpoints): make `zebra-checkpoints` work for zebrad backend (#5894)
* make `zebra-checkpoint` util work with zebra as the backend

* update snapshots

* update documentation

* applies suggestions from code review

* irefactor zebra-checkpoints to work with zebra using deserialization of the raw block

* fix imports and derives

* rename mode to backend

* remove old stuff

* fix docs

Co-authored-by: arya2 <aryasolhi@gmail.com>
2023-01-23 04:50:45 +00:00
dependabot[bot] d5399d1eea
build(deps): bump libgit2-sys from 0.14.0+1.5.0 to 0.14.2+1.5.1 (#6014)
Bumps [libgit2-sys](https://github.com/rust-lang/git2-rs) from 0.14.0+1.5.0 to 0.14.2+1.5.1.
- [Release notes](https://github.com/rust-lang/git2-rs/releases)
- [Commits](https://github.com/rust-lang/git2-rs/compare/0.14.0...libgit2-sys-0.14.2)

---
updated-dependencies:
- dependency-name: libgit2-sys
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 04:49:59 +00:00
dependabot[bot] 7c2264436c
build(deps): bump reqwest from 0.11.13 to 0.11.14 (#6010)
* build(deps): bump reqwest from 0.11.13 to 0.11.14

Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.13 to 0.11.14.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.13...v0.11.14)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* try to fix duplicates

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2023-01-23 04:49:13 +00:00
Arya be2c2299b1
change(rpc): Sort transaction hashes like zcashd in getrawmempool RPC response (#5994)
* Sorts transactions like zcashd in getrawmempool

* Simplifies sort logic and condenses duplicate code

* adds comment clarifying the intended byte order for transaction hashes

* Multiplies fee by MAX_BLOCK_BYTES/tx-size instead of tx-size

- Removes feature flag on get_raw_mempool

* Apply suggestions from code review

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

* Always uses `TransactionIds` request in tests

* reverts switch from #[cfg()] to cfg!()

* Adds feature flag to constant

* Updates tests and removes !cfg(not(test))

* Moves up comment

* adds missing transaction_ids

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-23 04:48:18 +00:00
Arya 53b446668e
fix(rpc): Avoid selecting duplicate transactions in block templates (#6006)
* Removes candidate_tx from candidate_txs

- Creates a new WeightedIndex instead of updating the weights

- Logs tx hashes and unpaid_actions in getblocktemplate

* Applies suggestions from PR review.
2023-01-23 02:48:45 +00:00
dependabot[bot] 002782b5b7
build(deps): bump tj-actions/changed-files from 35.4.3 to 35.4.4 (#6009)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 35.4.3 to 35.4.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/v35.4.3...v35.4.4)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-21 23:05:24 +00:00
Conrado Gouvea 6199b1240c
fix typos (#6012) 2023-01-21 15:43:20 +00:00
dependabot[bot] 6f6b13300e
build(deps): bump toml from 0.5.10 to 0.5.11 (#6011)
Bumps [toml](https://github.com/toml-rs/toml) from 0.5.10 to 0.5.11.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.10...toml-v0.5.11)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-21 15:42:59 +00:00
dependabot[bot] 3c04a10e91
build(deps): bump bumpalo from 3.8.0 to 3.12.0 (#6015)
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.8.0 to 3.12.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases)
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.8.0...3.12.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-21 15:42:33 +00:00
teor 6cc38e064b
Inline a format variable (#6007) 2023-01-20 14:11:32 +00:00
dependabot[bot] 81846d81e0
build(deps): bump tj-actions/changed-files from 35.4.1 to 35.4.3 (#6005)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 35.4.1 to 35.4.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/v35.4.1...v35.4.3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-19 19:45:20 +00:00
teor 67194c4336
Fix test dependency from zebra-rpc to zebra-network (#5992) 2023-01-19 09:12:31 +00:00
teor b3a480757a
fix(rpc): Return detailed errors to the RPC client when a block proposal fails (#5993)
* Return detailed errors to the RPC client when a block proposal fails

* Change proposal reject type in acceptance test
2023-01-19 06:41:55 +00:00
Alfredo Garcia de2ed812f6
docs(command): zebra download (#5901)
* document zebra download command

* Apply suggestions from code review

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: teor <teor@riseup.net>

* iremove log

Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: teor <teor@riseup.net>
2023-01-19 05:21:19 +00:00
teor ddda4d036d
fix(ci): Move docker push fix to the setup action (#5998)
* Move docker push fix to the setup action

* Apply docker push fix to the lightwalletd docker build
2023-01-19 03:30:38 +00:00
dependabot[bot] 2018d49907
build(deps): bump tokio from 1.24.1 to 1.24.2 (#5995)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.24.1 to 1.24.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 21:16:37 +00:00
Arya 5f0d5f6432
updates pull request template (#5988) 2023-01-18 02:23:19 +00:00
teor 6a06cbf3ad
test(rpc): Create a script that submits block proposals to zcashd (#5944)
* Revert "Update code that we're going to delete in the next PR anyway"

This reverts commit 1fed70da9e.

* Initial zcash-test-block-template script without block proposal construction

* Try creating block data using jq and printf

* Move proposal_block_from_template() to zebra-rpc and remove eyre dependency

* Implement FromStr for DateTime32 and Duration32

* Basic block-template-to-proposal command without time source handling

* Move block proposal code into its own module

* Use time source in block-template-to-proposal

* Make block-template-to-proposal require the getblocktemplate-rpcs feature

* Use block-template-to-proposal in the test script zcash-rpc-block-template-to-proposal

* Apply new hex formatting to commitments and nonces in block proposal tests

* Re-add missing imports from rebase

* Re-add missing conversions from rebase

* Update to new method name after rebase

* Derive a Default impl

* Restore a comment that was accidentally deleted during the rebase

* Avoid a clippy::unwrap-in-result

* Temporarily fix the code for a disabled test

* Fix tool build with Docker caches

* Make clippy happy with the temporary fix

* Give a pass/fail status for each proposal response

* Accept zcashd block templates in block-template-to-proposal

* Fix pretty printing

* Zebra expects a longpollid, so give it a dummy value

* Add "required" fields which Zebra requires

* Use curtime as the dummy maxtime in zcashd templates

* Support large block proposals by reading proposal data from a file

* Test all valid time modes for each proposal

* Allow the user to set the time command

* Put debug logs into their own files

* Exit with an error status when any proposal is invalid

* Log the date and time to make it easier to match errors to node logs
2023-01-18 02:11:15 +00:00
teor 256b1c0008
fix(clippy): Fix new lints in nightly clippy (#5959)
* Derive default using #[default]

* Implement PartialEq manually to satisfy clippy

* Allow a manual derive in test-only code

* Fix some missing docs warnings in the Docker build
2023-01-18 00:27:42 +00:00
Gustavo Valverde 7e5253e27f
ci(build): fallback to a stable buildkit version for `docker/build-push-action` (#5985) 2023-01-17 22:58:51 +00:00
teor 8c451968ee
fix(diagnostics): Hex-encode debug format of commitments, nonces, and nullifiers (#5960)
* Format commitments and nonces as hex

* Format Sprout and Sapling nullifiers as hex when debugging

* Format Sprout commitments as hex when debugging

* Format redpallas keys as hex when debugging

* Update code that we're going to delete in the next PR anyway
2023-01-17 13:57:22 +00:00
Arya 1bb8a9c924
change(rpc): Add getpeerinfo RPC method (#5951)
* adds ValidateBlock request to state

* adds `Request` enum in block verifier

skips solution check for BlockProposal requests

calls CheckBlockValidity instead of Commit block for BlockProposal requests

* uses new Request in references to chain verifier

* adds getblocktemplate proposal mode response type

* makes getblocktemplate-rpcs feature in zebra-consensus select getblocktemplate-rpcs in zebra-state

* Adds PR review revisions

* adds info log in CheckBlockProposalValidity

* Reverts replacement of match statement

* adds `GetBlockTemplate::capabilities` fn

* conditions calling checkpoint verifier on !request.is_proposal

* updates references to validate_and_commit_non_finalized

* adds snapshot test, updates test vectors

* adds `should_count_metrics` to NonFinalizedState

* Returns an error from chain verifier for block proposal requests below checkpoint height

adds feature flags

* adds "proposal" to GET_BLOCK_TEMPLATE_CAPABILITIES_FIELD

* adds back block::Request to zebra-consensus lib

* updates snapshots

* Removes unnecessary network arg

* skips req in tracing intstrument for read state

* Moves out block proposal validation to its own fn

* corrects `difficulty_threshold_is_valid` docs

adds/fixes some comments, adds TODOs

general cleanup from a self-review.

* Update zebra-state/src/service.rs

* Apply suggestions from code review

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

* Update zebra-rpc/src/methods/get_block_template_rpcs.rs

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

* check best chain tip

* Update zebra-state/src/service.rs

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

* Applies cleanup suggestions from code review

* updates gbt acceptance test to make a block proposal

* fixes json parsing mistake

* adds retries

* returns reject reason if there are no retries left

* moves result deserialization to RPCRequestClient method, adds docs, moves jsonrpc_core to dev-dependencies

* moves sleep(EXPECTED_TX_TIME) out of loop

* updates/adds info logs in retry loop

* Revert "moves sleep(EXPECTED_TX_TIME) out of loop"

This reverts commit f7f0926f4050519687a79afc16656c3f345c004b.

* adds `allow(dead_code)`

* tests with curtime, mintime, & maxtime

* Fixes doc comment

* Logs error responses from chain_verifier CheckProposal requests

* Removes retry loop, adds num_txs log

* removes verbose info log

* sorts mempool_txs before generating merkle root

* Make imports conditional on a feature

* Disable new CI tests until bugs are fixed

* adds support for getpeerinfo RPC

* adds vector test

* Always passes address_book to RpcServer

* Update zebra-network/src/address_book.rs

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

* Renames PeerObserver to AddressBookPeers

* adds getpeerinfo acceptance test

* Asserts that addresses parse into SocketAddr

* adds launches_lightwalletd field to TestType::LaunchWithEmptyState and uses it from the get_peer_info test

* renames peer_observer mod

* uses SocketAddr as `addr` field type in PeerInfo

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-17 07:09:07 +00:00
teor dcf30679bf
fix(rpc): Calculate getblocktemplate RPC testnet min and max times correctly (#5925)
* Clean up some getblocktemplate difficulty code and tests

* Fix minimum difficulty adjustment

* Use clamp rather than max/min

Co-authored-by: Arya <aryasolhi@gmail.com>

* Remove unused imports

* Document the Zebra-specific standard rule that allows testnet miners time to mine a block

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Arya <aryasolhi@gmail.com>
2023-01-17 07:08:43 +00:00
Arya b0ba920a4f
change(test): Create test harness for calling getblocktemplate in proposal mode, but don't use it yet (#5884)
* adds ValidateBlock request to state

* adds `Request` enum in block verifier

skips solution check for BlockProposal requests

calls CheckBlockValidity instead of Commit block for BlockProposal requests

* uses new Request in references to chain verifier

* adds getblocktemplate proposal mode response type

* makes getblocktemplate-rpcs feature in zebra-consensus select getblocktemplate-rpcs in zebra-state

* Adds PR review revisions

* adds info log in CheckBlockProposalValidity

* Reverts replacement of match statement

* adds `GetBlockTemplate::capabilities` fn

* conditions calling checkpoint verifier on !request.is_proposal

* updates references to validate_and_commit_non_finalized

* adds snapshot test, updates test vectors

* adds `should_count_metrics` to NonFinalizedState

* Returns an error from chain verifier for block proposal requests below checkpoint height

adds feature flags

* adds "proposal" to GET_BLOCK_TEMPLATE_CAPABILITIES_FIELD

* adds back block::Request to zebra-consensus lib

* updates snapshots

* Removes unnecessary network arg

* skips req in tracing intstrument for read state

* Moves out block proposal validation to its own fn

* corrects `difficulty_threshold_is_valid` docs

adds/fixes some comments, adds TODOs

general cleanup from a self-review.

* Update zebra-state/src/service.rs

* Apply suggestions from code review

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

* Update zebra-rpc/src/methods/get_block_template_rpcs.rs

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

* check best chain tip

* Update zebra-state/src/service.rs

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

* Applies cleanup suggestions from code review

* updates gbt acceptance test to make a block proposal

* fixes json parsing mistake

* adds retries

* returns reject reason if there are no retries left

* moves result deserialization to RPCRequestClient method, adds docs, moves jsonrpc_core to dev-dependencies

* moves sleep(EXPECTED_TX_TIME) out of loop

* updates/adds info logs in retry loop

* Revert "moves sleep(EXPECTED_TX_TIME) out of loop"

This reverts commit f7f0926f4050519687a79afc16656c3f345c004b.

* adds `allow(dead_code)`

* tests with curtime, mintime, & maxtime

* Fixes doc comment

* Logs error responses from chain_verifier CheckProposal requests

* Removes retry loop, adds num_txs log

* removes verbose info log

* sorts mempool_txs before generating merkle root

* Make imports conditional on a feature

* Disable new CI tests until bugs are fixed

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-17 04:03:40 +00:00
dependabot[bot] 402ed3eaac
build(deps): bump mset from 0.1.0 to 0.1.1 (#5952)
Bumps [mset](https://github.com/lonnen/mset) from 0.1.0 to 0.1.1.
- [Release notes](https://github.com/lonnen/mset/releases)
- [Commits](https://github.com/lonnen/mset/commits)

---
updated-dependencies:
- dependency-name: mset
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-17 01:12:14 +00:00
Gustavo Valverde e21d8f9328
feat(ci): delete unused artifacts in registries (#5873)
* feat(ci): delete unused artifacts in registries

Previous behavior:
Docker artifacts are costing us a good part of our infrastructure budget,
and we needed a way to remove unused artifacts.

Expected behavior:
Delete unused (not just old) docker artifacts in GAR (Google Artifact Registry),
preferably using a generic solution is this needs to be expanded into other
Docker registries.

Solution:
Implement GCR Cleaner https://github.com/GoogleCloudPlatform/gcr-cleaner,
as this tools provided integration with `docker/login-action` to interact
with multiple Docker v2 registries.

* fix(action): use hours instead of days

* chore: add TODO

* Update .github/workflows/delete-gcp-resources.yml

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

* fix: allow the action to fail if some images can't be deleted

Co-authored-by: teor <teor@riseup.net>
2023-01-16 23:38:14 +00:00
teor c2896cce4b
change(deps): Remove unused zebra-utils dependencies (#5961)
* Remove unused zebra-utils dependencies

* Cleanup zebra-checkpoints
2023-01-16 21:39:47 +00:00
dependabot[bot] 7308dd5b73
build(deps): bump docker/build-push-action from 3.2.0 to 3.3.0 (#5956)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v3.2.0...v3.3.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 08:27:49 +00:00
dependabot[bot] 4dcd58a048
build(deps): bump docker/metadata-action from 4.2.0 to 4.3.0 (#5955)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v4.2.0...v4.3.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-16 05:40:16 +00:00
Arya a8bfb1b8dc
sorts mempool_txs before generating merkle root (#5953) 2023-01-16 03:37:39 +00:00
dependabot[bot] 7b7569c904
build(deps): bump tj-actions/changed-files from 35.4.0 to 35.4.1 (#5950)
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 35.4.0 to 35.4.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/v35.4.0...v35.4.1)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-15 00:36:29 +00:00
dependabot[bot] 1cf2d68209
build(deps): bump docker/metadata-action from 4.1.1 to 4.2.0 (#5945)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 4.1.1 to 4.2.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/v4.1.1...v4.2.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>

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>
2023-01-15 00:36:12 +00:00
dependabot[bot] 99a2da6182
build(deps): bump serde_with from 2.1.0 to 2.2.0 (#5938)
Bumps [serde_with](https://github.com/jonasbb/serde_with) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/jonasbb/serde_with/releases)
- [Commits](https://github.com/jonasbb/serde_with/compare/v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: serde_with
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

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>
2023-01-12 06:45:00 +00:00
Arya 3cbee9465a
change(rpc): Add proposal capability to getblocktemplate (#5870)
* adds ValidateBlock request to state

* adds `Request` enum in block verifier

skips solution check for BlockProposal requests

calls CheckBlockValidity instead of Commit block for BlockProposal requests

* uses new Request in references to chain verifier

* adds getblocktemplate proposal mode response type

* makes getblocktemplate-rpcs feature in zebra-consensus select getblocktemplate-rpcs in zebra-state

* Adds PR review revisions

* adds info log in CheckBlockProposalValidity

* Reverts replacement of match statement

* adds `GetBlockTemplate::capabilities` fn

* conditions calling checkpoint verifier on !request.is_proposal

* updates references to validate_and_commit_non_finalized

* adds snapshot test, updates test vectors

* adds `should_count_metrics` to NonFinalizedState

* Returns an error from chain verifier for block proposal requests below checkpoint height

adds feature flags

* adds "proposal" to GET_BLOCK_TEMPLATE_CAPABILITIES_FIELD

* adds back block::Request to zebra-consensus lib

* updates snapshots

* Removes unnecessary network arg

* skips req in tracing intstrument for read state

* Moves out block proposal validation to its own fn

* corrects `difficulty_threshold_is_valid` docs

adds/fixes some comments, adds TODOs

general cleanup from a self-review.

* Update zebra-state/src/service.rs

* Apply suggestions from code review

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

* Update zebra-rpc/src/methods/get_block_template_rpcs.rs

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

* check best chain tip

* Update zebra-state/src/service.rs

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

* Applies cleanup suggestions from code review

Co-authored-by: teor <teor@riseup.net>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2023-01-11 23:39:51 +00:00
dependabot[bot] 6e61066c7e
build(deps): bump prost from 0.11.5 to 0.11.6 (#5946)
Bumps [prost](https://github.com/tokio-rs/prost) from 0.11.5 to 0.11.6.
- [Release notes](https://github.com/tokio-rs/prost/releases)
- [Commits](https://github.com/tokio-rs/prost/compare/v0.11.5...v0.11.6)

---
updated-dependencies:
- dependency-name: prost
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-11 21:03:13 +00:00
Gustavo Valverde b0604080cb
ci: reduce the amount of API calls made by `arduino/setup-protoc@v1` (#5930)
* ci: reduce the amount of API calls made by `arduino/setup-protoc@v1`

If the `protoc` compiler version is not available locally, the action will look for the most recent version. We use a fixed version to reduce the amount of API calls being done in all workflows, but mainly on `build-crates-individually.yml`

* fix: decrease `protoc` version until the action is fixed
2023-01-10 21:22:03 +00:00
dependabot[bot] 943a72a0bb
build(deps): bump insta from 1.24.1 to 1.26.0 (#5931)
Bumps [insta](https://github.com/mitsuhiko/insta) from 1.24.1 to 1.26.0.
- [Release notes](https://github.com/mitsuhiko/insta/releases)
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mitsuhiko/insta/compare/1.24.1...1.26.0)

---
updated-dependencies:
- dependency-name: insta
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-10 10:11:27 +00:00
Gustavo Valverde fb3cc7b74c
fix(ci): remove warnings caused by missing `actions/checkout` step (#5874)
* fix(ci): remove warnings caused by missing `actions/checkout`

* fix: typo in arguments

* fix: add the whole disk name as this is a single instance

* fix: add dis name to mount
2023-01-10 10:11:11 +00:00
Arya 99cbffbcc0
change(docs): Update 'Design Overview' page of Zebra book (#5892)
* Updates design overview page of book with:
- a simplified graph of service dependencies in design overview
- links to notable blog posts
- removals of some out-of-date text

also corrects issue/pr refs in an rfc

* Updates service dependencies diagram

* Apply suggestions from code review

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

* updates diagram and adds doc links

* uses opacity to indicate clickability instead of drop shadow

Co-authored-by: teor <teor@riseup.net>
2023-01-10 10:10:45 +00:00