Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step1: Integrate ZSA-compatible crates into Zebra while maintaining original Orchard (Vanilla) support for now [to upstream] #7

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
43b5e50
Prepare to use Orchard ZSA
dmidem Jul 29, 2024
95dce56
Switch Zebra to QED-it ZSA-compatible crates but maintain the origina…
dmidem Aug 11, 2024
054e655
Merge remote-tracking branch 'origin/main' into switch-to-zsa-crates-…
dmidem Aug 18, 2024
cdb9efd
fix(docker): allow the `zebra` user access to relevant dirs (#8817)
gustavovalverde Aug 29, 2024
0ef9987
fix(state): Write database format version to disk atomically to avoid…
arya2 Aug 29, 2024
6b95d27
fix(rpc): Return verification errors from `sendrawtransaction` RPC me…
arya2 Aug 30, 2024
2d23d6b
Merge branch 'zsa1' into switch-to-zsa-crates-nu6
dmidem Sep 2, 2024
53c65b6
Trigger CI
dmidem Sep 2, 2024
9a616f4
fix(deps): Replace `serde_yaml` by `serde_yml` (#8825)
upbqdn Sep 2, 2024
c238847
Add basic CI checks workflow
dmidem Sep 3, 2024
2c13ae9
Fix ci-basic.yml
dmidem Sep 3, 2024
5a839c6
Fix ci-basic.yml (2)
dmidem Sep 3, 2024
367a14b
Add installing of build-essential to ci-basic.yml
dmidem Sep 3, 2024
5541b27
Remove `shielded-scan` from experimental features (#8827)
upbqdn Sep 3, 2024
f2427d6
add(docs): Add minimal hardware requirements (#8822)
upbqdn Sep 3, 2024
e9bbb97
Update README.md (#8824)
dismad Sep 3, 2024
f425747
Try to use librocksdb-dev in ci-basic.yml
dmidem Sep 3, 2024
831c847
Run ci-basic.yml on ubuntu-24.04
dmidem Sep 3, 2024
ecaf98d
Enable nu6 cfg flag in ci-basic.yml
dmidem Sep 3, 2024
7d11159
Adjust the code with librustzcash/zcash_protocol nu6 related changes
dmidem Sep 4, 2024
6a0196e
Add RUSTDOCFLAGS to ci-basic.yml
dmidem Sep 4, 2024
d31eea5
ref(docker): use cache mounts for build cache (#8796)
gustavovalverde Sep 5, 2024
17d7f91
build(deps): bump tj-actions/changed-files in the devops group (#8835)
dependabot[bot] Sep 5, 2024
1511997
fix clippy lints (#8855)
oxarbitrage Sep 6, 2024
554a37d
feat(rpc): Add a `stop` rpc method (#8839)
oxarbitrage Sep 9, 2024
082cdad
feat(rpc): Add a `generate` rpc method (#8849)
oxarbitrage Sep 9, 2024
3f94303
feat(rpc): Add more fields to `getmininginfo` call (#8860)
oxarbitrage Sep 18, 2024
60d09a4
build(deps): bump tj-actions/changed-files in the devops group (#8874)
dependabot[bot] Sep 18, 2024
c5d8eb5
fix(rpc): modify shutdown used in `stop()` (#8863)
oxarbitrage Sep 18, 2024
aec07f2
ref(ci): consolidate cached states workflows and scripts (#8865)
gustavovalverde Sep 19, 2024
8870b2c
feat(cd): deploy instances with attached cached states (#8868)
gustavovalverde Sep 19, 2024
6951988
chore(docker): remove debugging output by default (#8870)
gustavovalverde Sep 19, 2024
c8280d4
feat(tests): Move the RPC tests framework from zcashd (#8866)
oxarbitrage Sep 20, 2024
1526276
Merge remote-tracking branch 'origin/main' into switch-to-zsa-crates-nu6
dmidem Sep 22, 2024
9e94dc5
Merge remote-tracking branch 'zcash/main' into switch-to-zsa-crates-nu6
dmidem Sep 22, 2024
d6301a6
Returns an error instead of panicking when the relevant chain is empt…
arya2 Sep 23, 2024
ac1242a
feat(ci): add Docker Scout vulnerabilities scanning (#8871)
gustavovalverde Sep 24, 2024
689a776
build(deps): bump docker/scout-action in the devops group (#8890)
dependabot[bot] Oct 1, 2024
12ade98
Merge branch 'main' into switch-to-zsa-crates-nu6
dmidem Oct 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 69 additions & 38 deletions .github/workflows/cd-deploy-nodes-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,26 @@ on:
type: boolean
default: false

# TODO: Temporarily disabled to reduce network load, see #6894.
#push:
# # Skip main branch updates where Rust code and dependencies aren't modified.
# branches:
# - main
# paths:
# # code and tests
# - '**/*.rs'
# # hard-coded checkpoints and proptest regressions
# - '**/*.txt'
# # dependencies
# - '**/Cargo.toml'
# - '**/Cargo.lock'
# # configuration files
# - '.cargo/config.toml'
# - '**/clippy.toml'
# # workflow definitions
# - 'docker/**'
# - '.dockerignore'
# - '.github/workflows/cd-deploy-nodes-gcp.yml'
# - '.github/workflows/sub-build-docker-image.yml'
push:
# Skip main branch updates where Rust code and dependencies aren't modified.
branches:
- main
paths:
# code and tests
- '**/*.rs'
# hard-coded checkpoints and proptest regressions
- '**/*.txt'
# dependencies
- '**/Cargo.toml'
- '**/Cargo.lock'
# configuration files
- '.cargo/config.toml'
- '**/clippy.toml'
# workflow definitions
- 'docker/**'
- '.dockerignore'
- '.github/workflows/cd-deploy-nodes-gcp.yml'
- '.github/workflows/sub-build-docker-image.yml'

# Only runs the Docker image tests, doesn't deploy any instances
pull_request:
Expand Down Expand Up @@ -176,6 +175,19 @@ jobs:
test_variables: '-e NETWORK -e ZEBRA_CONF_PATH="zebrad/tests/common/configs/v1.0.0-rc.2.toml"'
network: ${{ inputs.network || vars.ZCASH_NETWORK }}

# Finds a `tip` cached state disk for zebra from the main branch
#
# Passes the disk name to subsequent jobs using `cached_disk_name` output
#
get-disk-name:
name: Get disk name
uses: ./.github/workflows/sub-find-cached-disks.yml
with:
network: ${{ inputs.network || vars.ZCASH_NETWORK }}
disk_prefix: zebrad-cache
disk_suffix: tip
prefer_main_cached_state: true

# Deploy Managed Instance Groups (MiGs) for Mainnet and Testnet,
# with one node in the configured GCP region.
#
Expand All @@ -196,9 +208,11 @@ jobs:
matrix:
network: [Mainnet, Testnet]
name: Deploy ${{ matrix.network }} nodes
needs: [ build, versioning, test-configuration-file, test-zebra-conf-path ]
needs: [ build, versioning, test-configuration-file, test-zebra-conf-path, get-disk-name ]
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CACHED_DISK_NAME: ${{ needs.get-disk-name.outputs.cached_disk_name }}
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -240,24 +254,31 @@ jobs:
# but the implementation is failing as it's requiring the disk names, contrary to what is stated in the official documentation
- name: Create instance template for ${{ matrix.network }}
run: |
NAME="zebrad-cache-${{ env.GITHUB_HEAD_REF_SLUG_URL || env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}-${NETWORK}"
DISK_PARAMS="name=${NAME},device-name=${NAME},size=400GB,type=pd-ssd"
if [ -n "${{ env.CACHED_DISK_NAME }}" ]; then
DISK_PARAMS+=",image=${{ env.CACHED_DISK_NAME }}"
else
echo "No cached disk found for ${{ matrix.network }} in main branch"
exit 1
fi
gcloud compute instance-templates create-with-container zebrad-${{ needs.versioning.outputs.major_version || env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}-${NETWORK} \
--boot-disk-size 300GB \
--machine-type ${{ vars.GCP_SMALL_MACHINE }} \
--boot-disk-size 50GB \
--boot-disk-type=pd-ssd \
--image-project=cos-cloud \
--image-family=cos-stable \
--user-output-enabled \
--metadata google-logging-enabled=true,google-logging-use-fluentbit=true,google-monitoring-enabled=true \
--network-interface=subnet=${{ vars.GCP_SUBNETWORK }} \
--create-disk="${DISK_PARAMS}" \
--container-mount-disk=mount-path='/var/cache/zebrad-cache',name=${NAME},mode=rw \
--container-stdin \
--container-tty \
--container-image ${{ vars.GAR_BASE }}/zebrad@${{ needs.build.outputs.image_digest }} \
--container-env "NETWORK=${{ matrix.network }},LOG_FILE=${{ vars.CD_LOG_FILE }},LOG_COLOR=false,SENTRY_DSN=${{ vars.SENTRY_DSN }}" \
--create-disk=name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }}-${NETWORK},device-name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }}-${NETWORK},auto-delete=yes,size=300GB,type=pd-ssd,mode=rw \
--container-mount-disk=mount-path='/var/cache/zebrad-cache',name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }}-${NETWORK},mode=rw \
--machine-type ${{ vars.GCP_SMALL_MACHINE }} \
--network-interface=subnet=${{ vars.GCP_SUBNETWORK }} \
--service-account ${{ vars.GCP_DEPLOYMENTS_SA }} \
--scopes cloud-platform \
--labels=app=zebrad,environment=prod,network=${NETWORK},github_ref=${{ env.GITHUB_REF_SLUG_URL }} \
--metadata google-logging-enabled=true,google-logging-use-fluentbit=true,google-monitoring-enabled=true \
--labels=app=zebrad,environment=staging,network=${NETWORK},github_ref=${{ env.GITHUB_REF_SLUG_URL }} \
--tags zebrad

# Check if our destination instance group exists already
Expand Down Expand Up @@ -297,9 +318,11 @@ jobs:
# Note: this instances are not automatically replaced or deleted
deploy-instance:
name: Deploy single ${{ inputs.network }} instance
needs: [ build, test-configuration-file, test-zebra-conf-path ]
needs: [ build, test-configuration-file, test-zebra-conf-path, get-disk-name ]
runs-on: ubuntu-latest
timeout-minutes: 30
env:
CACHED_DISK_NAME: ${{ needs.get-disk-name.outputs.cached_disk_name }}
permissions:
contents: 'read'
id-token: 'write'
Expand Down Expand Up @@ -340,22 +363,30 @@ jobs:
# Create instance template from container image
- name: Manual deploy of a single ${{ inputs.network }} instance running zebrad
run: |
NAME="zebrad-cache-${{ env.GITHUB_HEAD_REF_SLUG_URL || env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}-${NETWORK}"
DISK_PARAMS="name=${NAME},device-name=${NAME},size=400GB,type=pd-ssd"
if [ -n "${{ env.CACHED_DISK_NAME }}" ]; then
DISK_PARAMS+=",image=${{ env.CACHED_DISK_NAME }}"
else
echo "No cached disk found for ${{ matrix.network }} in main branch"
exit 1
fi
gcloud compute instances create-with-container "zebrad-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}-${NETWORK}" \
--boot-disk-size 300GB \
--machine-type ${{ vars.GCP_SMALL_MACHINE }} \
--boot-disk-size 50GB \
--boot-disk-type=pd-ssd \
--image-project=cos-cloud \
--image-family=cos-stable \
--user-output-enabled \
--metadata google-logging-enabled=true,google-logging-use-fluentbit=true,google-monitoring-enabled=true \
--network-interface=subnet=${{ vars.GCP_SUBNETWORK }} \
--create-disk="${DISK_PARAMS}" \
--container-mount-disk=mount-path='/var/cache/zebrad-cache',name=${NAME},mode=rw \
--container-stdin \
--container-tty \
--container-image ${{ vars.GAR_BASE }}/zebrad@${{ needs.build.outputs.image_digest }} \
--container-env "NETWORK=${{ inputs.network }},LOG_FILE=${{ inputs.log_file }},LOG_COLOR=false,SENTRY_DSN=${{ vars.SENTRY_DSN }}" \
--create-disk=name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }}-${NETWORK},device-name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }}-${NETWORK},auto-delete=yes,size=300GB,type=pd-ssd,mode=rw \
--container-mount-disk=mount-path='/var/cache/zebrad-cache',name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }}-${NETWORK},mode=rw \
--machine-type ${{ vars.GCP_SMALL_MACHINE }} \
--network-interface=subnet=${{ vars.GCP_SUBNETWORK }} \
--service-account ${{ vars.GCP_DEPLOYMENTS_SA }} \
--scopes cloud-platform \
--metadata google-logging-enabled=true,google-monitoring-enabled=true \
--labels=app=zebrad,environment=qa,network=${NETWORK},github_ref=${{ env.GITHUB_REF_SLUG_URL }} \
--tags zebrad \
--zone ${{ vars.GCP_ZONE }}
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ci-basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Basic checks

#on: [push, pull_request]
on: [push]

jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]

env:
# Use system-installed RocksDB library instead of building from scratch
ROCKSDB_LIB_DIR: /usr/lib
# Use system-installed Snappy library for compression in RocksDB
SNAPPY_LIB_DIR: /usr/lib/x86_64-linux-gnu
# Enable the `nu6` feature in `zcash_protocol`
RUSTFLAGS: '--cfg zcash_unstable="nu6"'
RUSTDOCFLAGS: '--cfg zcash_unstable="nu6"'

steps:
- uses: actions/checkout@v4
- name: Install dependencies on Ubuntu
#run: sudo apt-get update && sudo apt-get install -y protobuf-compiler build-essential librocksdb-dev
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler librocksdb-dev
- name: Run tests
run: cargo test --verbose
- name: Verify working directory is clean
run: git diff --exit-code
- name: Run doc check
run: cargo doc --all-features --document-private-items
- name: Run format check
run: cargo fmt -- --check
4 changes: 2 additions & 2 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Rust files
id: changed-files-rust
uses: tj-actions/[email protected].0
uses: tj-actions/[email protected].2
with:
files: |
**/*.rs
Expand All @@ -56,7 +56,7 @@ jobs:

- name: Workflow files
id: changed-files-workflows
uses: tj-actions/[email protected].0
uses: tj-actions/[email protected].2
with:
files: |
.github/workflows/*.yml
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/scripts/gcp-get-available-disks.sh

This file was deleted.

Loading