Skip to content

feat(state): Add a AnyChainBlock state request for querying blocks in side chains#10325

Merged
mergify[bot] merged 8 commits intomainfrom
any-chain-block
Feb 17, 2026
Merged

feat(state): Add a AnyChainBlock state request for querying blocks in side chains#10325
mergify[bot] merged 8 commits intomainfrom
any-chain-block

Conversation

@arya2
Copy link
Contributor

@arya2 arya2 commented Feb 14, 2026

Motivation

Closes #10305.

Solution

  • Adds a new request variant for querying block hashes in any chain
  • Adds a new read fn in zebra-state for reading blocks from any chain

Related changes:

  • Replaces some calls to with_watched_data() with calls to latest_best_chain()
  • Adds a new method on WatchReciever to map the borrowed data to an owned value
  • Updates latest_best_chain() to clone only the best chain and not the rest of the non-finalized state

Tests

Currently unused in Zebra and a trivial addition.

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used:

PR Checklist

  • The PR name is suitable for the release notes.
  • 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.

@arya2 arya2 self-assigned this Feb 14, 2026
@arya2 arya2 added C-enhancement Category: This is an improvement A-state Area: State / database changes P-High 🔥 labels Feb 14, 2026
@github-actions github-actions bot added the C-feature Category: New features label Feb 14, 2026
…g some state requests that only query the best non-finalized chain (perhaps at the expense of holding read locks slightly longer if the added traversals are worse than the copying, probably insignicant either way but this makes it easier to add fields to NonFinalizedState without worrying)

Adds a `cloned_mapped_watch_data()` method on `WatchReceiver`.
…tions for `block` and `any_chain_block` read fns (latter renamed to `any_block()`)
Copy link
Contributor

@oxarbitrage oxarbitrage left a comment

Choose a reason for hiding this comment

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

Nice one.

@mergify mergify bot added the queued label Feb 17, 2026
@mergify
Copy link
Contributor

mergify bot commented Feb 17, 2026

Merge Queue Status

Rule: batched


This pull request spent 11 minutes 18 seconds in the queue, including 29 seconds running CI.

Required conditions to merge

mergify bot added a commit that referenced this pull request Feb 17, 2026
@mergify mergify bot merged commit 899df3d into main Feb 17, 2026
91 checks passed
@mergify mergify bot deleted the any-chain-block branch February 17, 2026 19:40
@mergify mergify bot removed the queued label Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-state Area: State / database changes C-enhancement Category: This is an improvement C-feature Category: New features P-High 🔥

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: ReadRequest::Block equivalent for non-best-chain blocks

2 participants