fix(pxe): return no shared secrets when scope keys are not held - #24487
Merged
nchamo merged 3 commits intoJul 3, 2026
Conversation
nchamo
marked this pull request as ready for review
July 3, 2026 00:09
mverzilli
reviewed
Jul 3, 2026
nchamo
commented
Jul 3, 2026
nchamo
enabled auto-merge (squash)
July 3, 2026 14:29
nchamo
deleted the
nchamo/f-741-getsharedsecrets-throws-no-public-key-during-recipient
branch
July 3, 2026 14:54
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
Simulating a utility function for a scope the PXE does not control (e.g.
balance_of_private(A)on a PXE that only knows A as a registered sender) fails with "No public key registered" atToken.sync_state. The e2e tests have always expected this to read 0, and they used to pass, but only because the failing path was unreachable: with no handshakes on chain, sync skipped secret derivation entirely. Once onchain delivery started establishing a non-interactive handshake for every recipient (including each account's own constructor note), handshake discovery began deriving secrets for foreign scopes and hit the throw. The affected tests were skipped under TODO(F-741) until we could tackle this. This PR makes the path handle the no-keys case and restores the tests.Fix
getSharedSecretsreturns an empty array instead of throwing when the scope's keys are not held. Controlled accounts always have their complete address registered, so an empty response uniquely means "no key access".get_shared_secretsaccepts the empty response, so handshake discovery yields no secrets for a foreign scope.get_shared_secretreturnsOption<Field>, and message decryption treatsnoneas undecryptable and skips the message. This path was also broken for foreign scopes, previously masked by the discovery throw.Fixes F-741