Skip to content

[Backend] Indexer ignores fee_config_updated and admin_transferred governance events #524

@ogazboiz

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

The Soroban contract now emits two governance events that are never indexed:

Both are emitted with a single-element topic ((Symbol,)), but SorobanEventWorker.processEvent bails out early for any event with fewer than 2 topics:

// backend/src/workers/soroban-event-worker.ts:250
if (!event.topic || event.topic.length < 2) return;

So these events are dropped before they ever reach the switch, and the switch has no case for them anyway (only the 8 stream-lifecycle events are handled). The result: a treasury/fee-rate change or an admin rotation produces no StreamEvent row, no SSE broadcast, and no audit trail in the backend, even though the chain recorded it. The event-type taxonomy (backend/src/routes/v1/events.routes.ts, stream.controller.ts validEventTypes, and the frontend EVENT_STYLES) also has no entries for these.

These are protocol-level governance actions; not surfacing them is a real observability/audit gap, and the events were just added to the contract this cycle.

Acceptance criteria

  • Allow single-topic events through processEvent (handle topic.length === 1 for protocol events while still requiring streamId topic for per-stream events).
  • Add a fee_config_updated handler that persists a FEE_CONFIG_UPDATED record (decode admin, old_treasury, new_treasury, old_fee_rate_bps, new_fee_rate_bps).
  • Add an admin_transferred handler that persists an ADMIN_TRANSFERRED record (decode previous_admin, new_admin).
  • Add the two new event-type strings to the allow-list in backend/src/routes/v1/events.routes.ts and validEventTypes in backend/src/controllers/stream.controller.ts.
  • Broadcast the new events over SSE on a protocol/admin channel (these are not tied to a single streamId).
  • Add worker unit/integration coverage asserting both event types are decoded and stored.

Files to touch

  • backend/src/workers/soroban-event-worker.ts
  • backend/src/routes/v1/events.routes.ts
  • backend/src/controllers/stream.controller.ts
  • backend/src/__tests__/integration/streams.test.ts

Out of scope

  • Frontend rendering of governance events (a small follow-up to add EVENT_STYLES entries can be a separate issue).
  • Changing the contract event shapes.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksindexerBlockchain data indexing

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions