Skip to content

Add a walletstatus RPC method #316

@oxarbitrage

Description

@oxarbitrage

The motivation for this proposal comes from testing needs, but I don’t think the solution should be limited to that use case.

We want to eliminate the (ab)use of sleep-based synchronization in the Zebra wallet tests (ZcashFoundation/zebra#10045). The issue appears when Zebra mines a new block and there’s a delay before Zallet detects and processes it. To avoid guessing timing with sleeps, we need an RPC method that reports the wallet’s processed tip height, so the tests can actively poll until both components are in sync.

Zebra already provides healthy and ready HTTP endpoints (https://github.com/ZcashFoundation/zebra/blob/main/book/src/user/health.md), but this is different: we need to see the wallet’s actual best tip height, not just a binary "OK" once sync is complete. We need visibility into where the wallet currently is in the chain.

A dedicated RPC method seems reasonable for this. Existing calls such as getwalletinfo don’t expose the necessary state. That said, I’m open to discussion if there’s a preferred alternative.

Draft proposal (open for changes):

pub(crate) struct WalletStatus {
    /// The chain tip height the wallet has observed.
    observed_tip: u32,
    /// The most recent block height fully processed by the wallet.
    processed_height: u32,
    /// A timestamp for the wallet's status (e.g., time of last update).
    timestamp: u64,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-rpc-interfaceArea: RPC interfaceA-testingArea: Tests and testing infrastructureE-help-wantedCall for participation: Help is requested to fix this issue.S-in-progressStatus: Work is currently in progress on this item.Z-contributors-wantedalpha.4

    Type

    No type

    Projects

    Status

    In progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions