eos icon indicating copy to clipboard operation
eos copied to clipboard

"provided keys, permissions, and delays do not satisfy declared authorizations" when create account

Open spartucus opened this issue 8 years ago • 8 comments

I'm developing EOSDevHelper for EOS dawn-v4.0.0. It seems that authorization_manager::check_authorization changed since dawn-v3.0. When I created new account, it returns error code 3090003 after push_transaction.

Here's what i did: get_info response:

    "block_cpu_limit": 99900,
    "block_net_limit": 1048576,
    "head_block_id": "0000b16107ef1f8dc9000415c29e168ddf8e2adcc9ddd1435cff26c1cd19caeb",
    "head_block_num": 45409,
    "head_block_producer": "eosio",
    "head_block_time": "2018-05-15T10:14:06",
    "last_irreversible_block_id": "0000b16107ef1f8dc9000415c29e168ddf8e2adcc9ddd1435cff26c1cd19caeb",
    "last_irreversible_block_num": 45409,
    "server_version": "9be89106",
    "virtual_block_cpu_limit": 1e+08,
    "virtual_block_net_limit": 1048576000
}

get_required_keys request:

{
    "available_keys": [
        "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
        "EOS7JTrhEZPRQxUchwgrdTJvqdzr8SxUmMTrEYxyUCURmHh9EwwjK",
        "EOS7RPhXBVvpTtct3UzotePbmu61inHKjptZJiann1vUSXFrGcDsm"
    ],
    "transaction": {
        "actions": [
            {
                "account": "eosio",
                "authorization": [
                    {
                        "actor": "eosio",
                        "permission": "active"
                    }
                ],
                "data": "0000000000ea3055000000000060226d01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf01000000",
                "name": "newaccount"
            }
        ],
        "context_free_actions": [
        ],
        "delay_sec": 0,
        "expiration": "2018-05-15T18:14:36",
        "max_kcpu_usage": 0,
        "max_net_usage_words": 0,
        "ref_block_num": 45409,
        "ref_block_prefix": 352583881,
        "signatures": [
        ]
    }
}

response:

{
    "required_keys": [
        "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
    ]
}

push_transaction request:

{
    "compression": "none",
    "packed_context_free_data": "",
    "packed_trx": "0cb3fa5a61b1c900041500000000010000000000ea305500409e9a2264b89a010000000000ea305500000000a8ed3232660000000000ea3055000000000060226d01000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000001000000010002c0ded2bc1f1305fb0faac5e6c03ee3a1924234985427b6167ca569d13df435cf0100000000",
    "signatures": [
        "SIG_K1_Kcws3MugE2QN1mszSEzxonB5uikzPJZACDAe2MWnjXo9KRAS1taahZ4RHVJYLJQSgWGmgtSZtAwXjeRTHsJRdr9CdQnw32"
    ]
}

response:

{
    "code": 500,
    "error": {
        "code": 3090003,
        "details": [
            {
                "file": "authorization_manager.cpp",
                "line_number": 405,
                "message": "transaction declares authority '{\"actor\":\"eosio\",\"permission\":\"active\"}', but does not have signatures for it under a provided delay of 0 ms",
                "method": "check_authorization"
            }
        ],
        "name": "unsatisfied_authorization",
        "what": "provided keys, permissions, and delays do not satisfy declared authorizations"
    },
    "message": "Internal Service Error"
}

Any advice would be appreciated.

spartucus avatar May 15 '18 10:05 spartucus

Got the same problem...

starit avatar May 15 '18 16:05 starit

Turns out that I'm missed packing context_free_data when sign transaction. Related code:

   if( cfd.size() ) {
      fc::raw::pack( enc, digest_type::hash(cfd) );
   } else {
      fc::raw::pack( enc, digest_type() );
   }

spartucus avatar May 16 '18 04:05 spartucus

Hi @spartucus , can you post your full push_transaction request data to us? I have the same problem as well.

noprom avatar May 24 '18 04:05 noprom

Hi @noprom , this is all data during transfer.

abi_json_to_bin: request:

{
    "action": "transfer",
    "args": [
        "eosio",
        "hooo",
        "10.0000 EOS",
        "this is memo"
    ],
    "code": "eosio.token"
}

response:

{
    "binargs": "0000000000ea3055000000000040296da08601000000000004454f53000000000c74686973206973206d656d6f"
}

get_info: response:

{
    "block_cpu_limit": 95236,
    "block_net_limit": 1048248,
    "head_block_id": "0000319780f170e6b4fbbeeaa561ddef4071fbda3dedfc76376f1bfda7237c36",
    "head_block_num": 12695,
    "head_block_producer": "eosio",
    "head_block_time": "2018-05-24T02:16:19",
    "last_irreversible_block_id": "00003196d880ff45eee633e72434a73fde4b447001afeb5077fa866283780dea",
    "last_irreversible_block_num": 12694,
    "server_version": "503e0c8e",
    "virtual_block_cpu_limit": 1e+08,
    "virtual_block_net_limit": 1048576000
}

get_required_keys: request:

{
    "available_keys": [
        "EOS5rwxd2ab28Vy1ZgdhcziuTC16c1pTDxhnS3jGfqt4z4gQvbG6R",
        "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
        "EOS7GK4R3tX1eqZSQogK3PW51MJraxgR9xZ5EsYm5THe3hNkScF2G"
    ],
    "transaction": {
        "actions": [
            {
                "account": "eosio.token",
                "authorization": [
                    {
                        "actor": "eosio",
                        "permission": "active"
                    }
                ],
                "data": "0000000000ea3055000000000040296da08601000000000004454f53000000000c74686973206973206d656d6f",
                "name": "transfer"
            }
        ],
        "context_free_actions": [
        ],
        "context_free_data": [
        ],
        "delay_sec": 0,
        "expiration": "2018-05-24T10:16:49",
        "max_kcpu_usage": 0,
        "max_net_usage_words": 0,
        "ref_block_num": 12695,
        "ref_block_prefix": 3938384820,
        "signatures": [
        ]
    }
}

response:

{
    "required_keys": [
        "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"
    ]
}

push_transaction: request:

{
    "compression": "none",
    "packed_context_free_data": "00",
    "packed_trx": "9120065b9731b4fbbeea000000000100a6823403ea3055000000572d3ccdcd010000000000ea305500000000a8ed32322d0000000000ea3055000000000040296da08601000000000004454f53000000000c74686973206973206d656d6f00",
    "signatures": [
        "SIG_K1_K71KJ4oHqPaVUTiuLXyb9CwNCRfPMeNaDnkm6xNetANkKyqkwKTWTMVDbaUTDBi4knfga2obAsVMPS63eNdWaHZPV5Lv5d"
    ]
}

response:

{
    "processed": {
        "action_traces": [
            {
                "act": {
                    "account": "eosio.token",
                    "authorization": [
                        {
                            "actor": "eosio",
                            "permission": "active"
                        }
                    ],
                    "data": {
                        "from": "eosio",
                        "memo": "this is memo",
                        "quantity": "10.0000 EOS",
                        "to": "hooo"
                    },
                    "hex_data": "0000000000ea3055000000000040296da08601000000000004454f53000000000c74686973206973206d656d6f",
                    "name": "transfer"
                },
                "console": "",
                "cpu_usage": 0,
                "elapsed": 554,
                "inline_traces": [
                    {
                        "act": {
                            "account": "eosio.token",
                            "authorization": [
                                {
                                    "actor": "eosio",
                                    "permission": "active"
                                }
                            ],
                            "data": {
                                "from": "eosio",
                                "memo": "this is memo",
                                "quantity": "10.0000 EOS",
                                "to": "hooo"
                            },
                            "hex_data": "0000000000ea3055000000000040296da08601000000000004454f53000000000c74686973206973206d656d6f",
                            "name": "transfer"
                        },
                        "console": "",
                        "cpu_usage": 0,
                        "elapsed": 4,
                        "inline_traces": [
                        ],
                        "receipt": {
                            "abi_sequence": 1,
                            "act_digest": "38285c403d15c820bccc4188426a1c6aa776d0d609623b50ef8c59aa1ebfa051",
                            "auth_sequence": [
                                [
                                    "eosio",
                                    12703
                                ]
                            ],
                            "code_sequence": 1,
                            "global_sequence": 12706,
                            "receiver": "eosio",
                            "recv_sequence": 12701
                        },
                        "total_cpu_usage": 0,
                        "trx_id": "4f67822fb8107b56999dfe1b7343a2732de4c2968f4834ff582fc5e009c9b4ac"
                    },
                    {
                        "act": {
                            "account": "eosio.token",
                            "authorization": [
                                {
                                    "actor": "eosio",
                                    "permission": "active"
                                }
                            ],
                            "data": {
                                "from": "eosio",
                                "memo": "this is memo",
                                "quantity": "10.0000 EOS",
                                "to": "hooo"
                            },
                            "hex_data": "0000000000ea3055000000000040296da08601000000000004454f53000000000c74686973206973206d656d6f",
                            "name": "transfer"
                        },
                        "console": "",
                        "cpu_usage": 0,
                        "elapsed": 4,
                        "inline_traces": [
                        ],
                        "receipt": {
                            "abi_sequence": 1,
                            "act_digest": "38285c403d15c820bccc4188426a1c6aa776d0d609623b50ef8c59aa1ebfa051",
                            "auth_sequence": [
                                [
                                    "eosio",
                                    12704
                                ]
                            ],
                            "code_sequence": 1,
                            "global_sequence": 12707,
                            "receiver": "hooo",
                            "recv_sequence": 2
                        },
                        "total_cpu_usage": 0,
                        "trx_id": "4f67822fb8107b56999dfe1b7343a2732de4c2968f4834ff582fc5e009c9b4ac"
                    }
                ],
                "receipt": {
                    "abi_sequence": 1,
                    "act_digest": "38285c403d15c820bccc4188426a1c6aa776d0d609623b50ef8c59aa1ebfa051",
                    "auth_sequence": [
                        [
                            "eosio",
                            12702
                        ]
                    ],
                    "code_sequence": 1,
                    "global_sequence": 12705,
                    "receiver": "eosio.token",
                    "recv_sequence": 4
                },
                "total_cpu_usage": 0,
                "trx_id": "4f67822fb8107b56999dfe1b7343a2732de4c2968f4834ff582fc5e009c9b4ac"
            }
        ],
        "elapsed": 736,
        "except": null,
        "id": "4f67822fb8107b56999dfe1b7343a2732de4c2968f4834ff582fc5e009c9b4ac",
        "net_usage": 144,
        "receipt": {
            "cpu_usage_us": 736,
            "net_usage_words": 18,
            "status": "executed"
        },
        "scheduled": false
    },
    "transaction_id": "4f67822fb8107b56999dfe1b7343a2732de4c2968f4834ff582fc5e009c9b4ac"
}

spartucus avatar May 24 '18 05:05 spartucus

Hi, thanks for the post, but I still have some questions:

  1. in get_required_keys: why there are 3 public keys in available_keys, what are they for?
  2. in get_required_keys: how to I get ref_block_num?
  3. when I do a get_required_keys post using this request:
{
    "available_keys": [
        "EOS5ySgzeHp9G7TqNDGpyzaCtahAeRcTvPRPJbFey5CmySL3vKYgE"
    ],
    "transaction": {
        "actions": [
            {
                "account": "eosio.token",
                "authorization": [
                    {
                        "actor": "eosio",
                        "permission": "active"
                    }
                ],
                "data": "0000000000ea305500000000487a2b9d102700000000000004454f53000000001163726561746564206279206e6f70726f6d",
                "name": "transfer"
            }
        ],
        "context_free_actions": [
        ],
        "context_free_data": [
        ],
        "delay_sec": 0,
        "expiration": "2018-05-24T13:30:06.000",
        "max_kcpu_usage": 0,
        "max_net_usage_words": 0,
        "ref_block_num": 231858,
        "ref_block_prefix": 4074283664,
        "signatures": [
        ]
    }
}

I got this error:

{
    "code": 401,
    "message": "UnAuthorized",
    "error": {
        "code": 3090003,
        "name": "unsatisfied_authorization",
        "what": "provided keys, permissions, and delays do not satisfy declared authorizations",
        "details": [
            {
                "message": "transaction declares authority '{\"actor\":\"eosio\",\"permission\":\"active\"}', but does not have signatures for it.",
                "file": "authorization_manager.cpp",
                "line_number": 466,
                "method": "get_required_keys"
            }
        ]
    }
}
  1. in your push_transaction: How can I get packed_trx and signatures?

Look forward to your reply.

noprom avatar May 24 '18 12:05 noprom

Hi noprom.

  1. in get_required_keys: why there are 3 public keys in available_keys, what are they for?

These 3 public keys are simply imported keys in my wallet, it does nothing to do with whole RPC.


  1. in get_required_keys: how to I get ref_block_num?

ref_block_num was calculated by get_info's response head_block_id. see using get_info's data , createTransaction and how to get ref_block_num.


  1. when I do a get_required_keys post using this request:

can you post all data? including get_info, abi_json_to_bin.


  1. in your push_transaction: How can I get packed_trx and signatures?

here is how to get packed_trx. here and here are how to get signatures.

Hope it helps.

spartucus avatar May 25 '18 01:05 spartucus

我想问一下 您解决这个问题了吗? 期待回复 image

china-yuanzhihao avatar Sep 28 '18 11:09 china-yuanzhihao

我想问一下 您解决这个问题了吗? 期待回复 image

一样的问题

bytehi avatar Nov 08 '18 02:11 bytehi