eos icon indicating copy to clipboard operation
eos copied to clipboard

3090003, "name": "unsatisfied_authorization", "what": "Provided keys, permissions, and delays do not satisfy declared authorizations", "details": [{"message": "transaction declares authority \"{"actor":"testaccount1","permission":"active"}\", but does not have signatures for it under a provided delay of 0 ms, provided permissions [], and provided keys ["EOS7gGChmszuw8FvzjbZ9t4HMXdKZfNG2rNywEzHZNyAPTsTEEX6v"]", "file": "authorization_manager.cpp", "line_number": 411, "method": "check_authorization"}]}}

Open readygo586 opened this issue 8 years ago • 19 comments

when I try to use rpc to transfer currency, 3090003, "name": "unsatisfied_authorization", "what": "Provided keys, permissions, and delays do not satisfy declared authorizations happens, but if cleos works well

In my local test net,mainnet-1.2.5-38-gf0a257233 is used. 3 accounts are created, named testaccount1, testaccount3 and token. The eosio.token contract is deployed in token account, currency’s name is EOS. A default wallet is created, 6 public/private key pairs are imported. The account and keys relationship listed below:

default wallet "EOS5CuHFLvDhTaU8usM1A4PW5f6m1coCHpqhSmbtPQdEo84stnJQ7", //testaccount1 owner key "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", //testaccount1 active key "EOS6stFR6zp4mMQ9pvJSJFj49Nb3GjaxKt32927MfBsg8owUUqmju", //testaccount3 owner key "EOS772JxdvxG8dykycZg9CUwuMMeVxuPHcQfpqqjGL8EdsYoibxVv", //testaccount3 active key "EOS7KSiiAAFWSPMUxFdGRVhzCcNFNkKvXnttUyLFBUJ46qZrwxNy1", //token ownerkey "EOS7fZsUyKpkxtF8ygpnwNMFDbS8yzFJudcqztuDZ5GREWLH4EwwJ" //token activekey

I want to transfer 10 EOS from testaccount1 to testaccount2 with the memo="transfer 10 EOS from testaccount1 to testaccount3" through RPC with the following steps

Step1: http://127.0.0.1:8888/v1/chain/abi_json_to_bin, get the binargs Input: {"code": "token", "action": "transfer", "args": {"from": "testaccount1", "to": "testaccount3", "quantity": "10.0000 EOS", "memo": "transfer 10.0000 EOS from testaccount1 to testaccount3"}} Output: {"binargs": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433"}

Step2: http://127.0.0.1:8888/v1/chain/get_info output { "server_version": "f0a25723", "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f", "head_block_num": 185613, "last_irreversible_block_num": 185612, "last_irreversible_block_id":"0002d50c05e10556e13debcb03ab145564fea29505762c8c7c09380e5d519609", "head_block_id": "0002d50decbf6018202655feb849619d5dacf295132f01bfad4f2e7f7bfd1d0b", "head_block_time": "2018-09-20T16:50:27.500", "head_block_producer": "eosio", "virtual_block_cpu_limit": 200000000, "virtual_block_net_limit": 1048576000, "block_cpu_limit": 199900, "block_net_limit": 1048576, "server_version_string": "mainnet-1.2.5-38-gf0a257233" } Step3: http://127.0.0.1:8888/v1/chain/get_public keys Output ["EOS5CuHFLvDhTaU8usM1A4PW5f6m1coCHpqhSmbtPQdEo84stnJQ7", "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "EOS6stFR6zp4mMQ9pvJSJFj49Nb3GjaxKt32927MfBsg8owUUqmju", "EOS772JxdvxG8dykycZg9CUwuMMeVxuPHcQfpqqjGL8EdsYoibxVv", "EOS7KSiiAAFWSPMUxFdGRVhzCcNFNkKvXnttUyLFBUJ46qZrwxNy1", "EOS7fZsUyKpkxtF8ygpnwNMFDbS8yzFJudcqztuDZ5GREWLH4EwwJ"]

Step4: http://127.0.0.1:8888/v1/chain/get_required keys Input {"transaction": { "expiration":"2018-09-20T16:50:57.500", "ref_block_num": 54540, "ref_block_prefix": 3421191649, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data":"10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433"}], "transaction_extensions": [] }, "available_keys“:[ "EOS5CuHFLvDhTaU8usM1A4PW5f6m1coCHpqhSmbtPQdEo84stnJQ7", "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "EOS6stFR6zp4mMQ9pvJSJFj49Nb3GjaxKt32927MfBsg8owUUqmju", "EOS772JxdvxG8dykycZg9CUwuMMeVxuPHcQfpqqjGL8EdsYoibxVv", "EOS7KSiiAAFWSPMUxFdGRVhzCcNFNkKvXnttUyLFBUJ46qZrwxNy1", "EOS7fZsUyKpkxtF8ygpnwNMFDbS8yzFJudcqztuDZ5GREWLH4EwwJ"]} Output {"required_keys": ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"]} ////testaccount1;s active key is selected

Step5: http://127.0.0.1:8888/v1/chain/sign transaction Input [{ "expiration": "2018-09-20T16:50:57.500", "ref_block_num": 54540, "ref_block_prefix": 3421191649, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" }], "data":"10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433" } ], "transaction_extensions": [ ], "signatures":[] }, ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f" ]}

Output {"expiration": "2018-09-20T16:50:57", "ref_block_num": 54540, "ref_block_prefix": 3421191649, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{"account": "token", "name": "transfer", "authorization": [{"actor": "testaccount1", "permission": "active"}], "data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433"}], "transaction_extensions": [], "signatures": ["SIG_K1_K6U4QUaWeHDXGXMrUU9wLWxtBPhDqdSEiUPf1K54A1WHws6tkUHN3vGnZ2auheERXMHSgq3A5MFebL4Z32VX78hHFNoYja"], "context_free_data": []}

Step6: http://127.0.0.1:8888/v1/chain/push transaction Input { "signatures":["SIG_K1_K6U4QUaWeHDXGXMrUU9wLWxtBPhDqdSEiUPf1K54A1WHws6tkUHN3vGnZ2auheERXMHSgq3A5MFebL4Z32VX78hHFNoYja"], "compression": "none", "packed_context_free_data": "", "packed_trx": "0dd0a35b0cd5e13debcb00000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e743300"} Output {"code": 500, "message": "Internal Service Error", "error": {"code": 3090003, "name": "unsatisfied_authorization", "what": "Provided keys, permissions, and delays do not satisfy declared authorizations", "details": [{"message": "transaction declares authority "{"actor":"testaccount1","permission":"active"}", but does not have signatures for it under a provided delay of 0 ms, provided permissions [], and provided keys ["EOS7gGChmszuw8FvzjbZ9t4HMXdKZfNG2rNywEzHZNyAPTsTEEX6v"]", "file": "authorization_manager.cpp", "line_number": 411, "method": "check_authorization"}]}}

I use cleos to execute same command, it works as expected, the following is log.

cleos --print-request --print-response push action token transfer '{"from":"testaccount1","to":"testaccount3","quantity":"10.0000 EOS","memo":"transfer 10.0000 EOS from testaccount1 to testaccount3"}' --permission testaccount1@active

step1, get the abi

REQUEST:

POST /v1/chain/get_abi HTTP/1.0 Host: 127.0.0.1:8888 content-length: 29 Accept: / Connection: close

{ "account_name": "token" }

RESPONSE:

{ "account_name": "token", "abi": { "version": "eosio::abi/1.0", "types": [{ "new_type_name": "account_name", "type": "name" } ], "structs": [{ "name": "transfer", "base": "", "fields": [{ "name": "from", "type": "account_name" },{ "name": "to", "type": "account_name" },{ "name": "quantity", "type": "asset" },{ "name": "memo", "type": "string" } ] },{ "name": "create", "base": "", "fields": [{ "name": "issuer", "type": "account_name" },{ "name": "maximum_supply", "type": "asset" } ] },{ "name": "issue", "base": "", "fields": [{ "name": "to", "type": "account_name" },{ "name": "quantity", "type": "asset" },{ "name": "memo", "type": "string" } ] },{ "name": "account", "base": "", "fields": [{ "name": "balance", "type": "asset" } ] },{ "name": "currency_stats", "base": "", "fields": [{ "name": "supply", "type": "asset" },{ "name": "max_supply", "type": "asset" },{ "name": "issuer", "type": "account_name" } ] } ], "actions": [{ "name": "transfer", "type": "transfer", "ricardian_contract": "## Transfer Terms & Conditions\n\nI, {{from}}, certify the following to be true to the best of my knowledge:\n\n 1. I certify that {{quantity}} is not the proceeds of fraudulent or violent activities.\n2. I certify that, to the best of my knowledge, {{to}} is not supporting initiation of violence against others.\n3. I have disclosed any contractual terms & conditions with respect to {{quantity}} to {{to}}.\n\nI understand that funds transfers are not reversible after the {{transaction.delay}} seconds or other delay as configured by {{fr om}}'s permissions.\n\nIf this action fails to be irreversibly confirmed after receiving goods or services from '{{to}}', I agree to either ret urn the goods or services or resend {{quantity}} in a timely manner.\n" },{ "name": "issue", "type": "issue", "ricardian_contract": "" },{ "name": "create", "type": "create", "ricardian_contract": "" } ], "tables": [{ "name": "accounts", "index_type": "i64", "key_names": [ "currency" ], "key_types": [ "uint64" ], "type": "account" },{ "name": "stat", "index_type": "i64", "key_names": [ "currency" ], "key_types": [ "uint64" ], "type": "currency_stats" } ], "ricardian_clauses": [], "error_messages": [], "abi_extensions": [] } }

Step2, get the info, the rpc operation happens @185613, the cleos operation happened@185607, almost the same time.


REQUEST:

POST /v1/chain/get_info HTTP/1.0 Host: 127.0.0.1:8888 content-length: 0 Accept: / Connection: close


RESPONSE:

{ "server_version": "f0a25723", "chain_id": "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f", "head_block_num": 185607, "last_irreversible_block_num": 185606, "last_irreversible_block_id": "0002d506e5c73ee0f600aa3e2e4a7909ac8fc0f66a1b07969da138152abb1371", "head_block_id": "0002d507a5f96129a4803561eaab94db9502897f8429b26bd69d1b8499c27c3b", "head_block_time": "2018-09-20T16:50:24.500", "head_block_producer": "eosio", "virtual_block_cpu_limit": 200000000, "virtual_block_net_limit": 1048576000, "block_cpu_limit": 199900, "block_net_limit": 1048576, "server_version_string": "mainnet-1.2.5-38-gf0a257233" } Step3, get public keys, both results are same.

REQUEST:

POST /v1/wallet/get_public_keys HTTP/1.0 Host: 127.0.0.1:8900 content-length: 0 Accept: / Connection: close


RESPONSE:

[ "EOS5CuHFLvDhTaU8usM1A4PW5f6m1coCHpqhSmbtPQdEo84stnJQ7", "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "EOS6stFR6zp4mMQ9pvJSJFj49Nb3GjaxKt32927MfBsg8owUUqmju", "EOS772JxdvxG8dykycZg9CUwuMMeVxuPHcQfpqqjGL8EdsYoibxVv", "EOS7KSiiAAFWSPMUxFdGRVhzCcNFNkKvXnttUyLFBUJ46qZrwxNy1", "EOS7fZsUyKpkxtF8ygpnwNMFDbS8yzFJudcqztuDZ5GREWLH4EwwJ" ]

Step4, get public keys, in this step, you can see, both operations select the same key and their abi to json result are same too. For convenience, I abstract them here.,

In rpc operation, the abi to json result is "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433 In the cleos operation, the abi to json result is below: "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433


REQUEST:

POST /v1/chain/get_required_keys HTTP/1.0 Host: 127.0.0.1:8888 content-length: 1070 Accept: / Connection: close

{ "transaction": { "expiration": "2018-09-20T16:50:54", "ref_block_num": 54534, "ref_block_prefix": 1051328758, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d2074657374 6163636f756e743120746f20746573746163636f756e7433" } ], "transaction_extensions": [] }, "available_keys": [ "EOS5CuHFLvDhTaU8usM1A4PW5f6m1coCHpqhSmbtPQdEo84stnJQ7", "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "EOS6stFR6zp4mMQ9pvJSJFj49Nb3GjaxKt32927MfBsg8owUUqmju", "EOS772JxdvxG8dykycZg9CUwuMMeVxuPHcQfpqqjGL8EdsYoibxVv", "EOS7KSiiAAFWSPMUxFdGRVhzCcNFNkKvXnttUyLFBUJ46qZrwxNy1", "EOS7fZsUyKpkxtF8ygpnwNMFDbS8yzFJudcqztuDZ5GREWLH4EwwJ" ] }

RESPONSE:

{ "required_keys": [ "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" ] }

Step5, sign the transaction.,

REQUEST:

POST /v1/wallet/sign_transaction HTTP/1.0 Host: 127.0.0.1:8900 content-length: 847 Accept: / Connection: close

[{ "expiration": "2018-09-20T16:50:54", "ref_block_num": 54534, "ref_block_prefix": 1051328758, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d2074657374 6163636f756e743120746f20746573746163636f756e7433" } ], "transaction_extensions": [], "signatures": [], "context_free_data": [] },[ "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV" ], "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f" ]

RESPONSE:

{ "expiration": "2018-09-20T16:50:54", "ref_block_num": 54534, "ref_block_prefix": 1051328758, "max_net_usage_words": 0, "max_cpu_usage_ms": 0, "delay_sec": 0, "context_free_actions": [], "actions": [{ "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d207465737461 63636f756e743120746f20746573746163636f756e7433" } ], "transaction_extensions": [], "signatures": [ "SIG_K1_KZ5ZuW7Us25AyVH86NX9CuJcG6qrkuACgXxPoHTuF7rPm34KAcqMWnJPWxVuBskSfgDyffRnbdJWVmPJnJZ6dFm2M1aBq8" ], "context_free_data": [] }

Step6, push the transaction In this step, the packed trx the yellow colored parts are same

In the rpc operation, the packed_trx is 0dd0a35b0cd5e13debcb00000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e743300 In the cleos operation, the packed_trx is eecfa35b06d5f600aa3e00000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e743300


REQUEST:

POST /v1/chain/push_transaction HTTP/1.0 Host: 127.0.0.1:8888 content-length: 486 Accept: / Connection: close

{ "signatures": [ "SIG_K1_KZ5ZuW7Us25AyVH86NX9CuJcG6qrkuACgXxPoHTuF7rPm34KAcqMWnJPWxVuBskSfgDyffRnbdJWVmPJnJZ6dFm2M1aBq8" ], "compression": "none", "packed_context_free_data": "", "packed_trx": "eecfa35b06d5f600aa3e00000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193 b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7 43300" }

RESPONSE:

{ "transaction_id": "de3ed14e252af98d8bfff4d815eb6b9d8cd44a743b2b90c845514daeb7279275", "processed": { "id": "de3ed14e252af98d8bfff4d815eb6b9d8cd44a743b2b90c845514daeb7279275", "receipt": { "status": "executed", "cpu_usage_us": 656, "net_usage_words": 23 }, "elapsed": 656, "net_usage": 184, "scheduled": false, "action_traces": [{ "receipt": { "receiver": "token", "act_digest": "33e7b140676d9237575be4365d3a14ff107c9eaef7881cf399bc1bfef172b424", "global_sequence": 185661, "recv_sequence": 18, "auth_sequence": [[ "testaccount1", 37 ] ], "code_sequence": 1, "abi_sequence": 1 }, "act": { "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data": { "from": "testaccount1", "to": "testaccount3", "quantity": "10.0000 EOS", "memo": "transfer 10.0000 EOS from testaccount1 to testaccount3" }, "hex_data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d2074 6573746163636f756e743120746f20746573746163636f756e7433" }, "elapsed": 468, "cpu_usage": 0, "console": "", "total_cpu_usage": 0, "trx_id": "de3ed14e252af98d8bfff4d815eb6b9d8cd44a743b2b90c845514daeb7279275", "inline_traces": [{ "receipt": { "receiver": "testaccount1", "act_digest": "33e7b140676d9237575be4365d3a14ff107c9eaef7881cf399bc1bfef172b424", "global_sequence": 185662, "recv_sequence": 15, "auth_sequence": [[ "testaccount1", 38 ] ], "code_sequence": 1, "abi_sequence": 1 }, "act": { "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data": { "from": "testaccount1", "to": "testaccount3", "quantity": "10.0000 EOS", "memo": "transfer 10.0000 EOS from testaccount1 to testaccount3" }, "hex_data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d 20746573746163636f756e743120746f20746573746163636f756e7433" }, "elapsed": 3, "cpu_usage": 0, "console": "", "total_cpu_usage": 0, "trx_id": "de3ed14e252af98d8bfff4d815eb6b9d8cd44a743b2b90c845514daeb7279275", "inline_traces": [] },{ "receipt": { "receiver": "testaccount3", "act_digest": "33e7b140676d9237575be4365d3a14ff107c9eaef7881cf399bc1bfef172b424", "global_sequence": 185663, "recv_sequence": 6, "auth_sequence": [[ "testaccount1", 39 ] ], "code_sequence": 1, "abi_sequence": 1 }, "act": { "account": "token", "name": "transfer", "authorization": [{ "actor": "testaccount1", "permission": "active" } ], "data": { "from": "testaccount1", "to": "testaccount3", "quantity": "10.0000 EOS", "memo": "transfer 10.0000 EOS from testaccount1 to testaccount3" }, "hex_data": "10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d 20746573746163636f756e743120746f20746573746163636f756e7433" }, "elapsed": 4, "cpu_usage": 0, "console": "", "total_cpu_usage": 0, "trx_id": "de3ed14e252af98d8bfff4d815eb6b9d8cd44a743b2b90c845514daeb7279275", "inline_traces": [] } ] } ], "except": null } }

readygo586 avatar Sep 21 '18 00:09 readygo586

@jgiszczak @taokayan Could you help to check this issue?

readygo586 avatar Sep 26 '18 01:09 readygo586

For your convinience, I summarize the info in word format. Error 390003, unsatisfied_authorization happens in push transaction.docx

readygo586 avatar Sep 26 '18 02:09 readygo586

hi please upgrade to the latest version to see whether this issue still exist? from the result looks like some fields in the signed transaction has been changed after signed, which was a bug in some old versions.

taokayan avatar Sep 27 '18 03:09 taokayan

@taokayan, @sergmetelin what do you mean the signed transaction has been changed after signed? I have compared the payload in my rpc operation and cleos operation, only the first 10 bytes are different, which corresponds to "time , refe_block_num, ref_block_ref" 3 fields in transactions header, the other parts were same, please refer the Bold parts below.

anyway, I will try the latest verison, return the result.

In the rpc operation, the packed_trx is 0dd0a35b0cd5e13debcb00000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e743300 In the cleos operation, the packed_trx is eecfa35b06d5f600aa3e00000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e743300

readygo586 avatar Sep 27 '18 04:09 readygo586

@taokayan, @sergmetelin. Indeed, I have checked all issue about 3090003 in github, and found https://github.com/EOSIO/eos/pull/5461 was similar one. before I submitted this issue, I checked nodeos version, it was mainnet-1.2.5-38-gf0a257233,

readygo586 avatar Sep 27 '18 04:09 readygo586

only the first 10 bytes are different, which corresponds to "time , refe_block_num, ref_block_ref"

The signature is based on the hash of the whole transaction, including those fields. If they change, then the hash changes and the signature is no longer valid. The authority is thus not met.

tbfleming avatar Sep 27 '18 06:09 tbfleming

@tbfleming "only the first 10 bytes are different" means I sequentially(in adjacent time) execute the rpc push operation and cleos push operation, so the first 10 bytes are surly different.

readygo586 avatar Sep 27 '18 08:09 readygo586

@taokayan @sergmetelin @tbfleming I tested the rpc operation in version1.3.0, Another new error happened before the original 3090003. {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3040005, 'name': 'expired_tx_exception', 'what': 'Expired Transaction', 'details': [{'message': 'expired transaction 60b18752aeab37000eebdc917be6fd33d3a19354e07c15eef9f61eb97d5e4377', 'file': 'producer_plugin.cpp', 'line_number': 378, 'method': 'on_incoming_transaction_async'}]}}

To resolve this new issue, I analyzed the cleos covert pack_transaction's input and output, and found the transaction's expiration time is 2018-09-27T16:46:50 and pack_trx' s timestamp is 0x5bad097a(which corresponds to 2018-09-28T00:46:50 beijing time). I use python to show my calculation as below.

So does it mean the timezone should be considered in the packed_transaction function?

image

readygo586 avatar Sep 27 '18 17:09 readygo586

Please refer https://github.com/EOSIO/eos/issues/5721. I submitted same issue several days ago. I think this difference is introduced by the following code.

But the even though I set expiration time = local_time + 60sec, it still report expired_tx_excpetion. this new issue does not exist in mainnet-v1.2.5.

image

readygo586 avatar Sep 27 '18 18:09 readygo586

I attached the cleos covert pack_transaction input and output here for convenience.

cleos convert pack_transaction '{"expiration":"2018-09-27T16:46:50","ref_block_num":9376,"ref_block_prefix":1241064124,"max_net_usage_words":0,"max_cpu_usage_ms":0,"delay_sec":0,"context_free_actions":[],"actions":[{"account":"token","name":"transfer","authorization":[{"actor":"testaccount1","permission":"active"}],"data":"10f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e7433"}],"transaction_extensions":[],"signatures":["SIG_K1_K8Cmv8DbKFP8S9e9x3miVAMikqBVkEVxSrPTqtZbwYTA2pp8BQrjA66RK7DTZi9VhYda16adNmkRfKg3oYU6PNowxjpngX"],"context_free_data":[]}' { "signatures": [ "SIG_K1_K8Cmv8DbKFP8S9e9x3miVAMikqBVkEVxSrPTqtZbwYTA2pp8BQrjA66RK7DTZi9VhYda16adNmkRfKg3oYU6PNowxjpngX" ], "compression": "none", "packed_context_free_data": "", "packed_trx": "7a09ad5ba024bc22f94900000000010000000080a920cd000000572d3ccdcd0110f2d4142193b1ca00000000a8ed32325710f2d4142193b1ca30f2d4142193b1caa08601000000000004454f5300000000367472616e736665722031302e3030303020454f532066726f6d20746573746163636f756e743120746f20746573746163636f756e743300" }

readygo586 avatar Sep 27 '18 18:09 readygo586

@readygo586 The code you are quoting is in eosiolib. It is not used when submitting a transaction via cleos or the RPC api directly. It also has not changed since 2018-May-14.

In cleos, the default expiration time is generated by retrieving the current head block time and adding the default delay of 30 seconds to it, as seen here. This has not changed since 2017-Oct-27, and is not significantly different than its behavior since 2017-Jul-24.

I must amend my third paragraph in #5721: in fact, because cleos retrieves the head block time when composing a new transaction, it can compose a correct expiration time even when the local system clock is wrong. The rest of my description stands: the system runs in UTC. It is up to you to use a correct timestamp when composing your transactions. Local time is not appropriate. Use UTC time. You must perform the conversion yourself if you are retrieving local time from your system.

jgiszczak avatar Sep 27 '18 21:09 jgiszczak

@jgiszczak According your comments, I don't know how to explain the time difference in transaction's expiration time and pack_trx's timestamp. it's very confusing. Could you execute the above covert pack_transaction in your local PC and show me the input/output.

readygo586 avatar Sep 28 '18 00:09 readygo586

@jgiszczak @taokayan @sergmetelin I added some trace in producer_plug.cpp line 378 like below.

image

then rpc operation at 2018-09-28T13:34:38.000 UTC time,

  1. if no extra 8 * 3600 seconds added, expired_tx_exception is reported. The trx->expiration is substracted 8 * 3600 seconds in somewhere(don't know), which cause the expired.

{'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3040005, 'name': 'expired_tx_exception', 'what': 'Expired Transaction', 'details': [{'message': 'addby keep expired transaction 90497797c39763f9749afd96a71b37d568a9a46bfd5e56bfc84c7b1fbf6c52aa,expiration time 2018-09-28T05:35:07.000,block_time 2018-09-28T13:34:38.000 trx->expiration is 2018-09-28T05:35:07 ', 'file': 'producer_plugin.cpp', 'line_number': 382, 'method': 'on_incoming_transaction_async'}]}}

  1. if extra 8*3600 seconds added, the push_transaction works as expected. So I guess the original 3090003 issue has been fixed in v1.3.0.

Hope to know why extra 8*3600 seconds are needed. if you want more info, please contact with me.

readygo586 avatar Sep 28 '18 13:09 readygo586

image

In above picture, the cleos push_transaction and rpc push transaction are executed sequentially(timespan =1s ). the encode of ref_block_num is almost same, but the expiration difference is huge.

readygo586 avatar Sep 28 '18 14:09 readygo586

What are you using to encode the packed transaction?

jgiszczak avatar Sep 28 '18 23:09 jgiszczak

@jgiszczak I use python to encode the packed transaction to simulate fc::variant push_transaction( signed_transaction& trx, int32_t extra_kcpu = 1000, packed_transaction::compression_type compression = packed_transaction::none ) in cleos's main.cpp. image

I encode the tx_expiration as the red circled does, but cleos convert pack_transaction output different result. so I am confusing. I think we can study the cloes convert pack_transaction for further study.

readygo586 avatar Sep 29 '18 00:09 readygo586

@readygo586 I met the same question,I got the error says "{"code": 3090003, "name": "unsatisfied_authorization", "what": "Provided keys, permissions, and delays do not satisfy declared authorizations", "details": [{"message": "transaction declares authority "..."

have u solve this problem?could u tell me how to solve this?thx

Whisker17 avatar Nov 01 '18 03:11 Whisker17

You can't change the transaction header (expiration, ref block number, ref block id max cpu/net usage) after a transaction is signed. If not, you'll result in this error. Please ask in eosio.stackexchange.com if you have further questions.

taokayan avatar Nov 05 '18 07:11 taokayan

I can successfully call the contract through the CLEOs command, but when I use the eosjs RPC to call, I get the same error prompt as you. How did you solve this problem?

sbihgud avatar Dec 31 '19 08:12 sbihgud