Commit Graph

5611 Commits

Author SHA1 Message Date
Arya 1a43758733
Merge branch 'main' into mempool-change-rpc 2025-05-26 16:13:20 -04:00
Jack Grigg 694d11c7ac
tower-batch-control: Fix `Batch::new` compilation with `tokio_unstable` (#9547) 2025-05-26 15:19:34 +01:00
Gustavo Valverde 7c6b2f9e32
refactor(ci): Simplify cached disk selection logic (#9545) 2025-05-26 15:08:31 +01:00
Arya 61229f7673 fixes error messages and warning logs when a channel is closed unexpectedly.
stops indexer RPC tasks when client listener channels are closed
2025-05-22 22:15:30 -04:00
Alfredo Garcia cbd1bb7fc3
feat(rpc): Update `(z_)validateaddress` to validate TEX addresses (#9483)
* add TEX support to validate address rpc methods

* update call docs

* fix comment

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

---------

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-05-22 15:12:37 +00:00
Alfredo Garcia 5cc4357acb
add raw_value feature to serde_json (#9538) 2025-05-22 14:42:10 +00:00
Gustavo Valverde d3211081f9
feat(ci): Enable stateful MIGs and fix release deployment skipping (#9516)
* fix(ci): Ensure release deployments run and improve script clarity

This addresses several issues in the CD workflow:

- Modifies the 'build' job to remove its dependency on 'get-disk-name'.
  This allows the 'build' job and subsequently 'deploy-nodes' to run
  during release events, as 'get-disk-name' is intentionally skipped
  for releases.
- Updates the 'Create instance template' script in 'deploy-nodes' to
  correctly handle disk parameters for release events. It now ensures
  that release deployments attempt to use the existing persistent disk
  (e.g., 'zebrad-cache-mainnet') for state continuity, rather than
  relying on a dynamic cached image from the (skipped) 'get-disk-name' job.
- Refactors in-script comments within the 'deploy-nodes' job and moved them to the top, to avoid clutter in the script

* feat(ci): Implement stateful disk policy for release MIGs

This commit introduces a new step "Configure stateful disk policy for
release MIG" to the `deploy-nodes` job in the
`.github/workflows/cd-deploy-nodes-gcp.yml` workflow.

For `release` events, this step applies a stateful policy to the
Managed Instance Group (MIG) using the command:
`gcloud compute instance-groups managed set-stateful-policy`.

The policy is configured with
`--stateful-disk "device-name=zebrad-cache-${NETWORK},auto-delete=never"`.
This ensures that the specified data disk, which holds the Zebra node's
state, is preserved during instance recreations or updates within the MIG,
maintaining data persistence for production release deployments.
2025-05-22 14:30:13 +00:00
Jack Grigg a77de50cae
zebra-rpc: Correctly set optional `scriptPubKey` fields of transactions (#9536)
Closes ZcashFoundation/zebra#9535.
2025-05-16 23:07:06 +00:00
Arya cc062510a2
fix(clippy, build): fix latest Clippy lints introduced in v1.87.0 and migrate from vergen to vergen_git (#9531)
* fixes new lints

* rustfmt

* migrates from vergen to vergen_git2
2025-05-16 15:00:07 +00:00
Arya a80bf1e4d5 test that the new gRPC method notifies clients when a new message is received in the relevant channel. 2025-05-15 23:16:59 -04:00
Arya 5618fc6ceb Merge branch 'fix-lints' into mempool-change-rpc 2025-05-15 21:15:27 -04:00
Arya 952b3c47bc migrates from vergen to vergen_git2 2025-05-15 20:06:32 -04:00
Arya d187810780 rustfmt 2025-05-15 18:30:52 -04:00
Arya df1c281fb9 fixes new lints 2025-05-15 18:24:27 -04:00
Alfredo Garcia d171f4a509
remove test-scanner from CI (#9530) 2025-05-15 20:56:57 +00:00
Arya ecedb606fb fix doc link 2025-05-15 01:09:30 -04:00
Arya e97d3b1934 Merge remote-tracking branch 'origin/main' into mempool-change-rpc 2025-05-15 00:58:40 -04:00
Arya 9ac54288bd updates mempool tests to check that the mempool broadcasts what transactions were invalidated 2025-05-15 00:57:28 -04:00
idky137 8b9fdd073d
Transaction and block deserialization (#9522)
* added deserialisation to block and transaction structs

* fixed new test

* made TransactionObject::from_transaction pub

* renamed valueZat to valueSat

* removed double serde(with_hex)

* fixed script sig name

* Update zebra-chain/src/sapling/commitment.rs

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>

* qualify cursor

---------

Co-authored-by: Conrado Gouvea <conradoplg@gmail.com>
Co-authored-by: Hazel OHearn <gygaxis@zingolabs.org>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2025-05-14 23:19:25 +00:00
Marek 67bfc941fe
fix(rpc): Regroup imports (#9521)
* Regroup imports in `.../tests/common/regtest.rs`

* Regroup imports in `.../methods/tests/prop.rs`

* Regroup imports in `.../get_block_template.rs`

* Regroup imports in `.../zip317.rs`

* Regroup imports in `.../get_blockchain_info.rs`

* Regroup imports in `.../types/get_raw_mempool.rs`

* Regroup imports in `.../types/transaction.rs`

* Regroup imports in `.../server/tests/vectors.rs`

* Regroup imports in `.../args.rs`

* Regroup imports in `.../main.rs`

* Regroup imports in `.../openapi-generator/main.rs`

* Regroup imports in `zebrad/src/commands/start.rs`

* Regroup imports in `.../tests/fake_peer_set.rs`

* Regroup imports in `.../components/miner.rs`

* Regroup imports in `.../tests/acceptance.rs`

* Regroup imports in `.../get_block_template.rs`
2025-05-14 18:36:05 +00:00
Arya 7c9d50f116 fixes lints and a test 2025-05-13 00:09:59 -04:00
Arya d653d826a0 fixes proptests and clippy lints 2025-05-12 21:40:34 -04:00
Arya e5fd06d797 fixes test, lints, and docs. 2025-05-12 20:58:05 -04:00
Arya 82c04c0e5c Replaces 'BestTipChanged` type with async trait fns 2025-05-12 20:48:02 -04:00
Arya d2aa7e8447 Updates `TrustedChainSync` to use the `chain_tip_change` grpc method 2025-05-12 20:46:52 -04:00
Arya ca9976fe23 add(rpc): Add a `mempool_transactions()` RPC method for listening to changes in the mempool 2025-05-12 19:17:19 -04:00
Marek 89f825265a
change(rpc): Move GBT RPCs into the main RPC server (#9459)
* Remove the `getblocktemplate-rpcs` Cargo feature

* Merge GBT RPCs with the rest

* Fix `rpc_server_spawn_port_conflict`

* Fix snapshot data

* Remove old files after merge

* Fix snapshot for `get_mining_info`

* Fix refs in docs

* Update snapshot data for `bet_block_count`

* Update snapshot data for `get_minig_info`

* Fix snapshots

* Fix RPC tests

* Unguard internal miner config

* remove getblocktemplate file (#9485)

* Fix imports in `zebra-rpc/src/server.rs`

* Fix imports in `zebra-rpc/src/methods.rs`

* Rename vars in `RpcImpl::new`

* Split imports in `.../methods/tests/snapshot.rs`

* Refactor imports in `.../methods/tests/vectors.rs`

* Update error log messages

* fmt

* Fix snapshots with missing peers

* fmt

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
2025-05-09 09:56:54 +00:00
ala-mode ca51c39003
update README with Arch build patch (#9513)
* update readme with GCC on Arch patch

* suggested change
2025-05-08 07:46:59 +00:00
Alfredo Garcia 3a99279690
use `RawValue` instead of `Value` for the `result` field of `JsonRpcResponse` (#9474) 2025-05-07 10:19:15 +00:00
Alfredo Garcia 0ca510b7cb
fix z_get_treestate optional values (#9451) 2025-05-06 22:09:17 +00:00
Marek b0e7fd4a9a
chore: Release v2.3.0 (#9475)
* Update changelog

* Update end of support

* Add release date

* Add breaking change description

* Add new PRs to changelog

* Add breaking change description to changelog

* Update list of PRs in changelog

* chore: Release

* Apply suggestions from code review

Co-authored-by: Arya <aryasolhi@gmail.com>

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2025-05-06 14:47:47 +00:00
Alfredo Garcia 638b4a212d
feat(rpc): Add `time` and `size` field to `TransactionObject` (#9458)
* add size and time to getrawtransaction object

* fix annoying clippy lint about large enum variant

* add todo

* add TODO, remove TODO

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

---------

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2025-05-06 08:44:03 +00:00
Arya 188cb77081
fix(ci): check, create and mount lwd cached state for tests (#9481)
Co-authored-by: Gustavo Valverde <g.valverde02@gmail.com>
2025-05-06 07:58:02 +01:00
Alfredo Garcia ee65be98c5
fix(usability): Improve the cache dir and database startup panics (#9441)
* improve cache dir database panics

* Apply suggestions from code review

Co-authored-by: Arya <aryasolhi@gmail.com>

* fix build

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2025-05-06 01:01:53 +00:00
Marek 3423e6c71c
Update `Cargo.lock` (#9467) 2025-05-06 00:00:46 +00:00
Conrado Gouvea 33a416b719
fix(ci): change dependabot to only update lockfile (#9416) 2025-05-05 22:01:36 +00:00
Marek 1e25546955
chore: Add checkpoints (#9466)
* Add Mainnet checkpoints

* Add Testnet checkpoints
2025-05-05 20:48:07 +00:00
Marek 7cd185855c
chore: Update docs (#9469)
* Simplify `README.md`

* Remove a resolved issue from known issues

* Simplify the PR template
2025-04-29 14:20:54 +00:00
Gustavo Valverde 12b3d5ea41
fix(ci): use log exit code instead of docker stop (#9465)
Tests in `sub-test-zebra-config.yml` were failing in some instances with exit code 137 (SIGKILL) or 139 (SIGSEGV) during the `docker stop` phase, even when the preceding log check (`grep`) succeeded. This occurred because zebrad sometimes doesn't shut down gracefully within the default docker stop timeout.

This change modifies the exit logic to return status 0 if the grep command passes, regardless of the exit code from `docker wait`. This aligns the step result with the actual test outcome determined by log analysis and mirrors the fix from PR #8107.

Ref: #7898
2025-04-29 13:49:32 +00:00
natalie 94f2e98dc1
refactor(chain): replace sinsemilla with external library (#9426)
* Replace sinsemilla with external library (#7801)

* Update zebra-chain/src/orchard/sinsemilla.rs

Co-authored-by: Conrado Gouvea <conrado@zfnd.org>

---------

Co-authored-by: Pili Guerra <1311133+mpguerra@users.noreply.github.com>
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
2025-04-25 14:37:15 +00:00
Gustavo Valverde 8408dc33ae
refactor(ci): simplify Docker tagging to remove redundant tags (#9431)
- Removed `latest_tag` and `tag_suffix` inputs from Docker build workflow, as those are no longer required.
- Split SHA tagging into PR and branch events for clarity.
- Removed tag event references and flavor customizations to prevent redundant tags.
- Updated comments for clarity on tag purposes.

Closes #7415
2025-04-25 10:12:11 +00:00
Paul e6dc3b6fd3
NU7 constants (#9256)
* Introduce Nu7

* Introduce Nu7 fo other crates of Zebra

* Fix of new_regtest call (as it additionally needs Nu7 arg now)

* Fix of new_regtest call (as it additionally needs Nu7 arg now) (2)

* Set Nu7 as a network update for testnet in zebra-chain network tests

* Fix serde names for NU7

* Update test snapshot in zebra-rpc to use NU7

* Copy Nu7-related changes from zsa-integration-state

* Uncomment zcash_unstable = nu7

* Fix Nu7 constants and add cfg(zcash_unstable ...) attribute according to PR #15 review comments

* Update network constant values according to PR #15 review comments

* Add zcash_unstable=nu6 Rust flag to .cargo/config.toml to use nu6 by default

* Add zcash_unstable = nu6 cfg in zebra-network/.../types.rs

* Fix nu7 activation heights in network_upgrade.rs (nu6 value + 1 does not work - causes a test failure)

* Add cfg for CURRENT_NETWORK_PROTOCOL_VERSION constant definition, add FIXMEs for a couple of Nu6 processing cases, add processing of Nu7

* Update get_blockchain_info@testnet_10.snap

* Update get_blockchain_info@mainnet_10.snap

* updated cfg flag

* remove `zcash_unstable` flag

* Remove testnet and mainnet NU7 activation heights, comment out consensus branch id and conversion to zcash primitives nu type

* Yep, it'll work after NU7

* Yep, the test should work fine after NU7

* Yep, it only needs to be a post-nu6 height.

* other fixes and cleanups

* Updates snapshots, removes unnecessary FIXMEs, fixes issues with bad merge conflict resolution

* fixes test hang when there are NUs defined without activation heights

* fixes test, applies suggestion from code review.

* Enable consensus branch ID for Nu7

---------

Co-authored-by: Dmitry Demin <dmitry@qed-it.com>
Co-authored-by: Arya <aryasolhi@gmail.com>
Co-authored-by: Marek <mail@marek.onl>
2025-04-21 13:38:44 +00:00
Alfredo Garcia 9002cfcbd3
downgrade info message (#9448) 2025-04-21 11:10:41 +00:00
Tomass fb3c8d80f2
docs: remove consecutive duplicate words (#9446)
* Update get_block_template.rs

* Update vectors.rs

* Update serialize.rs
2025-04-19 16:10:14 +00:00
Kris Nuttycombe 63723e7e84
zebra-state: Return only the history tree root in GetBlockTemplateChainInfo response. (#9444)
The `HistoryTree` type is intended for internal use within the node; it
should not be exposed via the ReadStateService response. Instead, this
response should simply include the hash needed for block template
construction.
2025-04-18 20:57:45 +00:00
Gustavo Valverde 6e039c26c3
fix(ci): set `ZEBRA_CACHE_DIR` in full and checkpoint syncs (#9434)
* fix(ci): set `ZEBRA_CACHE_DIR` in full and checkpoint syncs

Updates the GitHub Actions workflows for GCP integration tests to explicitly set the ZEBRA_CACHE_DIR environment variable to `/home/zebra/.cache/zebra` for the following test jobs:
- regenerate-stateful-disks (Zebra checkpoint sync to mandatory checkpoint)
- test-full-sync (Zebra full sync to tip on Mainnet)
- test-full-sync-testnet (Zebra full sync to tip on Testnet)

The rationale for this change is to address permission issues encountered during tests that attempt to create or access a cached database directory. By setting ZEBRA_CACHE_DIR to a specific path within the user's home directory, we ensure that the test has the necessary write permissions to create and manage the cache directory, avoiding 'Permission denied (os error 13)' errors that occur when using default or system directories without adequate access rights.

* chore: fix typo
2025-04-18 15:16:02 +00:00
Arya 33a44e5f9c
add(mining): Restore internal miner (#9311)
Co-authored-by: Marek <mail@marek.onl>
Co-authored-by: Alfredo Garcia <oxarbitrage@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2025-04-18 08:29:42 +01:00
Gustavo Valverde c572027ca9
fix(cd): allow to deploy without healthchecks (#9433) 2025-04-17 09:05:42 +00:00
Gustavo Valverde 4e3426c8f3
feat(ci): Centralize zebra configuration testing with Docker (#9423)
* refactor(docker): Enhance Zebra configuration options and entrypoint logic

- Introduced multiple methods for configuring Zebra, including custom config file paths and automatic generation from environment variables.
- Updated entrypoint script to handle configuration more robustly, checking for existing files and generating defaults as needed.
- Improved documentation in `docker.md` to clarify configuration options and their precedence.
- Adjusted environment variable handling in `docker/.env` for better clarity and functionality.
- Refactored `prepare_conf_file` to create a complete configuration based on environment variables, streamlining the setup process.

* fix(docker): remove non-essential variables and set correct defaults

* feat(ci): Centralize zebra configuration testing with Docker

- Replace multiple separate test jobs with a single comprehensive matrix-based test
- Create a new ADR documenting the design decision for centralizing Docker tests
- Move all test scenarios from both CI and CD pipelines into a single reusable workflow
- Define extensive test matrix covering network, RPC, directory, feature configurations
- Improve workflow readability with descriptive test names and clear organization
- Simplify workflow inputs to only require the Docker image identifier

* chore(ci): cleanup jobs that already don't exist
2025-04-16 14:16:27 +00:00
Gustavo Valverde aa7205d660
refactor(docker): Enhance Zebra configuration options and entrypoint logic (#9344)
* refactor(docker): Enhance Zebra configuration options and entrypoint logic

- Introduced multiple methods for configuring Zebra, including custom config file paths and automatic generation from environment variables.
- Updated entrypoint script to handle configuration more robustly, checking for existing files and generating defaults as needed.
- Improved documentation in `docker.md` to clarify configuration options and their precedence.
- Adjusted environment variable handling in `docker/.env` for better clarity and functionality.
- Refactored `prepare_conf_file` to create a complete configuration based on environment variables, streamlining the setup process.

* fix(entrypoint): use correct `ZEBRA_RPC_PORT` variable

This also removes the logic to set the default port for RPC as this was introducing a buggy logic

* fix(docker): remove non-essential variables and set correct defaults

* chore(docker): use the default config for docker-compose as the default approach

* Apply suggestions from code review

Co-authored-by: Marek <mail@marek.onl>

* chore: better comment for user understanding

* fix(entrypoint): set permissions correctly for parent directories

* chore: align documentation and implementation

* chore: clearer and aligned comments with docker-compose

* fix(entrypoint): chown the zebra config file when `ZEBRA_CONF_PATH` is not set

---------

Co-authored-by: Marek <mail@marek.onl>
2025-04-16 12:27:32 +00:00