state service chain index integration#690
Merged
AloeareV merged 105 commits intochain_index_integrationfrom Feb 13, 2026
Merged
state service chain index integration#690AloeareV merged 105 commits intochain_index_integrationfrom
AloeareV merged 105 commits intochain_index_integrationfrom
Conversation
- Moved `NodeBackedChainIndex`, `NodeBackedChainIndexSubscriber`, and `State` import to maintain alphabetical order - Updated deprecation messages to be more informative regarding the new indexer's role and related issue #677 - Added more fields to the deprecation, as I believe they are part of what chain_index replaces, so we better get it out from the get go.
- Reordered fields in `StateService` and `StateServiceSubscriber` structs in `zaino-state/src/backends/state.rs` - Reordering aligns with ongoing transition to new indexer field as part of #677 completion
Since the whole state_service module is annotated as deprecated alaready, the deprecation warnings that stem from the fields we marked as deprecated on this PR get confused with the rest. Also, there were allow(deprecated) exceptions that canceled everything out, so: - commented out deprecated annotation on StateService, StateServiceSubscriber and StateServiceError - commented out allow(deprecated) on implementors of the above mentioned this way we now get the right warnings just for the fields we are deprecating on this PR one apparent problem is that state.rs being a massive 2.5k single file module, we get all warnings for all method implementations at once. It would be WAY cleaner if we had a file per implemented method, that way it would be overly clear which methods have been properly ported already.
Contributor
|
Got warnings discriminating the deprecated fields only. Work on individual rpcs will be easier if done on top of this 👍🏼 |
the method now uses the chain index interface I haven't run tests yet, we'll see if this is the right implementation
- Removed #[deprecated] annotations in `StateService` and `StateServiceSubscriber` Since NodeBackedChainINdex can't yet provide those fields, we leave them un-deprecated on a first migration pass. reference #677 (comment) for reference
- Commented out the #[deprecated] attribute on StateServiceConfig in config.rs This cluttered the deprecation wrning for the current migratiion work.
- Removed `#[deprecated]` attribute from `mempool` field in `state.rs` Since i realised that FetchService is also keeping this field... we might as well complete this migration without deprecating it either on stateservice. I suspect all changes will boil down to nbci replacing the blockcache field...
- Added ChainIndex trait and chain_types imports - Replaced block_cache.get_compact_block() with indexer methods - Uses snapshot_nonfinalized_state() for consistent queries - Handles both hash and height lookups via get_block_height()
…ck_cache - Added ChainIndex trait and chain_types imports - Use indexer.get_compact_block() then apply compact_block_to_nullifiers() - Simplified height conversion with map_err
- Added ChainIndex, NonFinalizedSnapshot traits and chain_types imports - Simplified height parsing with chained map_err - Use indexer.get_compact_block() in a loop for start..=end range - Get chain height from snapshot.best_chaintip() - Removed complex backwards-walking via prev_hash
- Added NonFinalizedSnapshot to imports - Get chain_height from indexer snapshot's best_chaintip()
- Updated import to include ChainIndexError in state.rs - Replaced block_cache with compact_block retrieval from indexer - Added error handling for missing compact block data - Removed unused `NonEmpty` import for clean-up replaced block_cache for indexer
…_block_nullifiers
Add readiness polling to test utilities after block generation These seem useful! Aren't they relevant to wider contexts than test?
The sync loop was silently exiting on errors (via `?`) without updating the status, leaving it stuck at `Syncing`. This caused tests to hang indefinitely waiting for block heights that would never be reached. Changes: - Wrap sync loop in async block to catch errors before task exits - Set status to CriticalError when sync loop exits with an error - Log the error for debugging Also add liveness checks to test utilities: - generate_blocks_and_poll_indexer now checks is_live() each iteration - generate_blocks_and_poll_chain_index now checks is_live() each iteration - Tests fail fast with descriptive messages when backend is unreachable This enables early detection of backend failures in CI instead of waiting for nextest timeouts.
Introduce Status trait for service readiness probing
…pdate_state_service_chain_index_integration
Contributor
|
…_integration Update state service chain index integration: Feature/lightclient protocol v0.4.0
This was referenced Feb 4, 2026
Update state service get block
…ange Update state service get block range
get_block method migrated to use chain_index
get_block_range(_nullfiers) migrated to use chain_index
moved the compact methods over to proto utils since local_cache is being removed. maybe it belongs somewhere else on zaino-state instead... @pacu #idky137 ?
Remove deprecated local_cache module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #677
This deprecates all fields from
StateServiceandStateServiceSubscriberwithout deleting them, so that we can update the rpc implementations (ZcashIndexerandLightwalletdIndexertraits) while still compiling fine.Once those fields are completely un-relied upon by any endpoint, we can remove them and call this done.
NOTE: this work is done on top of PR #650, and it's expected to land before it