Repository navigation
chore(solana-relay): remove dead transaction cache and forwarding - #96
Merged
Merged
Conversation
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>
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.
Why
After every relay,
broadcastTransactionre-confirmed the transaction, fetched it with a rawgetTransactionrequest, wrote the JSON to Redis undersolana:transaction:<sig>, and POSTed it to every other node's/solana/cacheendpoint (signed with the node's delegate key) so the Python indexer could skip RPC calls while indexing.That indexer is retired. Nothing in
apior pedalboard reads the Redis key, and nothing calls/solana/cacheexcept this forwarding loop. So each relay was paying for one extra confirmation, onegetTransaction, one Redis write and N outbound HTTP requests with no consumer. It was also the only remaininggetTransactioncall in pedalboard, the one flagged in the Helius Transaction v1 notice.What
Removed, all in
apps/solana-relay:broadcastTransactionandforwardTransactioninutils/transaction.ts, plus the call in the relay route/solana/cacheroute and handlerdiscoveryNodeSignerRecoveryMiddleware, theDiscovery-Signaturecheck andres.locals.isSignedByDiscovery, which only guarded/solana/cachecacheTransactionandgetCachedDiscoveryNodesRedis helpersconfig.endpointandconfig.delegatePrivateKeywith 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.redisandeth-sig-utilstay as dependencies: Redis still backs token-account rate limiting, andeth-sig-utilstill recovers user signatures.The relay response was already sent before
broadcastTransactionran, so client-visible behavior is unchanged.Supersedes #95, which only bumped the version flag on the fetch this PR deletes.
Verification
npm run lintinapps/solana-relay(tsc plus eslint) passes; the two remaining warnings are pre-existing inerrorHandler.ts.vitest run: 3 files, 50 tests pass.🤖 Generated with Claude Code