EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.76k forks source link

cleos - not detecting valid signatures that already exist #10108

Open eosauthority opened 3 years ago

eosauthority commented 3 years ago

An issue with

cleos version full v2.1.0-rc3-19ac0bf5ad1f6a917f51974ff3227022b2301ed9

Cleos does not seem to like existing signatures. Transactions created with EOSJS or with cleos itself does not seem to work as expected.

Steps with two parties signing same transaction

  1. Create a valid transaction with two actions. First action requiring Party 1 signature and second action requiring Party 2 signature.
  2. Party 1 signature is created by EOSJS and included in the transaction.
  3. Use cleos push transaction and sign the transaction Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations

Steps with one party signing the same transaction on cleos

  1. Create a valid transaction with one actions. Just one signature required.

    cleos -u https://api.jungle3.alohaeos.com push transaction '{"delay_sec":0,"actions":[{"account":"eosio","name":"voteproducer","data":{"voter":"streamgood12","proxy":"","producers":["lioninjungle"]},"authorization":[{"actor":"streamgood12","permission":"active"}]}]}' -d > s.json

(s.json contains valid json file with signatures section filled in).

  1. Lock the wallet

    cleos wallet lock -n thewallet

  2. Unlock another wallet (no keys there)

    cleos wallet unlock -n wallet_no_keys

  3. Try to push the transaction that's already signed

    cleos -u https://api.jungle3.alohaeos.com push transaction s.json

Error 3090003: Provided keys, permissions, and delays do not satisfy declared authorizations Ensure that you have the related private keys inside your wallet and your wallet is unlocked. Error Details: transaction declares authority '{"actor":"streamgood12","permission":"active"}', but does not have signatures for it.

There shouldn't be an error here. Not sure why, the signature already exists.

Cleos can actually detect duplicate If instead of Step 2 and 3 above, the wallet it left unlocked, you get this message while trying to run the last step. It does indeed look like cleos is capable of detecting signatures.

cleos -u https://api.jungle3.alohaeos.com push transaction s.json

Error 3090001: Duplicate signature included Error Details: transaction includes more than one signature signed using the same key associated with public key: EOS72YpnxKDppvMPzWAHbj5UcXBxhWBAQxCQkvYoyCQbk2YrvhtDK

aclark-b1 commented 3 years ago

Docs team - Per Engineering this is expected behavior. Is this something we can clarify in our developer materials?

eosauthority commented 3 years ago

Is there a work around to avoid signing check?