Skip to content

View tag matching#45

Merged
truthixify merged 4 commits into
wraith-protocol:mainfrom
clintjeff2:view-tag-matching
Jun 1, 2026
Merged

View tag matching#45
truthixify merged 4 commits into
wraith-protocol:mainfrom
clintjeff2:view-tag-matching

Conversation

@clintjeff2

Copy link
Copy Markdown
Contributor

Motivation

  • Ensure the Stellar scan migration boundary between the new public-announcement view-tag and the legacy shared-secret view-tag is tested so optimized scanning doesn't silently break compatibility.
  • Provide regression coverage that the optimized scanner rejects legacy-tagged announcements while the legacy scanner (scanAnnouncementsLegacySharedSecretTag) still finds them for migration and benchmarking.

Description

  • Updated test/chains/stellar/scan.test.ts to import computeSharedSecret, computeViewTag, and scanAnnouncementsLegacySharedSecretTag from the Stellar codepath.
  • Added a new test keeps legacy shared-secret view tags on the legacy scanner path that builds a deterministic legacy-tagged announcement, asserts the optimized scanAnnouncements rejects it, and asserts the legacy scanner finds it.
  • The change exercises both tag derivations and preserves existing benchmark/compatibility tooling without altering runtime scan logic.

Testing

  • Ran typecheck with pnpm exec tsc --noEmit, which succeeded without errors.
  • Ran the targeted test with pnpm test -- test/chains/stellar/scan.test.ts, which passed (all tests in that file succeeded).
  • Ran the full test suite with pnpm test, which completed successfully with all tests passing (136 passed).
  • Ran the benchmark STELLAR_SCAN_BENCH_SIZES=10000 pnpm exec vitest bench test/chains/stellar/bench/scan.bench.ts --run, which reported an approximately 229× speedup for the optimized public-prefilter scan over the legacy shared-secret-tag scan on the 10k synthetic dataset.

Closes #4

@truthixify

Copy link
Copy Markdown
Contributor

229× speedup on the 10k dataset is well past what #4 asked for, and keeping the legacy scanAnnouncementsLegacySharedSecretTag path alongside the optimized one with a migration-boundary regression test is the right call for safe rollout. Design doc covers the privacy tradeoff explicitly. Merging. Thanks @clintjeff2.

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.

View-tag batching for Stellar scan performance

2 participants