Client: assert failure and confusing behavior when address has multiple aliases
Environment (Alphanet, build from source, or both)
I am using tezos-client
executable built for babylonnet
, revision b8731913.
Summary
If I add an address with two different aliases, list known addresses
incorrectly displays whether unencrypted sk is known and sign bytes
command unexpectedly fails with
"Assert_failure src/lib_client_base/client_keys.ml:237:6"
Expected behavior
- I expect
list known addresses
command to say that unencrypted sk is known for bothtmp
andtmp1
. - I expect
tezos-client sign bytes 0x00 for tz1R6xC3DBhrxoUxahw6s5D1PcJysQDe4cBY
andtezos-client sign bytes 0x00 for tmp1
to sign bytes successfully.
Actual behavior
-
list known addresses
command does not say that unencrypted sk is known fortmp
andtmp1
. It does not say the opposite either, but I suppose it is implied. -
sign bytes
works only fortmp
, but nottmp1
and address literal. It prints the following error in both cases:
Fatal error:
"Assert_failure src/lib_client_base/client_keys.ml:237:6"
Steps to reproduce
I have an address with alias tmp
, so that tezos-client list known addresses
command prints the following:
tmp: tz1R6xC3DBhrxoUxahw6s5D1PcJysQDe4cBY (unencrypted sk known)
As you can see, its secret key is known. I want to give this address another alias, let's say tmp1
. So I do:
tezos-client add address tmp1 tmp --force
Now if I do tezos-client list known addresses
I will get:
tmp1: tz1R6xC3DBhrxoUxahw6s5D1PcJysQDe4cBY
tmp: tz1R6xC3DBhrxoUxahw6s5D1PcJysQDe4cBY
Then I try to sign bytes to check whether sk is really not known: tezos-client sign bytes 0x00 for tmp
. It succeeds and prints a signature.
However, if I try to do tezos-client sign bytes 0x00 for tmp1
or tezos-client sign bytes 0x00 for tz1R6xC3DBhrxoUxahw6s5D1PcJysQDe4cBY
, I will get the error I posted above.
History mode
Not applicable.
Logs
No logs apart from command output.