Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Signing transactions with keys generated at runtime. #346

Closed
kziemianek opened this issue Nov 6, 2020 · 3 comments
Closed

Signing transactions with keys generated at runtime. #346

kziemianek opened this issue Nov 6, 2020 · 3 comments
Labels
signing TeamGroot Identifies a given issue is assigned to the Groot Team

Comments

@kziemianek
Copy link

Hello,

I'm running ehtsigner in multikey mode and i'm generating keys at runtime (toml files and vault entries) but I cannot use them to sign transactions, while eth_accounts returns newly generated keys.

2020-11-06 09:44:44.407+01:00 | vert.x-worker-thread-3 | INFO  | SendTransactionHandler | From address (0x4a614e64192824b59a8cf227e2a7c8fe1438dcb5) does not match any available account
$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":0}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":0,"result":["0x3bdaf240808f7bb7db9a0447ee6e24fdb26c346d","0x4a614e64192824b59a8cf227e2a7c8fe1438dcb5","0xa98f8ab0636b9b893bc88dd64727ced57f24a77d","0xbfb3c8333f44714af13f729e3f676b11acce4189","0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"]}

After restarting ethsigner I can sign transactions with 0x4a614e64192824b59a8cf227e2a7c8fe1438dcb5 key successfully.

According to docs keys can be added without restarting ethsigner.
Files can be added or removed from the directory without needing to restart EthSigner.
https://docs.ethsigner.consensys.net/en/latest/HowTo/Use-Multiple-Signers/

It seems like AddressIndexedSignerProvider#addressToPublicKeyMap is never updated.
https://github.com/ConsenSys/ethsigner/blob/b55e5dc2ee1af4e91d44240a2d00200e131a2323/ethsigner/core/src/main/java/tech/pegasys/ethsigner/core/AddressIndexedSignerProvider.java#L28

I would expect ethsigner to sign transactions with newly generated keys without restart.

@kziemianek
Copy link
Author

I can think of two solutions:

  1. Fetch all keys naively if key is not present (kziemianek@0551e4f).
  2. Watch keys dir and notify listeners in case of change (addition/deletion of key config toml file). It will require change both in signers and ethsigner. The solution will involve registering listeners through SignerProvider interface.

Which one do You prefer or maybe there is third ?

@usmansaleem
Copy link
Contributor

#390

@jframe jframe added the TeamGroot Identifies a given issue is assigned to the Groot Team label Jan 18, 2022
@usmansaleem
Copy link
Contributor

Fixed by #391

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
signing TeamGroot Identifies a given issue is assigned to the Groot Team
Projects
None yet
Development

No branches or pull requests

4 participants