Repository navigation
fix(redis-helper): namespace cache keys like Kafka topics (testnet v5/v6 cache collision) - #12
Merged
Merged
Conversation
Cache keys were `${L2_NETWORK_ID}-...`. Testnet v5 and v6 run as
separate stacks sharing L2_NETWORK_ID=TESTNET and one Redis, so their
explorer-apis read and wrote each other's cached responses. The v6
preview API served v5's chain info and blocks, and the public testnet
API could serve responses cached from the nearly empty v6 database.
Keys now start with the deployment namespace from KAFKA_NAMESPACE, the
variable that already isolates the stack's Kafka topics (v6-TESTNET-...).
Unset, as for mainnet and testnet v5, keys are unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Production bug on testnet, found while bringing up the testnet v6 stack.
redis-helperkeys every cached response as${L2_NETWORK_ID}-…. Testnet v5 and testnet v6 now run as separate stacks on one host, both withL2_NETWORK_ID=TESTNET, so their explorer-apis read and write the same cache keys:api.testnetv6.aztecscan-prod.aztec.foundation) served v5's chain info, rollup-version history and latest block. Only its uncached tips endpoint showed the v6 node's height;api.testnet.aztecscan.xyzcould serve responses cached by the v6 API from its nearly empty database, for up to 60 s (10 s for "latest" endpoints).#10 isolated Kafka with
KAFKA_NAMESPACEbut missed Redis. The v6 explorer-api has been stopped on the host until this ships.Fix
Cache keys start with the deployment namespace from
KAFKA_NAMESPACE, the variable that already isolates the stack's Kafka topics and thatfoundation-iacsets for testnet v6 (v6-TESTNET-…). Unset, as for mainnet and testnet v5, the keys are byte-for-byte unchanged, so existing caches stay valid. Nofoundation-iacconfig change is needed; the v6 images just need rebuilding from this commit.Only
explorer-apiusesredis-helper. Nothing else in the two stacks is shared by network id alone: Postgres databases are per network key, Kafka is namespaced, and the WebSocket publisher only uses Kafka.Verification
redis-helperbuilds and lints.explorer-apibuilds.yarn testpasses across the repo (227 tests).🤖 Generated with Claude Code