* make start and end fields optional and apply new rules to match zcashd
* update docs to mark range fields as optionals
* Apply suggestions from code review
Co-authored-by: Arya <aryasolhi@gmail.com>
---------
Co-authored-by: Arya <aryasolhi@gmail.com>
* extend `getrawtransaction` verbose output
* replace strings where possible, fix tests
* fix orchard
* add todos for script assembly code
* fix an import
* fmt
* fmt
* suggestion for #9329: change coinbase field and add valueSat field to match zcashd (#9407)
* change coinbase field and add valueSat field to match zcashd
* remove valueSat; update vectors
---------
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
* fix(test): wait for genesis block before launching lightwalletd
The `lightwalletd_integration` test would fail when running with an empty
`zebrad` state (`LaunchWithEmptyState` test type). `lightwalletd` expects
the connected `zebrad` instance to have processed at least the genesis
block upon startup and treats a completely empty state as a fatal error.
This adds a wait step specifically for the empty state scenario.
The test now waits for `zebrad` to log that it has committed the genesis
block (Height 0) before launching the `lightwalletd` process. This
ensures `zebrad` is ready and prevents `lightwalletd` from exiting
prematurely.
* fix(test): use syncer state tip log for lightwalletd launch condition
* fix(test): lint
* refactor!: remove experimental features from release builds
BREAKING CHANGE: Experimental features are no longer built into release images.
Users must now build custom images with specific features if needed.
- Remove experimental build job from release workflow
- Remove experimental features from CI matrix
- Update documentation to reflect new feature strategy
- Simplify Dockerfile by removing experimental feature args
- Keep RUN_ALL_EXPERIMENTAL_TESTS for testing purposes only
Migration: Users who need specific features should:
1. Build custom images using --build-arg FEATURES="feature1 feature2"
2. Use the documented feature flags in their builds
3. Refer to the new documentation for building with custom features
Closes #9210Closes#9204
Partially #7415
* revert(ci): Add support for experimental features in test runs
Enable passing experimental features to Docker test runs by:
- Updating workflow configuration to pass EXPERIMENTAL_FEATURES
- Modifying entrypoint script to include experimental features during test execution
- Documenting new experimental test category in workflow README
* refactor(docs): streamline Docker documentation and feature testing strategy
- Reorganized and clarified advanced usage instructions for building Docker images with custom features, including metrics support.
- Enhanced the presentation of alternatives and configuration details for Docker usage.
* Apply suggestions from code review
Co-authored-by: Marek <mail@marek.onl>
* chore: revert deleted sentence
* Update book/src/user/docker.md
Co-authored-by: Marek <mail@marek.onl>
---------
Co-authored-by: Marek <mail@marek.onl>
This also updates to the latest `zcash_client_backend` dependency, and
fixes a few imports to use base types instead of reexported versions
that may be deprecated in the future.
* fix(docker): set `HOME` environment variable explicitly in Dockerfile
The HOME environment variable was defaulting to /root when the container started, causing cache directories to be incorrectly set up under /root/.cache/zebra instead of /home/zebra/.cache/zebra. This explicit setting ensures the HOME environment variable is correctly set to the zebra user's home directory.
* fix(docker): add default `CMD` to test stage in Dockerfile
When running the container using docker-compose without explicitly
providing a command, the entrypoint.sh script was attempting to execute
`exec_as_user` with no arguments, resulting in a gosu error:
```
exec_as_user
exec gosu 10001:10001
Usage: gosu user-spec command [args]
```
By adding `CMD ["cargo", "test"]` to the test stage in the Dockerfile,
we ensure a default command is available for the entrypoint script to
execute, preventing the gosu error when no command is explicitly provided.
This fix allows `docker-compose.test.yml` to run successfully without
needing to specify a command in the service definition.
* Adds a new trait for disk format upgrades, implements in on a new struct, `PruneTrees`, and moves the logic for tree deduplication to the trait impl
* refactors add subtrees format upgrade to use new trait
* refactors fix tree keys, cache genesis roots, and value balance upgrades to use new trait
* Applies suggestions from code review:
- Avoids duplicate validation of format upgrades at startup when db is already upgraded,
- Minor refactors
- Doc fixes and cleanups
* Applies suggestions from code review
---------
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Adds reconsider_block method and appropriate test cases
* Refactors invalidated_blocks state to use IndexMap. Returns error from validate_and_commit if a candidate block's hash is in the map of invalidated blocks. Stores invalidated_blocks by height and clears when finalizing. Checks against non finalized tip hash to create a new chain if parnt_chain doesn't exist. Renames ReconsiderError variant NonPreviouslyInvalidatedBlock to MissingInvalidatedBlock.
* Moves MAX_INVALIDATED_BLOCKS constant to constants.rs
* Maintains invalidate_blocks cleanup in reconsider_block and finalize(). Removes unused ReconsiderError variant. Opts to refuse block consideration if parent_chain does not exist. Adds db handle to reconsider_block function. Edits max blocks constant documentation
* Checks the finalized state first to create a new chain from non finalized blocks only before checking parent_chain.
The HOME environment variable was defaulting to /root when the container started, causing cache directories to be incorrectly set up under /root/.cache/zebra instead of /home/zebra/.cache/zebra. This explicit setting ensures the HOME environment variable is correctly set to the zebra user's home directory.
* Use gosu only once
* Remove `COLORBT_SHOW_HIDDEN`
* Simplify Dockerfile
* Remove `check_directory_files` from entrypoint
* Remove check for `ZEBRA_CONF_PATH` in entrypoint
* Simplify ownership setting for `ZEBRA_CACHE_DIR`
* Simplify ownership setting for `LOG_FILE`
* Refactor Dockerfile & entrypoint
* Refactor vars in Dockerfile
* fmt
* Use `chown` for `ZEBRA_CONF_PATH`
* `run_cargo_test` -> `run_test`
* Make `run_test` runnable with gosu
* Cosmetics
* Don't pre-compile Zebra
* Revert: "Don't pre-compile Zebra"
* Fix the custom conf test
* Reintroduce `CARGO_HOME` in Dockerfile
* Pass `FEATURES` as env var to entrypoint
* Fix ARGs in Dockerfile
* Revert "Remove `COLORBT_SHOW_HIDDEN`"
This reverts commit 960d5ca308.
* Specify cache state dir in CI
* Specify lwd cache dir in CI
* refactor: reorganize variables and avoid running entrypoint commands in subshell (#9326)
* refactor(docker): improve container configuration and security
- Optimize Dockerfile build stages and environment variables
- Improve file operations with proper ownership
- Streamline entrypoint script privilege management
* refactor(docker): enhance user management and directory ownership
- Add HOME argument back to ensure proper user home directory setup
- Implement ownership change for the user's home directory
* refactor(docker): remove redundant cache directory setup
- Eliminate explicit creation and ownership setting for LWD and Zebra cache directories in Dockerfile.
- Introduce default values for cache directories in entrypoint script, allowing for environment variable overrides.
* fix: run all cargo commands as user
* chore: reduce diff
* fix: revert to more robust command array
---------
Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
* feat(ci): Add Rust environment variables to Docker test workflows
Enhance test workflows by adding Rust-specific environment variables:
- Include RUST_LOG for logging configuration
- Add RUST_BACKTRACE and RUST_LIB_BACKTRACE for improved error tracing
- Include COLORBT_SHOW_HIDDEN for detailed backtraces
- Add CARGO_INCREMENTAL for build performance optimization
These changes improve debugging capabilities and provide more flexibility in test environments across dockerized CI jobs.
* feat(ci): Add CARGO_INCREMENTAL build argument to Docker workflow
Enable configurable Rust incremental compilation in Docker builds by:
- Adding CARGO_INCREMENTAL as a build argument in GitHub Actions workflow
- Setting a default value of 0 in Dockerfile to control build performance
- Integrating with existing Rust environment variable configuration
This change provides more granular control over Rust compilation strategies in containerized builds.
* fix(docker): resolve user creation issues in Dockerfile
- Move WORKDIR after user creation to prevent home directory ownership issues
- Properly set environment variables for UID, GID, HOME, and USER in each stage
- Reorganize Dockerfile to ensure home directory is created after user setup
- Fix interactive prompts during adduser by ensuring proper directory ownership
* fix(docs): Apply suggestions from code review
Co-authored-by: Marek <mail@marek.onl>
---------
Co-authored-by: Marek <mail@marek.onl>
* docs(decisions): add architectural decision records structure
Create a structured decision records system to document important technical choices across multiple domains (DevOps, Network, Consensus, etc.).
This implements a modified MADR template approach for preserving context, trade-offs, and reasoning behind significant architectural decisions.
* fix(docs): suggestions from code review
Co-authored-by: Marek <mail@marek.onl>
---------
Co-authored-by: Marek <mail@marek.onl>
* Switch to a non-privileged user in tests
* Change test env setup
* Remove unneeded ARGs
* Simplify UID & GID handling in `runtime` target
* Simplify docs
* refactor(docker): Improve user and permission handling in Dockerfiles
- Add gosu for flexible non-root user execution
- Enhance user and group creation with configurable UID/GID
- Modify entrypoint script to support dynamic user switching
- Improve cache and log directory permission management
- Update comments to clarify user and permission strategies
* refactor(docker): Improve Zebra config file handling in entrypoint script
- Enhance error handling for missing config file (now exits with error)
- Simplify config preparation logic by removing redundant file copying
- Update comments to reflect new config file handling approach
- Ensure consistent use of ZEBRA_CONF_PATH throughout the script
* refactor(docker): Enhance container user security and configuration
- Increase UID/GID to 10001 to minimize host system user conflicts
- Remove `--system` flag from user and group creation to prevent potential issues
- Add detailed comments explaining UID/GID selection rationale
- Improve security by using high UID/GID values to reduce namespace collision risks
- Remove redundant `chmod` for entrypoint script
Co-authored-by: Marek <mail@marek.onl>
---------
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
Co-authored-by: Gustavo Valverde <gustavo@iterativo.do>
* Update PR template
* Don't automatically assign the `C-trivial` label
* Use `C-exclude-from-changelog` label
* Simplify the PR template
* Simplify the PR template
* Simplify the PR template
* Update .github/pull_request_template.md
Co-authored-by: Pili Guerra <1311133+mpguerra@users.noreply.github.com>
* grammar
---------
Co-authored-by: Pili Guerra <1311133+mpguerra@users.noreply.github.com>
* fix(ci): Improve workflow conditions for cached disk jobs
Refactor GitHub workflow conditions to:
- Handle workflow dispatch events more precisely
- Prevent running cached disk jobs on forked PRs
- Ensure consistent behavior across different deployment workflows
- Avoid skipping main branch deployments
- Updated the if condition for the deploy-nodes job to ensure it only runs when the build job runs successfully and is not skipped.
* fix(ci): disable custom Zebra config test and fix registry condition
- Comment out the `test-zebra-conf-path` job in the deployment workflow
- Fix a syntax error in the GCP resource deletion workflow's condition
- Remove an extra single quote in the `if` condition for the `clean-registries` job
* Rm `.env` files
* Update `mining-docker.md`
* Revert "Rm `.env` files"
This reverts commit caaa4559c3.
* Add `enable_cookie_auth` to default Zebra conf
* Rename `default_zebra_config.toml`
* fmt `prometheus.yaml`
* Update `docker/test.env`
* Update `docker/.env`
* Refactor `docker compose` for lwd
* Enable disabling cookie authentication
* Update `docker compose` for tests
* Update general `docker compose`
* Update docs for running Zebra in Docker
* Add example `docker compose` file for Grafana
* Fix a bug in an example command
* Refactor test execution logic in entrypoint
* Rename `v2.1.0.toml` conf to `custom-conf.toml`
* Fix CI tests for loading of custom conf files
* Use the new conf file name in CI checks
* Use an extended regexp for custom conf CI check