You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rs-sdk: verify a fetched quorum key without reading it back from the provider's cache #5693
After a context provider fetches a quorum key (fetch_quorum_public_key), Sdk::verify_fetching_quorum_key drops the returned key (Ok(Some(_)), packages/rs-sdk/src/sdk/quorum_key.rs) and verifies the response again. That second verification reads the key back from the provider through get_quorum_public_key.
So the second check passes only if the provider still holds the key. A provider with a bounded cache can evict it in between: a concurrent fetch of another quorum completes and pushes it out. The SDK then reports QuorumSourceUnavailable for a fetch that succeeded. No node is banned and no wrong key is accepted, but the request fails over and the key is fetched again.
#5523 rules this out for VerifiedHttpContextProvider by refusing a cache smaller than the number of active Platform quorums. That leaves the SDK depending on each provider's caching. Any other provider with a small cache, now or later, can hit the same race.
Proposed fix: run the second verification against a wrapper around the provider that answers the fetched quorum (type, hash) from the returned key, and delegates everything else to the provider. The key is used for exactly the proof it was fetched for, so caching no longer affects correctness.
Activity