entropyxyz / cli

CLI utility to ease interactions with an Entropy network.
GNU Affero General Public License v3.0
5 stars 0 forks source link

Map arguments mis-match error when signing. #75

Closed johnnymatthews closed 3 months ago

johnnymatthews commented 4 months ago

I just hit this error when trying to sign a message:

/root/cli/node_modules/@polkadot/api/cjs/util/validate.js:21
            throw new Error(`${sig(registry, creator, keys)} is a map, requiring ${keys.length} arguments, ${args.length} found`);
                  ^
Error: stakingExtension.thresholdServers(AccountId32) is a map, requiring 1 arguments, 0 found
    at extractStorageArgs (/root/cli/node_modules/@polkadot/api/cjs/util/validate.js:21:19)
    at overrideNoSub (/root/cli/node_modules/@polkadot/api/cjs/base/Decorate.js:623:97)
    at /root/cli/node_modules/@polkadot/api/cjs/promise/decorateMethod.js:43:30
    at new Promise (<anonymous>)
    at decorateCall (/root/cli/node_modules/@polkadot/api/cjs/promise/decorateMethod.js:39:12)
    at Object.thresholdServers (/root/cli/node_modules/@polkadot/api/cjs/promise/decorateMethod.js:73:15)
    at /root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12793:61
    at Array.map (<anonymous>)
    at SignatureRequestManager.pickValidators (/root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12792:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The message I was signing was this (from Alice in Wonderland):

Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, `and what is the use of a book,' thought Alice `without pictures or conversation?'

So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.

There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, `Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge. 

Dunno if the line-breaks are freaking the signer out. I'll try again without them.

johnnymatthews commented 4 months ago

Nope, got the same error even after removing the line-breaks. Let me try a smaller message.

johnnymatthews commented 4 months ago

Hmmm, this time I tried Hello World! as the message and got a different error:

/root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12218
    throw new Error(
          ^
Error: request failed 500, Internal Server Error fetch: http://44.204.64.128:3001/user/sign_tx FULLRESPONSE: Invalid Signer: Invalid Signer in Signing group
    at sendHttpPost (/root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12218:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12769:26
    at async Promise.all (index 0)
    at async SignatureRequestManager.sign (/root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12670:18)
    at async SignatureRequestManager.signWithAdaptersInOrder (/root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:12636:23)
    at async Entropy.signWithAdaptersInOrder (/root/cli/node_modules/@entropyxyz/sdk/dist/index.cjs:13186:12)
    at async Object.sign (/root/cli/src/flows/sign/index.ts:91:24)
    at async main (/root/cli/src/index.ts:89:30)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command
johnnymatthews commented 4 months ago

Tried with a message Will I Am went missing. and everything worked fine... Maybe the CLI doesn't like special characters or long messages?

rh0delta commented 3 months ago

the special characters aren't an issue, the error you faced is a known issue with polkadot and how its handling our adapters, which is sorta being handled in #63 the real issue here is the length of the message being signed.

johnnymatthews commented 3 months ago

real issue here is the length of the message being signed.

This'll be mostly addressed by https://github.com/entropyxyz/entropy-docs/issues/112. Gonna close this one for now.