Cache item support multiple Payload Hashes - #5422
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: e9fcfed The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brunotm
approved these changes
Sep 21, 2026
denis-chernov-smartcontract
enabled auto-merge (squash)
September 21, 2026 16:05
Merged
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.
Problem
A streams adapter running both HTTP and gRPC transports failed to deliver observations to gRPC subscribers when an asset pair had already been registered over HTTP with a different request payload.
Solution
Allow a single cache item to track all payload hashes registered for the same raw cache key, and fan out observations to every registered hash. Additionally, expose the adapter version on the Go runtime
/healthendpoint by reading it from the JS adapter's health response.Changes
common/types.goCacheItemnow storesPayloadHashes map[[32]byte]struct{}instead of a singlePayloadHash.cache/cache.goSetNewseeds the hash set with the first subscriber's hash.AddPayloadHashto register additional hashes for an existing raw key.PayloadHashesByRawKeyto retrieve all hashes for fan-out.PayloadHashByRawKey.server/server.goEnsureSubscriptionadds the new payload hash when the raw key already exists./cachedebug endpoint exposespayloadHashes(list) instead of a duplicated singlepayloadHash.SetAdapterVersionand includeadapterVersionin the/healthresponse.redcon/redcon.gomain.gowaitForEAServernow reads and returns the adapter version from the JS adapter/healthresponse viareadAdapterVersion.Tests
TestCache_AddPayloadHashto verify multiple hashes are tracked per cache item.TestHandleCommand_Eval_FansOutToMultiplePayloadHashesto verify a single observation is delivered to subscribers on different payload hashes.TestReadAdapterVersionandTestHealthHandler_AdapterVersionto verify the adapter version is parsed from the JS adapter health response and returned by/health.