Skip to content

feat(rpc): expose the Ironwood note commitment tree and subtrees - #10888

Merged
conradoplg merged 1 commit into
mainfrom
ironwood-rpc-read-path
Jul 2, 2026
Merged

feat(rpc): expose the Ironwood note commitment tree and subtrees#10888
conradoplg merged 1 commit into
mainfrom
ironwood-rpc-read-path

Conversation

@upbqdn

@upbqdn upbqdn commented Jul 2, 2026

Copy link
Copy Markdown
Member

Motivation

The Ironwood state (#10762) stores a note commitment tree and subtrees, but no read request or RPC exposes them, so a wallet or light-client indexer cannot obtain Ironwood frontiers or subtree roots after NU6.3 — the pool is spendable per consensus but unusable through Zebra's RPC surface. This adds the read path, mirroring Orchard. Stacks on #10886.

Solution

  • state: ReadRequest::IronwoodTree / ReadRequest::IronwoodSubtrees and the matching ReadResponse variants; read::ironwood_tree / read::ironwood_subtrees; the ZebraDb::ironwood_tree_by_hash_or_height accessor; and the read-service handlers. These mirror the Orchard read path (Ironwood reuses the Orchard tree/node types in separate column families).

  • rpc:

    • z_gettreestate gains an ironwood treestate, present only from NU6.3.
    • z_getsubtreesbyindex accepts pool = "ironwood".
    • verbose getblock reports the Ironwood note-commitment-tree size under trees.ironwood.

    All three are Option/skip_serializing_if-empty and serde(default) on read, so pre-NU6.3 responses and existing fixtures are byte-for-byte unchanged.

Tests

Local gate green on d.lan: fmt --check, clippy --workspace --all-targets -D warnings, cargo doc, and nextest for zebra-rpc (107) and zebra-state (149). The existing z_gettreestate / getblock snapshot and serialization round-trip tests pass unchanged (Ironwood is empty/absent pre-NU6.3); the GetBlockTrees round-trip test now also carries the empty Ironwood tree.

Specifications & References

Follow-up Work

None outstanding.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: Claude found the gap in the review, implemented the read path, and drafted this description.

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed in an issue or with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

Comment thread zebra-rpc/src/methods.rs
arya2
arya2 previously approved these changes Jul 2, 2026

@arya2 arya2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good pending a fix for the getblock RPC returning error for heights below NU6.3

arya2
arya2 previously approved these changes Jul 2, 2026
jvff
jvff previously approved these changes Jul 2, 2026
@upbqdn
upbqdn force-pushed the ironwood-rpc-read-path branch from 9c3d5d0 to 2187d21 Compare July 2, 2026 18:48
@upbqdn
upbqdn force-pushed the ironwood-rpc-read-path branch from 2187d21 to e3a02fb Compare July 2, 2026 18:57
@upbqdn
upbqdn force-pushed the ironwood-review-fixes-2 branch from 7b876e0 to 7655df2 Compare July 2, 2026 19:58
@upbqdn
upbqdn force-pushed the ironwood-rpc-read-path branch from e3a02fb to 5f90f58 Compare July 2, 2026 19:58
Base automatically changed from ironwood-review-fixes-2 to main July 2, 2026 20:16
@conradoplg
conradoplg dismissed stale reviews from arya2 and jvff July 2, 2026 20:16

The base branch was changed.

Add the Ironwood read path that mirrors Orchard, so wallets and indexers
can obtain Ironwood frontiers and subtree roots after NU6.3:

- state: ReadRequest/ReadResponse IronwoodTree and IronwoodSubtrees
  variants, read::ironwood_tree / ironwood_subtrees, and the
  ZebraDb::ironwood_tree_by_hash_or_height accessor.
- rpc: an ironwood treestate in z_gettreestate (present from NU6.3), the
  ironwood pool in z_getsubtreesbyindex, and the ironwood tree size in
  verbose getblock. All are skipped/omitted when empty, so pre-NU6.3
  responses and fixtures are unchanged.
@conradoplg

Copy link
Copy Markdown
Collaborator

Not sure how it does not have conflicts, but should probably be rebased after #10886 merged

@conradoplg

Copy link
Copy Markdown
Collaborator

Admin-merging, tested locally

@conradoplg
conradoplg merged commit 1decae1 into main Jul 2, 2026
126 of 134 checks passed
@conradoplg
conradoplg deleted the ironwood-rpc-read-path branch July 2, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants