Skip to content

feat(pxe)!: add source and block-range filtering to get_logs_by_tag#23326

Open
nchamo wants to merge 3 commits into
merge-train/fairiesfrom
nchamo/f-657-add-fromto-block-range-filtering-to-get_logs_by_tag
Open

feat(pxe)!: add source and block-range filtering to get_logs_by_tag#23326
nchamo wants to merge 3 commits into
merge-train/fairiesfrom
nchamo/f-657-add-fromto-block-range-filtering-to-get_logs_by_tag

Conversation

@nchamo
Copy link
Copy Markdown
Contributor

@nchamo nchamo commented May 15, 2026

Why

Constrained delivery introduces log tags that can be repeated across multiple logs and that only appear on private logs. The current get_logs_by_tag oracle returns at most one log per tag and always queries both private and public RPCs, which doesn't work for this use case:

  • Repeated tags mean we need to return multiple logs per tag, not just the first match
  • Without block-range filtering, re-scanning the same tag range returns previously seen logs — from_block/to_block let callers scope queries to new blocks only
  • Some tags are private-only, so querying both RPCs is wasteful — a source filter lets callers specify private, public, or both

Our fix

  • Extend LogRetrievalRequest with source, from_block, and to_block fields across the Noir-TS boundary
  • Change fetchLogsByTag to return all matching logs per tag (LogRetrievalResponse[][]) instead of only the first match
  • Add LogSource enum (private / public / public-and-private) following the repo's struct-based enum pattern, with validation on TS deserialization
  • Block range uses half-open [fromBlock, toBlock) semantics to match AztecNode conventions
  • Client-side filtering for now; push-down to the node layer is tracked separately (F-650)

Fixes F-657
Fixes #15052

@nchamo nchamo requested a review from nventuro as a code owner May 15, 2026 21:03
@nchamo nchamo self-assigned this May 15, 2026
@nchamo nchamo changed the title feat(pxe): add source and block-range filtering to get_logs_by_tag feat!(pxe): add source and block-range filtering to get_logs_by_tag May 15, 2026
@nchamo nchamo changed the title feat!(pxe): add source and block-range filtering to get_logs_by_tag feat(pxe)!: add source and block-range filtering to get_logs_by_tag May 15, 2026
/// without actually using any of the new oracles then there is no reason to throw.
pub global ORACLE_VERSION_MAJOR: Field = 22;
pub global ORACLE_VERSION_MINOR: Field = 1;
pub global ORACLE_VERSION_MAJOR: Field = 23;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would have expected this to be 12 (the version we decided protocol contracts were going to use), but apparently we are keeping it up to date with PXE's version

@nchamo nchamo requested review from mverzilli and vezenovm May 15, 2026 22:20
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.

1 participant