From 17648cc6e1ec8c4608b05c6d713ff83a20bc4a04 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Tue, 19 Nov 2024 06:25:37 -0300 Subject: [PATCH 1/7] remove `scan-start-where-left-test` from CI (#9026) --- .../sub-ci-integration-tests-gcp.yml | 24 ------------------- docker/entrypoint.sh | 6 ----- 2 files changed, 30 deletions(-) diff --git a/.github/workflows/sub-ci-integration-tests-gcp.yml b/.github/workflows/sub-ci-integration-tests-gcp.yml index 75de0bfda2a..d4e4bd506d4 100644 --- a/.github/workflows/sub-ci-integration-tests-gcp.yml +++ b/.github/workflows/sub-ci-integration-tests-gcp.yml @@ -480,29 +480,6 @@ jobs: saves_to_disk: false secrets: inherit - # Test that the scanner can continue scanning where it was left when zebrad restarts. - # - # Runs: - # - after every PR is merged to `main` - # - on every PR update - # - # If the state version has changed, waits for the new cached states to be created. - # Otherwise, if the state rebuild was skipped, runs immediately after the build job. - scan-start-where-left-test: - name: Scan starts where left - needs: [test-full-sync, get-available-disks] - uses: ./.github/workflows/sub-deploy-integration-tests-gcp.yml - if: ${{ !cancelled() && !failure() && (fromJSON(needs.get-available-disks.outputs.zebra_tip_disk) || needs.test-full-sync.result == 'success') && github.event.inputs.regenerate-disks != 'true' && github.event.inputs.run-full-sync != 'true' && github.event.inputs.run-lwd-sync != 'true' }} - with: - app_name: zebra-scan - test_id: scan-start-where-left - test_description: Test that the scanner can continue scanning where it was left when zebrad restarts. - test_variables: "-e NETWORK=${{ inputs.network || vars.ZCASH_NETWORK }} -e TEST_SCAN_START_WHERE_LEFT=1 -e ZEBRA_FORCE_USE_COLOR=1 -e ZEBRA_CACHED_STATE_DIR=/var/cache/zebrad-cache" - needs_zebra_state: true - needs_lwd_state: false - saves_to_disk: true - secrets: inherit - # Test that the scan task registers keys, deletes keys, and subscribes to results for keys while running. # # Runs: @@ -546,7 +523,6 @@ jobs: lightwalletd-grpc-test, get-block-template-test, submit-block-test, - scan-start-where-left-test, scan-task-commands-test, ] # Only open tickets for failed scheduled jobs, manual workflow runs, or `main` branch merges. diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d71be57805d..9c1165c54a3 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -74,7 +74,6 @@ fi : "${TEST_LWD_TRANSACTIONS:=}" : "${TEST_GET_BLOCK_TEMPLATE:=}" : "${TEST_SUBMIT_BLOCK:=}" -: "${TEST_SCAN_START_WHERE_LEFT:=}" : "${ENTRYPOINT_FEATURES:=}" : "${TEST_SCAN_TASK_COMMANDS:=}" @@ -340,11 +339,6 @@ case "$1" in check_directory_files "${ZEBRA_CACHED_STATE_DIR}" run_cargo_test "${ENTRYPOINT_FEATURES}" "submit_block" - elif [[ "${TEST_SCAN_START_WHERE_LEFT}" -eq "1" ]]; then - # Test that the scanner can continue scanning where it was left when zebra-scanner restarts. - check_directory_files "${ZEBRA_CACHED_STATE_DIR}" - exec cargo test --locked --release --features "zebra-test" --package zebra-scan -- --nocapture --include-ignored scan_start_where_left - elif [[ "${TEST_SCAN_TASK_COMMANDS}" -eq "1" ]]; then # Test that the scan task commands are working. check_directory_files "${ZEBRA_CACHED_STATE_DIR}" From 3983428ac4dcb7e181896529963575ec702acc10 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 19 Nov 2024 11:41:57 +0000 Subject: [PATCH 2/7] fix(ci): run most lighwalletd tests correctly (#9038) A LWD test was expecting the `ZEBRA_TEST_LIGHTWALLETD` to be set, but this variable is needed for all LWD tests and not specifically for `lightwalletd_integration`. We had to rename this variable on a buggy `elif` statement in our Docker entrypoint. This was avoiding most LWD tests to run correctly. --- .github/workflows/sub-ci-unit-tests-docker.yml | 2 +- docker/entrypoint.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sub-ci-unit-tests-docker.yml b/.github/workflows/sub-ci-unit-tests-docker.yml index 475072e81c7..dd6c89a5a75 100644 --- a/.github/workflows/sub-ci-unit-tests-docker.yml +++ b/.github/workflows/sub-ci-unit-tests-docker.yml @@ -138,7 +138,7 @@ jobs: NETWORK: ${{ inputs.network || vars.ZCASH_NETWORK }} run: | docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} - docker run --tty -e NETWORK -e ZEBRA_TEST_LIGHTWALLETD=1 ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} + docker run --tty -e NETWORK -e ZEBRA_TEST_LIGHTWALLETD=1 -e TEST_LWD_INTEGRATION=1 ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} # Test that Zebra works using the default config with the latest Zebra version. test-configuration-file: diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 9c1165c54a3..dc1dbc121cf 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -59,7 +59,7 @@ fi : "${RUN_ALL_EXPERIMENTAL_TESTS:=}" : "${TEST_FAKE_ACTIVATION_HEIGHTS:=}" : "${TEST_ZEBRA_EMPTY_SYNC:=}" -: "${ZEBRA_TEST_LIGHTWALLETD:=}" +: "${TEST_LWD_INTEGRATION:=}" : "${FULL_SYNC_MAINNET_TIMEOUT_MINUTES:=}" : "${FULL_SYNC_TESTNET_TIMEOUT_MINUTES:=}" : "${TEST_DISK_REBUILD:=}" @@ -239,10 +239,6 @@ case "$1" in # Test that Zebra syncs and checkpoints a few thousand blocks from an empty state. run_cargo_test "${ENTRYPOINT_FEATURES}" "sync_large_checkpoints_" - elif [[ "${ZEBRA_TEST_LIGHTWALLETD}" -eq "1" ]]; then - # Test launching lightwalletd with an empty lightwalletd and Zebra state. - run_cargo_test "${ENTRYPOINT_FEATURES}" "lightwalletd_integration" - elif [[ -n "${FULL_SYNC_MAINNET_TIMEOUT_MINUTES}" ]]; then # Run a Zebra full sync test on mainnet. run_cargo_test "${ENTRYPOINT_FEATURES}" "full_sync_mainnet" @@ -303,6 +299,10 @@ case "$1" in # Since these tests use the same cached state, a state problem in the first test can fail the second test. run_cargo_test "${ENTRYPOINT_FEATURES}" "--test-threads" "1" "fully_synced_rpc_" + elif [[ "${TEST_LWD_INTEGRATION}" -eq "1" ]]; then + # Test launching lightwalletd with an empty lightwalletd and Zebra state. + run_cargo_test "${ENTRYPOINT_FEATURES}" "lightwalletd_integration" + elif [[ "${TEST_LWD_FULL_SYNC}" -eq "1" ]]; then # Starting at a cached Zebra tip, run a lightwalletd sync to tip. check_directory_files "${ZEBRA_CACHED_STATE_DIR}" From 5f2f97209e96d7e3c9fa3d47f72e5aa134c877fd Mon Sep 17 00:00:00 2001 From: Marek Date: Fri, 22 Nov 2024 13:15:01 +0100 Subject: [PATCH 3/7] fix(test): Update the reference Sapling treestate (#9051) * Update the reference Sapling treestate Zebra's treestate serialization differs from `zcashd` in the following way: `zcashd` omits the serialization of empty trailing ommers, while Zebra doesn't. This means that `zcashd` serializes the Sapling treestate for height 419_201 as 019eb30778ddeea84c72e69e07a1689f3c8def3dc0a1939f0edcbe47279069d9310002000150715810d52caf35471d10feb487213fbd95ff209122225b7b65d27a7fb1a44d Whereas Zebra serializes it as 019eb30778ddeea84c72e69e07a1689f3c8def3dc0a1939f0edcbe47279069d931001f000150715810d52caf35471d10feb487213fbd95ff209122225b7b65d27a7fb1a44d0000000000000000000000000000000000000000000000000000000000 Serialization Format ==================== The serialized treestate consists of optional, hex-encoded, 32-byte hashes. If the hash is not present, it is serialized as byte 0, i.e., `0x00`. If the hash is present, it is prefixed by byte 1, i.e. `0x01`. The first two hashes in the serialized treestate are the treestate's left and right leaves. These are followed by the serialized length of the vector of ommers. This length is serialized as 1, 3, 5, or 9 bytes. If the length is less than 253, it is serialized as a single byte. The length is then followed by the serialized ommers. We can now parse the first string, produced by `zcashd`: - `0119eb30778ddeea84c72e69e07a1689f3c8def3dc0a1939f0edcbe47279069d931` is the serialized left leaf, - `00` is the serialized right leaf, - `02` is the serialized length of the vector of ommers, - `00` is the serialized first ommer, - `0150715810d52caf35471d10feb487213fbd95ff209122225b7b65d27a7fb1a44d` is the serialized second ommer. And the second one, produced by Zebra: - `0119eb30778ddeea84c72e69e07a1689f3c8def3dc0a1939f0edcbe47279069d931` is the serialized left leaf, - `00` is the serialized right leaf, - `1f` is the serialized length of the vector of ommers, - `00` is the serialized first ommer, - `0150715810d52caf35471d10feb487213fbd95ff209122225b7b65d27a7fb1a44d` is the serialized second ommer - `0000000000000000000000000000000000000000000000000000000000` are the remaining 29 serialized ommers. Note that both serializations represent the same treestate. * Remove a new line char --- zebra-test/src/vectors/sapling-treestate-main-0-419-201.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra-test/src/vectors/sapling-treestate-main-0-419-201.txt b/zebra-test/src/vectors/sapling-treestate-main-0-419-201.txt index c6cd1b532c0..7ce9416012a 100644 --- a/zebra-test/src/vectors/sapling-treestate-main-0-419-201.txt +++ b/zebra-test/src/vectors/sapling-treestate-main-0-419-201.txt @@ -1 +1 @@ -019eb30778ddeea84c72e69e07a1689f3c8def3dc0a1939f0edcbe47279069d9310002000150715810d52caf35471d10feb487213fbd95ff209122225b7b65d27a7fb1a44d \ No newline at end of file +019eb30778ddeea84c72e69e07a1689f3c8def3dc0a1939f0edcbe47279069d931001f000150715810d52caf35471d10feb487213fbd95ff209122225b7b65d27a7fb1a44d0000000000000000000000000000000000000000000000000000000000 \ No newline at end of file From 4f0746a613fb893990f042b46b24989c5be76926 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Fri, 22 Nov 2024 09:15:06 -0300 Subject: [PATCH 4/7] fix links in release templates (#9050) --- .github/ISSUE_TEMPLATE/release.md | 2 +- .../release-checklist.md | 19 +++++++++++++------ book/src/SUMMARY.md | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 0e2ee30b7b1..080bc385c20 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -16,7 +16,7 @@ They can be skipped for urgent releases. To check consensus correctness, we want to test that the state format is valid after a full sync. (Format upgrades are tested in CI on each PR.) -- [ ] Make sure there has been [at least one successful full sync test](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-integration-tests-gcp.yml?query=event%3Aschedule) since the last state change, or +- [ ] Make sure there has been [at least one successful full sync test](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-tests.yml?query=event%3Aschedule) since the last state change, or - [ ] Start a manual workflow run with a Zebra and `lightwalletd` full sync. State format changes can be made in `zebra-state` or `zebra-chain`. The state format can be changed by data that is sent to the state, data created within the state using `zebra-chain`, or serialization formats in `zebra-state` or `zebra-chain`. diff --git a/.github/PULL_REQUEST_TEMPLATE/release-checklist.md b/.github/PULL_REQUEST_TEMPLATE/release-checklist.md index 5445834df3e..8679a37154f 100644 --- a/.github/PULL_REQUEST_TEMPLATE/release-checklist.md +++ b/.github/PULL_REQUEST_TEMPLATE/release-checklist.md @@ -9,7 +9,7 @@ assignees: '' # Prepare for the Release -- [ ] Make sure there has been [at least one successful full sync test](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-integration-tests-gcp.yml?query=event%3Aschedule) since the last state change, or start a manual full sync. +- [ ] Make sure there has been [at least one successful full sync test in the main branch](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-tests.yml?query=branch%3Amain) since the last state change, or start a manual full sync. - [ ] Make sure the PRs with the new checkpoint hashes and missed dependencies are already merged. (See the release ticket checklist for details) @@ -57,7 +57,13 @@ fastmod --fixed-strings '1.58' '1.65' - [ ] Freeze the [`batched` queue](https://dashboard.mergify.com/github/ZcashFoundation/repo/zebra/queues) using Mergify. - [ ] Mark all the release PRs as `Critical` priority, so they go in the `urgent` Mergify queue. - [ ] Mark all non-release PRs with `do-not-merge`, because Mergify checks approved PRs against every commit, even when a queue is frozen. +- [ ] Add the `A-release` tag to the release pull request in order for the `check_no_git_refs_in_cargo_lock` to run. +## Zebra git sources dependencies + +- [ ] Ensure the `check_no_git_refs_in_cargo_lock` check passes. + +This check runs automatically on pull requests with the `A-release` label. It must pass for crates to be published to crates.io. If the check fails, you should either halt the release process or proceed with the understanding that the crates will not be published on crates.io. # Update Versions and End of Support @@ -76,7 +82,7 @@ Zebra's Rust API doesn't have any support or stability guarantees, so we keep al ### Update Crate Versions -If you're publishing crates for the first time, [log in to crates.io](https://github.com/ZcashFoundation/zebra/blob/doc-crate-own/book/src/dev/crate-owners.md#logging-in-to-cratesio), +If you're publishing crates for the first time, [log in to crates.io](https://zebra.zfnd.org/dev/crate-owners.html#logging-in-to-cratesio), and make sure you're a member of owners group. Check that the release will work: @@ -103,7 +109,7 @@ Crate publishing is [automatically checked in CI](https://github.com/ZcashFounda ## Update End of Support The end of support height is calculated from the current blockchain height: -- [ ] Find where the Zcash blockchain tip is now by using a [Zcash explorer](https://zcashblockexplorer.com/blocks) or other tool. +- [ ] Find where the Zcash blockchain tip is now by using a [Zcash Block Explorer](https://mainnet.zcashexplorer.app/) or other tool. - [ ] Replace `ESTIMATED_RELEASE_HEIGHT` in [`end_of_support.rs`](https://github.com/ZcashFoundation/zebra/blob/main/zebrad/src/components/sync/end_of_support.rs) with the height you estimate the release will be tagged.
@@ -141,8 +147,7 @@ The end of support height is calculated from the current blockchain height: ## Test the Pre-Release - [ ] Wait until the Docker binaries have been built on `main`, and the quick tests have passed: - - [ ] [ci-unit-tests-docker.yml](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-unit-tests-docker.yml?query=branch%3Amain) - - [ ] [ci-integration-tests-gcp.yml](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-integration-tests-gcp.yml?query=branch%3Amain) + - [ ] [ci-tests.yml](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-tests.yml?query=branch%3Amain) - [ ] Wait until the [pre-release deployment machines have successfully launched](https://github.com/ZcashFoundation/zebra/actions/workflows/cd-deploy-nodes-gcp.yml?query=event%3Arelease) ## Publish Release @@ -151,7 +156,7 @@ The end of support height is calculated from the current blockchain height: ## Publish Crates -- [ ] [Run `cargo login`](https://github.com/ZcashFoundation/zebra/blob/doc-crate-own/book/src/dev/crate-owners.md#logging-in-to-cratesio) +- [ ] [Run `cargo login`](https://zebra.zfnd.org/dev/crate-owners.html#logging-in-to-cratesio) - [ ] Run `cargo clean` in the zebra repo (optional) - [ ] Publish the crates to crates.io: `cargo release publish --verbose --workspace --execute` - [ ] Check that Zebra can be installed from `crates.io`: @@ -159,7 +164,9 @@ The end of support height is calculated from the current blockchain height: and put the output in a comment on the PR. ## Publish Docker Images + - [ ] Wait for the [the Docker images to be published successfully](https://github.com/ZcashFoundation/zebra/actions/workflows/release-binaries.yml?query=event%3Arelease). +- [ ] Wait for the new tag in the [dockerhub zebra space](https://hub.docker.com/r/zfnd/zebra/tags) - [ ] Un-freeze the [`batched` queue](https://dashboard.mergify.com/github/ZcashFoundation/repo/zebra/queues) using Mergify. - [ ] Remove `do-not-merge` from the PRs you added it to diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md index a7b018a2b9a..9f8715a8806 100644 --- a/book/src/SUMMARY.md +++ b/book/src/SUMMARY.md @@ -37,6 +37,7 @@ - [Doing Mass Renames](dev/mass-renames.md) - [Updating the ECC dependencies](dev/ecc-updates.md) - [Running a Private Testnet Test](dev/private-testnet.md) + - [Zebra crates](dev/crate-owners.md) - [Zebra RFCs](dev/rfcs.md) - [Pipelinable Block Lookup](dev/rfcs/0001-pipelinable-block-lookup.md) - [Parallel Verification](dev/rfcs/0002-parallel-verification.md) From 802a2433857647d5696bd88b02eed6fdf4d4fb95 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 27 Nov 2024 15:49:02 +0000 Subject: [PATCH 5/7] fix(mergify): align `build` job name across workflows (#9055) --- .github/workflows/ci-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 7f0a19dcc06..517ba4151f2 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -121,7 +121,7 @@ jobs: # workflow or repository variable is configured differently. Testnet jobs change that config to # testnet when running the image. build: - name: Build images + name: Build CI Docker # Skip PRs from external repositories, let them pass, and then GitHub's Merge Queue will check them if: ${{ !startsWith(github.event_name, 'pull') || !github.event.pull_request.head.repo.fork }} uses: ./.github/workflows/sub-build-docker-image.yml From 0af07426134986f14ac202765358de522ef7cc23 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 27 Nov 2024 12:49:07 -0300 Subject: [PATCH 6/7] upgrade min protocol versions for all network kinds (#9058) --- zebra-network/src/constants.rs | 8 ++++---- zebra-network/src/peer_set/set/tests/vectors.rs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/zebra-network/src/constants.rs b/zebra-network/src/constants.rs index a116fd63018..acab966f40c 100644 --- a/zebra-network/src/constants.rs +++ b/zebra-network/src/constants.rs @@ -396,14 +396,14 @@ lazy_static! { /// /// The minimum network protocol version typically changes after Mainnet and /// Testnet network upgrades. - // TODO: Change `Nu5` to `Nu6` after NU6 activation. + // TODO: Change `Nu6` to `Nu7` after NU7 activation. // TODO: Move the value here to a field on `testnet::Parameters` (#8367) pub static ref INITIAL_MIN_NETWORK_PROTOCOL_VERSION: HashMap = { let mut hash_map = HashMap::new(); - hash_map.insert(NetworkKind::Mainnet, Version::min_specified_for_upgrade(&Mainnet, Nu5)); - hash_map.insert(NetworkKind::Testnet, Version::min_specified_for_upgrade(&Network::new_default_testnet(), Nu5)); - hash_map.insert(NetworkKind::Regtest, Version::min_specified_for_upgrade(&Network::new_regtest(None, None), Nu5)); + hash_map.insert(NetworkKind::Mainnet, Version::min_specified_for_upgrade(&Mainnet, Nu6)); + hash_map.insert(NetworkKind::Testnet, Version::min_specified_for_upgrade(&Network::new_default_testnet(), Nu6)); + hash_map.insert(NetworkKind::Regtest, Version::min_specified_for_upgrade(&Network::new_regtest(None, None), Nu6)); hash_map }; diff --git a/zebra-network/src/peer_set/set/tests/vectors.rs b/zebra-network/src/peer_set/set/tests/vectors.rs index 0a5d3d34eaf..9f8fbe1f136 100644 --- a/zebra-network/src/peer_set/set/tests/vectors.rs +++ b/zebra-network/src/peer_set/set/tests/vectors.rs @@ -26,7 +26,7 @@ fn peer_set_ready_single_connection() { let peer_versions = PeerVersions { peer_versions: vec![Version::min_specified_for_upgrade( &Network::Mainnet, - NetworkUpgrade::Nu5, + NetworkUpgrade::Nu6, )], }; @@ -118,7 +118,7 @@ fn peer_set_ready_single_connection() { #[test] fn peer_set_ready_multiple_connections() { // Use three peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version, peer_version], }; @@ -182,7 +182,7 @@ fn peer_set_rejects_connections_past_per_ip_limit() { const NUM_PEER_VERSIONS: usize = crate::constants::DEFAULT_MAX_CONNS_PER_IP + 1; // Use three peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: [peer_version; NUM_PEER_VERSIONS].into_iter().collect(), }; @@ -232,7 +232,7 @@ fn peer_set_route_inv_empty_registry() { let test_hash = block::Hash([0; 32]); // Use two peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version], }; @@ -315,7 +315,7 @@ fn peer_set_route_inv_advertised_registry_order(advertised_first: bool) { let test_change = InventoryStatus::new_available(test_inv, test_peer); // Use two peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version], }; @@ -423,7 +423,7 @@ fn peer_set_route_inv_missing_registry_order(missing_first: bool) { let test_change = InventoryStatus::new_missing(test_inv, test_peer); // Use two peers with the same version - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version, peer_version], }; @@ -525,7 +525,7 @@ fn peer_set_route_inv_all_missing_fail() { let test_change = InventoryStatus::new_missing(test_inv, test_peer); // Use one peer - let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu5); + let peer_version = Version::min_specified_for_upgrade(&Network::Mainnet, NetworkUpgrade::Nu6); let peer_versions = PeerVersions { peer_versions: vec![peer_version], }; From 8cfb61f52c0948cab9e57df7222244799de379e5 Mon Sep 17 00:00:00 2001 From: Arya Date: Wed, 27 Nov 2024 10:49:12 -0500 Subject: [PATCH 7/7] add(ci): Check that dependencies have all been published to crates.io on release PRs (#8992) * Adds a test to check for crates in the Cargo.lock file that are being pulled in from a git source. * add `check_no_git_refs_in_cargo_lock` to CI * try skip instead of exclude --------- Co-authored-by: Alfredo Garcia --- .github/workflows/sub-ci-unit-tests-docker.yml | 9 +++++++++ docker/entrypoint.sh | 8 ++++++-- zebrad/tests/acceptance.rs | 12 ++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub-ci-unit-tests-docker.yml b/.github/workflows/sub-ci-unit-tests-docker.yml index dd6c89a5a75..da69d12e286 100644 --- a/.github/workflows/sub-ci-unit-tests-docker.yml +++ b/.github/workflows/sub-ci-unit-tests-docker.yml @@ -197,3 +197,12 @@ jobs: # If there is already an open issue with this label, any failures become comments on that issue. always-create-new-issue: false github-token: ${{ secrets.GITHUB_TOKEN }} + + run-check-no-git-refs: + if: contains(github.event.pull_request.labels.*.name, 'A-release') + runs-on: ubuntu-latest + steps: + - name: Run check_no_git_refs_in_cargo_lock + run: | + docker pull ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} + docker run --tty -e NETWORK -e RUN_CHECK_NO_GIT_REFS=1 ${{ vars.GAR_BASE }}/${{ vars.CI_IMAGE_NAME }}@${{ inputs.image_digest }} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index dc1dbc121cf..ccd09f43c33 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -224,12 +224,16 @@ case "$1" in if [[ "${RUN_ALL_TESTS}" -eq "1" ]]; then # Run unit, basic acceptance tests, and ignored tests, only showing command output if the test fails. # If the lightwalletd environmental variables are set, we will also run those tests. - exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored + exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored --skip check_no_git_refs_in_cargo_lock elif [[ "${RUN_ALL_EXPERIMENTAL_TESTS}" -eq "1" ]]; then # Run unit, basic acceptance tests, and ignored tests with experimental features. # If the lightwalletd environmental variables are set, we will also run those tests. - exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES_EXPERIMENTAL}" --workspace -- --nocapture --include-ignored + exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES_EXPERIMENTAL}" --workspace -- --nocapture --include-ignored --skip check_no_git_refs_in_cargo_lock + + elif [[ "${RUN_CHECK_NO_GIT_REFS}" -eq "1" ]]; then + # Run the check_no_git_refs_in_cargo_lock test. + exec cargo test --locked --release --features "${ENTRYPOINT_FEATURES}" --workspace -- --nocapture --include-ignored check_no_git_refs_in_cargo_lock elif [[ "${TEST_FAKE_ACTIVATION_HEIGHTS}" -eq "1" ]]; then # Run state tests with fake activation heights. diff --git a/zebrad/tests/acceptance.rs b/zebrad/tests/acceptance.rs index 1a8cefbe0b2..3dfc959eb58 100644 --- a/zebrad/tests/acceptance.rs +++ b/zebrad/tests/acceptance.rs @@ -3538,3 +3538,15 @@ async fn nu6_funding_streams_and_coinbase_balance() -> Result<()> { Ok(()) } + +/// Check that Zebra does not depend on any crates from git sources. +#[test] +#[ignore] +fn check_no_git_refs_in_cargo_lock() { + let cargo_lock_contents = + fs::read_to_string("../Cargo.lock").expect("should have Cargo.lock file in root dir"); + + if cargo_lock_contents.contains(r#"source = "git+"#) { + panic!("Cargo.lock includes git sources") + } +}