Event-filter analysis tool + 15-term v2-spec getEvents filter corpus#749
Closed
chowbao wants to merge 3 commits into
Closed
Event-filter analysis tool + 15-term v2-spec getEvents filter corpus#749chowbao wants to merge 3 commits into
chowbao wants to merge 3 commits into
Conversation
Adds cmd/stellar-rpc/scripts/event-filter-analysis: scans a cold ledger pack, counts per-contract topic-prefix and per-position topic-value distributions over events with 4 topics, and emits a v2-spec getEvents filter sized to a 15-unique-term budget (3 contractIds + 4 positions × 3 values per position). When a topic position has fewer than 3 distinct real values across the picked contracts, the picker grows the contractId set to spend the remaining term budget on additional contracts rather than padding with empty/synthetic values. Output for chunk 5999 (ledgers 59,990,002–60,000,001, 9.9M events) is checked in at bench-out/filter-15terms-5999.json (v2 layout) and bench-out/filter-15terms-5999-v1.json (cartesian-product expansion into v1 per-tuple filters, 216 entries, same 15-term universe). The resulting filter exercises 4 contractIds + [2,3,3,3] topic values across positions — 5-way bitmap union/AND per query — and targets the hottest real Stellar Asset Contract activity (transfer/approve verbs, hot wallet transfer pairs, native + USDC + VLR asset identifiers).
5c87362 to
0a50b00
Compare
added 2 commits
May 21, 2026 19:14
700 ready-to-fire JSON-RPC envelopes sampled from the 216-entry v1
filter pool, stratified across K (filters per request) ∈ {1, 2, 3, 5,
8, 12, 15} with 100 requests per bucket. Filters are drawn without
replacement; all use the chunk-5999 ledger range (59,990,002–60,000,001,
the v2-proposal-max 10K-ledger window) and pagination.limit=100.
Sampling is deterministic (seed 20260521) so repeated bench runs hit
the same workload. Sidecar -meta.json records the seed, bucket plan,
and pool size for the bench harness to read back.
Layout:
- bench-out/filter-15terms-5999-requests.jsonl — JSONL, 700 requests
- bench-out/filter-15terms-5999-requests-meta.json — generation metadata
Contributor
|
these changes were integrated into #751 so now this can be closed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd/stellar-rpc/scripts/event-filter-analysis: a one-shot scanner over a cold ledger pack that derives a v2-specgetEventsfilter sized to a 15-unique-term budget (3 contractIds + 4 topic positions × 3 values per position, per the proposal in stellar discussion #1872).bench-out/filter-15terms-5999.json(v2 layout, single filter) andbench-out/filter-15terms-5999-v1.json(cartesian-product expansion to 216 v1-style per-tuple filters, same 15-term universe).What the 15 terms exercise
Symbol(transfer)(3M hits) +Symbol(approve)Bytes: native, USDC, VLRPer-query bitmap work: union 4 contract bitmaps + union 2/3/3/3 topic bitmaps at the 4 positions, then AND all 5 unions — the heaviest real shape that fits in the proposed v2 caps.
Test plan
go build ./cmd/stellar-rpc/scripts/event-filter-analysis— clean onrpc-hackbase./event-filter-analysis -pack <path> -out /tmp/fc.json -filter15-out /tmp/f15.jsonand confirmunique_terms == 15🤖 Generated with Claude Code