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
## Motivation
The `get_public_key` method in the `Signer` API is a blocker for
implementing that trait for EVM wallets - like MetaMask - which do not
expose the public key to the users.
## Proposal
Remove `Signer::get_public_key`.
There were few palces where we used `get_public_key()` via `ChainClient`
only to map that into `AccountOwner` - these were updated to call
`client.identity()` directly instead.
The biggest change is in the `BlockProposal` struct, which also carried
`AccountPublicKey` used for verifying the signature later on. Here the
public keys were "inlined" into the `AccountSignature`: for `Ed25519 and
`Secp256k1` cases this meant simply adding the key to those variants:
```rust
pub enum AccountSignature {
Ed25519 {
signature: ed25519::Ed25519Signature,
public_key: ed25519::Ed25519PublicKey,
},
Secp256k1 {
signature: secp256k1::Secp256k1Signature,
public_key: secp256k1::Secp256k1PublicKey,
},
EvmSecp256k1(secp256k1::evm::EvmSignature)
```
and use the `public_key`s to verify the signatures later.
For the EVM case we recover the `AccountOwner` (via recovering EVM
address and turning that into `AccountOwner::Address20`) from the
signature and the message.
## Test Plan
CI
## Release Plan
- Nothing to do / These changes follow the usual release cycle.
## Links
Closes#4077
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
0 commit comments