Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
b5ace4d
add chain indexer field to StateService
Oscar-Pepper Nov 24, 2025
336817c
Refactor and update deprecation messages in state.rs
nachog00 Nov 28, 2025
ca363ec
Reorder struct fields and apply #[deprecated] attribute
nachog00 Nov 28, 2025
ad74c10
Temporary remove deprecated attribute annotations
nachog00 Nov 28, 2025
599bb92
get_block_count method migrated to use chain_index
nachog00 Nov 28, 2025
4079607
cargo fmt
nachog00 Nov 28, 2025
81e90d3
get_mempool_info method migrated to use chain_index
nachog00 Nov 29, 2025
eb5d6b4
get_raw_mempool method migrated to use chain_index
nachog00 Nov 29, 2025
a46e23e
Merge branch 'state_service_chain_index_integration' into 677/get_blo…
nachog00 Dec 4, 2025
d5d64cf
Merge branch 'chain_index_integration' into state_service_chain_index…
nachog00 Dec 4, 2025
1f6d106
Remove deprecated annotations from state.rs
nachog00 Dec 4, 2025
9efd467
Remove StateServiceConfig deprecation attribute
nachog00 Dec 4, 2025
38d3478
Remove deprecated attribute in state.rs
nachog00 Dec 7, 2025
887d541
same for StateServiceSubscriber
nachog00 Dec 7, 2025
ac090d7
Migrate get_block to use indexer instead of deprecated block_cache
nachog00 Dec 7, 2025
61f6682
fmt
nachog00 Dec 7, 2025
1f415ab
Merge branch 'state_service_chain_index_integration' into 677/get_blo…
nachog00 Dec 7, 2025
6ad5e68
Merge branch 'state_service_chain_index_integration' into 677/699-get…
nachog00 Dec 7, 2025
77cb939
Merge branch 'state_service_chain_index_integration' into 677/700-get…
nachog00 Dec 7, 2025
6ab46a6
Migrate get_block_nullifiers to use indexer instead of deprecated blo…
nachog00 Dec 7, 2025
ccd3ba1
fmt
nachog00 Dec 7, 2025
ab9bbaf
Migrate get_block_range to use indexer instead of deprecated block_cache
nachog00 Dec 7, 2025
dbaa988
Update error_get_block to use indexer instead of deprecated block_cache
nachog00 Dec 7, 2025
d7a96d1
Refactor state.rs for compact block retrieval
nachog00 Dec 9, 2025
947089c
Merge branch 'state_service_chain_index_integration' into 677/696-get…
nachog00 Dec 11, 2025
ae7b7a7
Merge branch 'state_service_chain_index_integration' into 677/694-get…
nachog00 Dec 11, 2025
6b9e008
Merge branch 'state_service_chain_index_integration' into 677/695-get…
nachog00 Dec 11, 2025
7a23872
Merge branch 'state_service_chain_index_integration' into 677/700-get…
nachog00 Dec 11, 2025
6742be9
Merge branch 'chain_index_integration' into state_service_chain_index…
nachog00 Dec 12, 2025
7b8db52
Merge branch 'chain_index_integration' into state_service_chain_index…
nachog00 Dec 12, 2025
81f5dae
Merge branch 'state_service_chain_index_integration' into 677/696-get…
nachog00 Dec 12, 2025
558b6d9
Merge branch 'state_service_chain_index_integration' into 677/700-get…
nachog00 Dec 12, 2025
2b3a285
Merge branch 'state_service_chain_index_integration' into 677/699-get…
nachog00 Dec 12, 2025
e669587
Merge branch 'state_service_chain_index_integration' into 677/694-get…
nachog00 Dec 12, 2025
01f20d2
Merge branch 'state_service_chain_index_integration' into 677/695-get…
nachog00 Dec 12, 2025
f43a80d
Merge branch 'state_service_chain_index_integration' into 677/get_blo…
nachog00 Dec 12, 2025
bd79576
Refactor state.rs for compact block retrieval
nachog00 Dec 9, 2025
3cc828e
Refactor mempool height retrieval in state.rs
nachog00 Dec 11, 2025
aea88c6
Merge branch 'chain_index_integration' into state_service_chain_index…
nachog00 Dec 16, 2025
1c245b2
Merge branch 'state_service_chain_index_integration' into 677/get_blo…
nachog00 Dec 16, 2025
d599197
Refactor mempool height retrieval in state.rs
nachog00 Dec 11, 2025
96ab2e8
fixed missing imports on state.rs
nachog00 Dec 16, 2025
3219a4d
Merge branch 'state_service_chain_index_integration' into 677/694-get…
nachog00 Dec 16, 2025
3439400
Merge branch 'state_service_chain_index_integration' into 677/get_blo…
nachog00 Dec 16, 2025
c69c593
Merge branch 'state_service_chain_index_integration' into 677/700-get…
nachog00 Dec 16, 2025
1ea7690
Merge pull request #746 from zingolabs/677/700-get_raw_mempool
nachog00 Dec 16, 2025
7379d8f
Merge branch 'state_service_chain_index_integration' into 677/get_blo…
nachog00 Dec 16, 2025
db8678d
Merge pull request #744 from zingolabs/677/get_block_count
nachog00 Dec 16, 2025
0c8e9c6
Merge branch 'state_service_chain_index_integration' into 677/694-get…
nachog00 Dec 16, 2025
f72a1ba
Merge branch 'state_service_chain_index_integration' into 677/699-get…
nachog00 Dec 16, 2025
97b74f2
Merge branch 'state_service_chain_index_integration' into 677/695-get…
nachog00 Dec 16, 2025
269192f
Merge branch 'state_service_chain_index_integration' into 677/696-get…
nachog00 Dec 16, 2025
c7a1f08
Merge pull request #745 from zingolabs/677/699-get_mempool_info
nachog00 Dec 16, 2025
9d045a8
Merge branch 'state_service_chain_index_integration' into 677/694-get…
nachog00 Dec 16, 2025
4853f67
Merge branch 'state_service_chain_index_integration' into 677/696-get…
nachog00 Dec 16, 2025
b90a0e0
fixed messed imports from merge
nachog00 Dec 16, 2025
245327d
Merge branch 'state_service_chain_index_integration' into 677/695-get…
nachog00 Dec 19, 2025
67f1e3b
Merge chain_index_integration into state_service_chain_index_integration
nachog00 Dec 19, 2025
9a20b75
Merge branch 'state_service_chain_index_integration' into 677/695-get…
nachog00 Dec 19, 2025
1c11ecf
fixed wrong imports
nachog00 Dec 19, 2025
d63ccc3
Merge branch 'state_service_chain_index_integration' into 677/694-get…
nachog00 Dec 19, 2025
5f49d0a
fix: mis-merge flipped tx orders on fetch_service_get_mempool_tx again
nachog00 Dec 12, 2025
ed90361
Move StatusType to zaino-common/status module
nachog00 Dec 16, 2025
a6e9b1d
initialised probing module
nachog00 Dec 16, 2025
2326214
Add Status trait with blanket impls for Liveness and Readiness
nachog00 Dec 16, 2025
a71207a
Implement Status trait for AtomicStatus
nachog00 Dec 16, 2025
2aed526
Refactor ZcashService::status() to be sync and source from ChainIndex
nachog00 Dec 16, 2025
4add72a
Make ZcashService a supertrait of Status
nachog00 Dec 16, 2025
5ec2b14
Implement Status trait for subscriber types and add poll_until_ready
nachog00 Dec 16, 2025
a581ff2
Fix duplicate imports in state.rs
nachog00 Dec 19, 2025
6fe1066
Fix race condition in StateServiceSubscriber::get_latest_block()
nachog00 Dec 17, 2025
de092a0
Add idempotent write support for shared ZainoDB
nachog00 Dec 17, 2025
bea4012
Add readiness polling after height sync in generate_blocks_and_poll f…
nachog00 Dec 17, 2025
9b36149
Remove local_cache
nachog00 Dec 12, 2025
4342a29
removed local_cache leftovers
nachog00 Dec 12, 2025
b1e443f
romved local_cache tests
nachog00 Dec 12, 2025
d03be5c
Reinstated test-dep import of BlockCacheConfig
nachog00 Dec 12, 2025
0572266
Fix state.rs to use indexer instead of block_cache
nachog00 Dec 19, 2025
c5afac6
Merge pull request #758 from zingolabs/677/695-get_block_nullifiers
AloeareV Dec 19, 2025
888ce1b
Merge branch 'state_service_chain_index_integration' into 677/status-…
nachog00 Dec 20, 2025
63186ee
Merge branch 'state_service_chain_index_integration' into 677/fix-rac…
nachog00 Dec 20, 2025
4c4d713
Merge pull request #780 from zingolabs/677/test-readiness-polling
zancas Dec 21, 2025
2cc2621
fix(chain_index): set CriticalError when sync loop exits unexpectedly
nachog00 Jan 15, 2026
f238d37
Merge branch 'state_service_chain_index_integration' into 677/status-…
nachog00 Jan 29, 2026
b1afd8f
Merge pull request #776 from zingolabs/677/status-trait
nachog00 Jan 29, 2026
b752840
merge conflicts
idky137 Feb 3, 2026
48c91e9
Merge remote-tracking branch 'idky137/chain_index_integration' into u…
idky137 Feb 3, 2026
35b4475
remove unused import
idky137 Feb 3, 2026
8a82a99
merge conflicts
idky137 Feb 3, 2026
5c2fecc
merge conflicts
idky137 Feb 3, 2026
3221c90
Merge pull request #817 from idky137/update_state_service_chain_index…
AloeareV Feb 3, 2026
a0da4c9
Merge branch 'chain_index_integration' into state_service_chain_index…
idky137 Feb 3, 2026
91ee9aa
updated test
idky137 Feb 3, 2026
778de61
added issue link
idky137 Feb 4, 2026
829350e
Merge pull request #819 from idky137/update_state_service_get_block
nachog00 Feb 5, 2026
a345538
Merge pull request #820 from idky137/update_state_service_get_block_r…
nachog00 Feb 5, 2026
b17b56a
Merge branch 'state_service_chain_index_integration' into 677/694-get…
idky137 Feb 5, 2026
34b3625
Merge branch 'state_service_chain_index_integration' into 677/696-get…
idky137 Feb 5, 2026
aafd566
Merge pull request #757 from zingolabs/677/694-get_block
idky137 Feb 5, 2026
e68fcd4
dep import merge conflict
idky137 Feb 5, 2026
bb4d510
Merge pull request #759 from zingolabs/677/696-get_block_range
idky137 Feb 5, 2026
f102138
Merge branch 'state_service_chain_index_integration' into 677/fix-rac…
nachog00 Feb 11, 2026
67e9a5d
Merge branch '677/fix-race-condition' into 677/remove-local-cache
nachog00 Feb 12, 2026
29db365
fixed remaining imports of compact_block_with_pool_types
nachog00 Feb 12, 2026
ba11f6f
Merge pull request #782 from zingolabs/677/remove-local-cache
AloeareV Feb 13, 2026
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:
# - "integration-tests::chain_cache" FIXME: this must be reintroduced when the chain index test hangs are debugged
- "integration-tests::fetch_service"
- "integration-tests::json_server"
- "integration-tests::local_cache"
- "integration-tests::state_service"
- "integration-tests::test_vectors"
- "integration-tests::wallet_to_validator"
Expand Down
1 change: 1 addition & 0 deletions integration-tests/tests/chain_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ mod chain_query_interface {
NetworkKind::Testnet => zebra_chain::parameters::Network::new_default_testnet(),
NetworkKind::Mainnet => zebra_chain::parameters::Network::Mainnet,
};
// FIXME: when state service is integrated into chain index this initialization must change
let state_service = StateService::spawn(StateServiceConfig::new(
zebra_state::Config {
cache_dir: state_chain_cache_dir,
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/tests/fetch_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use zaino_proto::proto::service::{
use zaino_state::ChainIndex;
use zaino_state::FetchServiceSubscriber;
#[allow(deprecated)]
use zaino_state::{FetchService, LightWalletIndexer, StatusType, ZcashIndexer};
use zaino_state::{FetchService, LightWalletIndexer, Status, StatusType, ZcashIndexer};
use zaino_testutils::{TestManager, ValidatorExt, ValidatorKind};
use zebra_chain::parameters::subsidy::ParameterSubsidy as _;
use zebra_chain::subtree::NoteCommitmentSubtreeIndex;
Expand Down Expand Up @@ -1918,7 +1918,7 @@ async fn fetch_service_get_subtree_roots<V: ValidatorExt>(validator: &ValidatorK
};

let fetch_service_stream = fetch_service_subscriber
.get_subtree_roots(subtree_roots_arg.clone())
.get_subtree_roots(subtree_roots_arg)
.await
.unwrap();
let fetch_service_roots: Vec<_> = fetch_service_stream.collect().await;
Expand Down
194 changes: 0 additions & 194 deletions integration-tests/tests/local_cache.rs

This file was deleted.

12 changes: 11 additions & 1 deletion integration-tests/tests/state_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2925,10 +2925,19 @@ mod zebra {
.unwrap()
.height;

// NOTE / TODO: Zaino can not currently serve non standard script types in compact blocks,
// because of this it does not return the script pub key for the coinbase transaction of the
// genesis block. We should decide whether / how to fix this.
//
// For this reason this test currently does not fetch the genesis block.
//
// Issue: https://github.com/zingolabs/zaino/issues/818
//
// To see bug update start height of get_block_range to 0.
let compact_block_range = state_service_subscriber
.get_block_range(BlockRange {
start: Some(BlockId {
height: 0,
height: 1,
hash: Vec::new(),
}),
end: Some(BlockId {
Expand All @@ -2947,6 +2956,7 @@ mod zebra {

for cb in compact_block_range.into_iter() {
for tx in cb.vtx {
dbg!(&tx);
// script pub key of this transaction is not empty
assert!(!tx.vout.first().unwrap().script_pub_key.is_empty());
}
Expand Down
2 changes: 2 additions & 0 deletions zaino-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

pub mod config;
pub mod net;
pub mod probing;
pub mod status;

// Re-export network utilities
pub use net::{resolve_socket_addr, try_resolve_address, AddressResolution};
Expand Down
71 changes: 71 additions & 0 deletions zaino-common/src/probing.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//! Service health and readiness probing traits.
//!
//! This module provides decoupled traits for health and readiness checks,
//! following the Kubernetes probe model:
//!
//! - [`Liveness`]: Is the component alive and functioning?
//! - [`Readiness`]: Is the component ready to serve requests?
//! - [`VitalsProbe`]: Combined trait for components supporting both probes.
//!
//! These traits are intentionally simple (returning `bool`) and decoupled
//! from any specific status type, allowing flexible implementation across
//! different components.
//!
//! # Example
//!
//! ```
//! use zaino_common::probing::{Liveness, Readiness, VitalsProbe};
//!
//! struct MyService {
//! connected: bool,
//! synced: bool,
//! }
//!
//! impl Liveness for MyService {
//! fn is_live(&self) -> bool {
//! self.connected
//! }
//! }
//!
//! impl Readiness for MyService {
//! fn is_ready(&self) -> bool {
//! self.connected && self.synced
//! }
//! }
//!
//! // VitalsProbe is automatically implemented via blanket impl
//! fn check_service(service: &impl VitalsProbe) {
//! println!("Live: {}, Ready: {}", service.is_live(), service.is_ready());
//! }
//! ```

/// Liveness probe: Is this component alive and functioning?
///
/// A component is considered "live" if it is not in a broken or
/// unrecoverable state. This corresponds to Kubernetes liveness probes.
///
/// Failure to be live typically means the component should be restarted.
pub trait Liveness {
/// Returns `true` if the component is alive and functioning.
fn is_live(&self) -> bool;
}

/// Readiness probe: Is this component ready to serve requests?
///
/// A component is considered "ready" if it can accept and process
/// requests. This corresponds to Kubernetes readiness probes.
///
/// A component may be live but not ready (e.g., still syncing).
pub trait Readiness {
/// Returns `true` if the component is ready to serve requests.
fn is_ready(&self) -> bool;
}

/// Combined vitals probe for components supporting both liveness and readiness.
///
/// This trait is automatically implemented for any type that implements
/// both [`Liveness`] and [`Readiness`].
pub trait VitalsProbe: Liveness + Readiness {}

// Blanket implementation: anything with Liveness + Readiness gets VitalsProbe
impl<T: Liveness + Readiness> VitalsProbe for T {}
Loading
Loading