fix(stellar): query announcer buckets via Soroban RPC topic filters#43
Open
wheval wants to merge 1 commit into
Open
fix(stellar): query announcer buckets via Soroban RPC topic filters#43wheval wants to merge 1 commit into
wheval wants to merge 1 commit into
Conversation
Add v2 bucketed getEvents filters, dual v1/v2 ingestion during migration, and tests for filter construction and mixed event parsing. Closes wraith-protocol/contracts#25
Contributor
|
Direction is correct, this is the SDK companion to contracts #26's v2 event topic design. The new Same rebase blocker as the other PRs this round. Could you rebase and limit the diff to the v2 topic-filter additions? git fetch origin
git rebase origin/develop
# during the rebase, keep your event-filters.ts, the scan.test/scan.ts additions, and announcements changes that add bucket-based fetching
# drop any reverting changes to src/chains/stellar/* that you didn't intend to touch (the rest of develop already has JSDoc and range filtering)
git push --force-with-leaseThanks @wheval. |
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
Updates the Wraith Stellar SDK event ingestion path to use Soroban RPC topic filters for the v2 announcer schema, while continuing to read the legacy v1 announcer stream during the migration window.
Purpose / Motivation
The current
fetchAnnouncements()implementation downloads every event from the v1 announcer contract and filters client-side. As announcement volume grows, that wastes bandwidth and RPC cost. Soroban supports indexed topic filters viagetEvents; the v2 announcer schema (contracts #24) exposesview_tag_bucketas topic slot 2 so clients can request only the buckets they need.Changes Made
event-filters.tswith helpers to build v1 and v2 Soroban RPC filters:("announce", *, *)oncontracts.announcer("announce", 2, view_tag_bucket, *)oncontracts.announcerV2("announce", 2, *, *)fetchAnnouncements()to ingest v1 + v2 during transition, dedupe overlapping results, and acceptviewTagBucketsfor targeted v2 queriesscanAnnouncements()to accept scheme ID 2 (v2)EVENT_FETCHING.mdandfetchAnnouncementsJSDocSet
contracts.announcerV2in deployments once the v2 contract from wraith-protocol/contracts#24 is deployed.How to Test
npm installnpm test -- test/chains/stellar/event-filters.test.ts test/chains/stellar/announcements.test.ts test/chains/stellar/scan.test.tsBreaking Changes
None for existing callers.
fetchAnnouncements('stellar')remains valid and continues fetching the v1 stream. v2 ingestion is opt-in viacontracts.announcerV2deployment config.Related Issues
Closes wraith-protocol/contracts#25
Checklist