Skip to content

Support block-only selections and block.number set filters#1277

Merged
DZakh merged 3 commits into
claude/amazing-thompson-IzI1Mfrom
claude/peaceful-euler-4Vg1w
Jun 3, 2026
Merged

Support block-only selections and block.number set filters#1277
DZakh merged 3 commits into
claude/amazing-thompson-IzI1Mfrom
claude/peaceful-euler-4Vg1w

Conversation

@DZakh
Copy link
Copy Markdown
Member

@DZakh DZakh commented Jun 3, 2026

Summary

Fixes queries that select only block fields without log/transaction filters, and improves block.number filter handling to support set membership (_in) with client-side filtering.

Key Changes

  • Block-only selections: Added include_all_blocks() to HyperSync queries when block fields are selected but no log/transaction/block filters scope the results. Previously these queries returned empty results because HyperSync only returns rows matching a selection.

  • block.number refactoring: Replaced custom operator parsing with reuse of the general parse_conditions infrastructure, enabling support for _in operator alongside existing comparison operators.

  • block.number set handling: When _in is used with multiple values, the query scans [min, max] server-side and applies a client-side filter to drop unmatched blocks. Single-value sets skip the client filter (already exact). Empty sets are handled with a client filter that matches nothing.

  • Pagination support: The render_where_hint function now preserves block.number sets across pages by including _in alongside the updated _gte/_lte range, ensuring consistent filtering across paginated results.

  • Helper methods: Added narrow_from() and narrow_to_excl() to centralize block range narrowing logic.

Notable Implementation Details

  • block.number desugars to from_block/to_block parameters rather than row filters, so it's handled separately from other field filters.
  • The wants_log_fields, wants_tx_fields, and wants_block_fields flags determine whether to request all rows of each kind when no explicit filter exists.
  • Client-side block.number filters are excluded from the pagination hint since the set is already included in the _in operator.
  • Tests verify single-block pins, range scans with client filtering, and the interaction with block field selection.

https://claude.ai/code/session_01QfhyYZWhpDLkzgFUhT2GgT

claude added 3 commits June 3, 2026 11:21
…selections

HyperSync only returns rows that match a selection, so a query like
`envio data block.hash --chain=base` produced an empty response: no
log/transaction/block selection meant nothing to return.

Add an unfiltered selection for every entity the user requests fields
for, and set include_all_blocks when block fields are wanted but no
filter scopes the blocks. Bare queries now stream from block zero.
block.number now accepts the same forms as other fields: a scalar or
`_eq` pins a single block, and an array or `_in` scans [min, max] then
drops the leftover blocks client-side. Comparison operators keep their
existing range semantics. The pagination hint folds a carried-forward
set back into the number range so reruns keep filtering the same blocks.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 19a6dd87-2606-4c31-afee-bdad1bce817d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@DZakh DZakh merged commit 47320f7 into claude/amazing-thompson-IzI1M Jun 3, 2026
8 checks passed
@DZakh DZakh deleted the claude/peaceful-euler-4Vg1w branch June 3, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants