* move the rpc-tests framework from zcashd
* ignore pycache
* remove all tests from the list except getmininginfo
* iimprove a bit the readme
* change some env variable names
* add cache, add reindex test
* fix the paralell framework
* fix env variables
* change tests order
* update docs with env variable name change
* fix binary location
* reduce base config
* restore env var
* ignore stderr in the output
* ref(ci): consolidate cached states workflows and scripts
We've been using multiple approaches to locate and retrieve cached states in GCP. However, this has made it difficult to reuse the same methods across new workflows or different scenarios.
To address this, we've streamlined the process to make it more reusable in other contexts. This change will support deploying instances from both the `main` branch and `release`, simplifying future implementations and speeding up the process.
Changes:
- Use a single bash script (`gcp-get-cached-disks.sh`) to get cached states names and availability
- Move script logic from `sub-find-cached-disks.yml` to `gcp-get-cached-disks.sh` and adapt `sub-find-cached-disks.yml` to allow to output available disks and disks names.
- Simplify parameters usage in `sub-deploy-integration-tests-gcp.yml` and convert the `Find ${{ inputs.test_id }} cached state disk` step into an independent job, to be able to use the `sub-find-cached-disks.yml` reusable workflow
- Remove repetition in `sub-ci-integration-tests-gcp.yml`
* ref(tests): Use the `ZEBRA_CACHED_STATE_DIR` env var across tests
We had a technical debt with some tests using a hardcoded value for the cache directory (`/zebrad-cache`), which generated inconsistency across disks and cached states directories.
Changes:
- Allow sync tests to use the `ZEBRA_CACHED_STATE_DIR` as the cache directory, if specified
- Update the `entrypoint.sh` to reflect this change
- Add the `ZEBRA_CACHED_STATE_DIR` variable to the missing tests in `sub-ci-integration-tests-gcp.yml`, and remove extra parameters to call reusable workflows.
* feat(cd): deploy instances with cached states
* fix(cd): allow deploying from branch
* fix(cd): add missing `CACHED_DISK_NAME` env
* ref(ci): consolidate cached states workflows and scripts
We've been using multiple approaches to locate and retrieve cached states in GCP. However, this has made it difficult to reuse the same methods across new workflows or different scenarios.
To address this, we've streamlined the process to make it more reusable in other contexts. This change will support deploying instances from both the `main` branch and `release`, simplifying future implementations and speeding up the process.
Changes:
- Use a single bash script (`gcp-get-cached-disks.sh`) to get cached states names and availability
- Move script logic from `sub-find-cached-disks.yml` to `gcp-get-cached-disks.sh` and adapt `sub-find-cached-disks.yml` to allow to output available disks and disks names.
- Simplify parameters usage in `sub-deploy-integration-tests-gcp.yml` and convert the `Find ${{ inputs.test_id }} cached state disk` step into an independent job, to be able to use the `sub-find-cached-disks.yml` reusable workflow
- Remove repetition in `sub-ci-integration-tests-gcp.yml`
* ref(tests): Use the `ZEBRA_CACHED_STATE_DIR` env var across tests
We had a technical debt with some tests using a hardcoded value for the cache directory (`/zebrad-cache`), which generated inconsistency across disks and cached states directories.
Changes:
- Allow sync tests to use the `ZEBRA_CACHED_STATE_DIR` as the cache directory, if specified
- Update the `entrypoint.sh` to reflect this change
- Add the `ZEBRA_CACHED_STATE_DIR` variable to the missing tests in `sub-ci-integration-tests-gcp.yml`, and remove extra parameters to call reusable workflows.
* add a `stop` rpc method
* add todo comment
* add a ticket number to the TODO
Co-authored-by: Marek <mail@marek.onl>
---------
Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
* ref(docker): leverage cache mount with bind mounts
This update eliminates the need for external tools like `cargo-chef` to leverage caching layers, resulting in an average build time reduction of 4m30s (~36% improvement).
While this solution doesn't fully resolve the issues mentioned in https://github.com/ZcashFoundation/zebra/issues/6169#issuecomment-1712776391, it represents the best possible approach without resorting to custom solutions, which we'd prefer to avoid.
* chore: remove extra `WORKDIR` and imp comments
* chore: improve comment legibility
Co-authored-by: Arya <aryasolhi@gmail.com>
---------
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: Arya <aryasolhi@gmail.com>
* Adds a mempool request to wait for a transaction verification result and uses it in `sendrawtransaction` RPC method
* removes unnecessary clone
* fix clippy warnings
* returns verification errors for all `mempool::Queue` requests, removes `QueueRpc` request variant
* returns oneshot channel in mempool::Response::Queue
* updates a test vector to check for download or verification error in mempool::response::Queued result receiver
* Always require tokio as a dependency in zebra-node-services
* checks for closed channel errors in sendrawtransaction and updates a prop test to check that verification errors are propagated correctly
* Splits `atomic_write_to_tmp_file` out of `zebra_network::Config::update_peer_cache`
* Uses the new `atomic_write_to_tmp_file` fn in `update_peer_cache()`
* Replaces repetitive code for getting the default peer and state cache directories with `default_cache_dir()`
* Converts `atomic_write_to_tmp_file` to a blocking function and adds `spawn_atomic_write_to_tmp_file` for use in async environments.
* Uses `atomic_write_to_tmp_file` to write database versions to disk
* Removes `spawn_atomic_write_to_tmp_file()` and inlines its body at its callsite to avoid adding tokio as a dependency of zebra-chain.
* Apply suggestions from code review
Co-authored-by: Marek <mail@marek.onl>
---------
Co-authored-by: Marek <mail@marek.onl>
* fix(docker): allow the `zebra` user access to relevant dirs
When runnning a Zebra node using Docker without a privileged user, you won't be able to modify some files and directories, not even the ones in the current directory, as the `zebra` user has no permission to `/`.
The best way to solve this is making the `/opt/zebrad` the current `WORKDIR`. This also requires moving the `entrypoint.sh` from the root `/` directory to `/etc/zebrad` as this directory is used to save configuration, and other files.
An `APP_HOME` ARG is used as not all platforms where a Docker container is deployed allows writting permissions to the `/opt` directory. This allow some users to re-build the image with a custom `WORKDIR`
* fix(docker): allow starting the container without a `zebrad` command
As `gosu` is just required and available in our `runtime` image, trying to run `docker run -it --rm --name tests -t zfnd/zebra:<pr> /bin/bash` in other stages will fail, as `gosu` is not available.
* Updates `EOS_PANIC_AFTER` end of support constant from 16 weeks to 14 weeks, so the Mainnet panic height is just before the second halving and end of the current dev fund.
* version bumps
* Updates CHANGELOG.md
* Updates changelog
* updates end of support time to 10 weeks
* Adds a note to the changelog about recovering after finalizing blocks from a fork
* Add new changes on main to CHANGELOG.md
* Updates ESTIMATED_RELEASE_HEIGHT
* Apply suggestions from code review
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
* Update zebrad/src/components/sync/end_of_support.rs
---------
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
* fix(docker): typo and uknown option in debian
* fix(docker): use `gosu` for rootless execution
Some of our entrypoint commands requires creating directories and files in places a non-privileged user can't access.
So we use `gosu` to step down from `root` to a non-privileged user during container startup, right at our application execution.
* Moves `Zec` type out from behind feature flag
* Adds 'ValuePoolBalance` type
* Updates getblockchaininfo return type to a BoxFuture
* minor refactor
* Adds service request
* Adds real value balances to getblockchaininfo RPC response
* Updates snapshots and the suggested command for updating snapshots
* Uses generic error constructors wherever possible and removes outdated TODOs
* Updates prop tests to handle mock service requests
* set testnet activation height
* add lockbox object to getblocksubsidy RPC method
* add totals to getblocksubsidy
* fix comment
* use vectors instead of options for arrays
* update getblocksubsidy
* match zcashd output
* fix network consistency check for nu6 testnet
* doc changes
* fix typo
* change `is_nu6`
* Suggestion for "change(rpc): Modify `getblocksubsidy` for NU6" (#8766)
* refactors get_block_subsidy RPC method
* replaces a `Default` impl with derived impls
* removes NU6 testnet activation height
* updates snapshot test to use a configured Testnet for the post-NU6 getblocksubsidy output
* fixes snapshot test
* fixes snapshot
* Add a snapshot of getblockchaininfo with a future nu6 height
---------
Co-authored-by: Pili Guerra <mpguerra@users.noreply.github.com>
Co-authored-by: Arya <aryasolhi@gmail.com>