node icon indicating copy to clipboard operation
node copied to clipboard

cli: `Error: Invalid channel` when signing signatures with ledger on mac.

Open boz opened this issue 4 years ago • 21 comments

Mac users on v0.12.x and v0.14.x have recently begun not being able to issue akash tx sign. The error is:

Error: Invalid channel

The problem doesn't occur on Linux.

I have looked for "Invalid channel" in both our repository and in cosmos-sdk, and it is in neither code bases. It may be a change in iOS that our ledger libraries are running into.

Thoughts @troian ?

boz avatar Nov 11 '21 20:11 boz

i'll try to reproduce

troian avatar Nov 11 '21 20:11 troian

I found the error here: https://github.com/cosmos/ledger-go/blob/1c99b41f1877b58e3517ef93012cc76fe5cd335b/apduWrapper.go#L80

boz avatar Nov 11 '21 20:11 boz

apparently we're using wrong ledger-go (at least on master) this whole piece is missing

replace (
	github.com/cosmos/ledger-cosmos-go => github.com/ovrclk/ledger-cosmos-go v0.13.2
	github.com/zondax/hid => github.com/troian/hid v0.9.9
	github.com/zondax/ledger-go => github.com/ovrclk/ledger-go v0.13.4
)

re: the v0.14.0 has right one

troian avatar Nov 11 '21 21:11 troian

It's broken on v0.12.x - the same binary worked not too long ago. Might be an iOS upgrade issue.

I'm asking user to verify that v0.14.x doesn't work either.

boz avatar Nov 11 '21 21:11 boz

gotcha

troian avatar Nov 11 '21 21:11 troian

yeah, i haven't had such issues. is it Intel or M1 mac?

troian avatar Nov 11 '21 21:11 troian

yeah, i haven't had such issues. is it Intel or M1 mac?

I thought Intel, but checking.

boz avatar Nov 11 '21 21:11 boz

Intel, v0.14.1-rc6 does not work.

boz avatar Nov 11 '21 23:11 boz

ok, thanks

troian avatar Nov 11 '21 23:11 troian

just gave it a check and works fine for executable from v0.14.1-rc4 release

akash tx send <addr1> <addr2> --generate-only > tx.sign
akash tx sign tx.sign --from=<addr1>

does issue happen all the time or from time to time?

troian avatar Nov 11 '21 23:11 troian

All the time now. Two different users. :man_shrugging:

Here is the exact command:

./akash tx sign ./txs/team2/final/75-tx.json --multisig akash1pv9fm995q4vwkcqkt5vuuakv7rfpvgrk2n6cr7 --from cwang --output-document ./txs/team2/final/75-cwang-sig.json --account-number 89 --sequence 75 --offline --sign-mode amino-json --ledger

boz avatar Nov 12 '21 00:11 boz

could they run command below to check some other ledger communications

akash keys add blabla --ledger --index=20

troian avatar Nov 12 '21 00:11 troian

I had them run show -d and it worked.

./akash keys show $(whoami) -d
- name: bmenzalji
 type: ledger
 address: akash1nzd8jnu69w8eux3dcg4axxyarm7age86dclz3n
 pubkey: akashpub1addwnpepqwycuvsn8xq0pmgypyq29xrrgm82urrxvm3dp7qdhgjdm29c4zvtcj8l6hp
 mnemonic: ""
 threshold: 0
 pubkeys: []

boz avatar Nov 12 '21 00:11 boz

show does not talk to ledger tho

troian avatar Nov 12 '21 00:11 troian

show $name -d does - it prints this output if not connected:

./akash keys show abozanich-0 -d
- name: abozanich-0
  type: ledger
  address: akash1hrsq2cznkk3gkwly9wp2hm9y8ej2rc5reh37r5
  pubkey: akashpub1addwnpepqwg39096cyh8hdlkcpkm33h5zls9hgraejas9kl06t3yhs48wc8kjuwaxhx
  mnemonic: ""
  threshold: 0
  pubkeys: []
Error: please open Cosmos app on the Ledger device - error: Error code: 6804

-d will show the address on the ledger.

That said, it is likely a different code path.

boz avatar Nov 12 '21 00:11 boz

They're on iOS 12.0.1 if that matters

boz avatar Nov 12 '21 00:11 boz

i've got the bug, it happens wen signing multisig tx

troian avatar Nov 12 '21 00:11 troian

They're on iOS 12.0.1 if that matters

MacOS? 😄

troian avatar Nov 12 '21 00:11 troian

i've got the bug, it happens wen signing multisig tx

ah, nice!

boz avatar Nov 12 '21 00:11 boz

They're on iOS 12.0.1 if that matters

MacOS? 😄

It's all DOS to me 😂

boz avatar Nov 12 '21 00:11 boz

weirdly, it does not happen when using akash binary i've built locally. i can share them v0.14.1-rc6 binary i have

troian avatar Nov 12 '21 00:11 troian