Skip to content

[CRITICAL][STELLAR NETWORK ISOLATION] Key projected events by network and filter activity accordingly #201

Description

@Obiajulu-gif

Summary

Raw indexer envelopes are network-scoped, but the projected StellarIndexedEvent model has no network field and uses the Horizon operation ID alone as _id. Testnet and mainnet projections can collide, and the activity API queries every projected record without constraining the configured network.

Repository evidence

  • models/StellarIndexedEvent.ts:28-53 defines no network identity and documents _id as the operation/payment ID.
  • lib/stellar/indexer.ts:213-240 correctly includes network in raw-envelope keys, but persistEvent projects into the networkless model.
  • app/api/stellar/activity/route.ts:163-181 filters only by account (or nothing for admins), despite returning config.network in the response.

Scope

  • Add immutable network identity to projected events and use a collision-safe compound identity.
  • Backfill or rebuild legacy projections with explicit provenance and quarantine ambiguous records.
  • Filter all activity and administrative queries by the selected network.

Acceptance criteria

  • The same Horizon operation identifier can exist on testnet and mainnet without collision.
  • No testnet event appears in a mainnet activity response, including admin responses.
  • Network changes cannot silently relabel legacy networkless projections.

Tests

  • Cross-network ID collision, account with activity on both networks, admin filtering, legacy ambiguous record, rebuild, and unique-index migration tests.

Non-goals

  • Changing contiguous checkpoint or dead-letter behavior already handled by the raw indexer pipeline.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions