Skip to content

config: read_state_service rustdoc wrongly attributes non-best-chain reads to JSON-RPC for the zebra backend #654

Description

@pacu

Spun out of a review discussion on #649 (thanks @Cosmos-Harry).

Problem: The rustdoc on IndexerSection::read_state_service (zallet-core/src/config.rs) says:

The JSON-RPC settings above are still required: they are used for mempool access, transaction submission, and any non-best-chain block reads.

For the zebra backend this is wrong: backends/zebra/src/chain/reader.rs serves ReadRequest::AnyChainBlock and ReadRequest::AnyChainTransaction (including AnyTx::Side) locally via ReadStateService, with no JSON-RPC fallback — zebrad's local non-finalized state tracks side chains, so non-best-chain reads stay local. So the zebra backend uses JSON-RPC only for the mempool and transaction submission.

The comment appears to describe the zaino backend's behavior instead (whose non-best-chain read path was not verified here). Since this field applies to both backends, the rustdoc should be corrected to be backend-accurate.

Impact: This rustdoc flows into the generated zallet example-config output and the book's configuration reference, so the fix needs the trycmd fixture regenerated (TRYCMD=overwrite … --features zcashd-import). The book's setup guide has already been corrected for the zebra case in #649.

To do:

  1. Verify the zaino backend's non-best-chain read path (does it use JSON-RPC, even with read_state_service configured?).
  2. Rewrite the field rustdoc to state each backend's actual JSON-RPC usage.
  3. Regenerate the example-config fixture.

Filed with AI assistance (Claude); zebra path verified against reader.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions