Skip to content

Feature Request: Node::best_block #537

@thunderbiscuit

Description

@thunderbiscuit

There are currently two main ways to know the current height of your Kyoto node:

  1. You see the logs go by and pick up the highest number from the output
  2. After applying an update to your wallet, you call Wallet::latest_checkpoint

Both of these feel like workarounds for getting what you need and are probably suboptimal, for different reasons:

  • Using logs for querying state feels like an anti-pattern. It requires ensuring logs are never missed, and users must then maintain their own internal view of the node's likely latest block rather than being able to query it directly.
  • Querying the LocalChain on the wallet is likely more ergonomic, but this approach breaks down if the user is leveraging more than a single Kyoto client to sync their wallet. If this happens, the user then cannot trust the latest checkpoint on the Wallet type to represent the best block known by the Kyoto node. I suspect this could definitely be the case because of the ability for Esplora/Electrum clients to pick up mempool information, leading to software potentially offering a dual-client approach where users can also query an Electrum server for syncing requirements.

Adding a Client::best_block method would be a simple, direct solution to the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions