Bring the single-chunk query engine from rpc-hack into feature/full-history. Stacks on #756, which lands the Reader interface and the hot/cold stores it builds on. The rpc-hack query.go is a reference, not a spec — clean up and rewrite as you see fit.
Implement Query: run a set of filters against one chunk and return the matching events, ordered and capped. Built on the Reader interface, so it serves the hot store and cold segments without tier branching.
Scope:
- Filter semantics — AND within a filter (contract ID, topics 0–3), union across filters, restricted to an optional ledger range.
- Cap at
MaxEvents, ascending or descending. (rpc-hack is ascending-only; descending is added here.)
- Post-filter to drop term-hash collision false positives.
Out of scope: routing a query across multiple segments.
Add tests for filter combinations, ledger-range clipping, ordering and limit in both directions, and post-filter rejection.
Bring the single-chunk query engine from
rpc-hackintofeature/full-history. Stacks on #756, which lands theReaderinterface and the hot/cold stores it builds on. Therpc-hackquery.gois a reference, not a spec — clean up and rewrite as you see fit.Implement
Query: run a set of filters against one chunk and return the matching events, ordered and capped. Built on theReaderinterface, so it serves the hot store and cold segments without tier branching.Scope:
MaxEvents, ascending or descending. (rpc-hackis ascending-only; descending is added here.)Out of scope: routing a query across multiple segments.
Add tests for filter combinations, ledger-range clipping, ordering and limit in both directions, and post-filter rejection.