Sign auth entries when the signer is passed by public key - #2658
Open
fnando wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds reverse identity lookup so public-key contract arguments can locate their stored signing secrets.
Changes:
- Adds public-key-to-secret identity lookup.
- Resolves public-key arguments into auth signers.
- Adds unit and integration regression tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
config/locator.rs |
Adds reverse identity lookup and tests. |
config/address.rs |
Resolves literal account addresses to secrets. |
contract/arg_parsing.rs |
Creates signers from resolved addresses. |
integration/auth.rs |
Tests signing via a public key. |
fnando
force-pushed
the
resolve-signer-by-public-key
branch
from
July 27, 2026 17:39
a1d20fd to
822c4a2
Compare
fnando
enabled auto-merge (squash)
July 27, 2026 17:52
fnando
force-pushed
the
resolve-signer-by-public-key
branch
from
July 27, 2026 20:39
c8d351e to
0ad0cb2
Compare
fnando
force-pushed
the
resolve-signer-by-public-key
branch
from
July 28, 2026 13:45
0ad0cb2 to
e602827
Compare
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.
What
Passing an account by its public key (
G…) where that account must sign — e.g. anAddressargument that callsrequire_auth()— now resolves to the local identity that holds the matching key, exactly like passing the identity alias does. Previously this failed withMissing signing key for account G…, even though the key was present in the keystore.Fixes #2459.
Why
Every signing path only resolved in one direction: an identity name or secret to an address/secret. When a raw public key was supplied,
resolve_signer→get_secret_keyrecognized it as a public key and concluded no secret was available, so the auth entry went unsigned. Passing the same account by its alias worked, so the two were inconsistent for what is the same account. This adds the reverse lookup so a public key and its alias behave identically when signing.Implementation: a new
Locator::secret_by_public_keyscans stored identities and returns the secret whose public key matches (reusing each identity's ledger/secure-store-aware public-key derivation).UnresolvedMuxedAccount::resolve_secretuses it for literalG…/M…addresses, falling back to the existingCannotSignerror only when no identity matches. Covered by unit tests and an integration regression test that reproduces the original failure.Known limitations
N/A