From 9ae55853adf62fd25292cd5028ab8b34b4bf244b Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 11 Dec 2023 21:08:59 +0000 Subject: [PATCH 1/6] fix(ci): use official `codespell` action (#8087) --- .github/workflows/ci-lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 701f1c1c661..50296e738c1 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -160,7 +160,7 @@ jobs: needs: changed-files steps: - uses: actions/checkout@v4.1.1 - - uses: plettich/action-codespell@master + - uses: codespell-project/actions-codespell@v2.0 with: - github_token: ${{ secrets.github_token }} - level: warning + only_warn: 1 + From fc478ebb326e22482db8ed734839c976a8c39855 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 11 Dec 2023 22:32:53 +0000 Subject: [PATCH 2/6] fix(ci): use a bigger machine for config file tests (#8088) * fix(ci): use a bigger machine for config file tests * chore: run `Docker Unit Tests` if `sub-test-zebra-config.yml` changes --- .github/workflows/ci-unit-tests-docker.yml | 1 + .github/workflows/sub-test-zebra-config.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-unit-tests-docker.yml b/.github/workflows/ci-unit-tests-docker.yml index a0a1e7c115e..62a2514f4c9 100644 --- a/.github/workflows/ci-unit-tests-docker.yml +++ b/.github/workflows/ci-unit-tests-docker.yml @@ -43,6 +43,7 @@ on: - '.github/workflows/sub-deploy-integration-tests-gcp.yml' - '.github/workflows/sub-build-docker-image.yml' - '.github/workflows/sub-find-cached-disks.yml' + - '.github/workflows/sub-test-zebra-config.yml' push: branches: diff --git a/.github/workflows/sub-test-zebra-config.yml b/.github/workflows/sub-test-zebra-config.yml index 6ed561cbd7e..5fd84012065 100644 --- a/.github/workflows/sub-test-zebra-config.yml +++ b/.github/workflows/sub-test-zebra-config.yml @@ -32,7 +32,7 @@ jobs: test-docker-config: name: Test ${{ inputs.test_id }} in Docker timeout-minutes: 30 - runs-on: ubuntu-latest + runs-on: ubuntu-latest-m steps: - uses: actions/checkout@v4.1.1 with: From e5b810a52a85abe7aaae87568be965407cdb865b Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 11 Dec 2023 22:33:03 +0000 Subject: [PATCH 3/6] imp(ci): fix `codespell` words and ignore others (#8089) This cleans the annotations on every PR, so it doesn't show up from now on. --- .codespellrc | 2 +- CHANGELOG.md | 8 ++++---- book/src/user/fork-zebra-testnet.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.codespellrc b/.codespellrc index abf12fb0d05..2d242dca9ff 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,3 @@ [codespell] -ignore-words-list=crate,Sur,inout +ignore-words-list=crate,Sur,inout,Groth,groth,re-use, exclude-file=book/mermaid.min.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b1544f4737..e04d5a76f98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1623,7 +1623,7 @@ Zebra's latest beta fixes a `cargo install` build failure in the previous beta r #### Logging -- Log hashes as hex strings in block committment errors (#4021) +- Log hashes as hex strings in block commitment errors (#4021) #### Tests @@ -1665,7 +1665,7 @@ As part of the RPC changes, we made performance improvements to cached state acc #### Others - Added `TransactionsByMinedId` to mempool (#3907) -- Added code owners and automatic review assigment to the repository (#3677 #3708 #3718) +- Added code owners and automatic review assignment to the repository (#3677 #3708 #3718) - Validate ZIP-212 grace period blocks using checkpoints (#3889) - Store Sapling and Orchard note commitment trees in finalized and non-finalized state (#3818) - Get addresses from transparent outputs (#3802) @@ -2388,7 +2388,7 @@ Zebra's latest alpha continues our work on NU5, including Orchard and Transactio - Test consensus-critical Amount deserialization (#2487) - Update to use new GitHub action names in Google Cloud workflows (#2533) -- Add test intialization helper function for tests (#2539) +- Add test initialization helper function for tests (#2539) ### Changed @@ -2981,7 +2981,7 @@ Some notable changes include: ### Changed - Export new precompute api in zebra-script (#1493) -- Rewrite peer block request hander to match the zcashd implementation (#1518) +- Rewrite peer block request handler to match the zcashd implementation (#1518) ### Fixed - Avoid panics when there are multiple failures on the same connection (#1600) diff --git a/book/src/user/fork-zebra-testnet.md b/book/src/user/fork-zebra-testnet.md index 3bf72b7a634..a7bf7b410c4 100644 --- a/book/src/user/fork-zebra-testnet.md +++ b/book/src/user/fork-zebra-testnet.md @@ -67,7 +67,7 @@ After the changes, check that the library can be built with `cargo build --relea ## Zebra -Here we are making changes to create an isolated network version of Zebra. In addition to your own changes, this Zebra version needs to have the followings: +Here we are making changes to create an isolated network version of Zebra. In addition to your own changes, this Zebra version needs to have the following: - Add a `Nu6` variant to the `NetworkUpgrade` enum located in `zebra-chain/src/parameters/network_upgrade.rs`. - Add consensus branch id, a random non-repeated string. We used `00000006` in our tests when writing this tutorial. From b0b8b1a02837464e368a219a9aa9d0586a41e7b4 Mon Sep 17 00:00:00 2001 From: Arya Date: Mon, 11 Dec 2023 18:39:01 -0500 Subject: [PATCH 4/6] cargo update (#8086) --- Cargo.lock | 488 +++++++++++++++++++++++++++++++---------------------- deny.toml | 1 + 2 files changed, 286 insertions(+), 203 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b0908dc2463..285f3542735 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,7 +12,7 @@ dependencies = [ "arc-swap", "backtrace", "canonical-path", - "clap 4.4.10", + "clap 4.4.11", "color-eyre", "fs-err", "once_cell", @@ -84,7 +84,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", "version_check", "zerocopy", @@ -137,9 +137,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -157,30 +157,30 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -209,9 +209,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" +checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" dependencies = [ "flate2", "futures-core", @@ -239,7 +239,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -250,7 +250,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -408,14 +408,14 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] name = "bindgen" -version = "0.68.1" +version = "0.69.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" +checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" dependencies = [ "bitflags 2.4.1", "cexpr", @@ -430,7 +430,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.38", + "syn 2.0.40", "which", ] @@ -562,9 +562,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -766,9 +766,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.10" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -776,9 +776,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -795,7 +795,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -832,9 +832,9 @@ dependencies = [ [[package]] name = "color-spantrace" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" +checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" dependencies = [ "once_cell", "owo-colors", @@ -912,9 +912,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -922,9 +922,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -953,7 +953,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.4.10", + "clap 4.4.11", "criterion-plot", "is-terminal", "itertools 0.10.5", @@ -1065,7 +1065,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -1089,7 +1089,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -1106,7 +1106,7 @@ checksum = "2fa16a70dd58129e4dfffdff535fb1bce66673f7bbeec4a5a1765a504e1ccd84" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -1154,7 +1154,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -1176,7 +1176,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -1201,9 +1201,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", "serde", @@ -1249,14 +1249,14 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] name = "dyn-clone" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ed25519" @@ -1277,7 +1277,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "hex", "rand_core 0.6.4", "serde", @@ -1354,19 +1354,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "eyre" -version = "0.6.8" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +checksum = "8bbb8258be8305fb0237d7b295f47bb24ff1b136a535f473baf40e70468515aa" dependencies = [ "indenter", "once_cell", @@ -1400,9 +1400,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "fixed-hash" @@ -1453,9 +1453,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1476,9 +1476,12 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "funty" @@ -1542,7 +1545,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -1598,9 +1601,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1611,9 +1614,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git2" @@ -1636,15 +1639,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1661,9 +1664,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1671,7 +1674,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", "tokio-util 0.7.10", @@ -1741,9 +1744,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -1751,11 +1754,11 @@ dependencies = [ [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", "byteorder", "flate2", "nom", @@ -1862,9 +1865,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -1873,9 +1876,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1991,9 +1994,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2052,7 +2055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "serde", ] @@ -2167,9 +2170,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -2182,9 +2185,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -2266,11 +2269,11 @@ dependencies = [ [[package]] name = "known-folders" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b6f1427d9c43b1cce87434c4d9eca33f43bdbb6246a762aa823a582f74c1684" +checksum = "4397c789f2709d23cfcb703b316e0766a8d4b17db2d47b0ab096ef6047cae1d8" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2290,9 +2293,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libgit2-sys" @@ -2322,6 +2325,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -2366,9 +2380,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -2496,7 +2510,7 @@ checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -2537,9 +2551,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -2564,7 +2578,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] @@ -2681,9 +2695,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -2775,9 +2789,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -2789,11 +2803,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -2891,9 +2905,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -2926,7 +2940,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -2967,7 +2981,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -3000,9 +3014,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.1.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "plotters" @@ -3045,9 +3059,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "powerfmt" @@ -3068,7 +3082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -3093,12 +3107,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "toml_edit 0.20.7", ] [[package]] @@ -3127,9 +3140,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -3177,9 +3190,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck 0.4.1", @@ -3192,7 +3205,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.38", + "syn 2.0.40", "tempfile", "which", ] @@ -3207,14 +3220,14 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] name = "prost-types" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] @@ -3347,7 +3360,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] @@ -3448,12 +3461,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.11", + "libredox", "thiserror", ] @@ -3569,12 +3582,12 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.10", + "getrandom 0.2.11", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -3658,34 +3671,34 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.5", + "ring 0.17.7", "rustls-webpki", "sct", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64 0.21.5", ] @@ -3696,7 +3709,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -3720,9 +3733,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -3745,7 +3758,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -3914,7 +3927,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -3998,7 +4011,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -4050,9 +4063,12 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core 0.6.4", +] [[package]] name = "similar" @@ -4077,9 +4093,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" @@ -4140,9 +4156,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -4215,9 +4231,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" dependencies = [ "proc-macro2", "quote", @@ -4284,9 +4300,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -4317,7 +4333,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -4388,9 +4404,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ "backtrace", "bytes", @@ -4424,7 +4440,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -4522,9 +4538,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.1.0", "toml_datetime", @@ -4581,7 +4597,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -4699,7 +4715,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] @@ -4819,9 +4835,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -4873,9 +4889,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -4934,9 +4950,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" +checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" dependencies = [ "base64 0.21.5", "log", @@ -4949,9 +4965,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4967,9 +4983,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ "serde", ] @@ -5109,9 +5125,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -5119,24 +5135,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -5146,9 +5162,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5156,28 +5172,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -5185,9 +5201,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -5259,6 +5275,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -5289,6 +5314,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -5301,6 +5341,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -5313,6 +5359,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -5325,6 +5377,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -5337,6 +5395,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -5349,6 +5413,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -5361,6 +5431,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -5373,11 +5449,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "cb877ca3232bec99a6472ed63f7241de2a250165260908b2d24c09d867907a85" dependencies = [ "memchr", ] @@ -5571,7 +5653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8deff8ea47cbe2a008abefedc1a2d9c0e48a87844379759ace270a0b53353c71" dependencies = [ "bellman", - "bindgen 0.68.1", + "bindgen 0.69.1", "blake2b_simd", "blake2s_simd", "bls12_381", @@ -5932,7 +6014,7 @@ dependencies = [ "abscissa_core", "atty", "chrono", - "clap 4.4.10", + "clap 4.4.11", "color-eyre", "console-subscriber", "dirs", @@ -5995,29 +6077,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.21" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686b7e407015242119c33dab17b8f61ba6843534de936d94368856528eae4dcc" +checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.21" +version = "0.7.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020f3dfe25dfc38dfea49ce62d5d45ecdd7f0d8a724fa63eb36b6eba4ec76806" +checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -6030,5 +6112,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.40", ] diff --git a/deny.toml b/deny.toml index 44a6abcb756..510e11b0902 100644 --- a/deny.toml +++ b/deny.toml @@ -100,6 +100,7 @@ skip-tree = [ # wait for console-subscriber and tower to update hdrhistogram. # also wait for ron to update insta, and wait for tonic update. { name = "base64", version = "=0.13.1" }, + { name = "windows-sys", version = "=0.45.0" }, # wait for proptest's rusty-fork dependency to upgrade quick-error { name = "quick-error", version = "=1.2.3" }, From 5bdad1bcaa0d246bccce9926f31adc9f0f52bd82 Mon Sep 17 00:00:00 2001 From: Arya Date: Mon, 11 Dec 2023 19:44:15 -0500 Subject: [PATCH 5/6] Release Zebra 1.5.0 (#8027) * adds a summary to changelog * chore: Release * Apply suggestions from code review * updates Changelog.md * updates changelog.md * mentions/updates MSRV * updates checkpoints * updates ESTIMATE_RELEASE_HEIGHT * Apply suggestions from code review Co-authored-by: teor * updates estimated release height * combines changelog entries about scanner db * zebra-scan is still in alpha * Update CHANGELOG.md * update release checklist for zebra-scan * use fastmod to update zebra-scan version * corrects zebra-scan version requirement in zebrad * Applies suggestions from review * updates changelog * Update zebrad/src/components/sync/end_of_support.rs --------- Co-authored-by: teor --- .../release-checklist.md | 4 +- CHANGELOG.md | 56 +++++++ Cargo.lock | 26 ++-- book/src/user/docker.md | 2 +- book/src/user/install.md | 4 +- tower-batch-control/Cargo.toml | 2 +- tower-fallback/Cargo.toml | 2 +- zebra-chain/Cargo.toml | 4 +- zebra-consensus/Cargo.toml | 14 +- .../src/checkpoint/main-checkpoints.txt | 115 +++++++++++++++ .../src/checkpoint/test-checkpoints.txt | 139 ++++++++++++++++++ zebra-network/Cargo.toml | 4 +- zebra-node-services/Cargo.toml | 4 +- zebra-rpc/Cargo.toml | 14 +- zebra-scan/Cargo.toml | 2 +- zebra-script/Cargo.toml | 4 +- zebra-state/Cargo.toml | 6 +- zebra-test/Cargo.toml | 2 +- zebra-utils/Cargo.toml | 10 +- zebrad/Cargo.toml | 20 +-- zebrad/src/components/sync/end_of_support.rs | 2 +- 21 files changed, 374 insertions(+), 62 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/release-checklist.md b/.github/PULL_REQUEST_TEMPLATE/release-checklist.md index e25f0b64ce9..adf1395161f 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release-checklist.md +++ b/.github/PULL_REQUEST_TEMPLATE/release-checklist.md @@ -83,7 +83,9 @@ Check that the release will work: - [ ] Update crate versions, commit the changes to the release branch, and do a release dry-run: ```sh -cargo release version --verbose --execute --allow-branch '*' --workspace --exclude zebrad beta +cargo release version --verbose --execute --allow-branch '*' --workspace --exclude zebrad --exclude zebra-scan beta +# Due to a bug in cargo-release, we need to pass an exact version here +cargo release version --verbose --execute --allow-branch '*' --package zebra-scan 0.1.0-alpha.1 cargo release version --verbose --execute --allow-branch '*' --package zebrad patch # [ major | minor | patch ] cargo release replace --verbose --execute --allow-branch '*' --package zebrad cargo release commit --verbose --execute --allow-branch '*' diff --git a/CHANGELOG.md b/CHANGELOG.md index e04d5a76f98..dea8996f90f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,62 @@ All notable changes to Zebra are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org). +## [Zebra 1.5.0](https://github.com/ZcashFoundation/zebra/releases/tag/v1.5.0) - 2023-11-28 + +This release: +- fixes a panic that was introduced in Zebra v1.4.0, which happens in rare circumstances when reading cached sprout or history trees. +- further improves how Zebra recovers from network interruptions and prevents potential network hangs. +- limits the ability of synthetic nodes to spread throughout the network through Zebra to address some of the Ziggurat red team report. + +As of this release, Zebra requires Rust 1.73 to build. + +Finally, we've added an experimental "shielded-scan" feature and the zebra-scan crate as steps +towards supporting shielded scanning in Zebra. This feature has known security issues. +It is for experimental use only. Ongoing development is tracked in issue [#7728](https://github.com/ZcashFoundation/zebra/issues/7728). + +### Important Security Warning + +Do not use regular or sensitive viewing keys with Zebra's experimental scanning feature. Do not use this +feature on a shared machine. We suggest generating new keys for experimental use. + +### Security + +- security(net): Stop sending peer addresses from version messages directly to the address book ([#7977](https://github.com/ZcashFoundation/zebra/pull/7977)) +- security(net): Limit how many addresses are sent directly to the address book for a single peer address message ([#7952](https://github.com/ZcashFoundation/zebra/pull/7952)) +- security(net): Rate-limit GetAddr responses to avoid sharing the entire address book over a short period ([#7955](https://github.com/ZcashFoundation/zebra/pull/7955)) + +### Added + +- feat(config): Add config field for the viewing keys used by zebra-scan ([#7949](https://github.com/ZcashFoundation/zebra/pull/7949)) +- feat(scan): Add on-disk database to store keys and scan results ([#7942](https://github.com/ZcashFoundation/zebra/pull/7942), [#8036](https://github.com/ZcashFoundation/zebra/pull/8036)) +- feat(scan): Spawn zebra-scan task from zebrad with configured viewing keys ([#7989](https://github.com/ZcashFoundation/zebra/pull/7989)) +- feat(scan): Create a scan_block function to use across scanning tasks ([#7994](https://github.com/ZcashFoundation/zebra/pull/7994)) +- feat(scan): Scan blocks with Sapling keys and write the results to the database ([#8040](https://github.com/ZcashFoundation/zebra/pull/8040)) +- poc(scan): Proof of concept for shielded scanning ([#7758](https://github.com/ZcashFoundation/zebra/pull/7758)) +- add(docker): Add `ldb` RocksDB query tool to the Dockerfile ([#8074](https://github.com/ZcashFoundation/zebra/pull/8074)) + +### Changed + +- change(state): Expose ZebraDb methods that can create different kinds of databases ([#8002](https://github.com/ZcashFoundation/zebra/pull/8002)) +- change(state): Make the types for finalized blocks consistent ([#7923](https://github.com/ZcashFoundation/zebra/pull/7923)) +- change(scan): Create a scanner storage database ([#8031](https://github.com/ZcashFoundation/zebra/pull/8031)) +- change(scan): Store scanned TXIDs in "display order" ([#8057](https://github.com/ZcashFoundation/zebra/pull/8057)) +- change(scan): Create a function that scans one block by height, and stores the results in the database ([#8045](https://github.com/ZcashFoundation/zebra/pull/8045)) +- change(scan): Store one transaction ID per database row, to make queries easier ([#8062](https://github.com/ZcashFoundation/zebra/pull/8062)) +- change(log): Silence verbose failed connection logs ([#8072](https://github.com/ZcashFoundation/zebra/pull/8072)) + +### Fixed + +- fix(db): Fix a sprout/history tree read panic in Zebra v1.4.0, which only happens before the 25.3.0 state upgrade completes ([#7972](https://github.com/ZcashFoundation/zebra/pull/7972)) +- fix(net): Fix potential network hangs, and reduce code complexity ([#7859](https://github.com/ZcashFoundation/zebra/pull/7859)) +- fix(scan): Start scanning task only if there are keys to scan ([#8059](https://github.com/ZcashFoundation/zebra/pull/8059)) +- fix(rpc): Make the `verbose` argument of the `getrawtransaction` RPC optional ([#8076](https://github.com/ZcashFoundation/zebra/pull/8076)) + +### Contributors + +Thank you to everyone who contributed to this release, we couldn't make Zebra without you: +@arya2, @oxarbitrage, @teor2345 and @upbqdn + ## [Zebra 1.4.0](https://github.com/ZcashFoundation/zebra/releases/tag/v1.4.0) - 2023-11-07 Zebra's mining RPCs are now available in release builds. Our Docker images are significantly diff --git a/Cargo.lock b/Cargo.lock index 285f3542735..6219729c88b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4623,7 +4623,7 @@ dependencies = [ [[package]] name = "tower-batch-control" -version = "0.2.41-beta.7" +version = "0.2.41-beta.8" dependencies = [ "color-eyre", "ed25519-zebra", @@ -4647,7 +4647,7 @@ dependencies = [ [[package]] name = "tower-fallback" -version = "0.2.41-beta.7" +version = "0.2.41-beta.8" dependencies = [ "futures-core", "pin-project", @@ -5685,7 +5685,7 @@ dependencies = [ [[package]] name = "zebra-chain" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "bitflags 2.4.1", "bitflags-serde-legacy", @@ -5746,7 +5746,7 @@ dependencies = [ [[package]] name = "zebra-consensus" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "bellman", "blake2b_simd", @@ -5792,7 +5792,7 @@ dependencies = [ [[package]] name = "zebra-network" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "bitflags 2.4.1", "byteorder", @@ -5833,7 +5833,7 @@ dependencies = [ [[package]] name = "zebra-node-services" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "color-eyre", "jsonrpc-core", @@ -5845,7 +5845,7 @@ dependencies = [ [[package]] name = "zebra-rpc" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "chrono", "futures", @@ -5877,7 +5877,7 @@ dependencies = [ [[package]] name = "zebra-scan" -version = "0.1.0-alpha.0" +version = "0.1.0-alpha.1" dependencies = [ "bls12_381", "chrono", @@ -5903,7 +5903,7 @@ dependencies = [ [[package]] name = "zebra-script" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "displaydoc", "hex", @@ -5916,7 +5916,7 @@ dependencies = [ [[package]] name = "zebra-state" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "bincode", "chrono", @@ -5960,7 +5960,7 @@ dependencies = [ [[package]] name = "zebra-test" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "color-eyre", "futures", @@ -5988,7 +5988,7 @@ dependencies = [ [[package]] name = "zebra-utils" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" dependencies = [ "color-eyre", "hex", @@ -6009,7 +6009,7 @@ dependencies = [ [[package]] name = "zebrad" -version = "1.4.0" +version = "1.5.0" dependencies = [ "abscissa_core", "atty", diff --git a/book/src/user/docker.md b/book/src/user/docker.md index 0d37b7a847e..00228e1c158 100644 --- a/book/src/user/docker.md +++ b/book/src/user/docker.md @@ -17,7 +17,7 @@ docker run --detach zfnd/zebra:latest ### Build it locally ```shell -git clone --depth 1 --branch v1.4.0 https://github.com/ZcashFoundation/zebra.git +git clone --depth 1 --branch v1.5.0 https://github.com/ZcashFoundation/zebra.git docker build --file docker/Dockerfile --target runtime --tag zebra:local . docker run --detach zebra:local ``` diff --git a/book/src/user/install.md b/book/src/user/install.md index b4ca55b7eff..74881939274 100644 --- a/book/src/user/install.md +++ b/book/src/user/install.md @@ -19,7 +19,7 @@ To compile Zebra directly from GitHub, or from a GitHub release source archive: ```sh git clone https://github.com/ZcashFoundation/zebra.git cd zebra -git checkout v1.4.0 +git checkout v1.5.0 ``` 3. Build and Run `zebrad` @@ -32,7 +32,7 @@ target/release/zebrad start ### Compiling from git using cargo install ```sh -cargo install --git https://github.com/ZcashFoundation/zebra --tag v1.4.0 zebrad +cargo install --git https://github.com/ZcashFoundation/zebra --tag v1.5.0 zebrad ``` ### Compiling on ARM diff --git a/tower-batch-control/Cargo.toml b/tower-batch-control/Cargo.toml index ab988483aeb..8b12c70d55f 100644 --- a/tower-batch-control/Cargo.toml +++ b/tower-batch-control/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tower-batch-control" -version = "0.2.41-beta.7" +version = "0.2.41-beta.8" authors = ["Zcash Foundation ", "Tower Maintainers "] description = "Tower middleware for batch request processing" # # Legal diff --git a/tower-fallback/Cargo.toml b/tower-fallback/Cargo.toml index ad10c2713bc..791093a3a48 100644 --- a/tower-fallback/Cargo.toml +++ b/tower-fallback/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tower-fallback" -version = "0.2.41-beta.7" +version = "0.2.41-beta.8" authors = ["Zcash Foundation "] description = "A Tower service combinator that sends requests to a first service, then retries processing on a second fallback service if the first service errors." license = "MIT OR Apache-2.0" diff --git a/zebra-chain/Cargo.toml b/zebra-chain/Cargo.toml index a87d6f232ea..bf3f03cedfb 100644 --- a/zebra-chain/Cargo.toml +++ b/zebra-chain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-chain" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "Core Zcash data structures" license = "MIT OR Apache-2.0" @@ -126,7 +126,7 @@ proptest-derive = { version = "0.4.0", optional = true } rand = { version = "0.8.5", optional = true } rand_chacha = { version = "0.3.1", optional = true } -zebra-test = { path = "../zebra-test/", version = "1.0.0-beta.31", optional = true } +zebra-test = { path = "../zebra-test/", version = "1.0.0-beta.32", optional = true } [dev-dependencies] # Benchmarks diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index 3406fd422ca..731e6c1f565 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-consensus" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "Implementation of Zcash consensus checks" license = "MIT OR Apache-2.0" @@ -63,13 +63,13 @@ orchard = "0.6.0" zcash_proofs = { version = "0.13.0-rc.1", features = ["multicore" ] } wagyu-zcash-parameters = "0.2.0" -tower-fallback = { path = "../tower-fallback/", version = "0.2.41-beta.7" } -tower-batch-control = { path = "../tower-batch-control/", version = "0.2.41-beta.7" } +tower-fallback = { path = "../tower-fallback/", version = "0.2.41-beta.8" } +tower-batch-control = { path = "../tower-batch-control/", version = "0.2.41-beta.8" } -zebra-script = { path = "../zebra-script", version = "1.0.0-beta.31" } -zebra-state = { path = "../zebra-state", version = "1.0.0-beta.31" } -zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.31" } -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31" } +zebra-script = { path = "../zebra-script", version = "1.0.0-beta.32" } +zebra-state = { path = "../zebra-state", version = "1.0.0-beta.32" } +zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.32" } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32" } # prod feature progress-bar howudoin = { version = "0.1.2", optional = true } diff --git a/zebra-consensus/src/checkpoint/main-checkpoints.txt b/zebra-consensus/src/checkpoint/main-checkpoints.txt index 189a5032a81..145b5b7696c 100644 --- a/zebra-consensus/src/checkpoint/main-checkpoints.txt +++ b/zebra-consensus/src/checkpoint/main-checkpoints.txt @@ -11303,3 +11303,118 @@ 2275098 0000000000e65beaf7965aae4c0a912d11ca8f9bacd7b29c2b85586ead491081 2275498 0000000000abbda1bf3dab5f2211700e5df3854c402fa45d5f55856b64dd57cc 2275898 00000000003fd9806ce4571eacd5dea635bf87801f69b65f5491e571d292be0f +2276298 000000000081478c35afefe71c5514915c7b82c50dde006c716bb0b7bcf6ed1d +2276698 0000000001097d10dca940448201b610d4ca8b25696ce37194a506564de8d54c +2277098 0000000001a1c8223c08e8a526eb8b4e1dc75dce32bbbc9f45c6f0eec025fc5f +2277498 0000000001bb2ce9a9098171c023c6e6bdc5a491787a8762195ccd3244b51d9a +2277898 0000000001aa50561c65f5dbb17e1be03d4a48ad07dc3e4c2f455bb51f051a8b +2278298 00000000014ab4ef48e0a1fbfc3730a7cdbc5e4e59315ad575d1ed64bf3eaa06 +2278698 00000000003a3ec27e08e0e9dcfa322a508e2314a2b78aafc3af3c6a557a13be +2279098 0000000001321e28cd6f2cd821eb30326e8786e88ccb95b5bbbecd355863681b +2279498 0000000000b706a6fa7f0d4b5b2b8db2e72dc3e4ca7f1f5012ed8bd8032564d1 +2279898 00000000004993d35b87189ec3ac4693ad4ac9f53219bd343d1cbfbf2a731a46 +2280298 0000000000b770c2eb023ffaa339fbcb2df55254ad172294be59b0cdc675786e +2280698 000000000029832b55a1e0f90ed3ca0099dce7850fcd5f456623b86e2bcc54c1 +2281098 0000000000b00866e4926fdde1102d6ebcc14a7b07d36b57f7ef5fb61d0cb4ba +2281498 00000000000991bbf63b86a75fb8495b8b0127b58c036d412daa89bf01886bff +2281898 0000000001b12331c0d71122aa5c5df0a51354ebc2478b42e213a91d94fb5433 +2282298 0000000000b73fc46b498ca38b59c499781911d160af9289b70b9fe1cff5c6e5 +2282698 00000000015c503748f5ab9a48735a37d283a09cc92d17576d2288edba0ca128 +2283098 00000000011673e6809ee8dfd89673db8e6e58a16f2adc5c1b02fa0f00b83877 +2283498 000000000042fb905cc00922120ff12753362390fa6c7d50ac5b9f67dcf8d2a6 +2283898 000000000084ca2e3257fc6982e9b81a79cb96f305a84dd9fbed786c95dd774e +2284298 000000000069691b01f1d8b42ad95bdff1df472f2b105bcbf23922e4a97e5a81 +2284698 00000000006752f2759564957dc3299cd4ac7d995a16aef4f070b31c56a4bd25 +2285098 00000000011a59ef91766db47bc534ba875fbce6490c6d0f35a8c2d2cc00ad53 +2285498 0000000000e814abdc1e4912653ad47237d0b731d7bc6536c8e459d07cb4cc5d +2285898 00000000001ed38b3251192e4070ea2e7c9ffd61dbf677d1e0e0a0f1e1384c8d +2286298 0000000000e439f2921796034a1a28f1bbbfd2a77c18598f20bda8eff4a07dc8 +2286698 00000000005a3ecb87d8b1e2217e22ce1edc59c9ca3e434123f4ac834d937f94 +2287098 000000000065837cb08ccea8c6f245a72e7691aa595d80e785aa38a0bdbd318c +2287498 0000000000003175441ae9aa24c3f03f7685e3db11336f6313f1fe201210d62d +2287898 00000000011891aeff32f58e78e3aa81bcf0e5096452f15c1d2a4641dde82ccb +2288298 0000000000b25bd6f17598086514288ec94e47b5ac6501ae654c39a819ded4cd +2288698 00000000014874d5f5b2b6bb0814950ce61d14b97e016130a60047882c824b7f +2289098 0000000000c0e221e038934ea433c537dfd5d8314405b0af54c646c9367dcd60 +2289498 00000000015e0c20ce7fcc0d501a247b3e2788e0637306919d1bad19626efee0 +2289898 00000000001f89ed33e5b78dd35ce23f9661484d27eb3e6e76ce8375f917e4e6 +2290298 0000000000031532b65fa6b94d7a1aa5eeef8a55d11a6329134e3f8e25306bbd +2290698 00000000001cf3dcc74241bd26f8044a85627e4367427049b096d567601688f5 +2291098 000000000178a7bde945a75cf8d575dd8dc39c530daa3c4989d9ce26444332ff +2291498 00000000010e4cbdc80c7d873cc55b68aca818a8394bcfbe98e2122f6ebde723 +2291898 0000000000cb1c8a7689f22372821cfe241d6459279b8010fb54e1453ab6b956 +2292298 00000000011c8d57992a988463b7ed3ffb9621b7911985dd6110ce9539fc1a74 +2292698 0000000001f4b6b418acce67d3d3491257888a798a1cfe700785ccf3051dbb40 +2293098 000000000153b9e983da00ac7ca829bef4b92b58a7d3f3eca31b7bd76e34af2c +2293498 0000000001abe7f0748d84ccfae224b0147cecc7b83772e590cdf3f4fa6cac69 +2293898 0000000001299cac3639c2ae930120d1644f5304e9260b541236555c797cbbca +2294298 00000000007942814fdb9768244836e7d3cb6e27e4a6e9eea620a4ebfc67c2ba +2294698 00000000011027d373ea2ac93451e9d953880c1c1bba2f5b9b53f4062d3caa4c +2295098 000000000176ddf435f02c388ada40dcaca1b739fd5724e92999df280526f85b +2295498 0000000000e52e15cc76aaf051dcd22bbe9bd3a3b68c66f9aa9ea252499d1e81 +2295898 000000000131f1392ea39738abc23babbe41ddb415fdabce8c15c8a35f9e4ca6 +2296298 0000000000b491e08545a33eb6b55fdc2481bd616351f2b48292b514f6d67666 +2296698 0000000000a52e704cea2742a2abde854d540ac955ceaaea227c5ba25dbdb71f +2297098 0000000000bc1540795fb142d202dd7b9264d7789d3733e8612851ae7cdbd0d7 +2297498 00000000002feddfff55c0533d7dcc77f7aa457c19a9b80df2b9b2d8c66d7094 +2297898 00000000016e1eb1940a4b6d2ba26b5d4f33230983b0cf4f2567a1028892a518 +2298298 0000000000b7816ea932eb97f289dc3705e5794707f155bdbda1119df040d2cd +2298698 0000000000e3606691113bd16d0af056977ffa79b6e3841e2b5b589e641efe12 +2299098 0000000000b535b66166b1b42d78085dcac66300eb81465d575bc7de3cc26747 +2299498 0000000000567a67094f6ab26944175b3543e479186674f6dd8f7e28cc627673 +2299898 000000000178d0fd509e633794d3992048bb8bf95eb3f3edda8104a4aff3d7ee +2300298 0000000000a8e816f6873c87c45441be870a60c1a8ea4e10ef6563ac437ccdbc +2300698 000000000023e576eb60514c31db1154e4f03b8553ee01334a612909dedb0b3b +2301098 000000000060c546c617c56dbc369c2433b286b24910f6a5f62f9c322d7642e7 +2301498 00000000012799a8486a04e3ffb40ae25770ea205f081e50d7f2b96ca02a23e1 +2301898 0000000000d2ff96ef9c54a739293c587f7cda7553e53e135cca8c1943249ce8 +2302298 00000000013855741f6e0b9b74927e5151ca25c29a7407c7727bb607d3158e47 +2302698 00000000016f3ed8d2d3c13a20129072d3dc5e02b55ade28f6d191f0c0aae8f1 +2303098 000000000173a40e0557a8b44a692313fd393cd9adcbe7dcb510c6b7ab6cfd73 +2303498 0000000001733853d08d78e8188fbdb7fb192dd0b6c74a08344f6f77c5f6a676 +2303898 0000000001124111444b85daae68960df16878614244c7df777028efc13590cc +2304298 0000000000ec512eb3d57ce08f904c6de85d1bff4e0d572f26b02df6ed2f75af +2304698 0000000002b8ba319d79e5aeedac5858c99207ae14e391d1920cc2e949fd8028 +2305098 0000000001a7df726d5be9baea1fb8654c6f10aeccfe7b17aaba5af39d3ffe08 +2305498 000000000152b5fd63181a6662ba8e85f038fdc5916c36f68ece6a6351f6b59a +2305898 0000000000247f83173e7763274ced029470d57eadf4ef51116faa9a249d7999 +2306298 0000000000a6356488cf68a8f947aa6a23755d6e927625b79f26dde1734fdc30 +2306698 00000000013063329796c0408d424bbbf87d88784358e2ae36a09cb56ad53601 +2307098 0000000000f47ba701cd81044bce2ba16187284f340f93c39982d27f71297b6b +2307498 0000000000a72c661b91cf4cd3d127c6445f8da3aa1e9ff01b1d7e6bdc439130 +2307898 00000000001574a84ba3bd9be481ed5c84092bb62a7dfe5e8ce3369325f442cc +2308298 00000000005d829a743a7e887acffef6afacc40f29fe3ff8d533d83632bb992d +2308698 00000000013c151584751ba0dd39c647c1f7a84ea0c73b547f05d3455d50e68d +2309098 00000000000f83954948d745b67d76fbad2b7b1f45e0577e8159171f953c1df5 +2309498 00000000014087c83f96bf425afdb59c6d55cab4be91d863e72ec27ba0fb8203 +2309898 0000000001222834a2ff4b1d930c24b4188468be9afff99df1f2764d654bdb00 +2310298 000000000055ec48eb2d4a97eac76c4f244285994daa3ba7f544c6ac7bc5b8c4 +2310698 000000000169069103cbc6dd22e48c3d6c166fa2a3f53cf1ab9d2458508ab486 +2311098 0000000001af2ca95be39e4746d71964a657a991b1e35a21fcf7b71487935296 +2311498 0000000001545c40c27a125b73e3d34a901c6bc9c3e0cf07ea4df3cf54c92efd +2311898 00000000005e32e382cb5dc5e0d348e82321dbf7357929508d5d32c90440808c +2312298 00000000016d8c2c891a4c6fa26e0fdbdf2f77058675d3a5b1efb7bf411c9b0e +2312698 000000000085b9ff694f7d13269861a2dd975344d1bd71976a315ef70335a1e5 +2313098 00000000001d28127bcd2715ca3a0dd02c8118d3b4f474baae78054c72ff80bd +2313498 00000000019b8c237101b15d4274edec586119190a9d090a6bffeeb10f5143d3 +2313898 000000000104504614e77a33609942d1f847172c15f312c7bd492ad01c86272d +2314298 0000000000916ee2a8e50d4a2a4c059a1bf5721a399dfe735eb7284cca5622f9 +2314698 0000000000ab56107e185012af88dc242b9a7b4cf31df67f87e8e79924830c3b +2315098 0000000001bc4c04769639cc248d55696323aad122f89b1edd1cee1b1c2473fd +2315498 0000000000cb59e64f0794feb4abb5d24401abf1dc1829f345e2830547055ea0 +2315898 00000000015cf7dd94daaff9b862b110b5b56d0b13d6f3b254986d0fa7519b55 +2316298 0000000000653249d1653700e6aabe1b50f82afdcd1a95a0c165f9cde0962c6b +2316698 0000000000efcf36599361d9252291926179de9ee3346d802c506e808f9bb70c +2317098 000000000030eea323b6af247d94e19e39d6fd7a082e832be907e403cf6e46e2 +2317498 0000000000296b8958a02284b2d16678d8a77d7b5ce2c2a6125e0e6833796eda +2317898 00000000000b2aefaf4bb6149c8f79ff26d26628585bf958ef64cc31eeea6a72 +2318298 00000000011eb147f4fc11ba5bc267821d6634aee79de4b3eb6cccefec13338e +2318698 000000000065b3081c44ce0e02298b79d2d89df35f4c39f9a83614ebd68426e1 +2319098 000000000084e319f2659a2b02aaab6d87639a88bab4235b9211cfde19b0b26f +2319498 0000000000db047eb2129d4153d94689fc2369158b4ebe112ff93f50a441e739 +2319898 00000000011d08082023c66678d74afb7d5891d91c7d5e881d21dfb9cf06e05b +2320298 000000000100c6ce7572fbecf9297ad4c7af175e792a5d6be1d7c26e1304b12f +2320698 0000000000b21ec56046a2ff1d59eca3665b3c44bde3b8f49f4e5d084ef0299c +2321098 000000000023cf9e37285c3502340ae1befc518def5152a412da248636f53457 +2321498 0000000000164bb89ccf4a361f396dd67e5008c3e5434e52713a85fdb7e5d714 +2321898 00000000010983c6b200ae4d9d2e57a3348bd5855a72595b5dd9820639e3256d diff --git a/zebra-consensus/src/checkpoint/test-checkpoints.txt b/zebra-consensus/src/checkpoint/test-checkpoints.txt index 6c8af8e31cd..33e641d8bd7 100644 --- a/zebra-consensus/src/checkpoint/test-checkpoints.txt +++ b/zebra-consensus/src/checkpoint/test-checkpoints.txt @@ -6415,3 +6415,142 @@ 2565600 00029738a8dd2af55b59cd4af0c7d27f1c3b020c4d7f694f835e15f5d9ee7c96 2566000 000e3657d76e8df0985c96ffb9b200f03d37734a758c04a8818637b5bc3a9d84 2566400 002d055d5710cc823ac81751a31e1041b8f02fd9d47c7b82fd1152fd2f223367 +2566800 0021a704b7a728203d1869b65f9e7f4c04af03c4e935d3bf7662cb6451a4fbb1 +2567200 001112d28564d144c3a330be7a655ea95f615423d80e2c0584ba9a2a65919e72 +2567600 00439fac4e90ad99d1712d06d14e009a17f3cac9739f1439d26d02ed1ea1e22b +2568000 00039fadf185b14b3b9a7e0a7a50f615f01cbdc98890934a689e1f768b21c2ac +2568400 000cdd63ca98f0406da85d00883f6f37bbdc72f6bdc6d38810a9b5ad039168ea +2568800 000ed1537a118f37cabf015d47497ae53d55bcc8660b590f82ceb2b487c2198e +2569200 0009df6416538d5a30d1f70c9e4bccb6693b2ab6f5b4f38bc1c987098c9a744f +2569600 000be77f174535d1957c3333aff64d04b7a749b55e536a65328d4c400778b4ac +2570000 002f16febc8fe7cf17ed80593d364d639f5702bf780a91a81642bc195693667c +2570400 0017488cc6f5cd9febb647eaf80b908bbe8615bc9242b7726c6b6afefbc85316 +2570800 0022891d6c749ea542e2b5bc0367c84fb24caa49434748d5fdf358aea42fb606 +2571200 000b33f17e8e6638239bc76780127cea919e56f9d732bf65d6ce07bcfdaa344a +2571600 004c39f92647c3783b2bc9b71c9c73a9e1644ef514ec12d108cd6d20cfbe03e6 +2572000 000a3b341a6fb5a84ce1d7870510a0d908539863345d085a0030ba66401a7e96 +2572400 00312f39480ae958888d43e7c10e9f4f7ffd6965b87550b8ca56807a3d005478 +2572800 0005c6de91a15985a8ccb67480555e8e08bdeb89328a49438c4bcd5b2b298745 +2573200 00191265a052fb442ad76f40416875d061327f2bcdcbaa2f54a2c9626737828c +2573600 001ea8784da364305ddd1833179b823b1f0ee9003b63c536e15d4f3a6cdd6976 +2574000 0017e1a4555d508a688c134b33cdb9147ee221445a4d635e70bc9d1a74102b05 +2574400 0037f92886983911ac65131fd65d3a206b7734005a89ed896fa9b38bd3278f4f +2574800 003b483a1b6c3797efc1b4f0c4bff9beba38c6625176de39dc1faf0ae3caa384 +2575200 003b503f6164ed3d5cabf1f9ca08b69a6821e8ed429231db8ca9fcb4cce4460a +2575600 001de6ae25087b898d963a459cbb735242e052043475aee54d5fc0ca890fed3d +2576000 000f0387c063b5fc87472db6b71793c08faca808e9967d1faa03d48e13fe68e2 +2576400 0033b9228a0ed3672e8b77b3c3bdc005fe55fff2c9d871ce33c0f94349beb0de +2576800 00465d49441a41e519fbf9e09133bf46f6de485d2cc04588fa4c69f11fdf0e0f +2577200 001334c5b97893507f222202ab2b2c939e9fe58bbe0d5fa57bbfcff67c428493 +2577600 001f4d88da9320653530666a8c3eb7d6b6a2d55cce797592546e0887486d7c0a +2578000 000906a3241e53cb7e4e46815f5d204456f25d2480c640c05ca932792a20bb58 +2578400 0010a40544f2bd825d4e7c0bfec330e19e318930ce5277f34d27dab61a1e8d36 +2578800 0029007c4db008d726ecb00d9b736fbcb19e3fd013fda41b651cc6baa170e817 +2579200 000d3075bfe205c37ee3ca5cc9263eac72567977e60c4f41142e74a83088f789 +2579600 0010e19b074242c805455eddd29c0c7a4b5d302c939213a951fa06fc4e93dfa7 +2580000 000d717569dcdac9458704cec46eb7fc67ca105a20f6dbbf9b21f0b2a0a87910 +2580400 001eb1b827e96863ffb0b77f062ace47439b1d4294379f998525a316ec836d6a +2580800 002c637adc01af9d1e5bad80cb867845fd83977f6ae81f004850c3443a8b73da +2581200 00196120803818124a8fac78ba371f43331f796c60c7075f31e6bcfd0076c761 +2581600 003e015bb30b0e4fbf1bf10140703990e6e915fafe68869f3a474334dcd832ba +2582000 003abbcfc96f1f198cdf643ad7ec87a0d0fdaa72cd3f6089a1b0193512cba9c5 +2582400 00180eacdb358d2d655bc310f46124c4f3b4d30f19fb2fa31b9ea9007d34fb8a +2582800 000a8c0ffea7cbf0fe4c0bc4ac5d05daf9ce6dfdb69c5835e6a2a94bf6c085e6 +2583200 00334b987ef209cbfc7c119edbc949db0aa5f33a0e9b82f4a6514593eef85e14 +2583600 00204748cd2f3e5114e1e72e9e1c34b9b255a40676efda6b65b1cbffab9a2751 +2584000 000099bfa6640fe7e4e3e80f00f837fd3a9c18e46de6c7b424415e60e543dc18 +2584400 0019f3de261dd1159785e66e4ae6064f4fc84e3a5d732058641c671c6449309b +2584800 0030ed515220236633e68ddc881f8ef78208e8e83000c1e503376bdf6e88c255 +2585200 000c8be193c6bb414f656d7eef889ba21659b60e012b478d78742bc5df3ac697 +2585600 00035628329212e32bc16c4fa2a23b9ba7848c2b78cad81c5c00fbc69dbf67a9 +2586000 00098b106c2657e848413683d5a4052806c5c5ff9f15b6b55040cf3622431d54 +2586400 0002137522f0df162f1a924ddb786453d7c4aef0f69003979dc79634a3ac6d99 +2586800 00172c8381d8ceaaed83fd480fadc0e5b7ea7547827db5925465dd85332b0cb3 +2587200 000b8069a18a8c616a892eef778f792a47039bab54d6871e3955c326b8e5163a +2587600 002f9141dbd03e50cff2624ffd2f670d1bc1482b89ea48a0fe31074f23cf6b78 +2588000 00174cc0ea5e1d8d278933cbd3c8bbf5f1b94dda765fdaddbe0d51a49aa7040c +2588400 0037e24b1da2048f3606af275ac66458d052ac82ef408ed7e3e9ea42d00237fa +2588800 001027dbb204a514a32a790ffd871e03a61ef9b2bfcffcc9f7b33dc45204575a +2589200 000814d9fdb2ab69304e7c577fd0948fb93c61922cb2d71123664a97dbc23fd8 +2589600 00075b40446b6378495ac4c858a395ea4b341e99a192dbf3fc999203dccab36e +2590000 000e025af081ac1d5deac23db13a487a740c1dd11c8edbe101da87491c59987e +2590400 0024d0bb30b7f8a2a9c8d699480d303e0389eee3827b709d1ad0374ab6b57ab7 +2590800 001036c4bad14405ecb516fd7702342e627221558b76890108d49b364a62c2d2 +2591200 00124c377751a06275b51fcbe9226a614d8b40ba68608810b2b23279f8a896cb +2591600 00511575a33289ec41bdd9322b7910c75cf1858dfebceb7012be8a00d8c5e25e +2592000 002e88756241f925c2e583c1591949c1b37a76dddb2b3bba1d7fce049d6cac43 +2592400 0025dac86f46c07862c46b8a9f133eb6996b05213242efd0acfe2ccacc247b0d +2592800 000cc2becb78576b29116209bd8cdb218cff7e82b22f1d19802dcd43bf8d6b98 +2593200 0040d299bb3b5382f40b4a421265643349fa0453788e93e0a31db7f25c5a80d4 +2593600 004dafccdc8152cb85e8b24910396e9ea1df47c2b82b36481c7ca402c7f405a3 +2594000 005c1d143405266648f766e036d71bbc965134b7675a52c661acae52a68a671d +2594400 004e73df55157a562d6908f36022a4b39a39bad6abd423e45143b643714b87fd +2594800 0011297526d9a133adb068ed9df83c4ee66b4da3c1ff59590396917a94021f00 +2595200 001de1406dffa6755a8330043e93dd78245f283deb97f2c9f869e17274139ac6 +2595600 00139f3ce586a51e017eb6dfff7e6feb45847d9859a2ab89206e5268c8ade159 +2596000 001d6a711a1a7df35944b67bdf7f7523f49e48d3657535cda770d3d87670d47c +2596400 0032058829ad6ce5d26af35441ff85bcb0c80af39b41fe3c2f941b6dd4f700d9 +2596800 000aa5f78f90c8ea147d56584edd71c459608e872029dd2c20805b12c272a232 +2597200 0017c0d36cef228f71c3b3e0b1ef6d36219ab634904ad269b5caaa02503ef57c +2597600 001e0974f54783d6116d659c06cd652d53a13e29cf873220f9c5e6fdc6ac9ab5 +2598000 0020795a3b1781c937e0d0882af3334d828aea68ae1fb5d0f4e48d21604863f7 +2598400 0008708b94df86b73a4df0b854b1655c824c249ec8ea5533604ec67e6849657e +2598800 0006ac1470574bd39c8d9ebd2c815d069c523b959d7adcdc58033399edaf6aee +2599200 003a78d1e2ecfe5410a8abf8433e9669f3dde8110f64e3dca5391a0f0c7facf4 +2599600 001cf30f48f1cb9c62ef1d73f8385c48ed77a1f4c9f5924d65e8c266cfcf5252 +2600000 000b9ecc8bd155dedcf64d27771fc79b8b753fef0d8b0a2557eea1c17b0d8fe6 +2600400 00002605f44a66137a91d8fef93d4e3eec0e0b9395793f9157c5a4d475fe84dd +2600800 000051eddffdae0a1b66273ca2af7f9dac62e3167e6c18e26b43be9a126c09d5 +2601200 0000455b4081b8b0acf29c3ea83ed2655573fbec2756f633983ca72c498244ff +2601600 001fd7aa0334ca299f10d642842fe594e112263395e46ac4ff25e899cce6fa8c +2602000 000b65fc715cbf19e259f88e079f195bbf410435522a4edc58d478f0bdf40eb3 +2602400 00005a6a9613774b931a3d917a8b5333d3be2e0219334686ebde3835e47c420d +2602800 000c8ca93453ad7b227dab39a8f4805f2946a02bd313a69b6b88973a7d23e504 +2603200 00077a7b86918c789f6d0d918ec3a0509987d99b61fe92bc487be20adab8fb10 +2603600 0027102dbdfe96462d5a2a05d23a8e61ab1841e2c042a3dc3f2602d3b43f942f +2604000 0012fd14f8bcbe8bcc90b9e94caaf2aa5f846b3c52ecad1c8747ea9f8493388c +2604400 0028bc5aa39fa03f9989e7b39408829c6294c2deb1f3a04f02430469df2fc846 +2604800 006c91f3053b8c371937d913a57a60cca07493e648a43683d5c4458b6cb92df0 +2605200 0009ef1eb52e3acd1f5b178d04423c459f71395a547ff8f31e8965667cf2d646 +2605600 001a638a38e8aef76f1d251de55b433321971ea18e0940201f988cc4a7f226e9 +2606000 00555da1c42794eedcc49866871a86ef23f1c2a9ab8af082748170d2a89e29e9 +2606400 0023181dfca2cc2344a74811fd1733a1552da07f71e6337163a6c173d6e03edd +2606800 00669a430ee16be5ab026389fec1ea9e787dcca22822646066aae3c12849465b +2607200 0025912f1afbedf044209f4d5368f0f8cfc7ac2ae2a36103113cf55460589a9d +2607600 0019e55469477117859b855e26041bf0804627fe9f61821df8ad8f33e2271ae9 +2608000 001111631dffc309c795ef5a16249f858cee35e46c8d74b0566add6d71ffea32 +2608400 00113e9d77b1f8af57f0f6d9fed408d6b9a96fc7dc340d3e4d4b9e7ceca743ae +2608800 00007a34e8e3fbdb32f4ec512456d0d3705549a9054746fc2f6e1d0dbc024f79 +2609200 000fcb99d36ae30f9666a70195e1ffbda74705035986f4949ba7295747b0e3ae +2609600 0006f37ba23902325d30d2ad809f15683e0fe14e740723a0712a67de0e2e862b +2610000 001ec0dab50faa76f18e6f909e47fab55b1c4ca8d3e71ecb2ade5b4cbd0e5fe7 +2610400 003c6d96aa1d919ea8f512e181093d13d762d2d8dd33da09938dadcd260e1e5b +2610800 00141e7a4b4b6648fabda568a2c5fbb2ece5e86243efdbb2cb6c21df681f69d2 +2611200 00160a4588bae7ef7a8fb6434e9ba89b81082ab18ecaa5476cf743eed5c826ba +2611600 000f7ccbf43acf6b3bf994154cde06ad662d14ebb88c7a40874a52c9d2b1d73f +2612000 00013bad8b72f5a971ae0955857ea53d64d670028ee73edc4b708cafc937a7ef +2612400 000392b5bf5b61b83139267452490f66c46e456e28f016ce65beb00b999cbf1e +2612800 0056a08e17a40b4fd706411c71af523f7523fd0800d47be7742b674027f414f7 +2613200 003b86674b0da598750b88ed4eea867a3df98139ad1b45c4161c4381f0279244 +2613600 00182e65033070ea0aa3c39139fc03787257848f2b0ba235e1bb6089d30c1124 +2614000 003ff6847afb29c3c2e6f6c0efc87f3b322676d5f321da489d325f4febc9d90a +2614400 00185af82c7bd90cf3af6fe6aeae937348776867791e2e11362737f4639e93ce +2614800 001ae8bba5e7330338af23fd447272be606058d7acffc8f7e5b4180b43402cc3 +2615200 000a5296eeca33f3444b5976ca2c8a0d073bf398adee39248d635d55ee0d9b68 +2615600 000721d297f8a02edb3aed58d9e71a483c523fc03a129a4e95fbcb0e64cae62d +2616000 0001b34090adc1a19be3ef6a6cd90876ad39acc55a66634f2c2c18255a1368e5 +2616400 00154d5280982e05fd58f43d233709bc7c226d57c0b76f9b2f603698fca69ed5 +2616800 000059727bd647da6e2ad163d9d715084b8d9c4986dacd7213c2268c626ab9f7 +2617200 000455ff6a49dc313e2a4e58b60539ced01ab2c5ae0d80a8ec3d31a472119a15 +2617600 001e33b33a92762aa653a90e3e596e32b9a73d50a9856e72e94815d4897e6335 +2618000 001c6db62adb702e52b76e86e23b9b12f4af0a7f821e448cab977e077ab2311e +2618400 000ba9177eb0ad7c4e600047a2d151537e23fc4e10dce28e99748f7fc2ba4ab5 +2618800 0083378af0cfaec4ab860e94c0eb43ac3cdd22d269568fa4b0d95daf59ddc1a3 +2619200 007658e938a2ba766fb0cbb0bf5a9fc408c36ed762867073d4d41e78c7bdb2a8 +2619600 0011111464dccc6893133287125ca8fc612a0734157ef845a8f5a36e938fd3f5 +2620000 00139f229081782e5f0238fa02da7b0dd7516a0c6c8f7e3bc1940f841146f32b +2620400 00021eff77829d103433c08290df34d7f119744efc5e0f8a3080917ca062c794 +2620800 0015463a631c1cc2c2bf4963c78d685261805638f0086ba77479bf0e814bd036 +2621200 0020b50b5696bd12e97f13067eb772aedafecda7fa01b2b19bc243cf69bee223 +2621600 00a3af146bf8fdc7236df23c8232f8ada61bec043b3d011af143622e73b1ed42 +2622000 0028603097088eca9e801ef90fadbab686d38c21dc55603b9c97a4c0403a64f0 \ No newline at end of file diff --git a/zebra-network/Cargo.toml b/zebra-network/Cargo.toml index a338a32da14..542b25f71a8 100644 --- a/zebra-network/Cargo.toml +++ b/zebra-network/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-network" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation ", "Tower Maintainers "] description = "Networking code for Zebra" # # Legal @@ -83,7 +83,7 @@ howudoin = { version = "0.1.2", optional = true } proptest = { version = "1.4.0", optional = true } proptest-derive = { version = "0.4.0", optional = true } -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31", features = ["async-error"] } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32", features = ["async-error"] } [dev-dependencies] proptest = "1.4.0" diff --git a/zebra-node-services/Cargo.toml b/zebra-node-services/Cargo.toml index cf640e046dc..a50fa4b35f5 100644 --- a/zebra-node-services/Cargo.toml +++ b/zebra-node-services/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-node-services" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "The interfaces of some Zebra node services" license = "MIT OR Apache-2.0" @@ -35,7 +35,7 @@ rpc-client = [ ] [dependencies] -zebra-chain = { path = "../zebra-chain" , version = "1.0.0-beta.31" } +zebra-chain = { path = "../zebra-chain" , version = "1.0.0-beta.32" } # Optional dependencies diff --git a/zebra-rpc/Cargo.toml b/zebra-rpc/Cargo.toml index 7d86829ae9a..a8efede1ea6 100644 --- a/zebra-rpc/Cargo.toml +++ b/zebra-rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-rpc" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "A Zebra JSON Remote Procedure Call (JSON-RPC) interface" license = "MIT OR Apache-2.0" @@ -70,12 +70,12 @@ zcash_address = { version = "0.3.0", optional = true } # Test-only feature proptest-impl proptest = { version = "1.4.0", optional = true } -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31", features = ["json-conversion"] } -zebra-consensus = { path = "../zebra-consensus", version = "1.0.0-beta.31" } -zebra-network = { path = "../zebra-network", version = "1.0.0-beta.31" } -zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.31" } -zebra-script = { path = "../zebra-script", version = "1.0.0-beta.31" } -zebra-state = { path = "../zebra-state", version = "1.0.0-beta.31" } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32", features = ["json-conversion"] } +zebra-consensus = { path = "../zebra-consensus", version = "1.0.0-beta.32" } +zebra-network = { path = "../zebra-network", version = "1.0.0-beta.32" } +zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.32" } +zebra-script = { path = "../zebra-script", version = "1.0.0-beta.32" } +zebra-state = { path = "../zebra-state", version = "1.0.0-beta.32" } [dev-dependencies] insta = { version = "1.33.0", features = ["redactions", "json", "ron"] } diff --git a/zebra-scan/Cargo.toml b/zebra-scan/Cargo.toml index 802897a22fa..f4884e2f1a6 100644 --- a/zebra-scan/Cargo.toml +++ b/zebra-scan/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-scan" -version = "0.1.0-alpha.0" +version = "0.1.0-alpha.1" authors = ["Zcash Foundation "] description = "Shielded transaction scanner for the Zcash blockchain" license = "MIT OR Apache-2.0" diff --git a/zebra-script/Cargo.toml b/zebra-script/Cargo.toml index cb60d7ec10b..9dffcb5e9f0 100644 --- a/zebra-script/Cargo.toml +++ b/zebra-script/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-script" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "Zebra script verification wrapping zcashd's zcash_script library" license = "MIT OR Apache-2.0" @@ -17,7 +17,7 @@ categories = ["api-bindings", "cryptography::cryptocurrencies"] [dependencies] zcash_script = "0.1.14" -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31" } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32" } thiserror = "1.0.48" displaydoc = "0.2.4" diff --git a/zebra-state/Cargo.toml b/zebra-state/Cargo.toml index f528415542b..ce9912b2e97 100644 --- a/zebra-state/Cargo.toml +++ b/zebra-state/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-state" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "State contextual verification and storage code for Zebra" license = "MIT OR Apache-2.0" @@ -76,13 +76,13 @@ tracing = "0.1.39" elasticsearch = { version = "8.5.0-alpha.1", default-features = false, features = ["rustls-tls"], optional = true } serde_json = { version = "1.0.108", package = "serde_json", optional = true } -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31", features = ["async-error"] } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32", features = ["async-error"] } # prod feature progress-bar howudoin = { version = "0.1.2", optional = true } # test feature proptest-impl -zebra-test = { path = "../zebra-test/", version = "1.0.0-beta.31", optional = true } +zebra-test = { path = "../zebra-test/", version = "1.0.0-beta.32", optional = true } proptest = { version = "1.4.0", optional = true } proptest-derive = { version = "0.4.0", optional = true } diff --git a/zebra-test/Cargo.toml b/zebra-test/Cargo.toml index 6fd05c515f8..927c4d28536 100644 --- a/zebra-test/Cargo.toml +++ b/zebra-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-test" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "Test harnesses and test vectors for Zebra" license = "MIT OR Apache-2.0" diff --git a/zebra-utils/Cargo.toml b/zebra-utils/Cargo.toml index 19f5f01cd6f..45578ad98ec 100644 --- a/zebra-utils/Cargo.toml +++ b/zebra-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zebra-utils" -version = "1.0.0-beta.31" +version = "1.0.0-beta.32" authors = ["Zcash Foundation "] description = "Developer tools for Zebra maintenance and testing" license = "MIT OR Apache-2.0" @@ -17,7 +17,7 @@ categories = ["command-line-utilities", "cryptography::cryptocurrencies"] # Zebra is only supported on the latest stable Rust version. See the README for details. # Any Zebra release can break compatibility with older Rust versions. -rust-version = "1.70" +rust-version = "1.73" [[bin]] name = "zebra-checkpoints" @@ -74,11 +74,11 @@ tracing-error = "0.2.0" tracing-subscriber = "0.3.18" thiserror = "1.0.48" -zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.31" } -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31" } +zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.32" } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32" } # These crates are needed for the block-template-to-proposal binary -zebra-rpc = { path = "../zebra-rpc", version = "1.0.0-beta.31", optional = true } +zebra-rpc = { path = "../zebra-rpc", version = "1.0.0-beta.32", optional = true } # These crates are needed for the zebra-checkpoints binary itertools = { version = "0.12.0", optional = true } diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index d033111c401..2e04355249d 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -1,7 +1,7 @@ [package] # Crate metadata name = "zebrad" -version = "1.4.0" +version = "1.5.0" authors = ["Zcash Foundation "] description = "The Zcash Foundation's independent, consensus-compatible implementation of a Zcash node" license = "MIT OR Apache-2.0" @@ -19,7 +19,7 @@ edition = "2021" # Zebra is only supported on the latest stable Rust version. See the README for details. # Any Zebra release can break compatibility with older Rust versions. -rust-version = "1.70" +rust-version = "1.73" # Settings that impact runtime behaviour @@ -148,18 +148,18 @@ test_sync_past_mandatory_checkpoint_mainnet = [] test_sync_past_mandatory_checkpoint_testnet = [] [dependencies] -zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.31" } -zebra-consensus = { path = "../zebra-consensus", version = "1.0.0-beta.31" } -zebra-network = { path = "../zebra-network", version = "1.0.0-beta.31" } -zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.31" } -zebra-rpc = { path = "../zebra-rpc", version = "1.0.0-beta.31" } -zebra-state = { path = "../zebra-state", version = "1.0.0-beta.31" } +zebra-chain = { path = "../zebra-chain", version = "1.0.0-beta.32" } +zebra-consensus = { path = "../zebra-consensus", version = "1.0.0-beta.32" } +zebra-network = { path = "../zebra-network", version = "1.0.0-beta.32" } +zebra-node-services = { path = "../zebra-node-services", version = "1.0.0-beta.32" } +zebra-rpc = { path = "../zebra-rpc", version = "1.0.0-beta.32" } +zebra-state = { path = "../zebra-state", version = "1.0.0-beta.32" } # Experimental shielded-scan feature -zebra-scan = { path = "../zebra-scan", version = "0.1.0-alpha.0", optional = true } +zebra-scan = { path = "../zebra-scan", version = "0.1.0-alpha.1", optional = true } # Required for crates.io publishing, but it's only used in tests -zebra-utils = { path = "../zebra-utils", version = "1.0.0-beta.31", optional = true } +zebra-utils = { path = "../zebra-utils", version = "1.0.0-beta.32", optional = true } abscissa_core = "0.7.0" clap = { version = "4.4.10", features = ["cargo"] } diff --git a/zebrad/src/components/sync/end_of_support.rs b/zebrad/src/components/sync/end_of_support.rs index 0b615c1f050..760ded544d8 100644 --- a/zebrad/src/components/sync/end_of_support.rs +++ b/zebrad/src/components/sync/end_of_support.rs @@ -13,7 +13,7 @@ use zebra_chain::{ use crate::application::release_version; /// The estimated height that this release will be published. -pub const ESTIMATED_RELEASE_HEIGHT: u32 = 2_290_000; +pub const ESTIMATED_RELEASE_HEIGHT: u32 = 2_330_000; /// The maximum number of days after `ESTIMATED_RELEASE_HEIGHT` where a Zebra server will run /// without halting. From 3318eaaa22201229ddef1e40957648b1355bc48c Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 12 Dec 2023 17:45:12 +1000 Subject: [PATCH 6/6] test(scan): Add raw database format snapshots to the scanner (#8075) * Make some scanner storage methods more flexible * Move tests to a submodule and expose test functions and constants * Make scanner functions clearer and easier to use * Simplify state snapshot test code * Add raw data snapshot tests for the scanner * Add snapshots * Fix import path * Fix import conditional compilation * fix imports * fix imports 2 * Put read and write db exports together * Remove confusing IntoDisk/FromDisk impl * Fix an incorrect unused method that could panic * Delete a test that is no longer valid --------- Co-authored-by: Alfredo Garcia --- Cargo.lock | 3 + zebra-scan/Cargo.toml | 33 ++- zebra-scan/src/lib.rs | 4 +- zebra-scan/src/scan.rs | 6 +- zebra-scan/src/storage.rs | 13 +- zebra-scan/src/storage/db.rs | 3 + zebra-scan/src/storage/db/sapling.rs | 4 +- zebra-scan/src/storage/db/tests.rs | 3 + zebra-scan/src/storage/db/tests/snapshot.rs | 164 ++++++++++++++ .../tests/snapshots/column_family_names.snap | 8 + .../empty_column_families@empty.snap | 7 + .../empty_column_families@mainnet_0.snap | 5 + .../empty_column_families@mainnet_1.snap | 5 + .../empty_column_families@mainnet_2.snap | 5 + .../empty_column_families@mainnet_keys.snap | 5 + .../empty_column_families@testnet_0.snap | 5 + .../empty_column_families@testnet_1.snap | 5 + .../empty_column_families@testnet_2.snap | 5 + .../empty_column_families@testnet_keys.snap | 5 + .../sapling_tx_ids_raw_data@mainnet_0.snap | 18 ++ .../sapling_tx_ids_raw_data@mainnet_1.snap | 22 ++ .../sapling_tx_ids_raw_data@mainnet_2.snap | 26 +++ .../sapling_tx_ids_raw_data@mainnet_keys.snap | 14 ++ .../sapling_tx_ids_raw_data@testnet_0.snap | 18 ++ .../sapling_tx_ids_raw_data@testnet_1.snap | 22 ++ .../sapling_tx_ids_raw_data@testnet_2.snap | 26 +++ .../sapling_tx_ids_raw_data@testnet_keys.snap | 14 ++ zebra-scan/src/tests.rs | 204 ++---------------- zebra-scan/src/tests/vectors.rs | 198 +++++++++++++++++ zebra-state/src/lib.rs | 6 +- zebra-state/src/service/finalized_state.rs | 7 +- .../service/finalized_state/disk_format.rs | 5 +- .../finalized_state/disk_format/scan.rs | 42 ++-- .../disk_format/scan/tests/prop.rs | 7 - .../finalized_state/disk_format/tests.rs | 8 +- .../disk_format/tests/snapshot.rs | 25 +-- zebrad/Cargo.toml | 2 + zebrad/tests/acceptance.rs | 4 +- 38 files changed, 703 insertions(+), 253 deletions(-) create mode 100644 zebra-scan/src/storage/db/tests.rs create mode 100644 zebra-scan/src/storage/db/tests/snapshot.rs create mode 100644 zebra-scan/src/storage/db/tests/snapshots/column_family_names.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@empty.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_0.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_1.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_2.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_keys.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_0.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_1.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_2.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_keys.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_0.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_1.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_2.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_keys.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_0.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_1.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_2.snap create mode 100644 zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_keys.snap create mode 100644 zebra-scan/src/tests/vectors.rs diff --git a/Cargo.lock b/Cargo.lock index 6219729c88b..720fe491fea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5885,8 +5885,11 @@ dependencies = [ "ff", "group", "indexmap 2.1.0", + "insta", "itertools 0.12.0", "jubjub", + "proptest", + "proptest-derive", "rand 0.8.5", "semver 1.0.20", "serde", diff --git a/zebra-scan/Cargo.toml b/zebra-scan/Cargo.toml index f4884e2f1a6..f9b10750b31 100644 --- a/zebra-scan/Cargo.toml +++ b/zebra-scan/Cargo.toml @@ -18,6 +18,21 @@ categories = ["cryptography::cryptocurrencies"] # Production features that activate extra dependencies, or extra features in dependencies +# Test features + +proptest-impl = [ + "proptest", + "proptest-derive", + "zebra-state/proptest-impl", + "zebra-chain/proptest-impl", + "bls12_381", + "ff", + "group", + "jubjub", + "rand", + "zcash_note_encryption", +] + [dependencies] color-eyre = "0.6.2" @@ -37,15 +52,29 @@ zebra-state = { path = "../zebra-state", version = "1.0.0-beta.31", features = [ chrono = { version = "0.4.31", default-features = false, features = ["clock", "std", "serde"] } +# test feature proptest-impl +proptest = { version = "1.4.0", optional = true } +proptest-derive = { version = "0.4.0", optional = true } + +bls12_381 = { version = "0.8.0", optional = true } +ff = { version = "0.13.0", optional = true } +group = { version = "0.13.0", optional = true } +jubjub = { version = "0.10.0", optional = true } +rand = { version = "0.8.5", optional = true } +zcash_note_encryption = { version = "0.4.0", optional = true } + [dev-dependencies] +insta = { version = "1.33.0", features = ["ron", "redactions"] } +tokio = { version = "1.34.0", features = ["test-util"] } + +proptest = "1.4.0" +proptest-derive = "0.4.0" bls12_381 = "0.8.0" ff = "0.13.0" group = "0.13.0" jubjub = "0.10.0" rand = "0.8.5" -tokio = { version = "1.34.0", features = ["test-util"] } - zcash_note_encryption = "0.4.0" zebra-state = { path = "../zebra-state", version = "1.0.0-beta.31", features = ["proptest-impl"] } diff --git a/zebra-scan/src/lib.rs b/zebra-scan/src/lib.rs index b31fa99d8dc..eee89247c31 100644 --- a/zebra-scan/src/lib.rs +++ b/zebra-scan/src/lib.rs @@ -9,8 +9,8 @@ pub mod init; pub mod scan; pub mod storage; -#[cfg(test)] -mod tests; +#[cfg(any(test, feature = "proptest-impl"))] +pub mod tests; pub use config::Config; pub use init::{init, spawn_init}; diff --git a/zebra-scan/src/scan.rs b/zebra-scan/src/scan.rs index 0db045232be..f9d5d0f42e4 100644 --- a/zebra-scan/src/scan.rs +++ b/zebra-scan/src/scan.rs @@ -211,8 +211,8 @@ pub async fn scan_height_and_store_results( let dfvk_res = scanned_block_to_db_result(dfvk_res); let ivk_res = scanned_block_to_db_result(ivk_res); - storage.add_sapling_results(sapling_key.clone(), height, dfvk_res); - storage.add_sapling_results(sapling_key, height, ivk_res); + storage.add_sapling_results(&sapling_key, height, dfvk_res); + storage.add_sapling_results(&sapling_key, height, ivk_res); Ok::<_, Report>(()) }) @@ -398,7 +398,7 @@ fn scanned_block_to_db_result( .map(|tx| { ( TransactionIndex::from_usize(tx.index), - SaplingScannedResult::from(tx.txid.as_ref()), + SaplingScannedResult::from_bytes_in_display_order(*tx.txid.as_ref()), ) }) .collect() diff --git a/zebra-scan/src/storage.rs b/zebra-scan/src/storage.rs index c4324ceda45..10f1b1d37b8 100644 --- a/zebra-scan/src/storage.rs +++ b/zebra-scan/src/storage.rs @@ -71,7 +71,13 @@ impl Storage { /// /// This method can block while writing database files, so it must be inside spawn_blocking() /// in async code. - pub fn add_sapling_key(&mut self, sapling_key: &SaplingScanningKey, birthday: Option) { + pub fn add_sapling_key( + &mut self, + sapling_key: &SaplingScanningKey, + birthday: impl Into>, + ) { + let birthday = birthday.into(); + // It's ok to write some keys and not others during shutdown, so each key can get its own // batch. (They will be re-written on startup anyway.) let mut batch = ScannerWriteBatch::default(); @@ -93,7 +99,8 @@ impl Storage { self.sapling_keys_and_birthday_heights() } - /// Add the sapling results for `height` to the storage. + /// Add the sapling results for `height` to the storage. The results can be any map of + /// [`TransactionIndex`] to [`SaplingScannedResult`]. /// /// # Performance / Hangs /// @@ -101,7 +108,7 @@ impl Storage { /// in async code. pub fn add_sapling_results( &mut self, - sapling_key: SaplingScanningKey, + sapling_key: &SaplingScanningKey, height: Height, sapling_results: BTreeMap, ) { diff --git a/zebra-scan/src/storage/db.rs b/zebra-scan/src/storage/db.rs index 00262b01437..12a3a404db8 100644 --- a/zebra-scan/src/storage/db.rs +++ b/zebra-scan/src/storage/db.rs @@ -19,6 +19,9 @@ pub use zebra_state::{ pub mod sapling; +#[cfg(test)] +mod tests; + /// The directory name used to distinguish the scanner database from Zebra's other databases or /// flat files. /// diff --git a/zebra-scan/src/storage/db/sapling.rs b/zebra-scan/src/storage/db/sapling.rs index b47d344a9d9..db699207d09 100644 --- a/zebra-scan/src/storage/db/sapling.rs +++ b/zebra-scan/src/storage/db/sapling.rs @@ -47,13 +47,15 @@ impl Storage { // Reading Sapling database entries /// Returns the result for a specific database index (key, block height, transaction index). + /// Returns `None` if the result is missing or an empty marker for a birthday or progress + /// height. // // TODO: add tests for this method pub fn sapling_result_for_index( &self, index: &SaplingScannedDatabaseIndex, ) -> Option { - self.db.zs_get(&self.sapling_tx_ids_cf(), &index) + self.db.zs_get(&self.sapling_tx_ids_cf(), &index).flatten() } /// Returns the results for a specific key and block height. diff --git a/zebra-scan/src/storage/db/tests.rs b/zebra-scan/src/storage/db/tests.rs new file mode 100644 index 00000000000..ca39f410f8d --- /dev/null +++ b/zebra-scan/src/storage/db/tests.rs @@ -0,0 +1,3 @@ +//! General scanner database tests. + +mod snapshot; diff --git a/zebra-scan/src/storage/db/tests/snapshot.rs b/zebra-scan/src/storage/db/tests/snapshot.rs new file mode 100644 index 00000000000..0eaef193045 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshot.rs @@ -0,0 +1,164 @@ +//! Raw data snapshot tests for the scanner database format. +//! +//! These tests check: +//! - the name of each column family +//! - the number of key-value entries +//! - the bytes in each key and value +//! +//! These tests currently use fixed test vectors. +//! +//! # Fixing Test Failures +//! +//! If this test fails, run: +//! ```sh +//! cd zebra-scan +//! cargo insta test --review --features shielded-scan +//! ``` +//! to update the test snapshots, then commit the `test_*.snap` files using git. +//! +//! # Snapshot Format +//! +//! These snapshots use [RON (Rusty Object Notation)](https://github.com/ron-rs/ron#readme), +//! a text format similar to Rust syntax. Raw byte data is encoded in hexadecimal. +//! +//! Due to `serde` limitations, some object types can't be represented exactly, +//! so RON uses the closest equivalent structure. + +use std::{collections::BTreeMap, sync::Arc}; + +use zebra_chain::{ + block::{Block, Height}, + parameters::Network::{self, *}, + serialization::ZcashDeserializeInto, +}; +use zebra_state::{RawBytes, ReadDisk, TransactionIndex, KV}; + +use crate::{ + storage::{db::ScannerDb, Storage}, + tests::{FAKE_SAPLING_VIEWING_KEY, ZECPAGES_SAPLING_VIEWING_KEY}, + Config, +}; + +/// Snapshot test for RocksDB column families, and their key-value data. +/// +/// These snapshots contain the `default` column family, but it is not used by Zebra. +#[test] +fn test_raw_rocksdb_column_families() { + let _init_guard = zebra_test::init(); + + test_raw_rocksdb_column_families_with_network(Mainnet); + test_raw_rocksdb_column_families_with_network(Testnet); +} + +/// Snapshot raw column families for `network`. +/// +/// See [`test_raw_rocksdb_column_families`]. +fn test_raw_rocksdb_column_families_with_network(network: Network) { + let mut net_suffix = network.to_string(); + net_suffix.make_ascii_lowercase(); + + let mut storage = Storage::new(&Config::ephemeral(), network); + + // Snapshot the column family names + let mut cf_names = storage.db.list_cf().expect("empty database is valid"); + + // The order that RocksDB returns column families is irrelevant, + // because we always access them by name. + cf_names.sort(); + + // Assert that column family names are the same, regardless of the network. + // Later, we check they are also the same regardless of the block height. + insta::assert_ron_snapshot!("column_family_names", cf_names); + + // Assert that empty databases are the same, regardless of the network. + let mut settings = insta::Settings::clone_current(); + + settings.set_snapshot_suffix("empty"); + settings.bind(|| snapshot_raw_rocksdb_column_family_data(&storage.db, &cf_names)); + + // Snapshot a birthday that is automatically set to activation height + storage.add_sapling_key(&ZECPAGES_SAPLING_VIEWING_KEY.to_string(), None); + // Snapshot a birthday above activation height + storage.add_sapling_key(&FAKE_SAPLING_VIEWING_KEY.to_string(), Height(1_000_000)); + + settings.set_snapshot_suffix(format!("{net_suffix}_keys")); + settings.bind(|| snapshot_raw_rocksdb_column_family_data(&storage.db, &cf_names)); + + // Snapshot raw database data for: + // - mainnet and testnet + // - genesis, block 1, and block 2 + let blocks = match network { + Mainnet => &*zebra_test::vectors::CONTINUOUS_MAINNET_BLOCKS, + Testnet => &*zebra_test::vectors::CONTINUOUS_TESTNET_BLOCKS, + }; + + // We limit the number of blocks, because the serialized data is a few kilobytes per block. + for height in 0..=2 { + let block: Arc = blocks + .get(&height) + .expect("block height has test data") + .zcash_deserialize_into() + .expect("test data deserializes"); + + // Fake results from the first few blocks + storage.add_sapling_results( + &ZECPAGES_SAPLING_VIEWING_KEY.to_string(), + Height(height), + block + .transactions + .iter() + .enumerate() + .map(|(index, tx)| (TransactionIndex::from_usize(index), tx.hash().into())) + .collect(), + ); + + let mut settings = insta::Settings::clone_current(); + settings.set_snapshot_suffix(format!("{net_suffix}_{height}")); + + settings.bind(|| snapshot_raw_rocksdb_column_family_data(&storage.db, &cf_names)); + } +} + +/// Snapshot the data in each column family, using `cargo insta` and RON serialization. +fn snapshot_raw_rocksdb_column_family_data(db: &ScannerDb, original_cf_names: &[String]) { + let mut new_cf_names = db.list_cf().expect("empty database is valid"); + new_cf_names.sort(); + + // Assert that column family names are the same, regardless of the network or block height. + assert_eq!( + original_cf_names, new_cf_names, + "unexpected extra column families", + ); + + let mut empty_column_families = Vec::new(); + + // Now run the data snapshots + for cf_name in original_cf_names { + let cf_handle = db + .cf_handle(cf_name) + .expect("RocksDB API provides correct names"); + + // Correctness: Multi-key iteration causes hangs in concurrent code, but seems ok in tests. + let cf_items: BTreeMap = db.zs_items_in_range_ordered(&cf_handle, ..); + + // The default raw data serialization is very verbose, so we hex-encode the bytes. + let cf_data: Vec = cf_items + .iter() + .map(|(key, value)| KV::new(key.raw_bytes(), value.raw_bytes())) + .collect(); + + if cf_name == "default" { + assert_eq!(cf_data.len(), 0, "default column family is never used"); + } else if cf_data.is_empty() { + // distinguish column family names from empty column families + empty_column_families.push(format!("{cf_name}: no entries")); + } else { + // The note commitment tree snapshots will change if the trees do not have cached roots. + // But we expect them to always have cached roots, + // because those roots are used to populate the anchor column families. + insta::assert_ron_snapshot!(format!("{cf_name}_raw_data"), cf_data); + } + } + + insta::assert_ron_snapshot!("empty_column_families", empty_column_families); +} diff --git a/zebra-scan/src/storage/db/tests/snapshots/column_family_names.snap b/zebra-scan/src/storage/db/tests/snapshots/column_family_names.snap new file mode 100644 index 00000000000..dc65b126d9c --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/column_family_names.snap @@ -0,0 +1,8 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_names +--- +[ + "default", + "sapling_tx_ids", +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@empty.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@empty.snap new file mode 100644 index 00000000000..df6ef1d5f19 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@empty.snap @@ -0,0 +1,7 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[ + "sapling_tx_ids: no entries", +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_0.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_0.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_0.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_1.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_1.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_1.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_2.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_2.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_2.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_keys.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_keys.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@mainnet_keys.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_0.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_0.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_0.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_1.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_1.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_1.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_2.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_2.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_2.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_keys.snap b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_keys.snap new file mode 100644 index 00000000000..15b9ea627c6 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/empty_column_families@testnet_keys.snap @@ -0,0 +1,5 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: empty_column_families +--- +[] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_0.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_0.snap new file mode 100644 index 00000000000..7e4978dbaf5 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_0.snap @@ -0,0 +1,18 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000000000", + v: "c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a06657f0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_1.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_1.snap new file mode 100644 index 00000000000..710d65d2db8 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_1.snap @@ -0,0 +1,22 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000000000", + v: "c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000010000", + v: "851bf6fbf7a976327817c738c489d7fa657752445430922d94c983c0b9ed4609", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a06657f0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_2.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_2.snap new file mode 100644 index 00000000000..fae6f22c031 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_2.snap @@ -0,0 +1,26 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000000000", + v: "c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000010000", + v: "851bf6fbf7a976327817c738c489d7fa657752445430922d94c983c0b9ed4609", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000020000", + v: "8974d08d1c5f9c860d8b629d582a56659a4a1dcb2b5f98a25a5afcc2a784b0f4", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a06657f0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_keys.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_keys.snap new file mode 100644 index 00000000000..34ac710bbf2 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@mainnet_keys.snap @@ -0,0 +1,14 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a06657f0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_0.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_0.snap new file mode 100644 index 00000000000..53089e84891 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_0.snap @@ -0,0 +1,18 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000000000", + v: "c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0445bf0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_1.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_1.snap new file mode 100644 index 00000000000..4384d29f9f8 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_1.snap @@ -0,0 +1,22 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000000000", + v: "c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000010000", + v: "f37e9f691fffb635de0999491d906ee85ba40cd36dae9f6e5911a8277d7c5f75", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0445bf0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_2.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_2.snap new file mode 100644 index 00000000000..a2e7dfcea1c --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_2.snap @@ -0,0 +1,26 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000000000", + v: "c4eaa58879081de3c24a7b117ed2b28300e7ec4c4c1dff1d3f1268b7857a4ddb", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000010000", + v: "f37e9f691fffb635de0999491d906ee85ba40cd36dae9f6e5911a8277d7c5f75", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0000020000", + v: "5822c0532da8a008259ac39933d3210e508c17e3ba21d2b2c428785efdccb3d5", + ), + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0445bf0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_keys.snap b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_keys.snap new file mode 100644 index 00000000000..19340f88225 --- /dev/null +++ b/zebra-scan/src/storage/db/tests/snapshots/sapling_tx_ids_raw_data@testnet_keys.snap @@ -0,0 +1,14 @@ +--- +source: zebra-scan/src/storage/db/tests/snapshot.rs +expression: cf_data +--- +[ + KV( + k: "7a78766965777331713064757974676371717171707172653236776b6c343567767777776437303678773630386875636d7666616c72373539656a7766377173686a663572396161373332337a756c767a36706c68747470356d6c747163677339743033396378326430396d67713035747336336e387533356879763668396e633963747171747565327537636572326d716567756e75756c71326c7568713379776a637a333579796c6a657761346d676b676a7a79667768366672366a6430647a64343467686b306e78647632686e76346a356e7866777632347277646d676c6c68653070383536387367717439636b74303276326b786635616874716c3673306c746a706b636b77386774796d787478757539676372307377767a0445bf0000", + v: "", + ), + KV( + k: "7a78766965777366616b650f423f0000", + v: "", + ), +] diff --git a/zebra-scan/src/tests.rs b/zebra-scan/src/tests.rs index 99b8c87d907..55eef898019 100644 --- a/zebra-scan/src/tests.rs +++ b/zebra-scan/src/tests.rs @@ -12,17 +12,14 @@ use ff::{Field, PrimeField}; use group::GroupEncoding; use rand::{rngs::OsRng, thread_rng, RngCore}; -use zcash_client_backend::{ - encoding::decode_extended_full_viewing_key, - proto::compact_formats::{ - ChainMetadata, CompactBlock, CompactSaplingOutput, CompactSaplingSpend, CompactTx, - }, +use zcash_client_backend::proto::compact_formats::{ + ChainMetadata, CompactBlock, CompactSaplingOutput, CompactSaplingSpend, CompactTx, }; use zcash_note_encryption::Domain; use zcash_primitives::{ block::BlockHash, consensus::BlockHeight, - constants::{mainnet::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY, SPENDING_KEY_GENERATOR}, + constants::SPENDING_KEY_GENERATOR, memo::MemoBytes, sapling::{ note_encryption::{sapling_note_encryption, SaplingDomain}, @@ -30,200 +27,29 @@ use zcash_primitives::{ value::NoteValue, Note, Nullifier, }, - zip32::{DiversifiableFullViewingKey, ExtendedSpendingKey}, + zip32::DiversifiableFullViewingKey, }; use zebra_chain::{ amount::{Amount, NegativeAllowed}, block::{self, merkle, Block, Header, Height}, - chain_tip::ChainTip, fmt::HexDebug, - parameters::Network, primitives::{redjubjub, Groth16Proof}, sapling::{self, PerSpendAnchor, Spend, TransferData}, - serialization::{AtLeastOne, ZcashDeserializeInto}, + serialization::AtLeastOne, transaction::{LockTime, Transaction}, transparent::{CoinbaseData, Input}, work::{difficulty::CompactDifficulty, equihash::Solution}, }; -use zebra_state::{SaplingScannedResult, TransactionIndex}; - -use crate::{ - config::Config, - scan::{block_to_compact, scan_block}, -}; - -/// This test: -/// - Creates a viewing key and a fake block containing a Sapling output decryptable by the key. -/// - Scans the block. -/// - Checks that the result contains the txid of the tx containing the Sapling output. -#[tokio::test] -async fn scanning_from_fake_generated_blocks() -> Result<()> { - let extsk = ExtendedSpendingKey::master(&[]); - let dfvk: DiversifiableFullViewingKey = extsk.to_diversifiable_full_viewing_key(); - let nf = Nullifier([7; 32]); - - let (block, sapling_tree_size) = fake_block(1u32.into(), nf, &dfvk, 1, true, Some(0)); - - assert_eq!(block.transactions.len(), 4); - - let res = scan_block(Network::Mainnet, &block, sapling_tree_size, &[&dfvk]).unwrap(); - - // The response should have one transaction relevant to the key we provided. - assert_eq!(res.transactions().len(), 1); - - // Check that the original block contains the txid in the scanning result. - assert!(block - .transactions - .iter() - .map(|tx| tx.hash().bytes_in_display_order()) - .any(|txid| &txid == res.transactions()[0].txid.as_ref())); - - // Check that the txid in the scanning result matches the third tx in the original block. - assert_eq!( - res.transactions()[0].txid.as_ref(), - &block.transactions[2].hash().bytes_in_display_order() - ); - - // The block hash of the response should be the same as the one provided. - assert_eq!(res.block_hash().0, block.hash().0); - - Ok(()) -} - -/// Scan a populated state for the ZECpages viewing key. -/// This test is very similar to `scanning_from_populated_zebra_state` but with the ZECpages key. -/// There are no zechub transactions in the test data so we should get empty related transactions. -#[tokio::test] -async fn scanning_zecpages_from_populated_zebra_state() -> Result<()> { - /// The extended Sapling viewing key of [ZECpages](https://zecpages.com/boardinfo) - const ZECPAGES_VIEWING_KEY: &str = "zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz"; - - // Parse the key from ZECpages - let efvk = decode_extended_full_viewing_key( - HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY, - ZECPAGES_VIEWING_KEY, - ) - .unwrap(); - - // Build a vector of viewing keys `vks` to scan for. - let fvk = efvk.fvk; - let ivk = fvk.vk.ivk(); - let ivks = vec![ivk]; - - let network = Network::Mainnet; - - // Create a continuous chain of mainnet blocks from genesis - let blocks: Vec> = zebra_test::vectors::CONTINUOUS_MAINNET_BLOCKS - .iter() - .map(|(_height, block_bytes)| block_bytes.zcash_deserialize_into().unwrap()) - .collect(); - - // Create a populated state service. - let (_state_service, read_only_state_service, latest_chain_tip, _chain_tip_change) = - zebra_state::populated_state(blocks.clone(), network).await; - - let db = read_only_state_service.db(); - // use the tip as starting height - let mut height = latest_chain_tip.best_tip_height().unwrap(); +#[cfg(test)] +mod vectors; - let mut transactions_found = 0; - let mut transactions_scanned = 0; - let mut blocks_scanned = 0; - while let Some(block) = db.block(height.into()) { - // We use a dummy size of the Sapling note commitment tree. We can't set the size to zero - // because the underlying scanning function would return - // `zcash_client_backeng::scanning::ScanError::TreeSizeUnknown`. - let sapling_commitment_tree_size = 1; +/// The extended Sapling viewing key of [ZECpages](https://zecpages.com/boardinfo) +pub const ZECPAGES_SAPLING_VIEWING_KEY: &str = "zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz"; - let orchard_commitment_tree_size = 0; - - let chain_metadata = ChainMetadata { - sapling_commitment_tree_size, - orchard_commitment_tree_size, - }; - - let compact_block = block_to_compact(&block, chain_metadata); - - let res = scan_block(network, &block, sapling_commitment_tree_size, &ivks) - .expect("scanning block for the ZECpages viewing key should work"); - - transactions_found += res.transactions().len(); - transactions_scanned += compact_block.vtx.len(); - blocks_scanned += 1; - - // scan backwards - if height.is_min() { - break; - } - height = height.previous()?; - } - - // make sure all blocks and transactions were scanned - assert_eq!(blocks_scanned, 11); - assert_eq!(transactions_scanned, 11); - - // no relevant transactions should be found - assert_eq!(transactions_found, 0); - - Ok(()) -} - -/// Creates a viewing key and a fake block containing a Sapling output decryptable by the key, scans -/// the block using the key, and adds the results to the database. -/// -/// The purpose of this test is to check if our database and our scanning code are compatible. -#[test] -#[allow(deprecated)] -fn scanning_fake_blocks_store_key_and_results() -> Result<()> { - // Generate a key - let extsk = ExtendedSpendingKey::master(&[]); - // TODO: find out how to do it with `to_diversifiable_full_viewing_key` as `to_extended_full_viewing_key` is deprecated. - let extfvk = extsk.to_extended_full_viewing_key(); - let dfvk: DiversifiableFullViewingKey = extsk.to_diversifiable_full_viewing_key(); - let key_to_be_stored = - zcash_client_backend::encoding::encode_extended_full_viewing_key("zxviews", &extfvk); - - // Create a database - let mut s = crate::storage::Storage::new(&Config::ephemeral(), Network::Mainnet); - - // Insert the generated key to the database - s.add_sapling_key(&key_to_be_stored, None); - - // Check key was added - assert_eq!(s.sapling_keys().len(), 1); - assert_eq!( - s.sapling_keys().get(&key_to_be_stored), - Some(&s.min_sapling_birthday_height()) - ); - - let nf = Nullifier([7; 32]); - - let (block, sapling_tree_size) = fake_block(1u32.into(), nf, &dfvk, 1, true, Some(0)); - - let result = scan_block(Network::Mainnet, &block, sapling_tree_size, &[&dfvk]).unwrap(); - - // The response should have one transaction relevant to the key we provided. - assert_eq!(result.transactions().len(), 1); - - let result = SaplingScannedResult::from(result.transactions()[0].txid.as_ref()); - - // Add result to database - s.add_sapling_results( - key_to_be_stored.clone(), - Height(1), - [(TransactionIndex::from_usize(0), result)].into(), - ); - - // Check the result was added - assert_eq!( - s.sapling_results(&key_to_be_stored).get(&Height(1)), - Some(&vec![result]) - ); - - Ok(()) -} +/// A fake viewing key in an incorrect format. +pub const FAKE_SAPLING_VIEWING_KEY: &str = "zxviewsfake"; /// Generates a fake block containing a Sapling output decryptable by `dfvk`. /// @@ -232,7 +58,7 @@ fn scanning_fake_blocks_store_key_and_results() -> Result<()> { /// 2. a V4 tx containing a random Sapling output, /// 3. a V4 tx containing a Sapling output decryptable by `dfvk`, /// 4. depending on the value of `tx_after`, another V4 tx containing a random Sapling output. -fn fake_block( +pub fn fake_block( height: BlockHeight, nf: Nullifier, dfvk: &DiversifiableFullViewingKey, @@ -305,7 +131,7 @@ fn fake_block( // be a number for easier conversion: // https://github.com/zcash/librustzcash/blob/zcash_primitives-0.13.0/zcash_client_backend/src/scanning.rs#L635 // We need to copy because this is a test private function upstream. -fn fake_compact_block( +pub fn fake_compact_block( height: BlockHeight, prev_hash: BlockHash, nf: Nullifier, @@ -394,7 +220,7 @@ fn fake_compact_block( // This is an exact copy of `zcash_client_backend::scanning::random_compact_tx`: // https://github.com/zcash/librustzcash/blob/zcash_primitives-0.13.0/zcash_client_backend/src/scanning.rs#L597 // We need to copy because this is a test private function upstream. -fn random_compact_tx(mut rng: impl RngCore) -> CompactTx { +pub fn random_compact_tx(mut rng: impl RngCore) -> CompactTx { let fake_nf = { let mut nf = vec![0; 32]; rng.fill_bytes(&mut nf); @@ -427,7 +253,7 @@ fn random_compact_tx(mut rng: impl RngCore) -> CompactTx { } /// Converts [`CompactTx`] to [`Transaction::V4`]. -fn compact_to_v4(tx: &CompactTx) -> Result { +pub fn compact_to_v4(tx: &CompactTx) -> Result { let sk = redjubjub::SigningKey::::new(thread_rng()); let vk = redjubjub::VerificationKey::from(&sk); let dummy_rk = sapling::keys::ValidatingKey::try_from(vk) diff --git a/zebra-scan/src/tests/vectors.rs b/zebra-scan/src/tests/vectors.rs new file mode 100644 index 00000000000..bcdca24c6e7 --- /dev/null +++ b/zebra-scan/src/tests/vectors.rs @@ -0,0 +1,198 @@ +//! Fixed integration test vectors for the scanner. + +use std::sync::Arc; + +use color_eyre::Result; + +use zcash_client_backend::{ + encoding::decode_extended_full_viewing_key, proto::compact_formats::ChainMetadata, +}; +use zcash_primitives::{ + constants::mainnet::HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY, + sapling::Nullifier, + zip32::{DiversifiableFullViewingKey, ExtendedSpendingKey}, +}; + +use zebra_chain::{ + block::{Block, Height}, + chain_tip::ChainTip, + parameters::Network, + serialization::ZcashDeserializeInto, +}; +use zebra_state::{SaplingScannedResult, TransactionIndex}; + +use crate::{ + config::Config, + scan::{block_to_compact, scan_block}, + tests::{fake_block, ZECPAGES_SAPLING_VIEWING_KEY}, +}; + +/// This test: +/// - Creates a viewing key and a fake block containing a Sapling output decryptable by the key. +/// - Scans the block. +/// - Checks that the result contains the txid of the tx containing the Sapling output. +#[tokio::test] +async fn scanning_from_fake_generated_blocks() -> Result<()> { + let extsk = ExtendedSpendingKey::master(&[]); + let dfvk: DiversifiableFullViewingKey = extsk.to_diversifiable_full_viewing_key(); + let nf = Nullifier([7; 32]); + + let (block, sapling_tree_size) = fake_block(1u32.into(), nf, &dfvk, 1, true, Some(0)); + + assert_eq!(block.transactions.len(), 4); + + let res = scan_block(Network::Mainnet, &block, sapling_tree_size, &[&dfvk]).unwrap(); + + // The response should have one transaction relevant to the key we provided. + assert_eq!(res.transactions().len(), 1); + + // Check that the original block contains the txid in the scanning result. + assert!(block + .transactions + .iter() + .map(|tx| tx.hash().bytes_in_display_order()) + .any(|txid| &txid == res.transactions()[0].txid.as_ref())); + + // Check that the txid in the scanning result matches the third tx in the original block. + assert_eq!( + res.transactions()[0].txid.as_ref(), + &block.transactions[2].hash().bytes_in_display_order() + ); + + // The block hash of the response should be the same as the one provided. + assert_eq!(res.block_hash().0, block.hash().0); + + Ok(()) +} + +/// Scan a populated state for the ZECpages viewing key. +/// This test is very similar to `scanning_from_populated_zebra_state` but with the ZECpages key. +/// There are no zechub transactions in the test data so we should get empty related transactions. +#[tokio::test] +async fn scanning_zecpages_from_populated_zebra_state() -> Result<()> { + // Parse the key from ZECpages + let efvk = decode_extended_full_viewing_key( + HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY, + ZECPAGES_SAPLING_VIEWING_KEY, + ) + .unwrap(); + + // Build a vector of viewing keys `vks` to scan for. + let fvk = efvk.fvk; + let ivk = fvk.vk.ivk(); + let ivks = vec![ivk]; + + let network = Network::Mainnet; + + // Create a continuous chain of mainnet blocks from genesis + let blocks: Vec> = zebra_test::vectors::CONTINUOUS_MAINNET_BLOCKS + .iter() + .map(|(_height, block_bytes)| block_bytes.zcash_deserialize_into().unwrap()) + .collect(); + + // Create a populated state service. + let (_state_service, read_only_state_service, latest_chain_tip, _chain_tip_change) = + zebra_state::populated_state(blocks.clone(), network).await; + + let db = read_only_state_service.db(); + + // use the tip as starting height + let mut height = latest_chain_tip.best_tip_height().unwrap(); + + let mut transactions_found = 0; + let mut transactions_scanned = 0; + let mut blocks_scanned = 0; + while let Some(block) = db.block(height.into()) { + // We use a dummy size of the Sapling note commitment tree. We can't set the size to zero + // because the underlying scanning function would return + // `zcash_client_backeng::scanning::ScanError::TreeSizeUnknown`. + let sapling_commitment_tree_size = 1; + + let orchard_commitment_tree_size = 0; + + let chain_metadata = ChainMetadata { + sapling_commitment_tree_size, + orchard_commitment_tree_size, + }; + + let compact_block = block_to_compact(&block, chain_metadata); + + let res = scan_block(network, &block, sapling_commitment_tree_size, &ivks) + .expect("scanning block for the ZECpages viewing key should work"); + + transactions_found += res.transactions().len(); + transactions_scanned += compact_block.vtx.len(); + blocks_scanned += 1; + + // scan backwards + if height.is_min() { + break; + } + height = height.previous()?; + } + + // make sure all blocks and transactions were scanned + assert_eq!(blocks_scanned, 11); + assert_eq!(transactions_scanned, 11); + + // no relevant transactions should be found + assert_eq!(transactions_found, 0); + + Ok(()) +} + +/// Creates a viewing key and a fake block containing a Sapling output decryptable by the key, scans +/// the block using the key, and adds the results to the database. +/// +/// The purpose of this test is to check if our database and our scanning code are compatible. +#[test] +#[allow(deprecated)] +fn scanning_fake_blocks_store_key_and_results() -> Result<()> { + // Generate a key + let extsk = ExtendedSpendingKey::master(&[]); + // TODO: find out how to do it with `to_diversifiable_full_viewing_key` as `to_extended_full_viewing_key` is deprecated. + let extfvk = extsk.to_extended_full_viewing_key(); + let dfvk: DiversifiableFullViewingKey = extsk.to_diversifiable_full_viewing_key(); + let key_to_be_stored = + zcash_client_backend::encoding::encode_extended_full_viewing_key("zxviews", &extfvk); + + // Create a database + let mut s = crate::storage::Storage::new(&Config::ephemeral(), Network::Mainnet); + + // Insert the generated key to the database + s.add_sapling_key(&key_to_be_stored, None); + + // Check key was added + assert_eq!(s.sapling_keys().len(), 1); + assert_eq!( + s.sapling_keys().get(&key_to_be_stored), + Some(&s.min_sapling_birthday_height()) + ); + + let nf = Nullifier([7; 32]); + + let (block, sapling_tree_size) = fake_block(1u32.into(), nf, &dfvk, 1, true, Some(0)); + + let result = scan_block(Network::Mainnet, &block, sapling_tree_size, &[&dfvk]).unwrap(); + + // The response should have one transaction relevant to the key we provided. + assert_eq!(result.transactions().len(), 1); + + let result = + SaplingScannedResult::from_bytes_in_display_order(*result.transactions()[0].txid.as_ref()); + + // Add result to database + s.add_sapling_results( + &key_to_be_stored, + Height(1), + [(TransactionIndex::from_usize(0), result)].into(), + ); + + // Check the result was added + assert_eq!( + s.sapling_results(&key_to_be_stored).get(&Height(1)), + Some(&vec![result]) + ); + + Ok(()) +} diff --git a/zebra-state/src/lib.rs b/zebra-state/src/lib.rs index 09c31577c84..6dbffd9ac3e 100644 --- a/zebra-state/src/lib.rs +++ b/zebra-state/src/lib.rs @@ -63,12 +63,12 @@ pub use service::{ pub use rocksdb::AsColumnFamilyRef; #[cfg(feature = "shielded-scan")] pub use service::finalized_state::{ - FromDisk, IntoDisk, ReadDisk, SaplingScannedDatabaseEntry, SaplingScannedDatabaseIndex, + FromDisk, IntoDisk, SaplingScannedDatabaseEntry, SaplingScannedDatabaseIndex, SaplingScannedResult, SaplingScanningKey, ZebraDb, }; #[cfg(any(test, feature = "proptest-impl", feature = "shielded-scan"))] -pub use service::finalized_state::{DiskWriteBatch, WriteDisk}; +pub use service::finalized_state::{DiskWriteBatch, ReadDisk, WriteDisk}; #[cfg(feature = "getblocktemplate-rpcs")] pub use response::GetBlockTemplateChainInfo; @@ -77,7 +77,7 @@ pub use response::GetBlockTemplateChainInfo; pub use service::{ arbitrary::{populated_state, CHAIN_TIP_UPDATE_WAIT_LIMIT}, chain_tip::{ChainTipBlock, ChainTipSender}, - finalized_state::MAX_ON_DISK_HEIGHT, + finalized_state::{RawBytes, KV, MAX_ON_DISK_HEIGHT}, init_test, init_test_services, ReadStateService, }; diff --git a/zebra-state/src/service/finalized_state.rs b/zebra-state/src/service/finalized_state.rs index 2e923fe7330..151ed01253b 100644 --- a/zebra-state/src/service/finalized_state.rs +++ b/zebra-state/src/service/finalized_state.rs @@ -42,8 +42,8 @@ mod tests; pub use disk_db::{DiskDb, DiskWriteBatch, ReadDisk, WriteDisk}; #[allow(unused_imports)] pub use disk_format::{ - FromDisk, IntoDisk, OutputIndex, OutputLocation, TransactionIndex, TransactionLocation, - MAX_ON_DISK_HEIGHT, + FromDisk, IntoDisk, OutputIndex, OutputLocation, RawBytes, TransactionIndex, + TransactionLocation, MAX_ON_DISK_HEIGHT, }; pub use zebra_db::ZebraDb; @@ -53,6 +53,9 @@ pub use disk_format::{ SaplingScanningKey, }; +#[cfg(any(test, feature = "proptest-impl"))] +pub use disk_format::KV; + /// The column families supported by the running `zebra-state` database code. /// /// Existing column families that aren't listed here are preserved when the database is opened. diff --git a/zebra-state/src/service/finalized_state/disk_format.rs b/zebra-state/src/service/finalized_state/disk_format.rs index 11ef2aff416..0ce04431e54 100644 --- a/zebra-state/src/service/finalized_state/disk_format.rs +++ b/zebra-state/src/service/finalized_state/disk_format.rs @@ -16,7 +16,7 @@ pub mod upgrade; #[cfg(feature = "shielded-scan")] pub mod scan; -#[cfg(test)] +#[cfg(any(test, feature = "proptest-impl"))] mod tests; pub use block::{TransactionIndex, TransactionLocation, MAX_ON_DISK_HEIGHT}; @@ -28,6 +28,9 @@ pub use scan::{ SaplingScanningKey, }; +#[cfg(any(test, feature = "proptest-impl"))] +pub use tests::KV; + /// Helper type for writing types to disk as raw bytes. /// Also used to convert key types to raw bytes for disk lookups. pub trait IntoDisk { diff --git a/zebra-state/src/service/finalized_state/disk_format/scan.rs b/zebra-state/src/service/finalized_state/disk_format/scan.rs index 4d4b3b813c8..9c14800cf58 100644 --- a/zebra-state/src/service/finalized_state/disk_format/scan.rs +++ b/zebra-state/src/service/finalized_state/disk_format/scan.rs @@ -37,9 +37,21 @@ impl From for transaction::Hash { } } -impl From<&[u8; 32]> for SaplingScannedResult { - fn from(bytes: &[u8; 32]) -> Self { - Self(*bytes) +impl From for SaplingScannedResult { + fn from(hash: transaction::Hash) -> Self { + SaplingScannedResult(hash.bytes_in_display_order()) + } +} + +impl SaplingScannedResult { + /// Creates a `SaplingScannedResult` from bytes in display order. + pub fn from_bytes_in_display_order(bytes: [u8; 32]) -> Self { + Self(bytes) + } + + /// Returns the inner bytes in display order. + pub fn bytes_in_display_order(&self) -> [u8; 32] { + self.0 } } @@ -162,19 +174,8 @@ impl FromDisk for SaplingScannedDatabaseIndex { } } -impl IntoDisk for SaplingScannedResult { - type Bytes = [u8; 32]; - - fn as_bytes(&self) -> Self::Bytes { - self.0 - } -} - -impl FromDisk for SaplingScannedResult { - fn from_bytes(bytes: impl AsRef<[u8]>) -> Self { - SaplingScannedResult(bytes.as_ref().try_into().unwrap()) - } -} +// We can't implement IntoDisk or FromDisk for SaplingScannedResult, +// because the format is actually Option. impl IntoDisk for Option { type Bytes = Vec; @@ -183,7 +184,7 @@ impl IntoDisk for Option { let mut bytes = Vec::new(); if let Some(result) = self.as_ref() { - bytes.extend(result.as_bytes()); + bytes.extend(result.bytes_in_display_order()); } bytes @@ -191,13 +192,18 @@ impl IntoDisk for Option { } impl FromDisk for Option { + #[allow(clippy::unwrap_in_result)] fn from_bytes(bytes: impl AsRef<[u8]>) -> Self { let bytes = bytes.as_ref(); if bytes.is_empty() { None } else { - Some(SaplingScannedResult::from_bytes(bytes)) + Some(SaplingScannedResult::from_bytes_in_display_order( + bytes + .try_into() + .expect("unexpected incorrect SaplingScannedResult data length"), + )) } } } diff --git a/zebra-state/src/service/finalized_state/disk_format/scan/tests/prop.rs b/zebra-state/src/service/finalized_state/disk_format/scan/tests/prop.rs index fa964370b0b..c770daecbd1 100644 --- a/zebra-state/src/service/finalized_state/disk_format/scan/tests/prop.rs +++ b/zebra-state/src/service/finalized_state/disk_format/scan/tests/prop.rs @@ -29,13 +29,6 @@ fn roundtrip_sapling_db_index() { ); } -#[test] -fn roundtrip_sapling_result() { - let _init_guard = zebra_test::init(); - - proptest!(|(val in any::())| assert_value_properties(val)); -} - #[test] fn roundtrip_option_sapling_result() { let _init_guard = zebra_test::init(); diff --git a/zebra-state/src/service/finalized_state/disk_format/tests.rs b/zebra-state/src/service/finalized_state/disk_format/tests.rs index 4680764c453..f959800ba8d 100644 --- a/zebra-state/src/service/finalized_state/disk_format/tests.rs +++ b/zebra-state/src/service/finalized_state/disk_format/tests.rs @@ -2,12 +2,14 @@ use serde::{Deserialize, Serialize}; +#[cfg(test)] mod prop; +#[cfg(test)] mod snapshot; /// A formatting struct for raw key-value data #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -struct KV { +pub struct KV { /// The raw key bytes, as a hexadecimal-encoded string. k: String, @@ -17,7 +19,7 @@ struct KV { impl KV { /// Create a new `KV` from raw key-value data. - fn new(key: K, value: V) -> KV + pub fn new(key: K, value: V) -> KV where K: AsRef<[u8]>, V: AsRef<[u8]>, @@ -26,7 +28,7 @@ impl KV { } /// Create a new `KV` from hex-encoded key-value data. - fn new_hex(key: String, value: String) -> KV { + pub fn new_hex(key: String, value: String) -> KV { KV { k: key, v: value } } } diff --git a/zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs b/zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs index 67b4f2ebb68..5866b08ddc2 100644 --- a/zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs +++ b/zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs @@ -27,7 +27,7 @@ //! //! Test shielded data, and data activated in Overwinter and later network upgrades. -use std::sync::Arc; +use std::{collections::BTreeMap, sync::Arc}; use zebra_chain::{ block::Block, @@ -37,11 +37,11 @@ use zebra_chain::{ use crate::{ service::finalized_state::{ - disk_db::{DiskDb, DB}, - disk_format::tests::KV, + disk_db::DiskDb, + disk_format::{tests::KV, RawBytes}, FinalizedState, }, - Config, + Config, ReadDisk, }; /// Snapshot test for RocksDB column families, and their key-value data. @@ -133,13 +133,12 @@ fn snapshot_raw_rocksdb_column_family_data(db: &DiskDb, original_cf_names: &[Str .expect("RocksDB API provides correct names"); // Correctness: Multi-key iteration causes hangs in concurrent code, but seems ok in tests. - let mut cf_iter = db.full_iterator_cf(&cf_handle, rocksdb::IteratorMode::Start); + let cf_items: BTreeMap = db.zs_items_in_range_ordered(&cf_handle, ..); // The default raw data serialization is very verbose, so we hex-encode the bytes. - let cf_data: Vec = cf_iter - .by_ref() - .map(|result| result.expect("unexpected database error")) - .map(|(key, value)| KV::new(key, value)) + let cf_data: Vec = cf_items + .iter() + .map(|(key, value)| KV::new(key.raw_bytes(), value.raw_bytes())) .collect(); if cf_name == "default" { @@ -153,14 +152,6 @@ fn snapshot_raw_rocksdb_column_family_data(db: &DiskDb, original_cf_names: &[Str // because those roots are used to populate the anchor column families. insta::assert_ron_snapshot!(format!("{cf_name}_raw_data"), cf_data); } - - let raw_cf_iter: rocksdb::DBRawIteratorWithThreadMode = cf_iter.into(); - - assert_eq!( - raw_cf_iter.status(), - Ok(()), - "unexpected column family iterator error", - ); } insta::assert_ron_snapshot!("empty_column_families", empty_column_families); diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 2e04355249d..c71bea1e436 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -118,6 +118,7 @@ proptest-impl = [ "zebra-state/proptest-impl", "zebra-network/proptest-impl", "zebra-chain/proptest-impl", + "zebra-scan?/proptest-impl", ] # Build the zebra-checkpoints utility for checkpoint generation tests @@ -271,6 +272,7 @@ zebra-chain = { path = "../zebra-chain", features = ["proptest-impl"] } zebra-consensus = { path = "../zebra-consensus", features = ["proptest-impl"] } zebra-network = { path = "../zebra-network", features = ["proptest-impl"] } zebra-state = { path = "../zebra-state", features = ["proptest-impl"] } +zebra-scan = { path = "../zebra-scan", features = ["proptest-impl"] } zebra-node-services = { path = "../zebra-node-services", features = ["rpc-client"] } diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index c2cb2ec9300..94a8066a34e 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -2821,13 +2821,13 @@ async fn fully_synced_rpc_z_getsubtreesbyindex_snapshot_test() -> Result<()> { fn scan_task_starts() -> Result<()> { use indexmap::IndexMap; - const ZECPAGES_VIEWING_KEY: &str = "zxviews1q0duytgcqqqqpqre26wkl45gvwwwd706xw608hucmvfalr759ejwf7qshjf5r9aa7323zulvz6plhttp5mltqcgs9t039cx2d09mgq05ts63n8u35hyv6h9nc9ctqqtue2u7cer2mqegunuulq2luhq3ywjcz35yyljewa4mgkgjzyfwh6fr6jd0dzd44ghk0nxdv2hnv4j5nxfwv24rwdmgllhe0p8568sgqt9ckt02v2kxf5ahtql6s0ltjpkckw8gtymxtxuu9gcr0swvz"; + use zebra_scan::tests::ZECPAGES_SAPLING_VIEWING_KEY; let _init_guard = zebra_test::init(); let mut config = default_test_config(Mainnet)?; let mut keys = IndexMap::new(); - keys.insert(ZECPAGES_VIEWING_KEY.to_string(), 1); + keys.insert(ZECPAGES_SAPLING_VIEWING_KEY.to_string(), 1); config.shielded_scan.sapling_keys_to_scan = keys; let testdir = testdir()?.with_config(&mut config)?;