Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Why is my local blockchain not requiring eosio.code permission when an inline action is executed? #11088

Open
oliviera9 opened this issue May 8, 2022 · 1 comment

Comments

@oliviera9
Copy link

I am running a local blockchain with the following command:

nodeos -e -p "eosio" --plugin eosio::chain_api_plugin --plugin eosio::history_api_plugin --delete-all-blocks > /dev/null 2>&1 &

(nodeos v2.0.6)

I have a contract exposing this action and deployed to 'contract' account:

void token::action1(const name &sender, const asset &quantity, const string &memo)
   {
      action(
        permission_level{sender, "active"_n},
        get_self(),
        "action2"_n,
        std::make_tuple(sender, quantity, memo, std::vector<uint8_t>(), std::vector<uint8_t>())
      ).send();
   }

Calling the action with

cleos push action contract action1 '["account1", "1 TTT", ""]' -p account1@active

Pushing the same action to mainnet returns

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":"account1","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [{"actor":"contract","permission":"eosio.code"}], provided keys [], and a delay max limit of 3888000000 ms
pending console output: 

and I need to add contract eosio.code permission (under accounts) to account1@active to let it run correctly.

Why is my local blockchain accepting the transaction without setting the eosio.code permission? Is it because of some parameters missing when starting the local blockchain?

@oliviera9
Copy link
Author

oliviera9 commented May 8, 2022

Probably the nodeos setup prevents to enter

if( !control.skip_auth_check() && !privileged ) {
,

   // No need to check authorization if replaying irreversible blocks or contract is privileged

Probably we are in the replaying irreversible blocks case. Is it compatible with my nodeos configuration? How to configure nodeos in such a way this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@oliviera9 and others