Skip to content

chore(solana-relay): remove dead transaction cache and forwarding - #96

Merged
rickyrombo merged 1 commit into
mainfrom
chore/remove-solana-relay-tx-cache
Sep 15, 2026
Merged

rickyrombo merged 1 commit into
mainfrom
chore/remove-solana-relay-tx-cache

Conversation

@rickyrombo

Copy link
Copy Markdown
Contributor

Why

After every relay, broadcastTransaction re-confirmed the transaction, fetched it with a raw getTransaction request, wrote the JSON to Redis under solana:transaction:<sig>, and POSTed it to every other node's /solana/cache endpoint (signed with the node's delegate key) so the Python indexer could skip RPC calls while indexing.

That indexer is retired. Nothing in api or pedalboard reads the Redis key, and nothing calls /solana/cache except this forwarding loop. So each relay was paying for one extra confirmation, one getTransaction, one Redis write and N outbound HTTP requests with no consumer. It was also the only remaining getTransaction call in pedalboard, the one flagged in the Helius Transaction v1 notice.

What

Removed, all in apps/solana-relay:

  • broadcastTransaction and forwardTransaction in utils/transaction.ts, plus the call in the relay route
  • the /solana/cache route and handler
  • discoveryNodeSignerRecoveryMiddleware, the Discovery-Signature check and res.locals.isSignedByDiscovery, which only guarded /solana/cache
  • cacheTransaction and getCachedDiscoveryNodes Redis helpers
  • config.endpoint and config.delegatePrivateKey with their env vars (audius_discprov_url, audius_delegate_private_key), which were only used for forwarding. Leaving those env vars set in deployments is harmless.

redis and eth-sig-util stay as dependencies: Redis still backs token-account rate limiting, and eth-sig-util still recovers user signatures.

The relay response was already sent before broadcastTransaction ran, so client-visible behavior is unchanged.

Supersedes #95, which only bumped the version flag on the fetch this PR deletes.

Verification

  • npm run lint in apps/solana-relay (tsc plus eslint) passes; the two remaining warnings are pre-existing in errorHandler.ts.
  • vitest run: 3 files, 50 tests pass.

🤖 Generated with Claude Code

After relaying a transaction, the relay fetched it via getTransaction, stored
the raw JSON in Redis under solana:transaction:<sig>, and POSTed it to every
other node's /solana/cache endpoint (authenticated with a Discovery-Signature
header) so the Python indexer could avoid RPC calls. That indexer is retired
and nothing reads the Redis key or calls /solana/cache any more, so this was
one extra confirm, one getTransaction, one Redis write and N outbound HTTP
requests per relay for no consumer.

Removed:
- broadcastTransaction and forwardTransaction (utils/transaction.ts)
- the /solana/cache route and its handler
- discoveryNodeSignerRecoveryMiddleware, the Discovery-Signature check and
  res.locals.isSignedByDiscovery, which only guarded /solana/cache
- cacheTransaction and getCachedDiscoveryNodes Redis helpers
- config.endpoint, config.delegatePrivateKey and their env vars
  (audius_discprov_url, audius_delegate_private_key), only used for forwarding

The relay response is sent before any of this ran, so client-visible behavior
is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rickyrombo
rickyrombo merged commit 43e08c7 into main Sep 15, 2026
2 checks passed
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.

1 participant